PluginProbe
GetResponse Forms by Optin Cat / 1.8.0
GetResponse Forms by Optin Cat v1.8.0
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
getresponse / getresponse-wp.php

getresponse-wp.php in GetResponse Forms by Optin Cat 1.8.0, at getresponse-wp.php

176 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
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 Visits Into Email Subscribers. Set It Up In 2 Minutes.
6 Author: Fatcat Apps
7 Version: 1.8.0
8 Author URI: https://fatcatapps.com/
9 */
10
11 // define( 'FCA_EOI_DEBUG', true );
12
13 if ( ! function_exists( 'is_admin' ) ) {
14 exit();
15 }
16
17 define( 'FCA_EOI_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
18 define( 'FCA_EOI_PLUGIN_FILE', __FILE__ );
19 define( 'FCA_EOI_PLUGIN_URL', plugins_url( '', __FILE__ ) );
20 define( 'FCA_EOI_EDITION', 'getresponse' );
21 define( 'FCA_EOI_PLUGIN_SLUG', 'getresponse' );
22 define( 'FCA_EOI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
23
24 define( 'FCA_EOI_VER', '1.8.0' );
25
26 if( ! defined ( 'FCA_EOI_DEBUG' ) ) {
27 define( 'FCA_EOI_DEBUG', false );
28 }
29
30 /**
31 * Include and instantiate Mobile Detect
32 */
33 if ( !class_exists ( 'Mobile_Detect' ) ) {
34 require FCA_EOI_PLUGIN_DIR . 'includes/classes/Mobile-Detect/Mobile_Detect.php';
35 }
36
37 if( ! class_exists( 'DhEasyOptIns' ) ) {
38 class DhEasyOptIns {
39
40 var $distro = '';
41 var $shortcode = 'optin-cat';
42 var $shortcode_aliases = array(
43 'easy-opt-in',
44 'optincat',
45 'opt-in-cat',
46 );
47 var $settings;
48 var $provider = '';
49 var $providers = array();
50 var $post_type_obj = '';
51
52 function __construct() {
53 require_once FCA_EOI_PLUGIN_DIR . 'includes/classes/k/k.php';
54 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-powerups.php';
55 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-post-types.php';
56 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-layout.php';
57 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-shortcode.php';
58 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-widget.php';
59 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-pointer.php';
60 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-tour-pointer.php';
61 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-activity.php';
62 require_once FCA_EOI_PLUGIN_DIR . 'includes/eoi-functions.php';
63
64 global $fca_eoi_shortcodes;
65
66 // Settings
67 $this->settings['shortcode'] = $this->shortcode;
68 $this->settings['shortcode_aliases'] = $this->shortcode_aliases;
69 $this->settings['provider'] = $this->provider;
70
71 // Load all providers
72 foreach ( glob( FCA_EOI_PLUGIN_DIR . 'providers/*', GLOB_ONLYDIR ) as $provider_path ) {
73 $provider_id = basename( $provider_path );
74 require_once "$provider_path/provider.php";
75 $this->settings[ 'providers' ][ $provider_id ] = call_user_func( "provider_$provider_id" );
76 }
77
78 // Add provider to settings
79 $providers_available = array_keys( $this->settings[ 'providers' ] );
80
81 //set current post type to setting array
82 $this->settings[ 'post_type' ] = get_post_type();
83
84 // If there is only one provider, use it
85 if( 1 == count( $providers_available ) ) {
86 $this->provider = $this->settings[ 'provider' ] = $providers_available[ 0 ];
87 $this->distro = 'free';
88 $this->settings['distribution'] = 'free';
89 } else {
90 $this->distro = 'premium';
91 $this->settings['distribution'] = 'premium';
92 }
93
94 // Include provider helper class(es)
95 foreach ( $providers_available as $provider ) {
96 require_once FCA_EOI_PLUGIN_DIR . "providers/$provider/functions.php";
97 }
98
99 // Load extensions
100 $this->post_type_obj = new EasyOptInsPostTypes($this->settings);
101 $fca_eoi_shortcodes = new EasyOptInsShortcodes($this->settings);
102 $widget = new EasyOptInsWidgetHelper($this->settings);
103 EasyOptInsActivity::get_instance()->settings = $this->settings;
104
105 // Load subscribing banner for free users
106 if( $this->distro == 'free' ) {
107 $pointer = new EasyOptInsPointer( $this->settings );
108 //load EasyOptIns Upgrade notifications
109 require plugin_dir_path( __FILE__ ) . 'includes/eoi-upgrade.php';
110 new EasyOptInsUpgrade( $this->settings );
111 }
112 }
113 }
114 }
115
116 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
117
118 if ( ! is_plugin_active( plugin_basename( __FILE__ ) ) ) {
119 function fca_eoi_fail_activation( $message ) {
120 wp_die( sprintf(
121 '<h2>%s</h2><p>%s</p><p><a class="button button-large" href="%s">%s</a></p>'
122 , __( 'Ooops!' )
123 , __( $message )
124 , admin_url( 'plugins.php' )
125 , __( 'Go to plugins page' )
126 ) );
127 }
128
129 function fca_eoi_activation() {
130 $plugins = get_plugins();
131
132 // Fail to activate the plugin if other Optin Cat plugins are already active
133 foreach ( $plugins as $file => $plugin ) {
134 if ( stripos( $plugin['PluginURI'], 'fatcatapps.com/optincat' ) !== false && is_plugin_active( $file ) ) {
135 $current_plugin = $plugins[ plugin_basename( __FILE__ ) ];
136 fca_eoi_fail_activation(
137 'Only one Optin Cat plugin can be active at a time, but you already have ' .
138 htmlspecialchars( $plugin['Name'] ) . ' active. ' .
139 'Please deactivate it before activating ' .
140 htmlspecialchars( $current_plugin['Name'] ) . '.' );
141 }
142 }
143
144 // Fail to activate the plugin if the providers or layouts directories are empty
145 $providers = glob( FCA_EOI_PLUGIN_DIR . 'providers/*', GLOB_ONLYDIR );
146 $layouts = glob( FCA_EOI_PLUGIN_DIR . 'layouts/*', GLOB_ONLYDIR );
147
148 if ( empty( $providers ) || empty( $layouts ) ) {
149 fca_eoi_fail_activation( 'Something went wrong. Please delete the plugin and install it again.' );
150 }
151
152 require FCA_EOI_PLUGIN_DIR . 'includes/eoi-functions.php';
153
154 //convert everyone to new Post Meta Format if they are on OLD
155 fca_eoi_convert_post_meta();
156 //convert options from 'paf' to 'fca_eoi_settings'
157 fca_eoi_convert_option_save();
158
159 //check for users of custom form, otherwise that feature is disabled
160 $opt = get_option ( 'fca_eoi_allow_customform', '' );
161 if ( empty ( $opt ) ) {
162 fca_eoi_set_custom_form_depreciation();
163 }
164
165 // If everything went well, continue with the activation setup
166 require FCA_EOI_PLUGIN_DIR . 'includes/eoi-activity.php';
167 EasyOptInsActivity::get_instance()->setup();
168 }
169
170 // If the plugin is not yet active, check for any obstacles in activation
171 register_activation_hook( __FILE__, 'fca_eoi_activation' );
172 return;
173 }
174
175 $dh_easy_opt_ins_plugin = new DhEasyOptIns();
176