PluginProbe
GetResponse Forms by Optin Cat / 2.0.2
GetResponse Forms by Optin Cat v2.0.2
1.3.4 1.3.5 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 2.0.0 All 36 releases
← All changes | includes/eoi-shortcode.php +35 -26 1.6.32.0.2 View file →
@@ -44,9 +44,9 @@
44 44 public function button() {
45 45 global $post;
46 46 if (current_user_can( 'delete_pages' ) && $post->post_type != 'easy-opt-ins'){
47 47
48 - $button_title = __( 'Optin Cat' );
48 + $button_title = __( 'Add Optin Form' );
49 49
50 50 if ( version_compare( $GLOBALS['wp_version'], '3.5', '<' ) ) {
51 51 echo '<a href="#TB_inline?width=640&inlineId=fca-eoi-shortcode-thickbox" class="thickbox" title="' . $button_title . '">' . $button_title . '</a>';
52 52 } else {
@@ -108,20 +108,22 @@
108 108 public function enqueue_assets() {
109 109 $protocol = is_ssl() ? 'https' : 'http';
110 110
111 111 wp_enqueue_script( 'jquery' );
112 - wp_enqueue_style( 'fontawesome', $protocol . '://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css' );
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' );
115 - wp_enqueue_style( 'fca_eoi_tooltipster_css', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/tooltipster.bundle.min.css' );
116 - wp_enqueue_style( 'fca_eoi_tooltipster_theme_css', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/tooltipster-borderless.min.css' );
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 + wp_enqueue_style( 'fca_eoi_tooltipster_css', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/tooltipster.bundle.min.css', array(), FCA_EOI_VER );
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 - wp_enqueue_script( 'fca_eoi_featherlight_js', FCA_EOI_PLUGIN_URL . '/assets/vendor/featherlight/release/featherlight.min.js' );
119 - wp_enqueue_style( 'fca_eoi_featherlight_css', FCA_EOI_PLUGIN_URL . '/assets/vendor/featherlight/release/featherlight.min.css' );
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 + 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' );
122 - wp_enqueue_script( 'fca_eoi_script_js', FCA_EOI_PLUGIN_URL . '/assets/script.js' );
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,36 +128,43 @@
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 -
135 - $form_id = $atts['id'];
136 -
137 - /**
138 - * Check that we have a valid post ID
139 - */
140 - if( empty ( $form_id ) ) {
141 - return 'Missing form ID';
136 + if ( empty ( $atts['id'] ) ) {
137 + return 'Optin Cat: Invalid Form ID';
138 + } else {
139 + $form_id = $atts['id'];
140 + $post = get_post( $form_id );
142 141 }
143 - if( ! $post = get_post( $form_id ) ) {
144 - return 'Wrong form ID';
142 +
143 + if( !is_object( $post ) OR $post->post_status == 'trash' ) {
144 + return 'Optin Cat: Missing Form Data. Is it in the trash?';
145 145 }
146 +
146 147 $animation = get_post_meta( $form_id, 'fca_eoi_animation', true);
147 - if (!empty ($animation) ) {
148 - wp_enqueue_style( 'fca_eoi_powerups_animate', FCA_EOI_PLUGIN_URL . '/assets/vendor/animate/animate.css' );
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 );
149 150 }
151 +
150 152 $this->enqueue_assets();
151 153 $head = get_post_meta( $form_id, 'fca_eoi_head', true );
152 154
153 155 $layout_id = get_post_meta ( $form_id, 'fca_eoi_layout', true );
154 - $layout = new EasyOptInsLayout( $layout_id );
156 + $layout = new EasyOptInsLayout( $layout_id );
155 157
156 - if ( $layout->layout_type != 'lightbox' ) {
157 - $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 +
158 167 }
159 168
160 169 return $head;
161 170 }