{"id":13031049,"date":"2020-06-24T17:59:49","date_gmt":"2020-06-24T17:59:49","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/breaks-wp-cli\/"},"modified":"2020-06-24T17:59:49","modified_gmt":"2020-06-24T17:59:49","slug":"breaks-wp-cli","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/breaks-wp-cli\/","title":{"rendered":"Breaks WP-CLI"},"content":{"rendered":"<p>I have &#8220;mb YTPlayer PLUS for background videos&#8221; v3.4.8 installed and it&#8217;s not compatible with WordPress&#8217; CLI (WP-CLI). Over SSH when I try basic commands link &#8220;wp option get home&#8221; it results in the following PHP fatal error.<\/p>\n<p>PHP Fatal error:  Uncaught Error: Call to a member function get_lic_domain() on null in \/www\/public\/wp-content\/plugins\/wp-ytplayer-plus\/inc\/extra.php:22<br \/>\nStack trace:<br \/>\n#0 \/www\/public\/wp-includes\/class-wp-hook.php(287): WP_CLI\\Runner-&gt;{closure}()<br \/>\n#1 \/www\/public\/wp-includes\/class-wp-hook.php(311): WP_Hook-&gt;apply_filters()<br \/>\n#2 \/www\/public\/wp-includes\/plugin.php(478): WP_Hook-&gt;do_action()<br \/>\n#3 \/www\/public\/wp-settings.php(540): do_action()<br \/>\n#4 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Runner.php(1237): require(&#8216;\/www\/pennmanor_&#8230;&#8217;)<br \/>\n#5 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Runner.php(1158): WP_CLI\\Runner-&gt;load_wordpress()<br \/>\n#6 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Bootstrap\/LaunchRunner.php(23): WP_CLI\\Runner-&gt;start()<br \/>\n#7 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/bootstrap.php(74): WP_CLI\\Bootstrap\\LaunchRunner-&gt;process()<br \/>\n#8 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/wp-cli.php(27): WP_CLI\\bootstrap()<br \/>\n#9 p in \/www\/public\/wp-content\/plugins\/wp-ytplayer-plus\/inc\/extra.php on line 22<br \/>\nFatal error: Uncaught Error: Call to a member function get_lic_domain() on null in \/www\/public\/wp-content\/plugins\/wp-ytplayer-plus\/inc\/extra.php:22<br \/>\nStack trace:<br \/>\n#0 \/www\/public\/wp-includes\/class-wp-hook.php(287): WP_CLI\\Runner-&gt;{closure}()<br \/>\n#1 \/www\/public\/wp-includes\/class-wp-hook.php(311): WP_Hook-&gt;apply_filters()<br \/>\n#2 \/www\/public\/wp-includes\/plugin.php(478): WP_Hook-&gt;do_action()<br \/>\n#3 \/www\/public\/wp-settings.php(540): do_action()<br \/>\n#4 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Runner.php(1237): require(&#8216;\/www\/pennmanor_&#8230;&#8217;)<br \/>\n#5 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Runner.php(1158): WP_CLI\\Runner-&gt;load_wordpress()<br \/>\n#6 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Bootstrap\/LaunchRunner.php(23): WP_CLI\\Runner-&gt;start()<br \/>\n#7 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/bootstrap.php(74): WP_CLI\\Bootstrap\\LaunchRunner-&gt;process()<br \/>\n#8 phar:\/\/\/usr\/local\/bin\/wp\/vendor\/wp-cli\/wp-cli\/php\/wp-cli.php(27): WP_CLI\\bootstrap()<br \/>\n#9 p in \/www\/public\/wp-content\/plugins\/wp-ytplayer-plus\/inc\/extra.php on line 22<br \/>\nError: There has been a critical error on your website.Learn more about debugging in WordPress. There has been a critical error on your website.<\/p>\n<p>I was able to work around this issues by changing file &#8220;wp-content\/plugins\/wp-ytplayer-plus\/inc\/extra.php&#8221; from:<\/p>\n<pre><code>add_action(&quot;init&quot;, function(){\n        global $ytp_xxx, $is_in_development, $ytp_core, $lic_domain;\n<\/code><\/pre>\n<p>to the following:<\/p>\n<pre><code>add_action(&quot;init&quot;, function(){\n        if ( defined( &#039;WP_CLI&#039; ) &amp;&amp; WP_CLI ) {\n                return;\n        }\n        global $ytp_xxx, $is_in_development, $ytp_core, $lic_domain;\n<\/code><\/pre>\n<p>Can you add this fix to your plugin? Being able to use WP-CLI is fairly critical for my site.<\/p>\n","protected":false},"template":"","class_list":["post-13031049","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13031049","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\/13031049\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=13031049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}