Plugin Directory

Changeset 3073688


Ignore:
Timestamp:
04/19/2024 09:30:13 AM (23 months ago)
Author:
zorem
Message:

updated tracking file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • woo-advanced-shipment-tracking/trunk/zorem-tracking/zorem-tracking.php

    r3072972 r3073688  
    9595        }
    9696        public function load_admin_page() {
    97             $is_excluded = $this->excluded_urls();
    98             if ( true === $is_excluded ) {
    99                 return;
    100             }
     97           
    10198            if (isset($_GET['page']) && $_GET['page'] === $this->menu_slug) {
    10299               
     
    120117           
    121118            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           
    126120            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' ] ) {
    127121                update_option( $this->plugin_slug_with_hyphens . '_usage_data_selector', true );
     
    180174                return;
    181175            }
    182             $is_excluded = $this->excluded_urls();
    183             if ( true === $is_excluded ) {
    184                 return;
    185             }
     176           
    186177            // Update time first before sending to ensure it is set.
    187178            update_option( $this->plugin_slug_with_hyphens . '_usage_tracker_last_send', time() );
     
    454445            return $data;
    455446        }
    456 
    457         public function excluded_urls() {
    458             $words_to_check = array('staging', 'test', 'demo');
    459             // Extract URL from data
    460             $url = home_url();
    461             foreach ( $words_to_check as $word ) {
    462                 if ( false !== strpos($url, $word) ) {
    463                     return true;
    464                 }
    465             }
    466         }
    467447    }
    468448}
Note: See TracChangeset for help on using the changeset viewer.