{"id":16461632,"date":"2023-02-11T13:32:03","date_gmt":"2023-02-11T13:32:03","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/script-blocker-coding-error\/"},"modified":"2023-02-11T13:32:03","modified_gmt":"2023-02-11T13:32:03","slug":"script-blocker-coding-error","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/script-blocker-coding-error\/","title":{"rendered":"Script Blocker &#8211; coding error"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On line 138 in script-blocker.php, there is a coding error in so far as <code>!$this-&gt;script_data returns true <\/code>where an empty array is returned by $this-&gt;get_script_data().<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The effect is to make multiple calls to the $this-&gt;get_script_data for each entry in global $wt_cli_integration_list, which triggers multiple &#8220;SHOW TABLES&#8221; sql requests when only one search of the database is required.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Change the line to be <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>if ( is_null($this-&gt;script_data) ) {<\/code><\/p>\n","protected":false},"template":"","class_list":["post-16461632","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16461632","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\/16461632\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16461632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}