When installing WP Full Stripe results in a fatal error this article can help you resolve the issue.
You are installing WP Full Stripe, and Wordpress displays one of the following fatal errors:
“Fatal error: Cannot redeclare class Stripe\Stripe in /wp-content/plugins//classes/stripe/lib/Stripe.php on line 6”
“Fatal error: Another plugin has loaded an incompatible Stripe API client. Deactivate all other Stripe plugins, and try to activate Full Stripe again.”
WP Full Stripe loads its own copy of the Stripe PHP client library, and another plugin tries to do the same, and PHP throws an error.
The error is the result of a fundamental flaw in WordPress’ design: there is no central management for PHP libraries used by several plugins.
There are cases when this issue can be resolved, in other cases there is no solution. It depends on the Stripe PHP client library versions required by the conflicting plugins, and on the loading order of the plugins.
You can resolve the issue (if possible) by taking the following steps:
WP Full Stripe defines the version number in the wp-full-stripe.php file in the root of the plugin directory, you just have to find the WP_FULL_STRIPE_API_VERSION constant in the file (see last line of the code snippet):
For the other plugins, the safest bet is to find the VERSION file in the Stripe PHP library directory.
The loading order is determined by the alphabetical order of the plugin slugs.
Armed with the version numbers and loading order, consider the following cases:
The other plugin is loaded first, and it requires an older Stripe version than WP Full Stripe
In this case there is no solution. The oher plugin has to load the Stripe library, but it will be too old for WP Full Stripe.
The other plugin is loaded first, and it requires a newer Stripe version than WP Full Stripe
This might work, you have to comment out loading the Stripe library in the /wp-full-stripe.php file in the root folder of WP Full Stripe (see next section).
WP Full Stripe is loaded first, and it requires an older Stripe version than the other plugin
In this case there is no solution. WP Full Stripe has to load the Stripe library, but it will be too old for the other plugin.
WP Full Stripe is loaded first, and it requires a newer Stripe version than the other plugin
This might work, you have to comment out loading the Stripe library in the other plugin.
You have to comment out the code which verifies the version number of the Stripe PHP library if it’s already loaded.
It’s in the wp-full-stripe.php file:
Comment out the statements in the “else” block:
IMPORTANT: WP Full Stripe installations using a Stripe PHP library versions other than the exact version required by the plugin are not supported by Mammothology.
Our support team is happy to help you.
Contact support
Feature requests are always welcome!
We consider each feature request carefully, and examine how it fits the roadmap for the plugin.