Changeset 3073688
- Timestamp:
- 04/19/2024 09:30:13 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
woo-advanced-shipment-tracking/trunk/zorem-tracking/zorem-tracking.php
r3072972 r3073688 95 95 } 96 96 public function load_admin_page() { 97 $is_excluded = $this->excluded_urls(); 98 if ( true === $is_excluded ) { 99 return; 100 } 97 101 98 if (isset($_GET['page']) && $_GET['page'] === $this->menu_slug) { 102 99 … … 120 117 121 118 check_ajax_referer( $this->plugin_slug_with_hyphens . '_usage_data_form', $this->plugin_slug_with_hyphens . '_usage_data_form_nonce' ); 122 $is_excluded = $this->excluded_urls(); 123 if ( true === $is_excluded ) { 124 return; 125 } 119 126 120 if ( isset( $_POST[ $this->plugin_slug_with_hyphens . '_optin_email_notification' ] ) && 0 == $_POST[ $this->plugin_slug_with_hyphens . '_optin_email_notification' ] && isset( $_POST[ $this->plugin_slug_with_hyphens . '_enable_usage_data' ] ) && 0 == $_POST[ $this->plugin_slug_with_hyphens . '_enable_usage_data' ] ) { 127 121 update_option( $this->plugin_slug_with_hyphens . '_usage_data_selector', true ); … … 180 174 return; 181 175 } 182 $is_excluded = $this->excluded_urls(); 183 if ( true === $is_excluded ) { 184 return; 185 } 176 186 177 // Update time first before sending to ensure it is set. 187 178 update_option( $this->plugin_slug_with_hyphens . '_usage_tracker_last_send', time() ); … … 454 445 return $data; 455 446 } 456 457 public function excluded_urls() {458 $words_to_check = array('staging', 'test', 'demo');459 // Extract URL from data460 $url = home_url();461 foreach ( $words_to_check as $word ) {462 if ( false !== strpos($url, $word) ) {463 return true;464 }465 }466 }467 447 } 468 448 }
Note: See TracChangeset
for help on using the changeset viewer.