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-endpoint-manager.php +6 -7 2.6.23 → 2.7.2 View file →
@@ -80,19 +80,18 @@
80 80 */
81 81 public static function set_mode( $mode ) {
82 82 // Validate mode
83 83 if ( ! in_array( $mode, array( self::MODE_PRODUCTION, self::MODE_STAGING ), true ) ) {
84 - error_log( "MetaSync Endpoint Manager: Invalid mode '{$mode}' provided" );
84 + error_log( "MetaSync Endpoint Manager: Invalid mode '{$mode}' provided" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
85 85 return false;
86 86 }
87 87
88 88 $result = update_option( self::MODE_OPTION, $mode );
89 89
90 - if ( $result ) {
91 - error_log( "MetaSync Endpoint Manager: Endpoints switched to {$mode} mode by user " . get_current_user_id() );
92 - }
93 -
94 - return $result;
90 + // WordPress returns false when the requested value is already stored.
91 + // Read it back so selecting the current mode remains an idempotent success,
92 + // while a failed write that leaves another value still reports failure.
93 + return $result || self::get_mode() === $mode;
95 94 }
96 95
97 96 /**
98 97 * Get a specific endpoint URL by key.
@@ -103,9 +102,9 @@
103 102 public static function get_endpoint( $endpoint_key ) {
104 103 $mode = self::get_mode();
105 104
106 105 if ( ! isset( self::$endpoints[ $mode ][ $endpoint_key ] ) ) {
107 - error_log( "MetaSync Endpoint Manager: Unknown endpoint key '{$endpoint_key}'" );
106 + error_log( "MetaSync Endpoint Manager: Unknown endpoint key '{$endpoint_key}'" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
108 107
109 108 // Fallback to production if key exists there
110 109 if ( isset( self::$endpoints[ self::MODE_PRODUCTION ][ $endpoint_key ] ) ) {
111 110 return self::$endpoints[ self::MODE_PRODUCTION ][ $endpoint_key ];