PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.7.1
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.7.1
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-otto-cache-manager.php +25 -25 2.6.26 → 2.7.1 View file →
@@ -80,9 +80,9 @@
80 80 } else {
81 81 echo '<p style="color: var(--dashboard-text-secondary);">ℹ️ No cache plugins detected.</p>';
82 82 }
83 83 } catch (Exception $e) {
84 - error_log('MetaSync Cache Status Error: ' . $e->getMessage());
84 + error_log('MetaSync Cache Status Error: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- unreachable in production
85 85 echo '<p style="color: var(--dashboard-error);">⚠️ An error occurred while retrieving cache plugin status.</p>';
86 86 }
87 87 } else {
88 88 echo '<p style="color: var(--dashboard-error);">⚠️ Cache Purge class not loaded.</p>';
@@ -98,12 +98,12 @@
98 98 <p class="description" style="margin-top: 10px; color: var(--dashboard-text-secondary);">This will clear cache from WP Rocket, LiteSpeed, W3 Total Cache, and all other detected cache plugins.</p>
99 99 </form>
100 100
101 101 <?php
102 - if (isset($_GET['cache_cleared']) && $_GET['cache_cleared'] == '1') {
103 - $cleared = isset($_GET['cleared']) ? intval($_GET['cleared']) : 0;
104 - $failed = isset($_GET['failed']) ? intval($_GET['failed']) : 0;
105 - $plugins = isset($_GET['plugins']) ? sanitize_text_field($_GET['plugins']) : '';
102 + if (isset($_GET['cache_cleared']) && $_GET['cache_cleared'] == '1') { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
103 + $cleared = isset($_GET['cleared']) ? intval($_GET['cleared']) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
104 + $failed = isset($_GET['failed']) ? intval($_GET['failed']) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
105 + $plugins = isset($_GET['plugins']) ? sanitize_text_field(wp_unslash($_GET['plugins'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
106 106
107 107 if ($cleared > 0) {
108 108 echo '<div class="notice notice-success inline" style="margin-top: 15px;"><p>';
109 109 echo '✅ <strong>Success!</strong> Cleared cache for ' . intval( $cleared ) . ' plugin(s)';
@@ -123,10 +123,10 @@
123 123 echo '</p></div>';
124 124 }
125 125 }
126 126
127 - if (isset($_GET['cache_error']) && $_GET['cache_error'] == '1') {
128 - $message = isset($_GET['message']) ? urldecode(sanitize_text_field($_GET['message'])) : '';
127 + if (isset($_GET['cache_error']) && $_GET['cache_error'] == '1') { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
128 + $message = isset($_GET['message']) ? urldecode(sanitize_text_field(wp_unslash($_GET['message']))) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
129 129 if (empty($message)) {
130 130 $message = 'An unknown error occurred while clearing cache. Please check error logs for details.';
131 131 }
132 132 echo '<div class="notice notice-error inline" style="margin-top: 15px;"><p>';
@@ -222,12 +222,12 @@
222 222 </form>
223 223
224 224 <?php
225 225 // Hosting cache result messages
226 - if (isset($_GET['hosting_cache_cleared']) && $_GET['hosting_cache_cleared'] == '1') {
227 - $hc_cleared = isset($_GET['hc_cleared']) ? sanitize_text_field(urldecode($_GET['hc_cleared'])) : '';
228 - $hc_failed = isset($_GET['hc_failed']) ? sanitize_text_field(urldecode($_GET['hc_failed'])) : '';
229 - $hc_not_detected = isset($_GET['hc_not_detected']) ? sanitize_text_field(urldecode($_GET['hc_not_detected'])) : '';
226 + if (isset($_GET['hosting_cache_cleared']) && $_GET['hosting_cache_cleared'] == '1') { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
227 + $hc_cleared = isset($_GET['hc_cleared']) ? sanitize_text_field(urldecode($_GET['hc_cleared'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
228 + $hc_failed = isset($_GET['hc_failed']) ? sanitize_text_field(urldecode($_GET['hc_failed'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
229 + $hc_not_detected = isset($_GET['hc_not_detected']) ? sanitize_text_field(urldecode($_GET['hc_not_detected'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
230 230
231 231 if ($hc_cleared) {
232 232 echo '<div class="notice notice-success inline" style="margin-top: 15px;"><p>';
233 233 echo '✅ <strong>Success!</strong> Purged hosting cache on: ' . esc_html($hc_cleared);
@@ -295,11 +295,11 @@
295 295 <span style="color: var(--dashboard-accent);"><?php echo esc_html($cache_count); ?> cached entries</span>
296 296 </div>
297 297
298 298 <?php
299 - if (isset($_GET['otto_cache_cleared']) && $_GET['otto_cache_cleared'] == '1') {
300 - $cleared_count = isset($_GET['count']) ? intval($_GET['count']) : 0;
301 - $url = isset($_GET['url']) ? urldecode(sanitize_text_field($_GET['url'])) : '';
299 + if (isset($_GET['otto_cache_cleared']) && $_GET['otto_cache_cleared'] == '1') { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
300 + $cleared_count = isset($_GET['count']) ? intval($_GET['count']) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
301 + $url = isset($_GET['url']) ? urldecode(sanitize_text_field(wp_unslash($_GET['url']))) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
302 302
303 303 echo '<div class="notice notice-success inline" style="margin-top: 15px;"><p>';
304 304 if (!empty($url)) {
305 305 echo '✅ <strong>Success!</strong> Cleared cache for URL: <code>' . esc_html($url) . '</code> (' . intval( $cleared_count ) . ' entries)';
@@ -308,10 +308,10 @@
308 308 }
309 309 echo '</p></div>';
310 310 }
311 311
312 - if (isset($_GET['otto_cache_error']) && $_GET['otto_cache_error'] == '1') {
313 - $message = isset($_GET['message']) ? urldecode(sanitize_text_field($_GET['message'])) : 'An unknown error occurred.';
312 + if (isset($_GET['otto_cache_error']) && $_GET['otto_cache_error'] == '1') { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
313 + $message = isset($_GET['message']) ? urldecode(sanitize_text_field(wp_unslash($_GET['message']))) : 'An unknown error occurred.'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag for an escaped notice
314 314 echo '<div class="notice notice-error inline" style="margin-top: 15px;"><p>';
315 315 echo '❌ <strong>Error:</strong> ' . esc_html($message);
316 316 echo '</p></div>';
317 317 }
@@ -350,9 +350,9 @@
350 350 <td>
351 351 <input type="url"
352 352 id="otto_cache_url"
353 353 name="otto_cache_url"
354 - value="<?php echo isset($_GET['url']) ? esc_attr(urldecode(sanitize_text_field($_GET['url']))) : ''; ?>"
354 + value="<?php echo isset($_GET['url']) ? esc_attr(urldecode(sanitize_text_field(wp_unslash($_GET['url'])))) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only URL prefill, the form submit carries a nonce ?>"
355 355 class="regular-text"
356 356 placeholder="https://example.com/page/"
357 357 required />
358 358 <p class="description" style="color: var(--dashboard-text-secondary);">Enter the full URL of the page whose cache you want to clear.</p>
@@ -398,9 +398,9 @@
398 398 if (!empty($results['cleared'])) {
399 399 $redirect_url .= '&plugins=' . urlencode(implode(',', $results['cleared']));
400 400 }
401 401 } catch (Exception $e) {
402 - error_log('MetaSync Cache Clear Error: ' . $e->getMessage());
402 + error_log('MetaSync Cache Clear Error: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
403 403 $redirect_url .= '&cache_error=1&message=' . urlencode('An error occurred while clearing the cache. Please try again.');
404 404 }
405 405 } else {
406 406 $redirect_url .= '&cache_error=1&message=' . urlencode('Cache Purge class not available');
@@ -437,9 +437,9 @@
437 437 # the suggestions cache is now empty. Purge the page caches too so the
438 438 # next request regenerates with the current (clean) OTTO state.
439 439 self::purge_page_caches_all();
440 440 } catch (Exception $e) {
441 - error_log('MetaSync OTTO Cache Clear Error: ' . $e->getMessage());
441 + error_log('MetaSync OTTO Cache Clear Error: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
442 442 $redirect_url .= '&otto_cache_error=1&message=' . urlencode('An error occurred while clearing the OTTO cache. Please try again.');
443 443 }
444 444 } else {
445 445 $redirect_url .= '&otto_cache_error=1&message=' . urlencode('Transient Cache class not found');
@@ -492,9 +492,9 @@
492 492 } else {
493 493 $redirect_url .= '&otto_cache_error=1&message=' . urlencode($result['message']);
494 494 }
495 495 } catch (Exception $e) {
496 - error_log('MetaSync OTTO Cache Clear Error: ' . $e->getMessage());
496 + error_log('MetaSync OTTO Cache Clear Error: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
497 497 $redirect_url .= '&otto_cache_error=1&message=' . urlencode('An error occurred while clearing the OTTO cache for this URL. Please try again.');
498 498 }
499 499 } else {
500 500 $redirect_url .= '&otto_cache_error=1&message=' . urlencode('Transient Cache class not found');
@@ -584,11 +584,11 @@
584 584 wp_send_json_error(['message' => 'Invalid security token']);
585 585 return;
586 586 }
587 587
588 - $url_pattern = isset($_POST['url_pattern']) ? sanitize_text_field($_POST['url_pattern']) : '';
589 - $pattern_type = isset($_POST['pattern_type']) ? sanitize_text_field($_POST['pattern_type']) : 'exact';
590 - $description = isset($_POST['description']) ? sanitize_textarea_field($_POST['description']) : '';
588 + $url_pattern = isset($_POST['url_pattern']) ? sanitize_text_field(wp_unslash($_POST['url_pattern'])) : '';
589 + $pattern_type = isset($_POST['pattern_type']) ? sanitize_text_field(wp_unslash($_POST['pattern_type'])) : 'exact';
590 + $description = isset($_POST['description']) ? sanitize_textarea_field(wp_unslash($_POST['description'])) : '';
591 591
592 592 if (empty($url_pattern)) {
593 593 wp_send_json_error(['message' => 'URL pattern is required']);
594 594 return;
@@ -666,9 +666,9 @@
666 666 $cache_purge->clear_url_cache($url_pattern);
667 667 }
668 668 wp_cache_flush();
669 669 } catch (Exception $e) {
670 - error_log('MetaSync: Failed to clear cache for reactivated URL: ' . $e->getMessage());
670 + error_log('MetaSync: Failed to clear cache for reactivated URL: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
671 671 }
672 672 }
673 673
674 674 wp_send_json_success([
@@ -688,9 +688,9 @@
688 688 }
689 689
690 690 wp_cache_flush();
691 691 } catch (Exception $e) {
692 - error_log('MetaSync: Failed to clear cache for excluded URL: ' . $e->getMessage());
692 + error_log('MetaSync: Failed to clear cache for excluded URL: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets
693 693 }
694 694 }
695 695
696 696 wp_send_json_success([