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 | google-index/google-index-init.php +16 -7 2.6.20 → 2.7.2 View file →
@@ -30,9 +30,9 @@
30 30 // Load the main class
31 31 if (file_exists(GOOGLE_INDEX_DIRECT_PATH . '/class-google-index-direct.php')) {
32 32 require_once GOOGLE_INDEX_DIRECT_PATH . '/class-google-index-direct.php';
33 33 } else {
34 - error_log('MetaSync Google Index: class-google-index-direct.php not found at ' . GOOGLE_INDEX_DIRECT_PATH . '/class-google-index-direct.php');
34 + error_log('MetaSync Google Index: class-google-index-direct.php not found at ' . GOOGLE_INDEX_DIRECT_PATH . '/class-google-index-direct.php'); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
35 35 return;
36 36 }
37 37
38 38 // Load admin interface if in admin area
@@ -39,9 +39,9 @@
39 39 if (is_admin()) {
40 40 if (file_exists(GOOGLE_INDEX_DIRECT_PATH . '/class-google-index-admin.php')) {
41 41 require_once GOOGLE_INDEX_DIRECT_PATH . '/class-google-index-admin.php';
42 42 } else {
43 - error_log('MetaSync Google Index: class-google-index-admin.php not found at ' . GOOGLE_INDEX_DIRECT_PATH . '/class-google-index-admin.php');
43 + error_log('MetaSync Google Index: class-google-index-admin.php not found at ' . GOOGLE_INDEX_DIRECT_PATH . '/class-google-index-admin.php'); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
44 44 }
45 45 }
46 46 }
47 47
@@ -46,10 +46,14 @@
46 46 }
47 47
48 48 /**
49 49 * Get Google Index Direct instance
50 - *
51 - * @return Google_Index_Direct
50 + *
51 + * Returns null when the class could not be loaded — callers that reached this
52 + * before google_index_direct_init() ran, or on an install where the class file
53 + * is missing, get null rather than a fatal.
54 + *
55 + * @return Google_Index_Direct|null
52 56 */
53 57 function google_index_direct()
54 58 {
55 59 static $instance = null;
@@ -55,9 +59,9 @@
55 59 static $instance = null;
56 60
57 61 if ($instance === null) {
58 62 if (!class_exists('Google_Index_Direct')) {
59 - error_log('MetaSync Google Index: Google_Index_Direct class not available.');
63 + error_log('MetaSync Google Index: Google_Index_Direct class not available.'); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
60 64 return null;
61 65 }
62 66 $instance = new Google_Index_Direct();
63 67 }
@@ -95,11 +99,16 @@
95 99 *
96 100 * @param array $service_account_json Service account JSON configuration
97 101 * @return bool True on success, false on failure
98 102 */
99 -function google_index_save_service_account($service_account_json)
103 +function google_index_save_service_account($service_account_json)
100 104 {
101 - return google_index_direct()->save_service_account_config($service_account_json);
105 + $instance = google_index_direct();
106 + if (!$instance) {
107 + return false;
108 + }
109 +
110 + return $instance->save_service_account_config($service_account_json);
102 111 }
103 112
104 113
105 114 // Initialize on WordPress init