PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.13.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.13.0
2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 All 54 releases
← All changes | includes/seo/class-schema-management-system.php +27 -1 2.12.0 → 2.13.0 View file →
@@ -1325,13 +1325,39 @@
1325 1325 $this->cache_manager->invalidate_all_cache();
1326 1326 }
1327 1327
1328 1328 // AUTO-DEPLOY: Automatically regenerate and deploy schema when settings change
1329 - if ($success && !empty($settings['auto_deploy'])) {
1329 + if ($success && self::should_auto_deploy($settings, $this->get_settings($context_type, $context_id))) {
1330 1330 $this->auto_deploy_schema_on_settings_change($context_type, $context_id, $settings);
1331 1331 }
1332 1332
1333 1333 return $success;
1334 + }
1335 +
1336 +
1337 + /**
1338 + * Whether a save should redeploy the schema it changed.
1339 + *
1340 + * `auto_deploy` is a stored setting (on by default), not something a save
1341 + * restates. Reading it off the incoming patch meant a partial save — which
1342 + * is what the admin screen sends, one field at a time — skipped
1343 + * auto-deploy on a site that had it switched on, and the deployed snapshot
1344 + * the front end serves kept the name, logo and sameAs it was deployed
1345 + * with, however often the user saved (#904, the gate #12 left in place).
1346 + *
1347 + * A patch that does carry the key still wins, so a caller can deploy or
1348 + * hold deliberately.
1349 + *
1350 + * @param array $patch Settings being saved
1351 + * @param array $stored Settings as stored, after the save
1352 + * @return bool
1353 + */
1354 + public static function should_auto_deploy(array $patch, array $stored): bool {
1355 + if (array_key_exists('auto_deploy', $patch)) {
1356 + return !empty($patch['auto_deploy']);
1357 + }
1358 +
1359 + return !empty($stored['auto_deploy']);
1334 1360 }
1335 1361
1336 1362 /**
1337 1363 * Auto-deploy schema when settings change