Include specific checks for plugins that declare Multisite compatibility
The Problem
As a WordPress Multisite administrator, I frequently encounter plugins that claim Multisite compatibility, but fail to work correctly or introduce issues when activated on a Multisite network.
I understand the Plugin Check Plugin (PCP), at this stage, does not have any specific checks to validate a plugin's claim of Multisite compatibility.
The main issues are:
- Wasting time installing, testing, and debugging plugins that are advertised as compatible but are clearly not.
- Users becoming wary of these claims, even when a plugin might genuinely be compatible.
- Developers not realizing their plugin has Multisite issues until users report them.
Possible Solution
I suggest enhancing the Plugin Check Plugin (PCP), gradually over time, to include specific checks for plugins that declare Multisite compatibility.
I understand that comprehensive functional testing of all Multisite scenarios is incredibly complex. However, integrating some static analysis checks for common Multisite development patterns and potential pitfalls within PCP would be a significant step forward. This would help flag common issues improving the overall quality of plugins available to the large Multisite community.
Currently, the alternative is manual testing by Multisite users, which is time-consuming, prone to error, and reactive rather than proactive.
Developers also tend to rely on user bug reports to highlight problems, which is cumbersome & often ineffective. Adding Multisite compatibility to PCP should help encourage developers to test their plugins appropriately for WordPress Multisite.
Thank you for considering this enhancement.
I second that. Dear Plugin Team, please let me know what I can do to help!
Some common problems are:
Lack of Multisite Testing: Many plugin developers simply don't test their plugins thoroughly (or at all) on Multisite environments.
Database Interaction: Some plugins interact directly with the database in ways that don't account for the separate tables or contexts of individual sites within a Multisite network.
Activation Scope: A plugin that should be activated per-site might break if network-activated, and vice versa. Some plugins require specific code to run differently depending on whether they are on the main site or a sub-site.
Data Handling: Plugins that store data (e.g., custom post types, settings, user meta) might not be built to differentiate between data for the main site and data for sub-sites.
File Paths and URLs: Plugins often rely on specific file paths or URL structures. In a Multisite environment (with subdomains or domain mapping), these can differ significantly, causing the plugin to fail to locate necessary files or resources.
User Permissions: Some plugins might require permissions that are only available to a Super Admin, or they might not correctly handle the different user roles across the network.
Caching Issues: Caching plugins, in particular, can be tricky with Multisite as they need to correctly cache content for each individual site without conflicts.
Related:
- #64
There's no programmatic way for a plugin to declare Multisite compatibility. (except maybe for the Network: plugin header). Then, there's barely anything in the above list that could be checked with static analysis alone. So for a start, we would need to actually run PCP and the tested plugin in a Multisite environment. But even then, there are dozens of ways to do things in WordPress and Multisite, so determining whether something is right or wrong is tricky. This kind of compatibility testing might therefore be best done using some sort of end-to-end testing or so, as PCP is not well-suited for such a big scope.
tl;dr: this is more challenging than you might think :)
There is a new parameter called mode. That would be the place for that. You can propose basic checks where you can start it.
@swissspidy thanks for participating on this issue - I really appreciate you getting involved.
I'm fully aware of how challenging this issue is technically. but I'm equally aware how beneficial gradual improvements could be for typical users of WordPress Multisite like myself.
All of the common problems I listed above can be detected by plugin authors testing their plugins properly on Multisite environments.
The Plugin Team did a great job in recent years of educating plugin authors & providing tools to make it easier to comply with Plugin Team requirements, before moving to more enforcement.
We can follow a similar path for Multisite plugin compatibility:
- Education on how & why to test properly in Multisite environment.
- Gradually add suitable tests for Multisite in PCP to address common problems & major pain points for WordPress Multisite Admins.
- Overtime add enforcement of guidelines for plugins that claim Multisite compatibility.
The problem of plugins that work fine on single sites, just not working on WordPress Multisite, is a real everyday annoyance for users of WordPress Multisite.
In many cases the plugin authors are simply not aware of the actual problems.
For WordPress Multisite users there is no easy way to deal with these issues. You can spend hours investigating an issue before you clearly establish a plugin just does not work on your WordPress Multisite configuration & you still have no idea why or how to fix it.
So for a start, we would need to actually run PCP and the tested plugin in a Multisite environment.
Running WordPress Multisite is not currently available in WordPress Playground & WP Studio, but I understand they are working on it:
- Create site on a multisite, scope not added to the subsite URL #290
- Query API - multisite parameter is shown in the Available options section.