You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The theme customizer provides the ability to preview drafts using a special URL. While previewing, it is possible for Site Kit to raise an error such as the one below
PHP message: PHP Fatal error: Uncaught Error: Call to undefined function Google\\Site_Kit\\Core\\Util\\get_plugin_data() in /.../google-site-kit/includes/Core/Util/Auto_Updates.php:105
Stack trace:
#0 /.../google-site-kit/includes/Core/Util/Auto_Updates.php(56): Google\\Site_Kit\\Core\\Util\\Auto_Updates::sitekit_forced_autoupdates_status()
#1 /.../google-site-kit/includes/Core/Authentication/Authentication.php(902): Google\\Site_Kit\\Core\\Util\\Auto_Updates::is_plugin_autoupdates_enabled()
#2 /.../google-site-kit/includes/Core/Util/Method_Proxy_Trait.php(25): Google\\Site_Kit\\Core\\Authentication\\Authentication->inline_js_base_data()
#3 /.../example.com/public_html/...', referer: https://example.com/wp-admin/customize.php?return=%2Fwp-admin%2Fthemes.php
This is because the WP core function get_plugin_data is not loaded in this specific scenario.
Steps to reproduce
Set up Site Kit
Enable a theme that supports the customizer, e.g. Twenty Twenty
Go into the customizer and make any change
Click the cog next to Publish and choose Save Draft
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
No errors should be raised by Site Kit while previewing a customizer draft
Implementation Brief
Update Auto_Updates::sitekit_forced_autoupdates_status to conditionally load wp-admin/includes/plugin.php if the get_plugin_data does not exist prior to calling
Test Coverage
No changes necessary
QA Brief
Follow the "Steps to reproduce" in the issue description.
Verify that the reported error no longer occurs.
Changelog entry
Fix error when previewing Customizer drafts.
The text was updated successfully, but these errors were encountered:
Bug Description
The theme customizer provides the ability to preview drafts using a special URL. While previewing, it is possible for Site Kit to raise an error such as the one below
This is because the WP core function
get_plugin_data
is not loaded in this specific scenario.Steps to reproduce
Screenshots
Additional Context
Related support request
https://wordpress.org/support/topic/i-get-a-critical-error-but-only-through-customizer/
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Auto_Updates::sitekit_forced_autoupdates_status
to conditionally loadwp-admin/includes/plugin.php
if theget_plugin_data
does not exist prior to callingTest Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: