Plugin Directory

Changeset 3035929


Ignore:
Timestamp:
02/15/2024 12:29:36 AM (2 years ago)
Author:
deviodigital
Message:

Releasing BoostBox v1.6.0

Location:
boostbox/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • boostbox/trunk/README.txt

    r3031244 r3035929  
    55Requires at least: 3.0.1
    66Tested up to: 6.4.3
    7 Stable tag: 1.5.0
     7Stable tag: 1.6.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== 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
    5165
    5266= 1.5.0 =
  • boostbox/trunk/admin/boostbox-admin-settings.php

    r3031244 r3035929  
    104104            )
    105105        );
     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        );
    106117    }
    107118    add_action( 'init', 'boostbox_initialize_admin_settings', 100 );
  • boostbox/trunk/admin/boostbox-custom-post-type.php

    r3031244 r3035929  
    114114 */
    115115function boostbox_add_metrics_columns_to_admin_screen() {
     116    // Bail early if analytics is disabled.
     117    if ( boostbox_settings_disable_analytics() ) { return; }
     118
    116119    // Create an instance.
    117120    $boostbox_columns = new BoostBox_CPT_Columns( 'boostbox_popups' );
  • boostbox/trunk/admin/class-boostbox-admin.php

    r3031244 r3035929  
    1010 * @link       https://deviodigital.com
    1111 * @since      1.0.0
    12   */
     12 */
     13
     14// Exit if accessed directly.
     15if ( ! defined( 'ABSPATH' ) ) {
     16    wp_die();
     17}
    1318
    1419/**
  • boostbox/trunk/admin/metaboxes/boostbox-display-settings.php

    r3027699 r3035929  
    1212 * @since      1.1.0
    1313 */
     14
     15// Exit if accessed directly.
     16if ( ! defined( 'ABSPATH' ) ) {
     17    wp_die();
     18}
    1419
    1520/**
     
    138143            echo wp_kses( $field, boostbox_allowed_tags() );
    139144
    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() );
    143148
    144149            $animations = array(
     
    189194            echo wp_kses( $field, boostbox_allowed_tags() );
    190195
    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() );
    194199
    195200            $triggers = array(
     
    246251            echo wp_kses( $field, boostbox_allowed_tags() );
    247252
    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() );
    251256            $placements = array(
    252257                'outside' => esc_attr__( 'Outside', 'boostbox' ),
     
    294299
    295300            echo wp_kses( $field, boostbox_allowed_tags() );
    296         echo '</div>
     301        echo wp_kses( '</div>
    297302    </div>
    298303
    299 </div>';
     304</div>', boostbox_allowed_tags() );
    300305}
    301306
  • boostbox/trunk/admin/metaboxes/boostbox-metrics-settings.php

    r3027699 r3035929  
    1313 */
    1414
     15// Exit if accessed directly.
     16if ( ! defined( 'ABSPATH' ) ) {
     17    wp_die();
     18}
     19
    1520/**
    1621 * Metrics metabox
     
    2631 */
    2732function boostbox_metrics_metabox() {
     33    // Bail early if analytics is disabled.
     34    if ( boostbox_settings_disable_analytics() ) {
     35        return;
     36    }
     37   
    2838    // Add Metabox.
    2939    add_meta_box(
     
    4555 */
    4656function boostbox_metrics_metabox_content() {
     57    // Bail early if analytics is disabled.
     58    if ( boostbox_settings_disable_analytics() ) {
     59        return;
     60    }
     61
    4762    global $post;
    4863
  • boostbox/trunk/admin/metaboxes/boostbox-popup-settings.php

    r3027699 r3035929  
    1212 * @since      1.0.0
    1313 */
     14
     15// Exit if accessed directly.
     16if ( ! defined( 'ABSPATH' ) ) {
     17    wp_die();
     18}
    1419
    1520/**
  • boostbox/trunk/boostbox.php

    r3031244 r3035929  
    1414 * Plugin URI:        https://deviodigital.com/boostbox-lead-generation-plugin
    1515 * Description:       Build popups for lead generation, content promotion and more using the core editor.
    16  * Version:           1.5.0
     16 * Version:           1.6.0
    1717 * Author:            Devio Digital
    1818 * Author URI:        https://deviodigital.com
     
    2929
    3030// Current plugin version.
    31 define( 'BOOSTBOX_VERSION', '1.5.0' );
     31define( 'BOOSTBOX_VERSION', '1.6.0' );
    3232
    3333// Plugin basename.
  • boostbox/trunk/includes/boostbox-helper-functions.php

    r3031244 r3035929  
    3939    // form fields - input
    4040    $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(),
    4647    );
    4748    // select
     
    206207    return apply_filters( 'boostbox_popup_conversion_rate_formatted_percentage', $formatted_percentage, $conversion_percentage );
    207208}
     209
     210/**
     211 * Settings - Disable analytics
     212 *
     213 * @since  1.6.0
     214 * @return bool
     215 */
     216function 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 */
     238function 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  
    1111 * @since      1.0.0
    1212 */
     13
     14// Exit if accessed directly.
     15if ( ! defined( 'ABSPATH' ) ) {
     16    wp_die();
     17}
    1318
    1419/**
  • boostbox/trunk/includes/class-boostbox-deactivator.php

    r2764817 r3035929  
    1111 * @since      1.0.0
    1212 */
     13
     14// Exit if accessed directly.
     15if ( ! defined( 'ABSPATH' ) ) {
     16    wp_die();
     17}
    1318
    1419/**
  • boostbox/trunk/includes/class-boostbox-i18n.php

    r2764817 r3035929  
    1414 * @since      1.0.0
    1515 */
     16
     17// Exit if accessed directly.
     18if ( ! defined( 'ABSPATH' ) ) {
     19    wp_die();
     20}
    1621
    1722/**
  • boostbox/trunk/includes/class-boostbox-loader.php

    r2764817 r3035929  
    1111 * @since      1.0.0
    1212 */
     13
     14// Exit if accessed directly.
     15if ( ! defined( 'ABSPATH' ) ) {
     16    wp_die();
     17}
    1318
    1419/**
  • boostbox/trunk/includes/class-boostbox.php

    r3031244 r3035929  
    1414 * @since      1.0.0
    1515 */
     16
     17// Exit if accessed directly.
     18if ( ! defined( 'ABSPATH' ) ) {
     19    wp_die();
     20}
    1621
    1722/**
     
    7378    public function __construct() {
    7479        $this->plugin_name = 'boostbox';
    75         $this->version     = '1.5.0';
     80        $this->version     = '1.6.0';
    7681
    7782        if ( defined( 'BOOSTBOX_VERSION' ) ) {
  • boostbox/trunk/languages/boostbox.pot

    r3021397 r3035929  
    33msgstr ""
    44"Project-Id-Version: BoostBox\n"
    5 "POT-Creation-Date: 2022-08-01 16:36-0400\n"
    6 "PO-Revision-Date: 2022-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"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    1111"Content-Transfer-Encoding: 8bit\n"
    1212"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
    13 "X-Generator: Poedit 3.1\n"
     13"X-Generator: Poedit 3.2.2\n"
    1414"X-Poedit-Basepath: ..\n"
    1515"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
     
    2222"X-Poedit-SearchPathExcluded-0: *.min.js\n"
    2323
    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
    2526msgid "--"
    2627msgstr ""
    2728
    28 #: admin/boostbox-admin-settings.php:75
     29#: admin/boostbox-admin-settings.php:80
    2930msgid "General Settings"
    3031msgstr ""
    3132
    32 #: admin/boostbox-admin-settings.php:85
     33#: admin/boostbox-admin-settings.php:90
    3334msgid "Global popup"
    3435msgstr ""
    3536
    36 #: admin/boostbox-admin-settings.php:86
     37#: admin/boostbox-admin-settings.php:91
    3738msgid "Select the popup used whenever the global option is set on posts/pages"
     39msgstr ""
     40
     41#: admin/boostbox-admin-settings.php:101
     42msgid "Cookie days"
     43msgstr ""
     44
     45#: admin/boostbox-admin-settings.php:102
     46msgid "Set the days a cookie is stored after the user closes a popup"
     47msgstr ""
     48
     49#: admin/boostbox-admin-settings.php:113
     50msgid "Disable Tracking"
     51msgstr ""
     52
     53#: admin/boostbox-admin-settings.php:114
     54msgid "Turn off the impression and conversion tracking"
    3855msgstr ""
    3956
     
    147164msgstr ""
    148165
    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
    150168msgid "BoostBox Popups"
    151169msgstr ""
    152170
    153171#: admin/boostbox-custom-post-type.php:60
    154 msgid "Build custom popups with the core editor"
     172msgid "Build popups with the core editor"
     173msgstr ""
     174
     175#: admin/boostbox-custom-post-type.php:125
     176#: admin/metaboxes/boostbox-metrics-settings.php:75
     177msgid "Impressions"
     178msgstr ""
     179
     180#: admin/boostbox-custom-post-type.php:135
     181#: admin/metaboxes/boostbox-metrics-settings.php:76
     182msgid "Conversions"
     183msgstr ""
     184
     185#: admin/boostbox-custom-post-type.php:145
     186msgid "Conversion rate"
    155187msgstr ""
    156188
     
    164196
    165197#: admin/class-boostbox-admin-settings.php:727
    166 #: admin/metaboxes/boostbox-popup-settings.php:34
     198#: admin/metaboxes/boostbox-popup-settings.php:39
    167199msgid "BoostBox Settings"
    168200msgstr ""
     
    190222msgstr ""
    191223
    192 #: admin/metaboxes/boostbox-popup-settings.php:85
     224#: admin/class-boostbox-cpt-columns.php:221
     225msgid "N/A"
     226msgstr ""
     227
     228#: admin/class-boostbox-cpt-columns.php:295
     229msgid "Column label"
     230msgstr ""
     231
     232#: admin/js/boostbox-popups-block.js:36
     233msgid "Selected post is the current post. Do nothing."
     234msgstr ""
     235
     236#: admin/js/boostbox-popups-block.js:60
     237msgid "Error fetching post content:"
     238msgstr ""
     239
     240#: admin/js/boostbox-popups-block.js:79
     241msgid "Select a BoostBox Popup"
     242msgstr ""
     243
     244#: admin/js/boostbox-popups-block.js:90
     245msgid "Insert"
     246msgstr ""
     247
     248#: admin/metaboxes/boostbox-display-settings.php:31
     249msgid "Display Settings"
     250msgstr ""
     251
     252#: admin/metaboxes/boostbox-display-settings.php:55
     253#: admin/metaboxes/boostbox-display-settings.php:62
     254msgid "General"
     255msgstr ""
     256
     257#: admin/metaboxes/boostbox-display-settings.php:56
     258#: admin/metaboxes/boostbox-display-settings.php:65
     259msgid "Animation"
     260msgstr ""
     261
     262#: admin/metaboxes/boostbox-display-settings.php:57
     263#: admin/metaboxes/boostbox-display-settings.php:68
     264msgid "Trigger"
     265msgstr ""
     266
     267#: admin/metaboxes/boostbox-display-settings.php:58
     268#: admin/metaboxes/boostbox-display-settings.php:71
     269msgid "Close Button"
     270msgstr ""
     271
     272#: admin/metaboxes/boostbox-display-settings.php:78
     273msgid "Top Left"
     274msgstr ""
     275
     276#: admin/metaboxes/boostbox-display-settings.php:79
     277msgid "Top Center"
     278msgstr ""
     279
     280#: admin/metaboxes/boostbox-display-settings.php:80
     281msgid "Top Right"
     282msgstr ""
     283
     284#: admin/metaboxes/boostbox-display-settings.php:81
     285msgid "Center Left"
     286msgstr ""
     287
     288#: admin/metaboxes/boostbox-display-settings.php:82
     289msgid "Center Center"
     290msgstr ""
     291
     292#: admin/metaboxes/boostbox-display-settings.php:83
     293msgid "Center Right"
     294msgstr ""
     295
     296#: admin/metaboxes/boostbox-display-settings.php:84
     297msgid "Bottom Left"
     298msgstr ""
     299
     300#: admin/metaboxes/boostbox-display-settings.php:85
     301msgid "Bottom Center"
     302msgstr ""
     303
     304#: admin/metaboxes/boostbox-display-settings.php:86
     305msgid "Bottom Right"
     306msgstr ""
     307
     308#: admin/metaboxes/boostbox-display-settings.php:100
     309msgid "Display location"
     310msgstr ""
     311
     312#: admin/metaboxes/boostbox-display-settings.php:123
     313msgid "Max width"
     314msgstr ""
     315
     316#: admin/metaboxes/boostbox-display-settings.php:134
     317msgid "Cookie days (overrides global setting)"
     318msgstr ""
     319
     320#: admin/metaboxes/boostbox-display-settings.php:146
     321msgid "Fade in"
     322msgstr ""
     323
     324#: admin/metaboxes/boostbox-display-settings.php:147
     325msgid "Slide up"
     326msgstr ""
     327
     328#: admin/metaboxes/boostbox-display-settings.php:148
     329msgid "Slide down"
     330msgstr ""
     331
     332#: admin/metaboxes/boostbox-display-settings.php:149
     333msgid "Slide left"
     334msgstr ""
     335
     336#: admin/metaboxes/boostbox-display-settings.php:150
     337msgid "Slide right"
     338msgstr ""
     339
     340#: admin/metaboxes/boostbox-display-settings.php:151
     341msgid "Pop swirl"
     342msgstr ""
     343
     344#: admin/metaboxes/boostbox-display-settings.php:152
     345msgid "Anvil"
     346msgstr ""
     347
     348#: admin/metaboxes/boostbox-display-settings.php:162
     349msgid "Animation type"
     350msgstr ""
     351
     352#: admin/metaboxes/boostbox-display-settings.php:185
     353msgid "Animation speed (milliseconds)"
     354msgstr ""
     355
     356#: admin/metaboxes/boostbox-display-settings.php:196
     357msgid "Auto open"
     358msgstr ""
     359
     360#: admin/metaboxes/boostbox-display-settings.php:197
     361msgid "On Scroll"
     362msgstr ""
     363
     364#: admin/metaboxes/boostbox-display-settings.php:198
     365msgid "Time"
     366msgstr ""
     367
     368#: admin/metaboxes/boostbox-display-settings.php:208
     369msgid "Trigger type"
     370msgstr ""
     371
     372#: admin/metaboxes/boostbox-display-settings.php:231
     373msgid "Display speed (milliseconds)"
     374msgstr ""
     375
     376#: admin/metaboxes/boostbox-display-settings.php:242
     377msgid "Scroll distance"
     378msgstr ""
     379
     380#: admin/metaboxes/boostbox-display-settings.php:252
     381msgid "Outside"
     382msgstr ""
     383
     384#: admin/metaboxes/boostbox-display-settings.php:253
     385msgid "Inside"
     386msgstr ""
     387
     388#: admin/metaboxes/boostbox-display-settings.php:254
     389msgid "Hidden"
     390msgstr ""
     391
     392#: admin/metaboxes/boostbox-display-settings.php:264
     393msgid "Close icon placement"
     394msgstr ""
     395
     396#: admin/metaboxes/boostbox-display-settings.php:291
     397msgid "Close icon color"
     398msgstr ""
     399
     400#: admin/metaboxes/boostbox-metrics-settings.php:36
     401msgid "Metrics"
     402msgstr ""
     403
     404#: admin/metaboxes/boostbox-metrics-settings.php:77
     405msgid "Conversion Rate"
     406msgstr ""
     407
     408#: admin/metaboxes/boostbox-metrics-settings.php:80
     409msgid "Reset Metrics"
     410msgstr ""
     411
     412#: admin/metaboxes/boostbox-popup-settings.php:90
    193413msgid "Select popup to display"
    194414msgstr ""
    195415
    196 #: admin/metaboxes/boostbox-popup-settings.php:87
     416#: admin/metaboxes/boostbox-popup-settings.php:92
    197417msgid "Disable Popup"
    198418msgstr ""
    199419
    200 #: admin/metaboxes/boostbox-popup-settings.php:88
     420#: admin/metaboxes/boostbox-popup-settings.php:93
    201421msgid "Global Popup"
     422msgstr ""
     423
     424#: public/boostbox-popups.php:72
     425msgid " "
     426msgstr ""
     427
     428#: public/boostbox-popups.php:102
     429msgid "inside"
    202430msgstr ""
    203431
     
    208436#. Description of the plugin/theme
    209437msgid ""
    210 "Build popups for lead generation, content promotion and more using the "
    211 "core editor."
     438"Build popups for lead generation, content promotion and more using the core "
     439"editor."
    212440msgstr ""
    213441
  • boostbox/trunk/public/class-boostbox-public.php

    r3025445 r3035929  
    1111 * @since      1.0.0
    1212 */
     13
     14// Exit if accessed directly.
     15if ( ! defined( 'ABSPATH' ) ) {
     16    wp_die();
     17}
    1318
    1419/**
     
    8186        // Popup ID.
    8287        $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         }
    9388        // Milliseconds.
    9489        $milliseconds = get_post_meta( $popup_id, 'boostbox_display_speed', true );
     
    9792        }
    9893        // Scroll distance.
     94        $scroll_distance = '32px';
    9995        if ( get_post_meta( $popup_id, 'boostbox_scroll_distance', true ) ) {
    10096            $scroll_distance = get_post_meta( $popup_id, 'boostbox_scroll_distance', true );
    101         } else {
    102             $scroll_distance = '32px';
    10397        }
    10498        // Create localize script args.
     
    106100            'popup_id'             => $popup_id,
    107101            'milliseconds'         => $milliseconds,
    108             'cookie_days'          => $cookie_days,
     102            'cookie_days'          => boostbox_settings_cookie_days( $popup_id ),
    109103            'scroll_distance'      => $scroll_distance,
    110104            'trigger'              => get_post_meta( $popup_id, 'boostbox_trigger_type', true ),
    111105            'close_icon_placement' => get_post_meta( $popup_id, 'boostbox_close_icon_placement', true ),
    112106            '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()   
    114109        );
    115110        // Filter the args.
  • boostbox/trunk/public/js/boostbox-public.js

    r3025445 r3035929  
    66    // Milliseconds.
    77    var milliseconds = boostbox_settings.milliseconds;
     8    // Disable analytics?
     9    var disableAnalytics = boostbox_settings.disable_analytics;
    810    // Window inner height.
    911    var innerHeight = window.innerHeight;
     
    112114    // Increment popup view count.
    113115    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        }
    134139    }
    135140
    136141    // Increment popup conversion count.
    137142    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        }
    158166    }
    159167});
Note: See TracChangeset for help on using the changeset viewer.