Error when activating a custom plugin on production server
I'm currently developing a custom plugin. All works well on my local dev environment (Local by Flywheel), but, on production environment, I'm unable to activate the plugin. I get this error message:
Fatal error: Class 'Activate' not found in /datas/vol3/w4a156338/var/www/my-website/htdocs/wp-content/plugins/ads-toolbox/ads-toolbox.php on line 54
The 'ads-toolbox.php' file it the plugin main php file and it contains the following:
function activate_adstoolbox_plugin() { Inc\Base\Activate::activate(); } register_activation_hook( __FILE__, 'activate_adstoolbox_plugin' );
Line 54 is: Inc\Base\Activate::activate();
The class 'Activate' is inside the 'Activate.php' file located in 'inc/Base/' subdirectory and contains:
namespace Inc\Base; class Activate { public static function activate() { //Some code } }
I do not understand why it works locally but not on my hosted site!?
Any idea ?
Topic oop plugin-development Wordpress
Category Web