PluginProbe
GetResponse Forms by Optin Cat / 2.3.0
GetResponse Forms by Optin Cat v2.3.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 2.3.0, at getresponse-wp.php

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