PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.7.2
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.7.2
2.7.1 2.7.2 2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 All 141 releases
← All changes | includes/class-metasync-headless-graphql.php +12 -3 2.7.0 → 2.7.2 View file →
@@ -224,9 +224,16 @@
224 224 # execution follows exactly the path it does today, and an extra callback
225 225 # on a WPGraphQL schema build is an observable difference even when it
226 226 # returns immediately. The option read this costs is memoised and the
227 227 # plugin already reads that option several times per request.
228 - if (!Metasync_Headless_Config::is_enabled()) {
228 + #
229 + # The class_exists leg is the update-window case: this file and the
230 + # config class are separate files in the same auto-update, and WordPress
231 + # copies them one at a time. A request landing between the two copies
232 + # used to fatal here on every front-end load — the classmap cannot
233 + # autoload a file that is not on disk yet. Degrade to the no-headless
234 + # path instead; the site keeps serving until the update finishes.
235 + if (!class_exists('Metasync_Headless_Config') || !Metasync_Headless_Config::is_enabled()) {
229 236 return;
230 237 }
231 238
232 239 add_action('graphql_register_types', array(__CLASS__, 'register'));
@@ -294,15 +301,17 @@
294 301 *
295 302 * The headless check happens here rather than at hook time so switching the
296 303 * mode takes effect on the next request instead of needing a reload. With
297 304 * the mode off nothing is registered and the schema is byte-identical to a
298 - * site without this plugin.
305 + * site without this plugin. The class_exists leg mirrors init(): during an
306 + * auto-update the file set on disk can be mixed, and a callback that only
307 + * exists to be inert must survive landing in one.
299 308 *
300 309 * @return void
301 310 */
302 311 public static function register()
303 312 {
304 - if (!Metasync_Headless_Config::is_enabled()) {
313 + if (!class_exists('Metasync_Headless_Config') || !Metasync_Headless_Config::is_enabled()) {
305 314 return;
306 315 }
307 316
308 317 if (!function_exists('register_graphql_object_type') || !function_exists('register_graphql_field')) {