{"id":19030773,"date":"2026-09-28T02:36:22","date_gmt":"2026-09-28T02:36:22","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wp-cli-fatal-error-when-global-controller-is-null\/"},"modified":"2026-09-28T02:36:22","modified_gmt":"2026-09-28T02:36:22","slug":"wp-cli-fatal-error-when-global-controller-is-null","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wp-cli-fatal-error-when-global-controller-is-null\/","title":{"rendered":"WP-CLI fatal error when global controller is null"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Good Reviews for WordPress: WP-CLI fatal error when global controller is null<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On a site running PHP 8.4 and Good Reviews for WordPress 2.3.14, <code>wp plugin list<\/code> fails while loading the plugin:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Call to a member function check_permission() on null\nincludes\/Settings.class.php:416<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>show_submit_button()<\/code> declares <code>global $grfwp_controller<\/code> and calls <code>$grfwp_controller-&gt;permissions-&gt;check_permission()<\/code>. The controller is assigned at file scope near the end of <code>good-reviews-wp.php<\/code>. During WP-CLI loading, that assignment appears not to populate the global variable read by <code>show_submit_button()<\/code>. Running the same command with <code>--skip-plugins=good-reviews-wp<\/code> succeeds, which isolates the failure to this plugin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please test explicitly declaring the global before the assignment:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Global instance\nglobal $grfwp_controller;\n$grfwp_controller = grfwpInit::instance();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The plugin may also benefit from checking that the controller and permissions object exist before calling <code>check_permission()<\/code>. Re-uploading version 2.3.14 did not resolve the error.<\/p>\n","protected":false},"template":"","class_list":["post-19030773","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19030773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19030773\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19030773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}