Changeset 3035929
- Timestamp:
- 02/15/2024 12:29:36 AM (2 years ago)
- Location:
- boostbox/trunk
- Files:
-
- 17 edited
-
README.txt (modified) (2 diffs)
-
admin/boostbox-admin-settings.php (modified) (1 diff)
-
admin/boostbox-custom-post-type.php (modified) (1 diff)
-
admin/class-boostbox-admin.php (modified) (1 diff)
-
admin/metaboxes/boostbox-display-settings.php (modified) (5 diffs)
-
admin/metaboxes/boostbox-metrics-settings.php (modified) (3 diffs)
-
admin/metaboxes/boostbox-popup-settings.php (modified) (1 diff)
-
boostbox.php (modified) (2 diffs)
-
includes/boostbox-helper-functions.php (modified) (2 diffs)
-
includes/class-boostbox-activator.php (modified) (1 diff)
-
includes/class-boostbox-deactivator.php (modified) (1 diff)
-
includes/class-boostbox-i18n.php (modified) (1 diff)
-
includes/class-boostbox-loader.php (modified) (1 diff)
-
includes/class-boostbox.php (modified) (2 diffs)
-
languages/boostbox.pot (modified) (7 diffs)
-
public/class-boostbox-public.php (modified) (4 diffs)
-
public/js/boostbox-public.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
boostbox/trunk/README.txt
r3031244 r3035929 5 5 Requires at least: 3.0.1 6 6 Tested up to: 6.4.3 7 Stable tag: 1. 5.07 Stable tag: 1.6.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 49 49 50 50 == Changelog == 51 52 = 1.6.0 = 53 * Added 'boostbox_settings_disable_analytics' helper function in `includes/boostbox-helper-functions.php` 54 * Added 'boostbox_settings_disable_analytics' filter in `includes/boostbox-helper-functions.php` 55 * Added 'boostbox_settings_cookie_days' helper function in `includes/boostbox-helper-functions.php` 56 * Added 'boostbox_settings_cookie_days' filter in `includes/boostbox-helper-functions.php` 57 * Added 'Disable analytics' setting in `admin/boostbox-admin-settings.php` 58 * Updated impressions/conversions to turn off if analytics is disabled in multiple files throughout the plugin 59 * Updated boostbox_settings_disable_analytics() checks in multiple files throughout the plugin 60 * Updated metabox HTML elements to use echo with `wp_kses` in `admin/metaboxes/boostbox-display-settings.php` 61 * Updated input allowed tags to include checked attribute in `includes/boostbox-helper-functions.php` 62 * Updated localize script to use new `boostbox_settings_cookie_days` helper function in `public/class-boostbox-public.php` 63 * Updated text strings for localization in `languages/boostbox.pot` 64 * General code cleanup throughout multiple files throughout the plugin 51 65 52 66 = 1.5.0 = -
boostbox/trunk/admin/boostbox-admin-settings.php
r3031244 r3035929 104 104 ) 105 105 ); 106 107 // Field: Privacy - Disable analytics 108 $boostbox_obj->add_field( 109 'boostbox_general', 110 array( 111 'id' => 'boostbox_privacy_disable_analytics', 112 'type' => 'checkbox', 113 'name' => esc_attr__( 'Disable Tracking', 'boostbox' ), 114 'desc' => esc_attr__( 'Turn off the impression and conversion tracking', 'boostbox' ), 115 ) 116 ); 106 117 } 107 118 add_action( 'init', 'boostbox_initialize_admin_settings', 100 ); -
boostbox/trunk/admin/boostbox-custom-post-type.php
r3031244 r3035929 114 114 */ 115 115 function boostbox_add_metrics_columns_to_admin_screen() { 116 // Bail early if analytics is disabled. 117 if ( boostbox_settings_disable_analytics() ) { return; } 118 116 119 // Create an instance. 117 120 $boostbox_columns = new BoostBox_CPT_Columns( 'boostbox_popups' ); -
boostbox/trunk/admin/class-boostbox-admin.php
r3031244 r3035929 10 10 * @link https://deviodigital.com 11 11 * @since 1.0.0 12 */ 12 */ 13 14 // Exit if accessed directly. 15 if ( ! defined( 'ABSPATH' ) ) { 16 wp_die(); 17 } 13 18 14 19 /** -
boostbox/trunk/admin/metaboxes/boostbox-display-settings.php
r3027699 r3035929 12 12 * @since 1.1.0 13 13 */ 14 15 // Exit if accessed directly. 16 if ( ! defined( 'ABSPATH' ) ) { 17 wp_die(); 18 } 14 19 15 20 /** … … 138 143 echo wp_kses( $field, boostbox_allowed_tags() ); 139 144 140 echo '</div>141 142 <div id="second-panel" class="panel animated slideInRight">' ;145 echo wp_kses( '</div> 146 147 <div id="second-panel" class="panel animated slideInRight">', boostbox_allowed_tags() ); 143 148 144 149 $animations = array( … … 189 194 echo wp_kses( $field, boostbox_allowed_tags() ); 190 195 191 echo '</div>192 193 <div id="third-panel" class="panel animated slideInRight">' ;196 echo wp_kses( '</div> 197 198 <div id="third-panel" class="panel animated slideInRight">', boostbox_allowed_tags() ); 194 199 195 200 $triggers = array( … … 246 251 echo wp_kses( $field, boostbox_allowed_tags() ); 247 252 248 echo '</div>249 250 <div id="fourth-panel" class="panel animated slideInRight">' ;253 echo wp_kses( '</div> 254 255 <div id="fourth-panel" class="panel animated slideInRight">', boostbox_allowed_tags() ); 251 256 $placements = array( 252 257 'outside' => esc_attr__( 'Outside', 'boostbox' ), … … 294 299 295 300 echo wp_kses( $field, boostbox_allowed_tags() ); 296 echo '</div>301 echo wp_kses( '</div> 297 302 </div> 298 303 299 </div>' ;304 </div>', boostbox_allowed_tags() ); 300 305 } 301 306 -
boostbox/trunk/admin/metaboxes/boostbox-metrics-settings.php
r3027699 r3035929 13 13 */ 14 14 15 // Exit if accessed directly. 16 if ( ! defined( 'ABSPATH' ) ) { 17 wp_die(); 18 } 19 15 20 /** 16 21 * Metrics metabox … … 26 31 */ 27 32 function boostbox_metrics_metabox() { 33 // Bail early if analytics is disabled. 34 if ( boostbox_settings_disable_analytics() ) { 35 return; 36 } 37 28 38 // Add Metabox. 29 39 add_meta_box( … … 45 55 */ 46 56 function boostbox_metrics_metabox_content() { 57 // Bail early if analytics is disabled. 58 if ( boostbox_settings_disable_analytics() ) { 59 return; 60 } 61 47 62 global $post; 48 63 -
boostbox/trunk/admin/metaboxes/boostbox-popup-settings.php
r3027699 r3035929 12 12 * @since 1.0.0 13 13 */ 14 15 // Exit if accessed directly. 16 if ( ! defined( 'ABSPATH' ) ) { 17 wp_die(); 18 } 14 19 15 20 /** -
boostbox/trunk/boostbox.php
r3031244 r3035929 14 14 * Plugin URI: https://deviodigital.com/boostbox-lead-generation-plugin 15 15 * Description: Build popups for lead generation, content promotion and more using the core editor. 16 * Version: 1. 5.016 * Version: 1.6.0 17 17 * Author: Devio Digital 18 18 * Author URI: https://deviodigital.com … … 29 29 30 30 // Current plugin version. 31 define( 'BOOSTBOX_VERSION', '1. 5.0' );31 define( 'BOOSTBOX_VERSION', '1.6.0' ); 32 32 33 33 // Plugin basename. -
boostbox/trunk/includes/boostbox-helper-functions.php
r3031244 r3035929 39 39 // form fields - input 40 40 $my_allowed['input'] = array( 41 'class' => array(), 42 'id' => array(), 43 'name' => array(), 44 'value' => array(), 45 'type' => array(), 41 'class' => array(), 42 'id' => array(), 43 'name' => array(), 44 'value' => array(), 45 'type' => array(), 46 'checked' => array(), 46 47 ); 47 48 // select … … 206 207 return apply_filters( 'boostbox_popup_conversion_rate_formatted_percentage', $formatted_percentage, $conversion_percentage ); 207 208 } 209 210 /** 211 * Settings - Disable analytics 212 * 213 * @since 1.6.0 214 * @return bool 215 */ 216 function boostbox_settings_disable_analytics() { 217 // Get the general settings. 218 $settings = get_option( 'boostbox_general' ); 219 // Disable anaytics. 220 $disable_analytics = true; 221 if ( ! isset( $settings['boostbox_privacy_disable_analytics'] ) ) { 222 $disable_analytics = false; 223 } elseif ( isset( $settings['boostbox_privacy_disable_analytics'] ) && 'on' !== $settings['boostbox_privacy_disable_analytics'] ) { 224 $disable_analytics = false; 225 } 226 227 return apply_filters( 'boostbox_settings_disable_analytics', $disable_analytics ); 228 } 229 230 /** 231 * Settings - Cookie days 232 * 233 * @param int $popup_id - the popup ID to check for overrides from 234 * 235 * @since 1.6.0 236 * @return int 237 */ 238 function boostbox_settings_cookie_days( $popup_id = null ) { 239 // Cookie days. 240 $settings = get_option( 'boostbox_general' ); 241 $cookie_days = 30; 242 243 // Check if the setting is filled out. 244 if ( isset( $settings['boostbox_cookie_days'] ) ) { 245 $cookie_days = $settings['boostbox_cookie_days']; 246 } 247 248 // Override global cookie days with popup setting. 249 if ( isset( $popup_id ) && get_post_meta( $popup_id, 'boostbox_cookie_days', true ) ) { 250 $cookie_days = get_post_meta( $popup_id, 'boostbox_cookie_days', true ); 251 } 252 253 return apply_filters( 'boostbox_settings_cookie_days', $cookie_days, $popup_id ); 254 } -
boostbox/trunk/includes/class-boostbox-activator.php
r2764817 r3035929 11 11 * @since 1.0.0 12 12 */ 13 14 // Exit if accessed directly. 15 if ( ! defined( 'ABSPATH' ) ) { 16 wp_die(); 17 } 13 18 14 19 /** -
boostbox/trunk/includes/class-boostbox-deactivator.php
r2764817 r3035929 11 11 * @since 1.0.0 12 12 */ 13 14 // Exit if accessed directly. 15 if ( ! defined( 'ABSPATH' ) ) { 16 wp_die(); 17 } 13 18 14 19 /** -
boostbox/trunk/includes/class-boostbox-i18n.php
r2764817 r3035929 14 14 * @since 1.0.0 15 15 */ 16 17 // Exit if accessed directly. 18 if ( ! defined( 'ABSPATH' ) ) { 19 wp_die(); 20 } 16 21 17 22 /** -
boostbox/trunk/includes/class-boostbox-loader.php
r2764817 r3035929 11 11 * @since 1.0.0 12 12 */ 13 14 // Exit if accessed directly. 15 if ( ! defined( 'ABSPATH' ) ) { 16 wp_die(); 17 } 13 18 14 19 /** -
boostbox/trunk/includes/class-boostbox.php
r3031244 r3035929 14 14 * @since 1.0.0 15 15 */ 16 17 // Exit if accessed directly. 18 if ( ! defined( 'ABSPATH' ) ) { 19 wp_die(); 20 } 16 21 17 22 /** … … 73 78 public function __construct() { 74 79 $this->plugin_name = 'boostbox'; 75 $this->version = '1. 5.0';80 $this->version = '1.6.0'; 76 81 77 82 if ( defined( 'BOOSTBOX_VERSION' ) ) { -
boostbox/trunk/languages/boostbox.pot
r3021397 r3035929 3 3 msgstr "" 4 4 "Project-Id-Version: BoostBox\n" 5 "POT-Creation-Date: 202 2-08-01 16:36-0400\n"6 "PO-Revision-Date: 202 2-08-01 16:36-0400\n"5 "POT-Creation-Date: 2024-02-14 17:59-0500\n" 6 "PO-Revision-Date: 2024-02-14 17:59-0500\n" 7 7 "Last-Translator: \n" 8 8 "Language-Team: \n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 13 "X-Generator: Poedit 3. 1\n"13 "X-Generator: Poedit 3.2.2\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" … … 22 22 "X-Poedit-SearchPathExcluded-0: *.min.js\n" 23 23 24 #: admin/boostbox-admin-settings.php:64 24 #: admin/boostbox-admin-settings.php:64 admin/js/boostbox-popups-block.js:67 25 #: admin/metaboxes/boostbox-display-settings.php:145 25 26 msgid "--" 26 27 msgstr "" 27 28 28 #: admin/boostbox-admin-settings.php: 7529 #: admin/boostbox-admin-settings.php:80 29 30 msgid "General Settings" 30 31 msgstr "" 31 32 32 #: admin/boostbox-admin-settings.php: 8533 #: admin/boostbox-admin-settings.php:90 33 34 msgid "Global popup" 34 35 msgstr "" 35 36 36 #: admin/boostbox-admin-settings.php: 8637 #: admin/boostbox-admin-settings.php:91 37 38 msgid "Select the popup used whenever the global option is set on posts/pages" 39 msgstr "" 40 41 #: admin/boostbox-admin-settings.php:101 42 msgid "Cookie days" 43 msgstr "" 44 45 #: admin/boostbox-admin-settings.php:102 46 msgid "Set the days a cookie is stored after the user closes a popup" 47 msgstr "" 48 49 #: admin/boostbox-admin-settings.php:113 50 msgid "Disable Tracking" 51 msgstr "" 52 53 #: admin/boostbox-admin-settings.php:114 54 msgid "Turn off the impression and conversion tracking" 38 55 msgstr "" 39 56 … … 147 164 msgstr "" 148 165 149 #: admin/boostbox-custom-post-type.php:59 166 #: admin/boostbox-custom-post-type.php:59 admin/js/boostbox-popups-block.js:6 167 #: admin/js/boostbox-popups-block.js:77 150 168 msgid "BoostBox Popups" 151 169 msgstr "" 152 170 153 171 #: admin/boostbox-custom-post-type.php:60 154 msgid "Build custom popups with the core editor" 172 msgid "Build popups with the core editor" 173 msgstr "" 174 175 #: admin/boostbox-custom-post-type.php:125 176 #: admin/metaboxes/boostbox-metrics-settings.php:75 177 msgid "Impressions" 178 msgstr "" 179 180 #: admin/boostbox-custom-post-type.php:135 181 #: admin/metaboxes/boostbox-metrics-settings.php:76 182 msgid "Conversions" 183 msgstr "" 184 185 #: admin/boostbox-custom-post-type.php:145 186 msgid "Conversion rate" 155 187 msgstr "" 156 188 … … 164 196 165 197 #: admin/class-boostbox-admin-settings.php:727 166 #: admin/metaboxes/boostbox-popup-settings.php:3 4198 #: admin/metaboxes/boostbox-popup-settings.php:39 167 199 msgid "BoostBox Settings" 168 200 msgstr "" … … 190 222 msgstr "" 191 223 192 #: admin/metaboxes/boostbox-popup-settings.php:85 224 #: admin/class-boostbox-cpt-columns.php:221 225 msgid "N/A" 226 msgstr "" 227 228 #: admin/class-boostbox-cpt-columns.php:295 229 msgid "Column label" 230 msgstr "" 231 232 #: admin/js/boostbox-popups-block.js:36 233 msgid "Selected post is the current post. Do nothing." 234 msgstr "" 235 236 #: admin/js/boostbox-popups-block.js:60 237 msgid "Error fetching post content:" 238 msgstr "" 239 240 #: admin/js/boostbox-popups-block.js:79 241 msgid "Select a BoostBox Popup" 242 msgstr "" 243 244 #: admin/js/boostbox-popups-block.js:90 245 msgid "Insert" 246 msgstr "" 247 248 #: admin/metaboxes/boostbox-display-settings.php:31 249 msgid "Display Settings" 250 msgstr "" 251 252 #: admin/metaboxes/boostbox-display-settings.php:55 253 #: admin/metaboxes/boostbox-display-settings.php:62 254 msgid "General" 255 msgstr "" 256 257 #: admin/metaboxes/boostbox-display-settings.php:56 258 #: admin/metaboxes/boostbox-display-settings.php:65 259 msgid "Animation" 260 msgstr "" 261 262 #: admin/metaboxes/boostbox-display-settings.php:57 263 #: admin/metaboxes/boostbox-display-settings.php:68 264 msgid "Trigger" 265 msgstr "" 266 267 #: admin/metaboxes/boostbox-display-settings.php:58 268 #: admin/metaboxes/boostbox-display-settings.php:71 269 msgid "Close Button" 270 msgstr "" 271 272 #: admin/metaboxes/boostbox-display-settings.php:78 273 msgid "Top Left" 274 msgstr "" 275 276 #: admin/metaboxes/boostbox-display-settings.php:79 277 msgid "Top Center" 278 msgstr "" 279 280 #: admin/metaboxes/boostbox-display-settings.php:80 281 msgid "Top Right" 282 msgstr "" 283 284 #: admin/metaboxes/boostbox-display-settings.php:81 285 msgid "Center Left" 286 msgstr "" 287 288 #: admin/metaboxes/boostbox-display-settings.php:82 289 msgid "Center Center" 290 msgstr "" 291 292 #: admin/metaboxes/boostbox-display-settings.php:83 293 msgid "Center Right" 294 msgstr "" 295 296 #: admin/metaboxes/boostbox-display-settings.php:84 297 msgid "Bottom Left" 298 msgstr "" 299 300 #: admin/metaboxes/boostbox-display-settings.php:85 301 msgid "Bottom Center" 302 msgstr "" 303 304 #: admin/metaboxes/boostbox-display-settings.php:86 305 msgid "Bottom Right" 306 msgstr "" 307 308 #: admin/metaboxes/boostbox-display-settings.php:100 309 msgid "Display location" 310 msgstr "" 311 312 #: admin/metaboxes/boostbox-display-settings.php:123 313 msgid "Max width" 314 msgstr "" 315 316 #: admin/metaboxes/boostbox-display-settings.php:134 317 msgid "Cookie days (overrides global setting)" 318 msgstr "" 319 320 #: admin/metaboxes/boostbox-display-settings.php:146 321 msgid "Fade in" 322 msgstr "" 323 324 #: admin/metaboxes/boostbox-display-settings.php:147 325 msgid "Slide up" 326 msgstr "" 327 328 #: admin/metaboxes/boostbox-display-settings.php:148 329 msgid "Slide down" 330 msgstr "" 331 332 #: admin/metaboxes/boostbox-display-settings.php:149 333 msgid "Slide left" 334 msgstr "" 335 336 #: admin/metaboxes/boostbox-display-settings.php:150 337 msgid "Slide right" 338 msgstr "" 339 340 #: admin/metaboxes/boostbox-display-settings.php:151 341 msgid "Pop swirl" 342 msgstr "" 343 344 #: admin/metaboxes/boostbox-display-settings.php:152 345 msgid "Anvil" 346 msgstr "" 347 348 #: admin/metaboxes/boostbox-display-settings.php:162 349 msgid "Animation type" 350 msgstr "" 351 352 #: admin/metaboxes/boostbox-display-settings.php:185 353 msgid "Animation speed (milliseconds)" 354 msgstr "" 355 356 #: admin/metaboxes/boostbox-display-settings.php:196 357 msgid "Auto open" 358 msgstr "" 359 360 #: admin/metaboxes/boostbox-display-settings.php:197 361 msgid "On Scroll" 362 msgstr "" 363 364 #: admin/metaboxes/boostbox-display-settings.php:198 365 msgid "Time" 366 msgstr "" 367 368 #: admin/metaboxes/boostbox-display-settings.php:208 369 msgid "Trigger type" 370 msgstr "" 371 372 #: admin/metaboxes/boostbox-display-settings.php:231 373 msgid "Display speed (milliseconds)" 374 msgstr "" 375 376 #: admin/metaboxes/boostbox-display-settings.php:242 377 msgid "Scroll distance" 378 msgstr "" 379 380 #: admin/metaboxes/boostbox-display-settings.php:252 381 msgid "Outside" 382 msgstr "" 383 384 #: admin/metaboxes/boostbox-display-settings.php:253 385 msgid "Inside" 386 msgstr "" 387 388 #: admin/metaboxes/boostbox-display-settings.php:254 389 msgid "Hidden" 390 msgstr "" 391 392 #: admin/metaboxes/boostbox-display-settings.php:264 393 msgid "Close icon placement" 394 msgstr "" 395 396 #: admin/metaboxes/boostbox-display-settings.php:291 397 msgid "Close icon color" 398 msgstr "" 399 400 #: admin/metaboxes/boostbox-metrics-settings.php:36 401 msgid "Metrics" 402 msgstr "" 403 404 #: admin/metaboxes/boostbox-metrics-settings.php:77 405 msgid "Conversion Rate" 406 msgstr "" 407 408 #: admin/metaboxes/boostbox-metrics-settings.php:80 409 msgid "Reset Metrics" 410 msgstr "" 411 412 #: admin/metaboxes/boostbox-popup-settings.php:90 193 413 msgid "Select popup to display" 194 414 msgstr "" 195 415 196 #: admin/metaboxes/boostbox-popup-settings.php: 87416 #: admin/metaboxes/boostbox-popup-settings.php:92 197 417 msgid "Disable Popup" 198 418 msgstr "" 199 419 200 #: admin/metaboxes/boostbox-popup-settings.php: 88420 #: admin/metaboxes/boostbox-popup-settings.php:93 201 421 msgid "Global Popup" 422 msgstr "" 423 424 #: public/boostbox-popups.php:72 425 msgid " " 426 msgstr "" 427 428 #: public/boostbox-popups.php:102 429 msgid "inside" 202 430 msgstr "" 203 431 … … 208 436 #. Description of the plugin/theme 209 437 msgid "" 210 "Build popups for lead generation, content promotion and more using the "211 " coreeditor."438 "Build popups for lead generation, content promotion and more using the core " 439 "editor." 212 440 msgstr "" 213 441 -
boostbox/trunk/public/class-boostbox-public.php
r3025445 r3035929 11 11 * @since 1.0.0 12 12 */ 13 14 // Exit if accessed directly. 15 if ( ! defined( 'ABSPATH' ) ) { 16 wp_die(); 17 } 13 18 14 19 /** … … 81 86 // Popup ID. 82 87 $popup_id = get_post_meta( get_the_ID(), 'boostbox_popup_selected', true ); 83 // Cookie days.84 $settings = get_option( 'boostbox_general' );85 $cookie_days = 30;86 if ( isset( $settings['boostbox_cookie_days'] ) ) {87 $cookie_days = $settings['boostbox_cookie_days'];88 }89 // Override global cookie days with popup setting.90 if ( get_post_meta( $popup_id, 'boostbox_cookie_days', true ) ) {91 $cookie_days = get_post_meta( $popup_id, 'boostbox_cookie_days', true );92 }93 88 // Milliseconds. 94 89 $milliseconds = get_post_meta( $popup_id, 'boostbox_display_speed', true ); … … 97 92 } 98 93 // Scroll distance. 94 $scroll_distance = '32px'; 99 95 if ( get_post_meta( $popup_id, 'boostbox_scroll_distance', true ) ) { 100 96 $scroll_distance = get_post_meta( $popup_id, 'boostbox_scroll_distance', true ); 101 } else {102 $scroll_distance = '32px';103 97 } 104 98 // Create localize script args. … … 106 100 'popup_id' => $popup_id, 107 101 'milliseconds' => $milliseconds, 108 'cookie_days' => $cookie_days,102 'cookie_days' => boostbox_settings_cookie_days( $popup_id ), 109 103 'scroll_distance' => $scroll_distance, 110 104 'trigger' => get_post_meta( $popup_id, 'boostbox_trigger_type', true ), 111 105 'close_icon_placement' => get_post_meta( $popup_id, 'boostbox_close_icon_placement', true ), 112 106 'ajax_url' => admin_url( 'admin-ajax.php' ), 113 'nonce' => wp_create_nonce( 'boostbox_nonce' ), 107 'nonce' => wp_create_nonce( 'boostbox_nonce' ), 108 'disable_analytics' => boostbox_settings_disable_analytics() 114 109 ); 115 110 // Filter the args. -
boostbox/trunk/public/js/boostbox-public.js
r3025445 r3035929 6 6 // Milliseconds. 7 7 var milliseconds = boostbox_settings.milliseconds; 8 // Disable analytics? 9 var disableAnalytics = boostbox_settings.disable_analytics; 8 10 // Window inner height. 9 11 var innerHeight = window.innerHeight; … … 112 114 // Increment popup view count. 113 115 function incrementPopupViewCount() { 114 // AJAX request to increment view count. 115 $.ajax({ 116 url: boostbox_settings.ajax_url, 117 type: 'POST', 118 data: { 119 action: 'increment_popup_view_count', 120 popup_id: popupID, 121 nonce: boostbox_settings.nonce, 122 }, 123 success: function (response) { 124 // Turned off console log message (for now) @TODO - set up a "debug" option that turns this back on. 125 //console.log('[SUCCESS] Impression tracking complete!'); 126 //console.log(response); 127 }, 128 error: function (error) { 129 // Turned off console log message (for now) @TODO - set up a "debug" option that turns this back on. 130 //console.log('[ERROR] Impression tracking failed!'); 131 //console.log(error); 132 } 133 }); 116 // Only do this if analytics is not disabled. 117 if (!disableAnalytics) { 118 // AJAX request to increment view count. 119 $.ajax({ 120 url: boostbox_settings.ajax_url, 121 type: 'POST', 122 data: { 123 action: 'increment_popup_view_count', 124 popup_id: popupID, 125 nonce: boostbox_settings.nonce, 126 }, 127 success: function (response) { 128 // Turned off console log message (for now) @TODO - set up a "debug" option that turns this back on. 129 //console.log('[SUCCESS] Impression tracking complete!'); 130 //console.log(response); 131 }, 132 error: function (error) { 133 // Turned off console log message (for now) @TODO - set up a "debug" option that turns this back on. 134 //console.log('[ERROR] Impression tracking failed!'); 135 //console.log(error); 136 } 137 }); 138 } 134 139 } 135 140 136 141 // Increment popup conversion count. 137 142 function trackConversion() { 138 // AJAX request to track conversion. 139 $.ajax({ 140 url: boostbox_settings.ajax_url, 141 type: 'POST', 142 data: { 143 action: 'track_popup_conversion', 144 popup_id: popupID, 145 nonce: boostbox_settings.nonce, 146 }, 147 success: function (response) { 148 // Turned off console log message (for now) @TODO - set up a "debug" option that turns this back on. 149 //console.log('[SUCCESS] Conversion tracking complete!'); 150 //console.log(response); 151 }, 152 error: function (error) { 153 // Turned off console log message (for now) @TODO - set up a "debug" option that turns this back on. 154 //console.log('[ERROR] Conversion tracking failed!'); 155 //console.log(error); 156 } 157 }); 143 // Only do this if analytics is not disabled. 144 if (!disableAnalytics) { 145 // AJAX request to track conversion. 146 $.ajax({ 147 url: boostbox_settings.ajax_url, 148 type: 'POST', 149 data: { 150 action: 'track_popup_conversion', 151 popup_id: popupID, 152 nonce: boostbox_settings.nonce, 153 }, 154 success: function (response) { 155 // Turned off console log message (for now) @TODO - set up a "debug" option that turns this back on. 156 //console.log('[SUCCESS] Conversion tracking complete!'); 157 //console.log(response); 158 }, 159 error: function (error) { 160 // Turned off console log message (for now) @TODO - set up a "debug" option that turns this back on. 161 //console.log('[ERROR] Conversion tracking failed!'); 162 //console.log(error); 163 } 164 }); 165 } 158 166 } 159 167 });
Note: See TracChangeset
for help on using the changeset viewer.