PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / trunk
Search Atlas SEO – OTTO AI SEO Automation for WordPress vtrunk
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 | telemetry/telemetry-init.php +14 -6 2.6.17 → trunk View file →
@@ -14,14 +14,18 @@
14 14 if (!defined('WPINC')) {
15 15 die;
16 16 }
17 17
18 -// Class files are autoloaded by Composer. Procedural/side-effect files stay explicit.
19 -require_once plugin_dir_path(__FILE__) . 'sentry-wordpress-integration.php';
20 -require_once plugin_dir_path(__FILE__) . 'wordpress-error-handler.php';
21 -require_once plugin_dir_path(__FILE__) . 'sentry-helper.php';
18 +require_once plugin_dir_path(__FILE__) . 'privacy.php';
22 19
20 +// Side-effectful telemetry files must not load after either opt-out path.
21 +if (!metasync_telemetry_is_disabled()) {
22 + require_once plugin_dir_path(__FILE__) . 'sentry-wordpress-integration.php';
23 + require_once plugin_dir_path(__FILE__) . 'wordpress-error-handler.php';
24 + require_once plugin_dir_path(__FILE__) . 'sentry-helper.php';
25 +}
23 26
27 +
24 28 /**
25 29 * Initialize telemetry system
26 30 */
27 31 function init_metasync_telemetry() {
@@ -65,9 +69,9 @@
65 69 return; // Skip if memory was already determined to be unsafe
66 70 }
67 71
68 72 // Check if telemetry is explicitly disabled
69 - if (defined('METASYNC_DISABLE_TELEMETRY') && constant('METASYNC_DISABLE_TELEMETRY')) {
73 + if (metasync_telemetry_is_disabled()) {
70 74 return;
71 75 }
72 76
73 77 try {
@@ -136,9 +140,9 @@
136 140 }
137 141 }
138 142
139 143 // Only initialize telemetry if not explicitly disabled
140 -if (!defined('METASYNC_DISABLE_TELEMETRY') || !constant('METASYNC_DISABLE_TELEMETRY')) {
144 +if (!metasync_telemetry_is_disabled()) {
141 145 // Add hook - memory check is now handled inside the function for efficiency
142 146 add_action('plugins_loaded', 'init_metasync_telemetry', 5);
143 147 }
144 148
@@ -147,8 +151,12 @@
147 151 *
148 152 * @return Metasync_Telemetry_Manager|null Null when the class cannot be loaded.
149 153 */
150 154 function metasync_telemetry() {
155 + if (metasync_telemetry_is_disabled()) {
156 + return null;
157 + }
158 +
151 159 if (!class_exists('Metasync_Telemetry_Manager')) {
152 160 $manager_file = plugin_dir_path(__FILE__) . 'class-telemetry-manager.php';
153 161 if (is_readable($manager_file)) {
154 162 require_once $manager_file;