Resolved: Google Publisher Plugin error: “Plugin activation failed. Your WordPress installation doesn’t meet the minimum requirements.”
Resolved: Google Publisher Plugin error: “Plugin activation failed. Your WordPress installation doesn’t meet the minimum requirements.”
When trying to install Google’s Publisher WordPress Plugin you may encounter the following error:
Plugin could not be activated because it triggered a fatal error.
Plugin activation failed. Your WordPress installation doesn’t meet the minimum requirements.
« Back
This is a rather unhelpful message, as it does not specify what requirements it is missing. This is specially considering that their Installation instructions states (https://support.google.com/adsense/answer/3380627?hl=en&ref_topic=3380274):
System requirements
Before you start using the Google Publisher Plugin, make sure you meet the following minimum requirements:
-
PHP version: minimum 5.2.0
-
WordPress: minimum 3.0
-
Ensure that you can install third-party WordPress plugins.
So… what am I missing? Pretty sure I am running version 5.5.3 and WordPress is version 3.8.1
I decided I needed to dive into the code to figure out what it was doing and there it was in the Utils.php file:
private static $REQUIRED_EXTENSIONS = array('filter', 'json', 'pcre', 'SPL');
If you look at the code you will see all the meetsMinimumRequirementsOrDie function will show the error message if any of the two conditions are met:
- The filter, json, pcre and SPL extensions are loaded
- The PHP version is 5.2 or above
So now that we know what we need how do we get it?
Well, Filter, PCRE and SPL have been added by default over time to PHP and by version 5.5.3 you can count on them. At the time of writting 5.5.3 is the version that comes when you install php using apt-get install php5 on Ubuntu.
So that leaves us with json. To get it installed and loaded simply do the following:
- Install the extension via repository:apt-get install php5-json
- Restart your php service:
service php5-fpm restart
And you’re done! If you are using a different version that doesn’t come with the other 3 extensions you could edit the utils.php file to show the $extension that is throwing it off like this:
public static function meetsMinimumRequirements() { foreach (self::$REQUIRED_EXTENSIONS as $extension) { if (!extension_loaded($extension)) {
wp_die(__('Plugin activation failed. Your WordPress installation ' . 'doesn\'t meet the minimum requirements:' $extension, 'google-publisher-plugin'), '', array('response' => 200, 'back_link' => true));
return false; } } return version_compare(self::MINIMUM_PHP_VERSION, phpversion(), ‘<=’); }
Here are the details on the other extensions and when they were included:
- SPL
- Included by default in version 5.0.0
- As of PHP 5.3.0 this extension can no longer be disabled and is therefore always available.
- http://www.php.net/manual/en/spl.installation.php
- PCRE
- Included by default in version 4.2.0
- As of PHP 5.3.0 this extension cannot be disabled and is therefore always present.
- http://mx1.php.net/manual/en/pcre.installation.php
- Filter
- Enabled by default in version 5.2.0
- http://www.php.net/manual/en/filter.installation.php
Love
Can we use Let's Encrypt, the free and open certificate authority?
Hola! gracias por la info, me sirvió el comando sacandole el nombre del server. En mi caso, fue una migración…
Yes 3rd option helped me too. I removed the WC key Values from config file then started working.
I know this is from 2014. But really, thank you!