| @@ -110,18 +110,20 @@ | ||
| 110 | 110 | |
| 111 | 111 | wp_enqueue_script( 'jquery' ); |
| 112 | 112 | wp_enqueue_style( 'fontawesome', $protocol . '://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css', array(), FCA_EOI_VER ); |
| 113 | 113 | |
| 114 | - wp_enqueue_script( 'fca_eoi_tooltipster', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/tooltipster.bundle.min.js', array(), FCA_EOI_VER, true ); | |
| 114 | + wp_enqueue_script( 'fca_eoi_tooltipster_js', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/tooltipster.bundle.min.js', array(), FCA_EOI_VER, true ); | |
| 115 | 115 | wp_enqueue_style( 'fca_eoi_tooltipster_css', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/tooltipster.bundle.min.css', array(), FCA_EOI_VER ); |
| 116 | 116 | wp_enqueue_style( 'fca_eoi_tooltipster_theme_css', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/tooltipster-borderless.min.css', array(), FCA_EOI_VER ); |
| 117 | 117 | |
| 118 | 118 | wp_enqueue_script( 'fca_eoi_featherlight_js', FCA_EOI_PLUGIN_URL . '/assets/vendor/featherlight/release/featherlight.min.js', array(), FCA_EOI_VER, true ); |
| 119 | 119 | wp_enqueue_style( 'fca_eoi_featherlight_css', FCA_EOI_PLUGIN_URL . '/assets/vendor/featherlight/release/featherlight.min.css', array(), FCA_EOI_VER ); |
| 120 | + | |
| 121 | + wp_enqueue_script( 'fca_eoi_jstz', FCA_EOI_PLUGIN_URL . '/assets/vendor/jstz/jstz.min.js', array(), FCA_EOI_VER, true ); | |
| 122 | + | |
| 123 | + wp_enqueue_style( 'fca_eoi', FCA_EOI_PLUGIN_URL . '/assets/style-new.min.css', array(), FCA_EOI_VER ); | |
| 124 | + wp_enqueue_script( 'fca_eoi_script_js', FCA_EOI_PLUGIN_URL . '/assets/script.min.js', array( 'fca_eoi_jstz', 'jquery', 'fca_eoi_tooltipster_js', 'fca_eoi_featherlight_js'), FCA_EOI_VER, true ); | |
| 120 | 125 | |
| 121 | - wp_enqueue_style( 'fca_eoi', FCA_EOI_PLUGIN_URL . '/assets/style-new.css', array(), FCA_EOI_VER ); | |
| 122 | - wp_enqueue_script( 'fca_eoi_script_js', FCA_EOI_PLUGIN_URL . '/assets/script.js', array(), FCA_EOI_VER, true ); | |
| 123 | - | |
| 124 | 126 | //PASS VARIABLES TO JAVASCRIPT |
| 125 | 127 | $data = array ( |
| 126 | 128 | 'ajax_url' => admin_url( 'admin-ajax.php' ), |
| 127 | 129 | 'nonce' => wp_create_nonce( 'fca_eoi_submit_form' ), |
| @@ -126,9 +128,9 @@ | ||
| 126 | 128 | 'ajax_url' => admin_url( 'admin-ajax.php' ), |
| 127 | 129 | 'nonce' => wp_create_nonce( 'fca_eoi_submit_form' ), |
| 128 | 130 | ); |
| 129 | 131 | |
| 130 | - wp_localize_script( 'fca_eoi_script_js', 'fca_eoi', $data ); | |
| 132 | + wp_localize_script( 'fca_eoi_script_js', 'fcaEoiScriptData', $data ); | |
| 131 | 133 | } |
| 132 | 134 | |
| 133 | 135 | public function shortcode_content( $atts ) { |
| 134 | 136 | if ( empty ( $atts['id'] ) ) { |
| @@ -142,11 +144,12 @@ | ||
| 142 | 144 | return 'Optin Cat: Missing Form Data. Is it in the trash?'; |
| 143 | 145 | } |
| 144 | 146 | |
| 145 | 147 | $animation = get_post_meta( $form_id, 'fca_eoi_animation', true); |
| 146 | - if (!empty ($animation) ) { | |
| 147 | - wp_enqueue_style( 'fca_eoi_powerups_animate', FCA_EOI_PLUGIN_URL . '/assets/vendor/animate/animate.css', array(), FCA_EOI_VER ); | |
| 148 | + if (!empty( $animation ) ) { | |
| 149 | + wp_enqueue_style( 'fca_eoi_powerups_animate', FCA_EOI_PLUGIN_URL . '/assets/vendor/animate/animate.min.css', array(), FCA_EOI_VER ); | |
| 148 | 150 | } |
| 151 | + | |
| 149 | 152 | $this->enqueue_assets(); |
| 150 | 153 | $head = get_post_meta( $form_id, 'fca_eoi_head', true ); |
| 151 | 154 | |
| 152 | 155 | $layout_id = get_post_meta ( $form_id, 'fca_eoi_layout', true ); |
| @@ -151,10 +154,17 @@ | ||
| 151 | 154 | |
| 152 | 155 | $layout_id = get_post_meta ( $form_id, 'fca_eoi_layout', true ); |
| 153 | 156 | $layout = new EasyOptInsLayout( $layout_id ); |
| 154 | 157 | |
| 155 | - if ( $layout->layout_type != 'lightbox' ) { | |
| 156 | - $head .= '<script>' . EasyOptInsActivity::get_instance()->get_tracking_code( $form_id ) . '</script>'; | |
| 158 | + if ( $layout->layout_type !== 'lightbox' && $layout->layout_type !== 'banner' && $layout->layout_type !== 'overlay' ) { | |
| 159 | + | |
| 160 | + require_once FCA_EOI_PLUGIN_DIR . 'includes/classes/RobotDetector/RobotDetector.php'; | |
| 161 | + $robot_detector = new RobotDetector(); | |
| 162 | + | |
| 163 | + if ( get_post( $form_id ) && !is_user_logged_in() && !$robot_detector->is_robot() ) { | |
| 164 | + EasyOptInsActivity::get_instance()->add_impression( $form_id ); | |
| 165 | + } | |
| 166 | + | |
| 157 | 167 | } |
| 158 | 168 | |
| 159 | 169 | return $head; |
| 160 | 170 | } |