Publishing plugins on Marketplace

Submitted first plugin 9 days ago, got an email confirming review, no news ever since.

Tried to submit second one today:
→ We have detected PHP syntax errors in your plugin: PHP Fatal error: Namespace
declaration statement has to be the very first statement or after any declare call in the
script in /ReportHelpers.php on line 3. Please fix your plugin code so it does not trigger
errors. ←

I fixed it, created new tag - still got email with the same error. So I deleted the entire git repo, recreated it with the fixed file from the beginning - still the same error! It is cached somewhere on Matomo’s side, so I cannot even submit a working version.

Hi Mikanoshi,

Thanks for reporting this, and sorry for the frustrating experience. We investigated and confirmed that your latest archive is valid: the PHP files, including ReportHelpers.php, pass syntax checks.

The repeated error was caused by a Marketplace import issue: a broken file from the first failed import was retained under the same plugin version and was still being linted on later tag submissions. This was on our side, not GitHub caching your old repository contents. You do not need to delete or recreate the repository.

Before we can publish the plugin, please make two small changes:

  1. In both getVisitsReport() and getPagesReport() in API.php, restore:
Piwik::checkUserHasViewAccess($idSite);

These checks are currently commented out and are needed to ensure users can access data only for sites they are permitted to view.

  1. Your plugin.json declares PHP >=7.2.5, but the plugin uses PHP 8 syntax. Please either update the PHP requirement to >=8.0.0 or rewrite that syntax for older PHP versions.

Please make these changes in a new release: increment plugin.json’s version (for example to 1.0.1) and create a corresponding new Git tag. Once that is available, we’ll reprocess it and continue the publication review.

Thanks again for your patience.
Frankie

But Archive::createDataTableFromArchive() has that check as the first line, at least in Matomo 5.14.

Hi Mikanoshi,

You were correct about the access check: Archive::createDataTableFromArchive() already calls Piwik::checkUserHasViewAccess($idSite), so the commented-out checks in your two API methods are not needed.

One small update is still required before publication: your plugin declares PHP >=7.2.5, but it uses PHP 8 syntax (such as union types and match). Please update plugin.json to require PHP 8.0 or later:

"php": ">=8.0.0"

Thanks for pointing that out.

Hi Mikanoshi,

I saw your new 1.0.1 tag, and it imported successfully. I have now published DDBotTracker in the Matomo Marketplace.

Thanks again for your patience, and for contributing to the Matomo Marketplace.

Thanks. Is there a problem with parentheses in thumbnail titles?

Also my other plugin UltimateProfileAvatar is somewhere in limbo :slight_smile:

Hi Mikanoshi,

Yes, Marketplace only accepts screenshot filenames matching:

^[a-zA-Z0-9_-]+\.(png|jpg|jpeg)$

So the parentheses are invalid sorry.

I reviewed UltimateProfileAvatar and found a small set of changes needed before publication.

The main issue is in VisitorDetails.php. The plugin inserts the visitor User ID directly into HTML returned for the Visits Log. As User IDs can originate from tracking data, please HTML-escape the displayed User ID before rendering it. Please also escape the avatar URL before inserting it into the image src attribute.

Please also make the Libravatar request handling safer:

remove CURLOPT_SSL_VERIFYPEER = false, so TLS certificates are verified;
do not enable CURLOPT_FOLLOWLOCATION; and
handle request failures safely.

Finally, please replace the short PHP opening tag <? at the start of UserSettings.php with <?php, so the plugin works on installations where short PHP tags are disabled.

As a recommendation, please document that the plugin sends email-derived hashes to external avatar services, so administrators can make an informed privacy decision before enabling it.

Once these changes are made, please increment the version in plugin.json, create a matching new Git tag, and let us know. We will then review the new tagged release.

How Marketplace plugin titles are generated? By splitting CamelCase? Some plugins with multiple consecutive capital letters are split (MCP Server), some are not (DDBotTracker, KPIWidgets). It’s better to split mine like “DD Bot Tracker” to fit the majority.

Is new tag or new plugin.json version required to update screenshots? I also forgot to make cover :slight_smile:

Hi Mikanoshi,

Marketplace display names are not controlled by a general CamelCase-splitting rule in plugin.json. Some names have explicit Marketplace formatting—for example, McpServer is displayed as “MCP Server”—while other acronyms are not split consistently. The plugin’s technical name is also its Marketplace identity, directory name, and namespace, so please do not rename DDBotTracker or add spaces to the technical name.

“DD Bot Tracker” would require a Marketplace-side display-name override; a new tag would not change that automatically. We can look into improving display-name formatting for acronym-based plugin names in the future.

For the screenshots, please create a new release: rename the files to remove parentheses, increment the plugin.json version (for example, to 1.0.2), and create a matching Git tag. Marketplace stores screenshots per plugin version, so a new tag alone is not sufficient when the plugin.json version remains unchanged.

You can also add a cover image in the same release: place a valid PNG named exactly _cover.png in the screenshots/ directory.

This is the only reason I used CURL directly and not Http::sendHttpRequest().

Libravatar does 302 redirect to Gravatar proxy, so I need to always follow location to get a resulting HTTP code.

This part in Matomo code is not actually true, CURLOPT_FOLLOWLOCATION can be set with open_basedir. There are some redirection protocols shenanigans, but it works just fine.

Am I forced to use Http::sendHttpRequest(), but handle redirects manually?

Done. Used Http::sendHttpRequest() and manual location following up to 5 redirects.

Thanks Mikanoshi, your second plugin is now also live!

Too bad marketplace previews do not support animated pngs :see_no_evil_monkey:

Yes sorry, that’s correct — Marketplace currently processes screenshots through its image thumbnail service, which flattens animated PNGs to their first frame. Please use a static PNG for the Marketplace cover and screenshots; the animated version can still be linked from the plugin documentation or repository.

What happened? https://plugins.matomo.org/UltimateProfileAvatar

That sounds frustrating! Before assuming it is a cache issue, I would check whether the submission process is pulling the latest tag or an older release archive. Make sure <?php is the first content in ReportHelpers.php, with no BOM, whitespace, or other statements before the namespace declaration. If the error persists even with a clean repository and new tag, I would contact Matomo’s plugin review team to check which exact archive they are validating.