critical error on this website: An error of type E_COMPILE_ERROR was caused
See original GitHub issueBug Description
A support topic was opened in relation to users encountering a critical WordPress error, with 2 users reporting the error coming from Site Kit.
One user has encountered this on all the sites where he has Site Kit active on. Users are unable to access their site, I suspect both front end and admin panel. Once Site Kit is re-activated after “restoring” their site via a recovery link the same issue occurs.
The error appears as below:
An error of type E_COMPILE_ERROR was caused in line 34 of the file /var/www/wp-content/plugins/google-site-kit/includes/loader.php. Error message: require_once(): Failed opening required ‘/var/www/wp-content/plugins/google-site-kit/third-party/vendor/composer/InstalledVersions.php’ (include_path=’.:/opt/remi/php73/root/usr/share/pear:/opt/remi/php73/root/usr/share/php:/usr/share/pear:/usr/share/php’)
There have been other mentions of this on social media. awaiting further insights, unreproducible in support so far.
Support Topic(s): https://wordpress.org/support/topic/error-there-has-been-a-critical-error-on-this-website-3/ - Open - no SH info
Additional Context
- Site Kit 1.38.0
- Possible multiple users impacted
- No obvious cause looking at the front end of one users site. There are ads related console errors
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Site Kit should not try to autoload classes which are not part of the Site Kit build ZIP.
Implementation Brief
- Merge #3835
Test Coverage
- N/A
Visual Regression Changes
- N/A
QA Brief
- Verify that the autoloader used in the SK plugin doesn’t include classes that start not from the
Google\Site_Kit
namespace.
Changelog entry
- Fix bug where other plugins using an unprefixed version of Composer could cause Site Kit to trigger a fatal error.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
@eugene-manuilov @bethanylang If this is not caused by some odd edge-case situation, definitely a hot fix candidate. At a minimum, we’d need to include it in 1.39.0.
QA: Eng ✅
Due to the extra logic it’s no longer possible for a non-Site Kit class to be accidentally picked up by Site Kit’s autoloader. Only classes starting in
Google\Site_Kit
are considered.