As a plugin developer, I donate my time and energies to the WordPress community. I make it clear that I don’t support anyone modifying my code or running it on a non-standard variation of WordPress – this includes forks.
Thankfully, some forks make it easy for their use to be detected.
Here’s some code that can be used within your theme or plugin code…
This introduces 2 things…
The idea is that, within your plugin, you’d use the
is_fork function to determine if a fork is in use and, if so, not trigger any of your plugin functions – the admin notice is then informing them of why this is. It’s more difficult to achieve the same with a theme, so you’d probably miss out this step and just use the notice to inform the user that the theme isn’t supported on their platform. The notice is non-dismissible for good reason.
- A function named
is_fork– call this to determine if the current CMS being used is a fork (it returns the name of the fork or
- An admin notice informing the user that a fork is not supported. The output message defaults to an assumption that this is for a plugin but can be modified to taste.
At the moment, the above script only supports a small subset of forks – I’ll add more as I come across them.
However, many forks remain compatible with core WordPress so running plugins and themes under them shouldn’t cause any issues. Indeed, you could use this code for detection of the fork for other reasons (altering the code flow to better support them, for instance).