WP-CLI fatal error when global controller is null
-
Good Reviews for WordPress: WP-CLI fatal error when global controller is null
On a site running PHP 8.4 and Good Reviews for WordPress 2.3.14,
wp plugin listfails while loading the plugin:Call to a member function check_permission() on null includes/Settings.class.php:416show_submit_button()declaresglobal $grfwp_controllerand calls$grfwp_controller->permissions->check_permission(). The controller is assigned at file scope near the end ofgood-reviews-wp.php. During WP-CLI loading, that assignment appears not to populate the global variable read byshow_submit_button(). Running the same command with--skip-plugins=good-reviews-wpsucceeds, which isolates the failure to this plugin.Please test explicitly declaring the global before the assignment:
// Global instance global $grfwp_controller; $grfwp_controller = grfwpInit::instance();The plugin may also benefit from checking that the controller and permissions object exist before calling
check_permission(). Re-uploading version 2.3.14 did not resolve the error.
You must be logged in to reply to this topic.