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