Changeset 1864266
- Timestamp:
- 04/25/2018 04:25:56 PM (8 years ago)
- Location:
- at-internet/trunk
- Files:
-
- 6 edited
-
atinternet-smarttag.php (modified) (2 diffs)
-
includes/class-atinternet-smarttag-settings.php (modified) (1 diff)
-
includes/lib/class-atinternet-smarttag-tracking-js-builder.php (modified) (3 diffs)
-
includes/lib/class-atinternet-smarttag-tracking-tree-structure.php (modified) (1 diff)
-
includes/lib/class-atinternet-smarttag-tracking.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
at-internet/trunk/atinternet-smarttag.php
r1729337 r1864266 2 2 /* 3 3 * Plugin Name: AT Internet SmartTag 4 * Version: 0.1. 34 * Version: 0.1.4 5 5 * Plugin URI: http://www.atinternet.com/ 6 6 * Description: AT Internet official extension, allowing website tracking. … … 8 8 * Author URI: http://www.atinternet.com/ 9 9 * Requires at least: 4.0 10 * Tested up to: 4. 7.310 * Tested up to: 4.9.5 11 11 * 12 12 * Text Domain: atinternet-smarttag -
at-internet/trunk/includes/class-atinternet-smarttag-settings.php
r1631751 r1864266 132 132 'label' => __( 'Use SSL only?', 'at-internet' ), 133 133 'description' => __( 'Use only secure collect?', 'at-internet' ), 134 'type' => 'checkbox', 135 'default' => '' 136 ), 137 array( 138 'id' => 'async', 139 'label' => __( 'Use asynchronous tag?', 'at-internet' ), 134 140 'type' => 'checkbox', 135 141 'default' => '' -
at-internet/trunk/includes/lib/class-atinternet-smarttag-tracking-js-builder.php
r1631751 r1864266 82 82 return 'var ' . $this->tracker_name . ' = new ATInternet.Tracker.Tag(' . json_encode( $this->configuration ) . ');'; 83 83 } 84 85 /** 86 * Tracker initialisation. 87 * @access private 88 * @since 1.0.0 89 * @return string 90 */ 91 private function tracker_init_async() { 92 return 'window.' . $this->tracker_name . ' = new window.ATInternet.Tracker.Tag(' . json_encode( $this->configuration ) . ');'; 93 } 84 94 85 95 /** … … 119 129 * @return string 120 130 */ 121 public function display() { 122 echo $this->get_tracker(); 131 public function display($async) { 132 if($async) echo $this->get_tracker_async(); 133 else echo $this->get_tracker(); 123 134 } 124 135 … … 140 151 return $the_tracker; 141 152 } 153 154 /** 155 * Get the full tracker. 156 * @access public 157 * @since 1.0.0 158 * @return string 159 */ 160 public function get_tracker_async() { 161 $the_tracker = "<script type=\"text/javascript\">"; 162 $the_tracker .= "\nwindow.ATInternet = {"; 163 $the_tracker .= "\n onTrackerLoad:function(){"; 164 $the_tracker .= "\n " . $this->tracker_init_async(); 165 foreach ( $this->functionnalities as $functionnality ) { 166 $the_tracker .= "\n " . $this->$functionnality(); 167 } 168 $the_tracker .= "\n " . $this->tracker_dispatch(); 169 $the_tracker .= "\n }"; 170 $the_tracker .= "\n}"; 171 $the_tracker .= "\n</script>"; 172 173 return $the_tracker; 174 } 142 175 143 176 } -
at-internet/trunk/includes/lib/class-atinternet-smarttag-tracking-tree-structure.php
r1729337 r1864266 123 123 private function get_categories() { 124 124 $categories = array(); 125 if( $this->screen_type == 'post' ) $categories = get_the_terms( $this->post_id, 'category' ) ;126 if( $this->screen_type == 'product' ) $categories = get_the_terms( $this->post_id, 'product_cat' ) ;125 if( $this->screen_type == 'post' ) $categories = get_the_terms( $this->post_id, 'category' ) ?: array(); 126 if( $this->screen_type == 'product' ) $categories = get_the_terms( $this->post_id, 'product_cat' ) ?: array(); 127 127 128 128 $categories = array_values( $categories ); -
at-internet/trunk/includes/lib/class-atinternet-smarttag-tracking.php
r1631751 r1864266 76 76 if( $this->screen_type == 'search' ) $the_tracker->add( 'internal_search', $this->get_internal_search() ); 77 77 78 $conf_async = ( get_option( $this->prefix . 'async' ) === 'on' ) ? 1 : 0; 78 79 // Display tracking code 79 $the_tracker->display( );80 $the_tracker->display($conf_async); 80 81 81 82 } -
at-internet/trunk/readme.txt
r1729337 r1864266 3 3 Tags: AT Internet, Analytics, Tracking, Woocommerce 4 4 Requires at least: 4.0 5 Tested up to: 4. 7.35 Tested up to: 4.9.5 6 6 Stable tag: trunk 7 7 License: GPLv2 or later … … 32 32 == Changelog == 33 33 34 = 0.1.4 = 35 * 2018-04-25 36 * Add asynchronous tag setting 37 * Bug fix (on pages) 38 34 39 = 0.1.3 = 35 40 * 2017-09-13
Note: See TracChangeset
for help on using the changeset viewer.