PluginProbe
GetResponse Forms by Optin Cat / 2.4.1
GetResponse Forms by Optin Cat v2.4.1
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 +42 -27 1.6.22.4.1 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,54 +108,69 @@
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( 'fca-eoi-font-awesome', $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( 'tooltipster', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/jquery.tooltipster.min.js' );
115 - wp_enqueue_style( 'tooltipster', FCA_EOI_PLUGIN_URL . '/assets/vendor/tooltipster/tooltipster.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 );
116 117
117 - wp_enqueue_script( 'fca_eoi_featherlight_js', FCA_EOI_PLUGIN_URL . '/assets/vendor/featherlight/release/featherlight.min.js' );
118 - 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-common-css', 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.js', array( 'fca_eoi_jstz', 'jquery', 'fca_eoi_tooltipster_js', 'fca_eoi_featherlight_js'), FCA_EOI_VER, true );
119 125
120 - wp_enqueue_style( 'fca_eoi', FCA_EOI_PLUGIN_URL . '/assets/style-new.css' );
121 - wp_enqueue_script( 'fca_eoi_script_js', FCA_EOI_PLUGIN_URL . '/assets/script.js' );
122 -
123 126 //PASS VARIABLES TO JAVASCRIPT
127 + $options = get_option( 'fca_eoi_settings' );
128 + $consent_msg = empty( $options['consent_msg'] ) ? '' : $options['consent_msg'];
129 + $consent_headline = empty( $options['consent_headline'] ) ? '' : $options['consent_headline'];
124 130 $data = array (
125 131 'ajax_url' => admin_url( 'admin-ajax.php' ),
126 132 'nonce' => wp_create_nonce( 'fca_eoi_submit_form' ),
133 + 'gdpr_checkbox' => fca_eoi_show_gdpr_checkbox(),
134 + 'consent_headline' => $consent_headline,
135 + 'consent_msg' => $consent_msg
127 136 );
128 -
129 - wp_localize_script( 'fca_eoi_script_js', 'fca_eoi', $data );
137 + wp_localize_script( 'fca_eoi_script_js', 'fcaEoiScriptData', $data );
130 138 }
131 139
132 140 public function shortcode_content( $atts ) {
133 -
134 - $form_id = $atts['id'];
135 -
136 - /**
137 - * Check that we have a valid post ID
138 - */
139 - if( empty ( $form_id ) ) {
140 - return 'Missing form ID';
141 + if ( empty ( $atts['id'] ) ) {
142 + return "The selected Optin Cat form doesn't exist.";
143 + } else {
144 + $form_id = $atts['id'];
145 + $post = get_post( $form_id );
141 146 }
142 - if( ! $post = get_post( $form_id ) ) {
143 - return 'Wrong form ID';
147 +
148 + if( !is_object( $post ) OR $post->post_status == 'trash' ) {
149 + return "The selected Optin Cat form doesn't exist.";
144 150 }
151 +
145 152 $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' );
153 + if ( !empty( $animation ) ) {
154 + wp_enqueue_style( 'fca_eoi_powerups_animate', FCA_EOI_PLUGIN_URL . '/assets/vendor/animate/animate.min.css', array(), FCA_EOI_VER );
148 155 }
156 +
149 157 $this->enqueue_assets();
150 158 $head = get_post_meta( $form_id, 'fca_eoi_head', true );
151 159
152 160 $layout_id = get_post_meta ( $form_id, 'fca_eoi_layout', true );
153 - $layout = new EasyOptInsLayout( $layout_id );
161 + $layout = new EasyOptInsLayout( $layout_id );
154 162
155 - if ( $layout->layout_type != 'lightbox' ) {
156 - $head .= '<script>' . EasyOptInsActivity::get_instance()->get_tracking_code( $form_id ) . '</script>';
157 - }
163 + if ( $layout->layout_type !== 'lightbox' && $layout->layout_type !== 'banner' && $layout->layout_type !== 'overlay' ) {
164 +
165 + require_once FCA_EOI_PLUGIN_DIR . 'includes/classes/RobotDetector/RobotDetector.php';
166 + $robot_detector = new RobotDetector();
167 +
168 + if ( get_post( $form_id ) && !is_user_logged_in() && !$robot_detector->is_robot() ) {
169 + EasyOptInsActivity::get_instance()->add_impression( $form_id );
170 + }
171 +
172 + }
158 173
159 174 return $head;
160 175 }
161 176 }