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 | getresponse-wp.php +125 -241 1.5.22.4.1 View file →
@@ -1,281 +1,165 @@
1 1 <?php
2 2 /*
3 - Plugin Name: GetResponse Forms by Optin Cat
4 - Plugin URI: https://fatcatapps.com/optincat
5 - Description: The GetResponse Optin Cat WordPress Lets You Convert More Blog Viisots Into Email Subscribers. Set It Up In 2 Minutes.
6 - Author: Fatcat Apps
7 - Version: 1.5.2
8 - Author URI: https://fatcatapps.com/
3 + Plugin Name: GetResponse Forms by Optin Cat
4 + Plugin URI: https://fatcatapps.com/optincat
5 + Description: The GetResponse Optin Cat WordPress Lets You Convert More Blog Visits Into Email Subscribers. Set It Up In 2 Minutes.
6 + Author: Fatcat Apps
7 + Version: 2.4.1
8 + Author URI: https://fatcatapps.com/
9 9 */
10 -// define( 'FCA_EOI_DEBUG', true );
10 +
11 11 if ( ! function_exists( 'is_admin' ) ) {
12 - exit();
12 + exit();
13 13 }
14 14
15 -require 'includes/skelet/skelet.php';
16 -
17 15 define( 'FCA_EOI_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
18 16 define( 'FCA_EOI_PLUGIN_FILE', __FILE__ );
19 17 define( 'FCA_EOI_PLUGIN_URL', plugins_url( '', __FILE__ ) );
18 +define( 'FCA_EOI_EDITION', 'getresponse' );
19 +define( 'FCA_EOI_PLUGIN_SLUG', 'getresponse' );
20 +define( 'FCA_EOI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
21 +define( 'FCA_EOI_VER', '2.4.1' );
20 22
21 -
22 23 if( ! defined ( 'FCA_EOI_DEBUG' ) ) {
23 - define( 'FCA_EOI_DEBUG', false );
24 + define( 'FCA_EOI_DEBUG', false );
24 25 }
25 -if ( ! class_exists ( 'Mustache_Engine' ) ) {
26 - require FCA_EOI_PLUGIN_DIR . 'includes/classes/Mustache/Autoloader.php';
27 - Mustache_Autoloader::register();
28 -}
29 26
30 -/**
31 - * Include scssphp
32 - *
33 - * Latest version requires PHP 5.3
34 - * Version 0.0.15 works with PHP 5.2
35 - * We detect PHP > 5.3 by checking the constant __DIR__
36 - */
37 -if ( ! class_exists ( 'scssc' ) ) {
38 - if( defined( '__DIR__' ) ) {
39 - require FCA_EOI_PLUGIN_DIR . 'includes/classes/scssphp/scss.inc.php';
40 - } else {
41 - require FCA_EOI_PLUGIN_DIR . 'includes/classes/scssphp-0.0.15/scss.inc.php';
42 - }
43 -}
44 -
45 -/**
46 - * Include and instantiate Mobile Detect
47 - */
48 -if ( ! class_exists ( 'Mobile_Detect' ) ) {
49 - require FCA_EOI_PLUGIN_DIR . 'includes/classes/Mobile-Detect/Mobile_Detect.php';
50 -}
51 -
52 27 if( ! class_exists( 'DhEasyOptIns' ) ) {
53 -class DhEasyOptIns {
28 + class DhEasyOptIns {
54 29
55 - var $ver = '1.5.2';
56 - var $distro = '';
57 - var $shortcode = 'optin-cat';
58 - var $shortcode_aliases = array(
59 - 'easy-opt-in',
60 - 'optincat',
61 - 'opt-in-cat',
62 - );
63 - var $settings;
64 - var $provider = '';
65 - var $providers = array();
30 + var $distro = '';
31 + var $shortcode = 'optin-cat';
32 + var $shortcode_aliases = array(
33 + 'easy-opt-in',
34 + 'optincat',
35 + 'opt-in-cat',
36 + );
37 + var $settings;
38 + var $provider = '';
39 + var $providers = array();
40 + var $post_type_obj = '';
66 41
67 - function __construct() {
42 + function __construct() {
43 + require_once FCA_EOI_PLUGIN_DIR . 'includes/classes/k/k.php';
44 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-powerups.php';
45 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-subscribers.php';
46 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-post-types.php';
47 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-layout.php';
48 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-shortcode.php';
49 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-widget.php';
50 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-activity.php';
51 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-functions.php';
52 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-block.php';
53 + require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-uninstall.php';
68 54
69 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-error-handler.php';
70 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-post-types.php';
71 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-settings.php';
72 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-layout.php';
73 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-shortcode.php';
74 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-widget.php';
75 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-pointer.php';
76 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-tour-pointer.php';
77 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-activity.php';
78 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-init.php';
79 - require FCA_EOI_PLUGIN_DIR . 'includes/compatibility-mode/eoi-compatibility-mode.php';
80 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-functions.php';
55 + global $fca_eoi_shortcodes;
56 +
57 + // Settings
58 + $this->settings['shortcode'] = $this->shortcode;
59 + $this->settings['shortcode_aliases'] = $this->shortcode_aliases;
60 + $this->settings['provider'] = $this->provider;
81 61
82 - global $fca_eoi_shortcodes;
62 + // Load all providers
63 + foreach ( glob( FCA_EOI_PLUGIN_DIR . 'providers/*', GLOB_ONLYDIR ) as $provider_path ) {
64 + $provider_id = basename( $provider_path );
65 + require_once "$provider_path/provider.php";
66 + $this->settings[ 'providers' ][ $provider_id ] = call_user_func( "provider_$provider_id" );
67 + }
83 68
84 - $post_type = $this->get_current_post_type();
85 - $eoi_settings = get_option('easy_opt_in_settings');
69 + // Add provider to settings
70 + $providers_available = array_keys( $this->settings[ 'providers' ] );
71 +
72 + //set current post type to setting array
73 + $this->settings[ 'post_type' ] = get_post_type();
86 74
87 - // Settings
88 - $this->settings();
75 + // If there is only one provider, use it
76 + if( 1 == count( $providers_available ) ) {
77 + $this->provider = $this->settings[ 'provider' ] = $providers_available[ 0 ];
78 + $this->distro = 'free';
79 + $this->settings['distribution'] = 'free';
80 + } else {
81 + $this->distro = 'premium';
82 + $this->settings['distribution'] = 'premium';
83 + }
89 84
90 - // Add provider to settings
91 - $providers_available = array_keys( $this->settings[ 'providers' ] );
92 -
93 - //set current post type to setting array
94 - $this->settings[ 'post_type' ] = $post_type;
85 + // Include provider helper class(es)
86 + foreach ( $providers_available as $provider ) {
87 + require_once FCA_EOI_PLUGIN_DIR . "providers/$provider/functions.php";
88 + }
95 89
96 - // If there is only one provider, use it
97 - if( 1 == count( $providers_available ) ) {
98 - $this->provider = $this->settings[ 'provider' ] = $providers_available[ 0 ];
99 - }
90 + // Load extensions
91 + $this->post_type_obj = new EasyOptInsPostTypes($this->settings);
92 + $fca_eoi_shortcodes = new EasyOptInsShortcodes($this->settings);
93 + $widget = new EasyOptInsWidgetHelper($this->settings);
94 + EasyOptInsActivity::get_instance()->settings = $this->settings;
100 95
101 - // Distributions
102 - if( 1 == count( $providers_available ) ) {
103 - $this->distro = 'free';
104 - $this->settings['distribution'] = 'free';
105 - } else {
106 - $this->distro = 'premium';
107 - $this->settings['distribution'] = 'premium';
108 - }
109 -
110 - // Add options that are stored in DB if any
111 - $this->settings[ 'eoi_settings' ] = $eoi_settings;
112 -
113 - // Include provider helper class(es)
114 - foreach ( $providers_available as $provider ) {
115 - require $this->settings[ 'plugin_dir' ] . "providers/$provider/functions.php";
116 - }
117 -
118 - // Load extensions
119 - $post_types = new EasyOptInsPostTypes($this->settings);
120 - $fca_eoi_shortcodes = new EasyOptInsShortcodes($this->settings);
121 - $widget = new EasyOptInsWidgetHelper($this->settings);
122 - EasyOptInsActivity::get_instance()->settings = $this->settings;
123 - EasyOptInsInit::get_instance()->setup();
124 -
125 - // Load subscribing banner for free users
126 - if( 1 == count( $providers_available ) ) {
127 - $pointer = new EasyOptInsPointer( $this->settings );
128 - }
129 -
130 - //Load tour pointer
131 - //$tour_pointer = new EOITourPointer($this->settings );
132 -
133 - //load compatibility-mode
134 - new EasyOptInsCompatibilityMode( $this->settings );
135 -
136 - //load EasyOptIns Upgrade notifications
137 - if( count( $providers_available ) === 1 ) {
138 - require plugin_dir_path( __FILE__ ) . 'includes/eoi-upgrade.php';
139 - new EasyOptInsUpgrade( $this->settings );
140 - }
141 - }
142 -
143 - function get_current_post_type() {
144 -
145 - global $post, $typenow, $current_screen;
146 -
147 - if ( $post && $post->post_type ) {
148 - return $post->post_type;
149 - } elseif( $typenow ) {
150 - return $typenow;
151 - } elseif( $current_screen && $current_screen->post_type ) {
152 - return $current_screen->post_type;
153 - } elseif( isset( $_REQUEST['post_type'] ) ) {
154 - return sanitize_key( $_REQUEST['post_type'] );
155 - } elseif ( isset( $_REQUEST['post'] ) && $_REQUEST['post'] ) {
156 - $id = $_REQUEST['post'];
157 - $post_obj = get_post( $id );
158 - if( $post_obj ) {
159 - return $post_obj->post_type;
160 - }
161 - }
162 - return null;
163 - }
164 -
165 - function settings() {
166 - $this->settings['plugin_dir'] = FCA_EOI_PLUGIN_DIR;
167 - $this->settings['plugin_url'] = FCA_EOI_PLUGIN_URL;
168 - $this->settings['shortcode'] = $this->shortcode;
169 - $this->settings['shortcode_aliases'] = $this->shortcode_aliases;
170 - $this->settings['version'] = $this->ver;
171 - $this->settings['provider'] = $this->provider;
172 -
173 - // Load all providers
174 - foreach ( glob( $this->settings[ 'plugin_dir' ] . 'providers/*', GLOB_ONLYDIR ) as $provider_path ) {
175 - $provider_id = basename( $provider_path );
176 - require_once "$provider_path/provider.php";
177 - $this->settings[ 'providers' ][ $provider_id ] = call_user_func( "provider_$provider_id" );
178 - }
179 -
180 - if ( $_SERVER['REQUEST_METHOD'] == 'POST' && ! empty( $_POST['paf_submit'] ) ) {
181 - $options_before = get_option('paf');
182 - $options_after = empty( $_POST['paf'] ) ? array() : $_POST['paf'];
183 - $options_changed = true;
184 - } else {
185 - $options_changed = false;
186 - }
187 -
188 - // Load all powerups
189 - foreach ( glob( $this->settings[ 'plugin_dir' ] . 'powerups/*', GLOB_ONLYDIR ) as $powerup_path ) {
190 - $powerup_id = basename( $powerup_path );
191 - $powerup_id = preg_replace('/(\d+)_/', '', $powerup_id);
192 -
193 - require_once "$powerup_path/powerup.php";
194 - $function_name = "powerup_$powerup_id";
195 - $this->settings[ 'powerups' ][ $powerup_id ] = call_user_func( $function_name, $this->settings );
196 -
197 - $option_name = 'eoi_' . $function_name;
198 - if ( $options_changed ) {
199 - $hook_function_name = null;
200 -
201 - if ( empty( $options_before[ $option_name ] ) && ! empty( $options_after[ $option_name ] ) ) {
202 - $hook_function_name = $function_name . '_on_activate';
203 - } else if ( ! empty( $options_before[ $option_name ] ) && empty( $options_after[ $option_name ] ) ) {
204 - $hook_function_name = $function_name . '_on_deactivate';
205 - }
206 -
207 - if ( ! empty( $hook_function_name ) && function_exists( $hook_function_name ) ) {
208 - call_user_func( $hook_function_name, $this->settings );
209 - }
210 - }
211 - }
212 -
213 - paf_pages( array( 'eoi_powerups' => array(
214 - 'title' => __( 'Power Ups Settings' ),
215 - 'menu_title' => __( 'Power Ups' ),
216 - 'parent' => 'edit.php?post_type=easy-opt-ins',
217 - ) ) );
218 -
219 - }
96 + // Load subscribing banner for free users
97 + if( $this->distro == 'free' ) {
98 + //load EasyOptIns Upgrade notifications
99 + require plugin_dir_path( __FILE__ ) . 'includes/eoi-upgrade.php';
100 + new EasyOptInsUpgrade( $this->settings );
101 + }
102 + }
103 + }
220 104 }
221 -}
222 105
223 106 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
224 107
225 108 if ( ! is_plugin_active( plugin_basename( __FILE__ ) ) ) {
226 - function fca_eoi_fail_activation( $message ) {
227 - wp_die( sprintf(
228 - '<h2>%s</h2><p>%s</p><p><a class="button button-large" href="%s">%s</a></p>'
229 - , __( 'Ooops!' )
230 - , __( $message )
231 - , admin_url( 'plugins.php' )
232 - , __( 'Go to plugins page' )
233 - ) );
234 - }
109 + function fca_eoi_fail_activation( $message ) {
110 + wp_die( sprintf(
111 + '<h2>%s</h2><p>%s</p><p><a class="button button-large" href="%s">%s</a></p>'
112 + , __( 'Ooops!' )
113 + , __( $message )
114 + , admin_url( 'plugins.php' )
115 + , __( 'Go to plugins page' )
116 + ) );
117 + }
235 118
236 - function fca_eoi_activation() {
237 - $plugins = get_plugins();
119 + function fca_eoi_activation() {
120 + $plugins = get_plugins();
238 121
239 - // Fail to activate the plugin if other Optin Cat plugins are already active
240 - foreach ( $plugins as $file => $plugin ) {
241 - if ( stripos( $plugin['PluginURI'], 'fatcatapps.com/optincat' ) !== false && is_plugin_active( $file ) ) {
242 - $current_plugin = $plugins[ plugin_basename( __FILE__ ) ];
243 - fca_eoi_fail_activation(
244 - 'Only one Optin Cat plugin can be active at a time, but you already have ' .
245 - htmlspecialchars( $plugin['Name'] ) . ' active. ' .
246 - 'Please deactivate it before activating ' .
247 - htmlspecialchars( $current_plugin['Name'] ) . '.' );
248 - }
249 - }
122 + // Fail to activate the plugin if other Optin Cat plugins are already active
123 + foreach ( $plugins as $file => $plugin ) {
124 + if ( stripos( $plugin['PluginURI'], 'fatcatapps.com/optincat' ) !== false && is_plugin_active( $file ) ) {
125 + $current_plugin = $plugins[ plugin_basename( __FILE__ ) ];
126 + fca_eoi_fail_activation(
127 + 'Only one Optin Cat plugin can be active at a time, but you already have ' .
128 + htmlspecialchars( $plugin['Name'] ) . ' active. ' .
129 + 'Please deactivate it before activating ' .
130 + htmlspecialchars( $current_plugin['Name'] ) . '.' );
131 + }
132 + }
250 133
251 - // Fail to activate the plugin if the providers or layouts directories are empty
252 - $providers = glob( FCA_EOI_PLUGIN_DIR . 'providers/*', GLOB_ONLYDIR );
253 - $layouts = glob( FCA_EOI_PLUGIN_DIR . 'layouts/*', GLOB_ONLYDIR );
134 + // Fail to activate the plugin if the providers or layouts directories are empty
135 + $providers = glob( FCA_EOI_PLUGIN_DIR . 'providers/*', GLOB_ONLYDIR );
136 + $layouts = glob( FCA_EOI_PLUGIN_DIR . 'layouts/*', GLOB_ONLYDIR );
254 137
255 - if ( empty( $providers ) || empty( $layouts ) ) {
256 - fca_eoi_fail_activation( 'Something went wrong. Please delete the plugin and install it again.' );
257 - }
138 + if ( empty( $providers ) || empty( $layouts ) ) {
139 + fca_eoi_fail_activation( 'Something went wrong. Please delete the plugin and install it again.' );
140 + }
258 141
259 142 require FCA_EOI_PLUGIN_DIR . 'includes/eoi-functions.php';
260 -
261 - //convert everyone to new CSS if they are on OLD
262 - fca_eoi_migrate_css();
263 -
264 - //pre-compile SCSS
265 - fca_eoi_compile_scss();
266 -
267 - // If everything went well, continue with the activation setup
268 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-activity.php';
269 - EasyOptInsActivity::get_instance()->setup();
270 143
271 - require FCA_EOI_PLUGIN_DIR . 'includes/eoi-init.php';
272 - EasyOptInsInit::get_instance()->on_activate();
144 + //convert everyone to new Post Meta Format if they are on OLD
145 + fca_eoi_convert_post_meta();
146 + //convert options from 'paf' to 'fca_eoi_settings'
147 + fca_eoi_convert_option_save();
273 148
274 - }
149 + //check for users of custom form, otherwise that feature is disabled
150 + $opt = get_option ( 'fca_eoi_allow_customform', '' );
151 + if ( empty ( $opt ) ) {
152 + fca_eoi_set_custom_form_depreciation();
153 + }
154 +
155 + // If everything went well, continue with the activation setup
156 + require FCA_EOI_PLUGIN_DIR . 'includes/eoi-activity.php';
157 + EasyOptInsActivity::get_instance()->setup();
158 + }
275 159
276 - // If the plugin is not yet active, check for any obstacles in activation
277 - register_activation_hook( __FILE__, 'fca_eoi_activation' );
278 - return;
160 + // If the plugin is not yet active, check for any obstacles in activation
161 + register_activation_hook( __FILE__, 'fca_eoi_activation' );
162 + return;
279 163 }
280 164
281 165 $dh_easy_opt_ins_plugin = new DhEasyOptIns();