$A2A_SHARE_SAVE_plugin_dir not set and breaks WP CLI
-
wp option get siteurl
PHP Warning: include_once(/addtoany.widgets.php): failed to open stream: No such file or directory in .../wp-content/plugins/add-to-any/add-to-any.php on line 1116 Warning: include_once(/addtoany.widgets.php): failed to open stream: No such file or directory in .../wp-content/plugins/add-to-any/add-to-any.php on line 1116 PHP Warning: include_once(): Failed opening '/addtoany.widgets.php' for inclusion (include_path='/srv/www/wp-cli/vendor/phpunit/phpunit-mock-objects:/srv/www/wp-cli/vendor/phpunit/php-token-stream:/srv/www/wp-cli/vendor/phpunit/php-code-coverage:/srv/www/wp-cli/vendor/phpunit/phpunit:/srv/www/wp-cli/vendor/symfony/yaml:.:/usr/share/php:/usr/share/pear') in .../wp-content/plugins/add-to-any/add-to-any.php on line 1116 Warning: include_once(): Failed opening '/addtoany.widgets.php' for inclusion (include_path='/srv/www/wp-cli/vendor/phpunit/phpunit-mock-objects:/srv/www/wp-cli/vendor/phpunit/php-token-stream:/srv/www/wp-cli/vendor/phpunit/php-code-coverage:/srv/www/wp-cli/vendor/phpunit/phpunit:/srv/www/wp-cli/vendor/symfony/yaml:.:/usr/share/php:/usr/share/pear') in .../wp-content/plugins/add-to-any/add-to-any.php on line 1116 PHP Fatal error: Class 'A2A_SHARE_SAVE_Widget' not found in .../wp/wp-includes/widgets.php on line 591 Fatal error: Class 'A2A_SHARE_SAVE_Widget' not found in .../wp/wp-includes/widgets.php on line 591
Seems like the global is getting a NULL. The current code:
// WordPress Must-Use? if ( basename( dirname( __FILE__ ) ) == 'mu-plugins' ) { // __FILE__ expected in /wp-content/mu-plugins (parent directory for auto-execution) // /wp-content/mu-plugins/add-to-any $A2A_SHARE_SAVE_plugin_url_path = WPMU_PLUGIN_URL . '/add-to-any'; $A2A_SHARE_SAVE_plugin_dir = WPMU_PLUGIN_DIR . '/add-to-any'; } else { // /wp-content/plugins/add-to-any $A2A_SHARE_SAVE_plugin_url_path = WP_PLUGIN_URL . '/' . $A2A_SHARE_SAVE_plugin_basename; $A2A_SHARE_SAVE_plugin_dir = WP_PLUGIN_DIR . '/' . $A2A_SHARE_SAVE_plugin_basename; }
If you instead access the global before setting it, it works:
global $A2A_SHARE_SAVE_plugin_dir; // WordPress Must-Use? if ( basename( dirname( __FILE__ ) ) == 'mu-plugins' ) { // __FILE__ expected in /wp-content/mu-plugins (parent directory for auto-execution) // /wp-content/mu-plugins/add-to-any $A2A_SHARE_SAVE_plugin_url_path = WPMU_PLUGIN_URL . '/add-to-any'; $A2A_SHARE_SAVE_plugin_dir = WPMU_PLUGIN_DIR . '/add-to-any'; } else { // /wp-content/plugins/add-to-any $A2A_SHARE_SAVE_plugin_url_path = WP_PLUGIN_URL . '/' . $A2A_SHARE_SAVE_plugin_basename; $A2A_SHARE_SAVE_plugin_dir = WP_PLUGIN_DIR . '/' . $A2A_SHARE_SAVE_plugin_basename; }
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘$A2A_SHARE_SAVE_plugin_dir not set and breaks WP CLI’ is closed to new replies.