@@ -17,247 +17,247 @@ discard block |
||
17 | 17 | { |
18 | 18 | |
19 | 19 | |
20 | - /** |
|
21 | - * class constructor |
|
22 | - * |
|
23 | - * @access public |
|
24 | - */ |
|
25 | - public function __construct() |
|
26 | - { |
|
20 | + /** |
|
21 | + * class constructor |
|
22 | + * |
|
23 | + * @access public |
|
24 | + */ |
|
25 | + public function __construct() |
|
26 | + { |
|
27 | 27 | // throw new EE_Error('error'); |
28 | 28 | |
29 | - do_action('AHEE_log', __CLASS__, __FUNCTION__); |
|
30 | - |
|
31 | - //wp have no MONTH_IN_SECONDS constant. So we approximate our own assuming all months are 4 weeks long. |
|
32 | - if (! defined('MONTH_IN_SECONDS')) { |
|
33 | - define('MONTH_IN_SECONDS', WEEK_IN_SECONDS * 4); |
|
34 | - } |
|
35 | - |
|
36 | - if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
37 | - $this->_uxip_hooks(); |
|
38 | - } |
|
39 | - |
|
40 | - |
|
41 | - $ueip_optin = EE_Registry::instance()->CFG->core->ee_ueip_optin; |
|
42 | - $ueip_has_notified = EE_Registry::instance()->CFG->core->ee_ueip_has_notified; |
|
43 | - |
|
44 | - //has optin been selected for data collection? |
|
45 | - $espresso_data_optin = ! empty($ueip_optin) ? $ueip_optin : null; |
|
46 | - |
|
47 | - if (empty($ueip_has_notified) |
|
48 | - && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance |
|
49 | - ) { |
|
50 | - add_action('admin_notices', array($this, 'espresso_data_collection_optin_notice'), 10); |
|
51 | - add_action('admin_enqueue_scripts', array($this, 'espresso_data_collection_enqueue_scripts'), 10); |
|
52 | - add_action('wp_ajax_espresso_data_optin', array($this, 'espresso_data_optin_ajax_handler'), 10); |
|
53 | - update_option('ee_ueip_optin', 'yes'); |
|
54 | - $espresso_data_optin = 'yes'; |
|
55 | - } |
|
56 | - |
|
57 | - //let's prepare extra stats |
|
58 | - $extra_stats = array(); |
|
59 | - |
|
60 | - //only collect extra stats if the plugin user has opted in and transient is expired. |
|
61 | - if (! empty($espresso_data_optin) && $espresso_data_optin == 'yes') { |
|
62 | - if (false === ($transient = get_transient('ee_extra_data')) |
|
63 | - && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance |
|
64 | - ) { |
|
65 | - |
|
66 | - $current_site = is_multisite() ? get_current_site() : null; |
|
67 | - $site_pre = ! is_main_site() && ! empty($current_site) |
|
68 | - ? trim( |
|
69 | - preg_replace('/\b\w\S\w\b/', '', $current_site->domain), |
|
70 | - '.' |
|
71 | - ) . '_' |
|
72 | - : ''; |
|
73 | - |
|
74 | - |
|
75 | - //active gateways |
|
76 | - $active_gateways = get_option('event_espresso_active_gateways'); |
|
77 | - if (! empty($active_gateways)) { |
|
78 | - foreach ((array)$active_gateways as $gateway => $ignore) { |
|
79 | - $extra_stats[$site_pre . $gateway . '_gateway_active'] = 1; |
|
80 | - } |
|
81 | - } |
|
82 | - |
|
83 | - if (is_multisite() && is_main_site()) { |
|
84 | - $extra_stats['is_multisite'] = true; |
|
85 | - } |
|
86 | - |
|
87 | - //what is the current active theme? |
|
88 | - $active_theme = get_option('uxip_ee_active_theme'); |
|
89 | - if (! empty($active_theme)) { |
|
90 | - $extra_stats[$site_pre . 'active_theme'] = $active_theme; |
|
91 | - } |
|
92 | - |
|
93 | - //event info regarding an all event count and all "active" event count |
|
94 | - $all_events_count = get_option('uxip_ee4_all_events_count'); |
|
95 | - if (! empty($all_events_count)) { |
|
96 | - $extra_stats[$site_pre . 'ee4_all_events_count'] = $all_events_count; |
|
97 | - } |
|
98 | - $active_events_count = get_option('uxip_ee4_active_events_count'); |
|
99 | - if (! empty($active_events_count)) { |
|
100 | - $extra_stats[$site_pre . 'ee4_active_events_count'] = $active_events_count; |
|
101 | - } |
|
102 | - |
|
103 | - //datetime stuff |
|
104 | - $dtt_count = get_option('uxip_ee_all_dtts_count'); |
|
105 | - if (! empty($dtt_count)) { |
|
106 | - $extra_stats[$site_pre . 'all_dtts_count'] = $dtt_count; |
|
107 | - } |
|
108 | - |
|
109 | - $dtt_sold = get_option('uxip_ee_dtt_sold'); |
|
110 | - if (! empty($dtt_sold)) { |
|
111 | - $extra_stats[$site_pre . 'dtt_sold'] = $dtt_sold; |
|
112 | - } |
|
113 | - |
|
114 | - //ticket stuff |
|
115 | - $all_tkt_count = get_option('uxip_ee_all_tkt_count'); |
|
116 | - if (! empty($all_tkt_count)) { |
|
117 | - $extra_stats[$site_pre . 'all_tkt_count'] = $all_tkt_count; |
|
118 | - } |
|
119 | - |
|
120 | - $free_tkt_count = get_option('uxip_ee_free_tkt_count'); |
|
121 | - if (! empty($free_tkt_count)) { |
|
122 | - $extra_stats[$site_pre . 'free_tkt_count'] = $free_tkt_count; |
|
123 | - } |
|
124 | - |
|
125 | - $paid_tkt_count = get_option('uxip_ee_paid_tkt_count'); |
|
126 | - if (! empty($paid_tkt_count)) { |
|
127 | - $extra_stats[$site_pre . 'paid_tkt_count'] = $paid_tkt_count; |
|
128 | - } |
|
129 | - |
|
130 | - $tkt_sold = get_option('uxip_ee_tkt_sold'); |
|
131 | - if (! empty($tkt_sold)) { |
|
132 | - $extra_stats[$site_pre . 'tkt_sold'] = $tkt_sold; |
|
133 | - } |
|
134 | - |
|
135 | - //phpversion checking |
|
136 | - $extra_stats['phpversion'] = function_exists('phpversion') ? phpversion() : 'unknown'; |
|
137 | - |
|
138 | - //set transient |
|
139 | - set_transient('ee_extra_data', $extra_stats, WEEK_IN_SECONDS); |
|
140 | - } |
|
141 | - } |
|
142 | - |
|
143 | - |
|
144 | - // PUE Auto Upgrades stuff |
|
145 | - if (is_readable(EE_THIRD_PARTY . 'pue/pue-client.php')) { //include the file |
|
146 | - require_once(EE_THIRD_PARTY . 'pue/pue-client.php'); |
|
147 | - |
|
148 | - $api_key = isset(EE_Registry::instance()->NET_CFG->core->site_license_key) |
|
149 | - ? EE_Registry::instance()->NET_CFG->core->site_license_key |
|
150 | - : ''; |
|
151 | - //this needs to be the host server where plugin update engine is installed. Note, if you leave this blank |
|
152 | - // then it is assumed the WordPress repo will be used and we'll just check there. |
|
153 | - $host_server_url = 'https://eventespresso.com'; |
|
154 | - |
|
155 | - //Note: PUE uses a simple preg_match to determine what type is currently installed based on version number. |
|
156 | - // So it's important that you use a key for the version type that is unique and not found in another key. |
|
157 | - //For example: |
|
158 | - //$plugin_slug['premium']['p'] = 'some-premium-slug'; |
|
159 | - //$plugin_slug['prerelease']['pr'] = 'some-pre-release-slug'; |
|
160 | - //The above would not work because "p" is found in both keys for the version type. ( i.e 1.0.p vs 1.0.pr ) |
|
161 | - // so doing something like: |
|
162 | - //$plugin_slug['premium']['p'] = 'some-premium-slug'; |
|
163 | - //$plugin_slug['prerelease']['b'] = 'some-pre-release-slug'; |
|
164 | - //..WOULD work! |
|
165 | - $plugin_slug = array( |
|
166 | - 'free' => array('decaf' => 'event-espresso-core-decaf'), |
|
167 | - 'premium' => array('p' => 'event-espresso-core-reg'), |
|
168 | - 'prerelease' => array('beta' => 'event-espresso-core-pr'), |
|
169 | - ); |
|
170 | - |
|
171 | - |
|
172 | - //$options needs to be an array with the included keys as listed. |
|
173 | - $options = array( |
|
174 | - // 'optionName' => '', //(optional) - used as the reference for saving update information in the |
|
175 | - // clients options table. Will be automatically set if left blank. |
|
176 | - 'apikey' => $api_key, |
|
177 | - //(required), you will need to obtain the apikey that the client gets from your site and |
|
178 | - // then saves in their sites options table (see 'getting an api-key' below) |
|
179 | - 'lang_domain' => 'event_espresso', |
|
180 | - //(optional) - put here whatever reference you are using for the localization of your plugin (if it's |
|
181 | - // localized). That way strings in this file will be included in the translation for your plugin. |
|
182 | - 'checkPeriod' => '24', |
|
183 | - //(optional) - use this parameter to indicate how often you want the client's install to ping your |
|
184 | - // server for update checks. The integer indicates hours. If you don't include this parameter it will |
|
185 | - // default to 12 hours. |
|
186 | - 'option_key' => 'site_license_key', |
|
187 | - //this is what is used to reference the api_key in your plugin options. PUE uses this to trigger |
|
188 | - // updating your information message whenever this option_key is modified. |
|
189 | - 'options_page_slug' => 'espresso_general_settings', |
|
190 | - 'plugin_basename' => EE_PLUGIN_BASENAME, |
|
191 | - 'use_wp_update' => true, |
|
192 | - //if TRUE then you want FREE versions of the plugin to be updated from WP |
|
193 | - 'extra_stats' => $extra_stats, |
|
194 | - 'turn_on_notices_saved' => true, |
|
195 | - ); |
|
196 | - //initiate the class and start the plugin update engine! |
|
197 | - new PluginUpdateEngineChecker($host_server_url, $plugin_slug, $options); |
|
198 | - } |
|
199 | - } |
|
200 | - |
|
201 | - |
|
202 | - /** |
|
203 | - * The purpose of this function is to display information about Event Espresso data collection |
|
204 | - * and a optin selection for extra data collecting by users. |
|
205 | - * |
|
206 | - * @param bool $extra |
|
207 | - * @return string html. |
|
208 | - */ |
|
209 | - public static function espresso_data_collection_optin_text($extra = true) |
|
210 | - { |
|
211 | - if (! $extra) { |
|
212 | - echo '<h2 class="ee-admin-settings-hdr" ' |
|
213 | - . (! $extra ? 'id="UXIP_settings"' : '') |
|
214 | - . '>' |
|
215 | - . esc_html__('User eXperience Improvement Program (UXIP)', 'event_espresso') |
|
216 | - . EEH_Template::get_help_tab_link('organization_logo_info') |
|
217 | - . '</h2>'; |
|
218 | - printf( |
|
219 | - esc_html__( |
|
220 | - '%sPlease help us make Event Espresso better and vote for your favorite features.%s The %sUser eXperience Improvement Program (UXIP)%s, has been created so when you use Event Espresso you are voting for the features and settings that are important to you. The UXIP helps us understand how you use our products and services, track problems and in what context. If you opt-out of the UXIP you essentially elect for us to disregard how you use Event Espresso as we build new features and make changes. Participation in the program is completely voluntary but it is enabled by default. The end results of the UXIP are software improvements to better meet your needs. The data we collect will never be sold, traded, or misused in any way. %sPlease see our %sPrivacy Policy%s for more information.', |
|
221 | - 'event_espresso' |
|
222 | - ), |
|
223 | - '<p><em>', |
|
224 | - '</em></p>', |
|
225 | - '<a href="https://eventespresso.com/about/user-experience-improvement-program-uxip/" target="_blank">', |
|
226 | - '</a>', |
|
227 | - '<br><br>', |
|
228 | - '<a href="https://eventespresso.com/about/privacy-policy/" target="_blank">', |
|
229 | - '</a>' |
|
230 | - ); |
|
231 | - } else { |
|
232 | - $settings_url = EE_Admin_Page::add_query_args_and_nonce( |
|
233 | - array('action' => 'default'), |
|
234 | - admin_url('admin.php?page=espresso_general_settings') |
|
235 | - ); |
|
236 | - $settings_url .= '#UXIP_settings'; |
|
237 | - printf( |
|
238 | - esc_html__( |
|
239 | - 'The Event Espresso UXIP feature is active on your site. For %smore info%s and to opt-out %sclick here%s.', |
|
240 | - 'event_espresso' |
|
241 | - ), |
|
242 | - '<a href="https://eventespresso.com/about/user-experience-improvement-program-uxip/" target="_blank">', |
|
243 | - '</a>', |
|
244 | - '<a href="' . $settings_url . '" target="_blank">', |
|
245 | - '</a>' |
|
246 | - ); |
|
247 | - } |
|
248 | - } |
|
249 | - |
|
250 | - |
|
251 | - public function espresso_data_collection_optin_notice() |
|
252 | - { |
|
253 | - $ueip_has_notified = EE_Registry::instance()->CFG->core->ee_ueip_has_notified; |
|
254 | - if ($ueip_has_notified) { |
|
255 | - return; |
|
256 | - } |
|
257 | - // $settings_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default'), |
|
258 | - // admin_url( 'admin.php?page=espresso_general_settings') ); |
|
259 | - // $settings_url = $settings_url . '#UXIP_settings'; |
|
260 | - ?> |
|
29 | + do_action('AHEE_log', __CLASS__, __FUNCTION__); |
|
30 | + |
|
31 | + //wp have no MONTH_IN_SECONDS constant. So we approximate our own assuming all months are 4 weeks long. |
|
32 | + if (! defined('MONTH_IN_SECONDS')) { |
|
33 | + define('MONTH_IN_SECONDS', WEEK_IN_SECONDS * 4); |
|
34 | + } |
|
35 | + |
|
36 | + if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
37 | + $this->_uxip_hooks(); |
|
38 | + } |
|
39 | + |
|
40 | + |
|
41 | + $ueip_optin = EE_Registry::instance()->CFG->core->ee_ueip_optin; |
|
42 | + $ueip_has_notified = EE_Registry::instance()->CFG->core->ee_ueip_has_notified; |
|
43 | + |
|
44 | + //has optin been selected for data collection? |
|
45 | + $espresso_data_optin = ! empty($ueip_optin) ? $ueip_optin : null; |
|
46 | + |
|
47 | + if (empty($ueip_has_notified) |
|
48 | + && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance |
|
49 | + ) { |
|
50 | + add_action('admin_notices', array($this, 'espresso_data_collection_optin_notice'), 10); |
|
51 | + add_action('admin_enqueue_scripts', array($this, 'espresso_data_collection_enqueue_scripts'), 10); |
|
52 | + add_action('wp_ajax_espresso_data_optin', array($this, 'espresso_data_optin_ajax_handler'), 10); |
|
53 | + update_option('ee_ueip_optin', 'yes'); |
|
54 | + $espresso_data_optin = 'yes'; |
|
55 | + } |
|
56 | + |
|
57 | + //let's prepare extra stats |
|
58 | + $extra_stats = array(); |
|
59 | + |
|
60 | + //only collect extra stats if the plugin user has opted in and transient is expired. |
|
61 | + if (! empty($espresso_data_optin) && $espresso_data_optin == 'yes') { |
|
62 | + if (false === ($transient = get_transient('ee_extra_data')) |
|
63 | + && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance |
|
64 | + ) { |
|
65 | + |
|
66 | + $current_site = is_multisite() ? get_current_site() : null; |
|
67 | + $site_pre = ! is_main_site() && ! empty($current_site) |
|
68 | + ? trim( |
|
69 | + preg_replace('/\b\w\S\w\b/', '', $current_site->domain), |
|
70 | + '.' |
|
71 | + ) . '_' |
|
72 | + : ''; |
|
73 | + |
|
74 | + |
|
75 | + //active gateways |
|
76 | + $active_gateways = get_option('event_espresso_active_gateways'); |
|
77 | + if (! empty($active_gateways)) { |
|
78 | + foreach ((array)$active_gateways as $gateway => $ignore) { |
|
79 | + $extra_stats[$site_pre . $gateway . '_gateway_active'] = 1; |
|
80 | + } |
|
81 | + } |
|
82 | + |
|
83 | + if (is_multisite() && is_main_site()) { |
|
84 | + $extra_stats['is_multisite'] = true; |
|
85 | + } |
|
86 | + |
|
87 | + //what is the current active theme? |
|
88 | + $active_theme = get_option('uxip_ee_active_theme'); |
|
89 | + if (! empty($active_theme)) { |
|
90 | + $extra_stats[$site_pre . 'active_theme'] = $active_theme; |
|
91 | + } |
|
92 | + |
|
93 | + //event info regarding an all event count and all "active" event count |
|
94 | + $all_events_count = get_option('uxip_ee4_all_events_count'); |
|
95 | + if (! empty($all_events_count)) { |
|
96 | + $extra_stats[$site_pre . 'ee4_all_events_count'] = $all_events_count; |
|
97 | + } |
|
98 | + $active_events_count = get_option('uxip_ee4_active_events_count'); |
|
99 | + if (! empty($active_events_count)) { |
|
100 | + $extra_stats[$site_pre . 'ee4_active_events_count'] = $active_events_count; |
|
101 | + } |
|
102 | + |
|
103 | + //datetime stuff |
|
104 | + $dtt_count = get_option('uxip_ee_all_dtts_count'); |
|
105 | + if (! empty($dtt_count)) { |
|
106 | + $extra_stats[$site_pre . 'all_dtts_count'] = $dtt_count; |
|
107 | + } |
|
108 | + |
|
109 | + $dtt_sold = get_option('uxip_ee_dtt_sold'); |
|
110 | + if (! empty($dtt_sold)) { |
|
111 | + $extra_stats[$site_pre . 'dtt_sold'] = $dtt_sold; |
|
112 | + } |
|
113 | + |
|
114 | + //ticket stuff |
|
115 | + $all_tkt_count = get_option('uxip_ee_all_tkt_count'); |
|
116 | + if (! empty($all_tkt_count)) { |
|
117 | + $extra_stats[$site_pre . 'all_tkt_count'] = $all_tkt_count; |
|
118 | + } |
|
119 | + |
|
120 | + $free_tkt_count = get_option('uxip_ee_free_tkt_count'); |
|
121 | + if (! empty($free_tkt_count)) { |
|
122 | + $extra_stats[$site_pre . 'free_tkt_count'] = $free_tkt_count; |
|
123 | + } |
|
124 | + |
|
125 | + $paid_tkt_count = get_option('uxip_ee_paid_tkt_count'); |
|
126 | + if (! empty($paid_tkt_count)) { |
|
127 | + $extra_stats[$site_pre . 'paid_tkt_count'] = $paid_tkt_count; |
|
128 | + } |
|
129 | + |
|
130 | + $tkt_sold = get_option('uxip_ee_tkt_sold'); |
|
131 | + if (! empty($tkt_sold)) { |
|
132 | + $extra_stats[$site_pre . 'tkt_sold'] = $tkt_sold; |
|
133 | + } |
|
134 | + |
|
135 | + //phpversion checking |
|
136 | + $extra_stats['phpversion'] = function_exists('phpversion') ? phpversion() : 'unknown'; |
|
137 | + |
|
138 | + //set transient |
|
139 | + set_transient('ee_extra_data', $extra_stats, WEEK_IN_SECONDS); |
|
140 | + } |
|
141 | + } |
|
142 | + |
|
143 | + |
|
144 | + // PUE Auto Upgrades stuff |
|
145 | + if (is_readable(EE_THIRD_PARTY . 'pue/pue-client.php')) { //include the file |
|
146 | + require_once(EE_THIRD_PARTY . 'pue/pue-client.php'); |
|
147 | + |
|
148 | + $api_key = isset(EE_Registry::instance()->NET_CFG->core->site_license_key) |
|
149 | + ? EE_Registry::instance()->NET_CFG->core->site_license_key |
|
150 | + : ''; |
|
151 | + //this needs to be the host server where plugin update engine is installed. Note, if you leave this blank |
|
152 | + // then it is assumed the WordPress repo will be used and we'll just check there. |
|
153 | + $host_server_url = 'https://eventespresso.com'; |
|
154 | + |
|
155 | + //Note: PUE uses a simple preg_match to determine what type is currently installed based on version number. |
|
156 | + // So it's important that you use a key for the version type that is unique and not found in another key. |
|
157 | + //For example: |
|
158 | + //$plugin_slug['premium']['p'] = 'some-premium-slug'; |
|
159 | + //$plugin_slug['prerelease']['pr'] = 'some-pre-release-slug'; |
|
160 | + //The above would not work because "p" is found in both keys for the version type. ( i.e 1.0.p vs 1.0.pr ) |
|
161 | + // so doing something like: |
|
162 | + //$plugin_slug['premium']['p'] = 'some-premium-slug'; |
|
163 | + //$plugin_slug['prerelease']['b'] = 'some-pre-release-slug'; |
|
164 | + //..WOULD work! |
|
165 | + $plugin_slug = array( |
|
166 | + 'free' => array('decaf' => 'event-espresso-core-decaf'), |
|
167 | + 'premium' => array('p' => 'event-espresso-core-reg'), |
|
168 | + 'prerelease' => array('beta' => 'event-espresso-core-pr'), |
|
169 | + ); |
|
170 | + |
|
171 | + |
|
172 | + //$options needs to be an array with the included keys as listed. |
|
173 | + $options = array( |
|
174 | + // 'optionName' => '', //(optional) - used as the reference for saving update information in the |
|
175 | + // clients options table. Will be automatically set if left blank. |
|
176 | + 'apikey' => $api_key, |
|
177 | + //(required), you will need to obtain the apikey that the client gets from your site and |
|
178 | + // then saves in their sites options table (see 'getting an api-key' below) |
|
179 | + 'lang_domain' => 'event_espresso', |
|
180 | + //(optional) - put here whatever reference you are using for the localization of your plugin (if it's |
|
181 | + // localized). That way strings in this file will be included in the translation for your plugin. |
|
182 | + 'checkPeriod' => '24', |
|
183 | + //(optional) - use this parameter to indicate how often you want the client's install to ping your |
|
184 | + // server for update checks. The integer indicates hours. If you don't include this parameter it will |
|
185 | + // default to 12 hours. |
|
186 | + 'option_key' => 'site_license_key', |
|
187 | + //this is what is used to reference the api_key in your plugin options. PUE uses this to trigger |
|
188 | + // updating your information message whenever this option_key is modified. |
|
189 | + 'options_page_slug' => 'espresso_general_settings', |
|
190 | + 'plugin_basename' => EE_PLUGIN_BASENAME, |
|
191 | + 'use_wp_update' => true, |
|
192 | + //if TRUE then you want FREE versions of the plugin to be updated from WP |
|
193 | + 'extra_stats' => $extra_stats, |
|
194 | + 'turn_on_notices_saved' => true, |
|
195 | + ); |
|
196 | + //initiate the class and start the plugin update engine! |
|
197 | + new PluginUpdateEngineChecker($host_server_url, $plugin_slug, $options); |
|
198 | + } |
|
199 | + } |
|
200 | + |
|
201 | + |
|
202 | + /** |
|
203 | + * The purpose of this function is to display information about Event Espresso data collection |
|
204 | + * and a optin selection for extra data collecting by users. |
|
205 | + * |
|
206 | + * @param bool $extra |
|
207 | + * @return string html. |
|
208 | + */ |
|
209 | + public static function espresso_data_collection_optin_text($extra = true) |
|
210 | + { |
|
211 | + if (! $extra) { |
|
212 | + echo '<h2 class="ee-admin-settings-hdr" ' |
|
213 | + . (! $extra ? 'id="UXIP_settings"' : '') |
|
214 | + . '>' |
|
215 | + . esc_html__('User eXperience Improvement Program (UXIP)', 'event_espresso') |
|
216 | + . EEH_Template::get_help_tab_link('organization_logo_info') |
|
217 | + . '</h2>'; |
|
218 | + printf( |
|
219 | + esc_html__( |
|
220 | + '%sPlease help us make Event Espresso better and vote for your favorite features.%s The %sUser eXperience Improvement Program (UXIP)%s, has been created so when you use Event Espresso you are voting for the features and settings that are important to you. The UXIP helps us understand how you use our products and services, track problems and in what context. If you opt-out of the UXIP you essentially elect for us to disregard how you use Event Espresso as we build new features and make changes. Participation in the program is completely voluntary but it is enabled by default. The end results of the UXIP are software improvements to better meet your needs. The data we collect will never be sold, traded, or misused in any way. %sPlease see our %sPrivacy Policy%s for more information.', |
|
221 | + 'event_espresso' |
|
222 | + ), |
|
223 | + '<p><em>', |
|
224 | + '</em></p>', |
|
225 | + '<a href="https://eventespresso.com/about/user-experience-improvement-program-uxip/" target="_blank">', |
|
226 | + '</a>', |
|
227 | + '<br><br>', |
|
228 | + '<a href="https://eventespresso.com/about/privacy-policy/" target="_blank">', |
|
229 | + '</a>' |
|
230 | + ); |
|
231 | + } else { |
|
232 | + $settings_url = EE_Admin_Page::add_query_args_and_nonce( |
|
233 | + array('action' => 'default'), |
|
234 | + admin_url('admin.php?page=espresso_general_settings') |
|
235 | + ); |
|
236 | + $settings_url .= '#UXIP_settings'; |
|
237 | + printf( |
|
238 | + esc_html__( |
|
239 | + 'The Event Espresso UXIP feature is active on your site. For %smore info%s and to opt-out %sclick here%s.', |
|
240 | + 'event_espresso' |
|
241 | + ), |
|
242 | + '<a href="https://eventespresso.com/about/user-experience-improvement-program-uxip/" target="_blank">', |
|
243 | + '</a>', |
|
244 | + '<a href="' . $settings_url . '" target="_blank">', |
|
245 | + '</a>' |
|
246 | + ); |
|
247 | + } |
|
248 | + } |
|
249 | + |
|
250 | + |
|
251 | + public function espresso_data_collection_optin_notice() |
|
252 | + { |
|
253 | + $ueip_has_notified = EE_Registry::instance()->CFG->core->ee_ueip_has_notified; |
|
254 | + if ($ueip_has_notified) { |
|
255 | + return; |
|
256 | + } |
|
257 | + // $settings_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default'), |
|
258 | + // admin_url( 'admin.php?page=espresso_general_settings') ); |
|
259 | + // $settings_url = $settings_url . '#UXIP_settings'; |
|
260 | + ?> |
|
261 | 261 | <div class="updated data-collect-optin" id="espresso-data-collect-optin-container"> |
262 | 262 | <div id="data-collect-optin-options-container"> |
263 | 263 | <span class="dashicons dashicons-admin-site"></span> |
@@ -270,186 +270,186 @@ discard block |
||
270 | 270 | </div> |
271 | 271 | </div> |
272 | 272 | <?php |
273 | - } |
|
274 | - |
|
275 | - |
|
276 | - /** |
|
277 | - * enqueue scripts/styles needed for data collection optin |
|
278 | - * |
|
279 | - * @return void |
|
280 | - */ |
|
281 | - public function espresso_data_collection_enqueue_scripts() |
|
282 | - { |
|
283 | - wp_register_script( |
|
284 | - 'ee-data-optin-js', |
|
285 | - EE_GLOBAL_ASSETS_URL . 'scripts/ee-data-optin.js', |
|
286 | - array('jquery'), |
|
287 | - EVENT_ESPRESSO_VERSION, |
|
288 | - true |
|
289 | - ); |
|
290 | - wp_register_style( |
|
291 | - 'ee-data-optin-css', |
|
292 | - EE_GLOBAL_ASSETS_URL . 'css/ee-data-optin.css', |
|
293 | - array(), |
|
294 | - EVENT_ESPRESSO_VERSION |
|
295 | - ); |
|
296 | - |
|
297 | - wp_enqueue_script('ee-data-optin-js'); |
|
298 | - wp_enqueue_style('ee-data-optin-css'); |
|
299 | - } |
|
300 | - |
|
301 | - |
|
302 | - /** |
|
303 | - * This just handles the setting of the selected option for data optin via ajax |
|
304 | - * |
|
305 | - * @return void |
|
306 | - * @throws InvalidArgumentException |
|
307 | - * @throws InvalidDataTypeException |
|
308 | - * @throws InvalidInterfaceException |
|
309 | - */ |
|
310 | - public function espresso_data_optin_ajax_handler() |
|
311 | - { |
|
312 | - |
|
313 | - //verify nonce |
|
314 | - if (isset($_POST['nonce']) && ! wp_verify_nonce($_POST['nonce'], 'ee-data-optin')) { |
|
315 | - exit(); |
|
316 | - } |
|
317 | - |
|
318 | - //update_option('ee_ueip_optin', $ueip_optin); |
|
319 | - EE_Registry::instance()->CFG->core->ee_ueip_has_notified = 1; |
|
320 | - EE_Registry::instance()->CFG->update_espresso_config(false, false); |
|
321 | - exit(); |
|
322 | - } |
|
323 | - |
|
324 | - |
|
325 | - /** |
|
326 | - * This is a handy helper method for retrieving whether there is an update available for the given plugin. |
|
327 | - * |
|
328 | - * @param string $basename Use the equivalent result from plugin_basename() for this param as WP uses that to |
|
329 | - * identify plugins. Defaults to core update |
|
330 | - * @return boolean True if update available, false if not. |
|
331 | - */ |
|
332 | - public static function is_update_available($basename = '') |
|
333 | - { |
|
334 | - |
|
335 | - $basename = ! empty($basename) ? $basename : EE_PLUGIN_BASENAME; |
|
336 | - |
|
337 | - $update = false; |
|
338 | - |
|
339 | - // should take "event-espresso-core/espresso.php" and change to "/event-espresso-core" |
|
340 | - $folder = DS . dirname($basename); |
|
341 | - |
|
342 | - $plugins = get_plugins($folder); |
|
343 | - $current = get_site_transient('update_plugins'); |
|
344 | - |
|
345 | - foreach ((array)$plugins as $plugin_file => $plugin_data) { |
|
346 | - if (isset($current->response['plugin_file'])) { |
|
347 | - $update = true; |
|
348 | - } |
|
349 | - } |
|
350 | - |
|
351 | - //it's possible that there is an update but an invalid site-license-key is in use |
|
352 | - if (get_site_option('pue_json_error_' . $basename)) { |
|
353 | - $update = true; |
|
354 | - } |
|
355 | - |
|
356 | - return $update; |
|
357 | - } |
|
358 | - |
|
359 | - |
|
360 | - /** |
|
361 | - * UXIP TRACKING ******* |
|
362 | - */ |
|
363 | - |
|
364 | - |
|
365 | - /** |
|
366 | - * This method contains all the hooks into EE for gathering stats that will be reported with the PUE uxip system |
|
367 | - * |
|
368 | - * @public |
|
369 | - * @return void |
|
370 | - */ |
|
371 | - public function _uxip_hooks() |
|
372 | - { |
|
373 | - if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
374 | - add_action('admin_init', array($this, 'track_active_theme')); |
|
375 | - add_action('admin_init', array($this, 'track_event_info')); |
|
376 | - } |
|
377 | - } |
|
378 | - |
|
379 | - |
|
380 | - public function track_active_theme() |
|
381 | - { |
|
382 | - //we only check this once a month. |
|
383 | - if (false === ($transient = get_transient('ee_active_theme_check'))) { |
|
384 | - $theme = wp_get_theme(); |
|
385 | - update_option('uxip_ee_active_theme', $theme->get('Name')); |
|
386 | - set_transient('ee_active_theme_check', 1, MONTH_IN_SECONDS); |
|
387 | - } |
|
388 | - } |
|
389 | - |
|
390 | - |
|
391 | - public function track_event_info() |
|
392 | - { |
|
393 | - //we only check this once every couple weeks. |
|
394 | - if (false === ($transient = get_transient('ee4_event_info_check'))) { |
|
395 | - //first let's get the number for ALL events |
|
396 | - /** @var EEM_Event $EVT */ |
|
397 | - $EVT = EE_Registry::instance()->load_model('Event'); |
|
398 | - $DTT = EE_Registry::instance()->load_model('Datetime'); |
|
399 | - $TKT = EE_Registry::instance()->load_model('Ticket'); |
|
400 | - $count = $EVT->count(); |
|
401 | - if ($count > 0) { |
|
402 | - update_option('uxip_ee4_all_events_count', $count); |
|
403 | - } |
|
404 | - |
|
405 | - //next let's just get the number of ACTIVE events |
|
406 | - $count_active = $EVT->get_active_events(array(), true); |
|
407 | - if ($count_active > 0) { |
|
408 | - update_option('uxip_ee4_active_events_count', $count_active); |
|
409 | - } |
|
410 | - |
|
411 | - //datetimes! |
|
412 | - $dtt_count = $DTT->count(); |
|
413 | - if ($dtt_count > 0) { |
|
414 | - update_option('uxip_ee_all_dtts_count', $dtt_count); |
|
415 | - } |
|
416 | - |
|
417 | - |
|
418 | - //dttsold |
|
419 | - $dtt_sold = $DTT->sum(array(), 'DTT_sold'); |
|
420 | - if ($dtt_sold > 0) { |
|
421 | - update_option('uxip_ee_dtt_sold', $dtt_sold); |
|
422 | - } |
|
423 | - |
|
424 | - //allticketcount |
|
425 | - $all_tkt_count = $TKT->count(); |
|
426 | - if ($all_tkt_count > 0) { |
|
427 | - update_option('uxip_ee_all_tkt_count', $all_tkt_count); |
|
428 | - } |
|
429 | - |
|
430 | - //freetktcount |
|
431 | - $_where = array('TKT_price' => 0); |
|
432 | - $free_tkt_count = $TKT->count(array($_where)); |
|
433 | - if ($free_tkt_count > 0) { |
|
434 | - update_option('uxip_ee_free_tkt_count', $free_tkt_count); |
|
435 | - } |
|
436 | - |
|
437 | - //paidtktcount |
|
438 | - $_where = array('TKT_price' => array('>', 0)); |
|
439 | - $paid_tkt_count = $TKT->count(array($_where)); |
|
440 | - if ($paid_tkt_count > 0) { |
|
441 | - update_option('uxip_ee_paid_tkt_count', $paid_tkt_count); |
|
442 | - } |
|
443 | - |
|
444 | - //tktsold |
|
445 | - $tkt_sold = $TKT->sum(array(), 'TKT_sold'); |
|
446 | - if ($tkt_sold > 0) { |
|
447 | - update_option('uxip_ee_tkt_sold', $tkt_sold); |
|
448 | - } |
|
449 | - |
|
450 | - |
|
451 | - set_transient('ee4_event_info_check', 1, WEEK_IN_SECONDS * 2); |
|
452 | - } |
|
453 | - } |
|
273 | + } |
|
274 | + |
|
275 | + |
|
276 | + /** |
|
277 | + * enqueue scripts/styles needed for data collection optin |
|
278 | + * |
|
279 | + * @return void |
|
280 | + */ |
|
281 | + public function espresso_data_collection_enqueue_scripts() |
|
282 | + { |
|
283 | + wp_register_script( |
|
284 | + 'ee-data-optin-js', |
|
285 | + EE_GLOBAL_ASSETS_URL . 'scripts/ee-data-optin.js', |
|
286 | + array('jquery'), |
|
287 | + EVENT_ESPRESSO_VERSION, |
|
288 | + true |
|
289 | + ); |
|
290 | + wp_register_style( |
|
291 | + 'ee-data-optin-css', |
|
292 | + EE_GLOBAL_ASSETS_URL . 'css/ee-data-optin.css', |
|
293 | + array(), |
|
294 | + EVENT_ESPRESSO_VERSION |
|
295 | + ); |
|
296 | + |
|
297 | + wp_enqueue_script('ee-data-optin-js'); |
|
298 | + wp_enqueue_style('ee-data-optin-css'); |
|
299 | + } |
|
300 | + |
|
301 | + |
|
302 | + /** |
|
303 | + * This just handles the setting of the selected option for data optin via ajax |
|
304 | + * |
|
305 | + * @return void |
|
306 | + * @throws InvalidArgumentException |
|
307 | + * @throws InvalidDataTypeException |
|
308 | + * @throws InvalidInterfaceException |
|
309 | + */ |
|
310 | + public function espresso_data_optin_ajax_handler() |
|
311 | + { |
|
312 | + |
|
313 | + //verify nonce |
|
314 | + if (isset($_POST['nonce']) && ! wp_verify_nonce($_POST['nonce'], 'ee-data-optin')) { |
|
315 | + exit(); |
|
316 | + } |
|
317 | + |
|
318 | + //update_option('ee_ueip_optin', $ueip_optin); |
|
319 | + EE_Registry::instance()->CFG->core->ee_ueip_has_notified = 1; |
|
320 | + EE_Registry::instance()->CFG->update_espresso_config(false, false); |
|
321 | + exit(); |
|
322 | + } |
|
323 | + |
|
324 | + |
|
325 | + /** |
|
326 | + * This is a handy helper method for retrieving whether there is an update available for the given plugin. |
|
327 | + * |
|
328 | + * @param string $basename Use the equivalent result from plugin_basename() for this param as WP uses that to |
|
329 | + * identify plugins. Defaults to core update |
|
330 | + * @return boolean True if update available, false if not. |
|
331 | + */ |
|
332 | + public static function is_update_available($basename = '') |
|
333 | + { |
|
334 | + |
|
335 | + $basename = ! empty($basename) ? $basename : EE_PLUGIN_BASENAME; |
|
336 | + |
|
337 | + $update = false; |
|
338 | + |
|
339 | + // should take "event-espresso-core/espresso.php" and change to "/event-espresso-core" |
|
340 | + $folder = DS . dirname($basename); |
|
341 | + |
|
342 | + $plugins = get_plugins($folder); |
|
343 | + $current = get_site_transient('update_plugins'); |
|
344 | + |
|
345 | + foreach ((array)$plugins as $plugin_file => $plugin_data) { |
|
346 | + if (isset($current->response['plugin_file'])) { |
|
347 | + $update = true; |
|
348 | + } |
|
349 | + } |
|
350 | + |
|
351 | + //it's possible that there is an update but an invalid site-license-key is in use |
|
352 | + if (get_site_option('pue_json_error_' . $basename)) { |
|
353 | + $update = true; |
|
354 | + } |
|
355 | + |
|
356 | + return $update; |
|
357 | + } |
|
358 | + |
|
359 | + |
|
360 | + /** |
|
361 | + * UXIP TRACKING ******* |
|
362 | + */ |
|
363 | + |
|
364 | + |
|
365 | + /** |
|
366 | + * This method contains all the hooks into EE for gathering stats that will be reported with the PUE uxip system |
|
367 | + * |
|
368 | + * @public |
|
369 | + * @return void |
|
370 | + */ |
|
371 | + public function _uxip_hooks() |
|
372 | + { |
|
373 | + if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
374 | + add_action('admin_init', array($this, 'track_active_theme')); |
|
375 | + add_action('admin_init', array($this, 'track_event_info')); |
|
376 | + } |
|
377 | + } |
|
378 | + |
|
379 | + |
|
380 | + public function track_active_theme() |
|
381 | + { |
|
382 | + //we only check this once a month. |
|
383 | + if (false === ($transient = get_transient('ee_active_theme_check'))) { |
|
384 | + $theme = wp_get_theme(); |
|
385 | + update_option('uxip_ee_active_theme', $theme->get('Name')); |
|
386 | + set_transient('ee_active_theme_check', 1, MONTH_IN_SECONDS); |
|
387 | + } |
|
388 | + } |
|
389 | + |
|
390 | + |
|
391 | + public function track_event_info() |
|
392 | + { |
|
393 | + //we only check this once every couple weeks. |
|
394 | + if (false === ($transient = get_transient('ee4_event_info_check'))) { |
|
395 | + //first let's get the number for ALL events |
|
396 | + /** @var EEM_Event $EVT */ |
|
397 | + $EVT = EE_Registry::instance()->load_model('Event'); |
|
398 | + $DTT = EE_Registry::instance()->load_model('Datetime'); |
|
399 | + $TKT = EE_Registry::instance()->load_model('Ticket'); |
|
400 | + $count = $EVT->count(); |
|
401 | + if ($count > 0) { |
|
402 | + update_option('uxip_ee4_all_events_count', $count); |
|
403 | + } |
|
404 | + |
|
405 | + //next let's just get the number of ACTIVE events |
|
406 | + $count_active = $EVT->get_active_events(array(), true); |
|
407 | + if ($count_active > 0) { |
|
408 | + update_option('uxip_ee4_active_events_count', $count_active); |
|
409 | + } |
|
410 | + |
|
411 | + //datetimes! |
|
412 | + $dtt_count = $DTT->count(); |
|
413 | + if ($dtt_count > 0) { |
|
414 | + update_option('uxip_ee_all_dtts_count', $dtt_count); |
|
415 | + } |
|
416 | + |
|
417 | + |
|
418 | + //dttsold |
|
419 | + $dtt_sold = $DTT->sum(array(), 'DTT_sold'); |
|
420 | + if ($dtt_sold > 0) { |
|
421 | + update_option('uxip_ee_dtt_sold', $dtt_sold); |
|
422 | + } |
|
423 | + |
|
424 | + //allticketcount |
|
425 | + $all_tkt_count = $TKT->count(); |
|
426 | + if ($all_tkt_count > 0) { |
|
427 | + update_option('uxip_ee_all_tkt_count', $all_tkt_count); |
|
428 | + } |
|
429 | + |
|
430 | + //freetktcount |
|
431 | + $_where = array('TKT_price' => 0); |
|
432 | + $free_tkt_count = $TKT->count(array($_where)); |
|
433 | + if ($free_tkt_count > 0) { |
|
434 | + update_option('uxip_ee_free_tkt_count', $free_tkt_count); |
|
435 | + } |
|
436 | + |
|
437 | + //paidtktcount |
|
438 | + $_where = array('TKT_price' => array('>', 0)); |
|
439 | + $paid_tkt_count = $TKT->count(array($_where)); |
|
440 | + if ($paid_tkt_count > 0) { |
|
441 | + update_option('uxip_ee_paid_tkt_count', $paid_tkt_count); |
|
442 | + } |
|
443 | + |
|
444 | + //tktsold |
|
445 | + $tkt_sold = $TKT->sum(array(), 'TKT_sold'); |
|
446 | + if ($tkt_sold > 0) { |
|
447 | + update_option('uxip_ee_tkt_sold', $tkt_sold); |
|
448 | + } |
|
449 | + |
|
450 | + |
|
451 | + set_transient('ee4_event_info_check', 1, WEEK_IN_SECONDS * 2); |
|
452 | + } |
|
453 | + } |
|
454 | 454 | |
455 | 455 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | do_action('AHEE_log', __CLASS__, __FUNCTION__); |
30 | 30 | |
31 | 31 | //wp have no MONTH_IN_SECONDS constant. So we approximate our own assuming all months are 4 weeks long. |
32 | - if (! defined('MONTH_IN_SECONDS')) { |
|
32 | + if ( ! defined('MONTH_IN_SECONDS')) { |
|
33 | 33 | define('MONTH_IN_SECONDS', WEEK_IN_SECONDS * 4); |
34 | 34 | } |
35 | 35 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $extra_stats = array(); |
59 | 59 | |
60 | 60 | //only collect extra stats if the plugin user has opted in and transient is expired. |
61 | - if (! empty($espresso_data_optin) && $espresso_data_optin == 'yes') { |
|
61 | + if ( ! empty($espresso_data_optin) && $espresso_data_optin == 'yes') { |
|
62 | 62 | if (false === ($transient = get_transient('ee_extra_data')) |
63 | 63 | && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance |
64 | 64 | ) { |
@@ -68,15 +68,15 @@ discard block |
||
68 | 68 | ? trim( |
69 | 69 | preg_replace('/\b\w\S\w\b/', '', $current_site->domain), |
70 | 70 | '.' |
71 | - ) . '_' |
|
71 | + ).'_' |
|
72 | 72 | : ''; |
73 | 73 | |
74 | 74 | |
75 | 75 | //active gateways |
76 | 76 | $active_gateways = get_option('event_espresso_active_gateways'); |
77 | - if (! empty($active_gateways)) { |
|
78 | - foreach ((array)$active_gateways as $gateway => $ignore) { |
|
79 | - $extra_stats[$site_pre . $gateway . '_gateway_active'] = 1; |
|
77 | + if ( ! empty($active_gateways)) { |
|
78 | + foreach ((array) $active_gateways as $gateway => $ignore) { |
|
79 | + $extra_stats[$site_pre.$gateway.'_gateway_active'] = 1; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
@@ -86,50 +86,50 @@ discard block |
||
86 | 86 | |
87 | 87 | //what is the current active theme? |
88 | 88 | $active_theme = get_option('uxip_ee_active_theme'); |
89 | - if (! empty($active_theme)) { |
|
90 | - $extra_stats[$site_pre . 'active_theme'] = $active_theme; |
|
89 | + if ( ! empty($active_theme)) { |
|
90 | + $extra_stats[$site_pre.'active_theme'] = $active_theme; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | //event info regarding an all event count and all "active" event count |
94 | 94 | $all_events_count = get_option('uxip_ee4_all_events_count'); |
95 | - if (! empty($all_events_count)) { |
|
96 | - $extra_stats[$site_pre . 'ee4_all_events_count'] = $all_events_count; |
|
95 | + if ( ! empty($all_events_count)) { |
|
96 | + $extra_stats[$site_pre.'ee4_all_events_count'] = $all_events_count; |
|
97 | 97 | } |
98 | 98 | $active_events_count = get_option('uxip_ee4_active_events_count'); |
99 | - if (! empty($active_events_count)) { |
|
100 | - $extra_stats[$site_pre . 'ee4_active_events_count'] = $active_events_count; |
|
99 | + if ( ! empty($active_events_count)) { |
|
100 | + $extra_stats[$site_pre.'ee4_active_events_count'] = $active_events_count; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | //datetime stuff |
104 | 104 | $dtt_count = get_option('uxip_ee_all_dtts_count'); |
105 | - if (! empty($dtt_count)) { |
|
106 | - $extra_stats[$site_pre . 'all_dtts_count'] = $dtt_count; |
|
105 | + if ( ! empty($dtt_count)) { |
|
106 | + $extra_stats[$site_pre.'all_dtts_count'] = $dtt_count; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | $dtt_sold = get_option('uxip_ee_dtt_sold'); |
110 | - if (! empty($dtt_sold)) { |
|
111 | - $extra_stats[$site_pre . 'dtt_sold'] = $dtt_sold; |
|
110 | + if ( ! empty($dtt_sold)) { |
|
111 | + $extra_stats[$site_pre.'dtt_sold'] = $dtt_sold; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | //ticket stuff |
115 | 115 | $all_tkt_count = get_option('uxip_ee_all_tkt_count'); |
116 | - if (! empty($all_tkt_count)) { |
|
117 | - $extra_stats[$site_pre . 'all_tkt_count'] = $all_tkt_count; |
|
116 | + if ( ! empty($all_tkt_count)) { |
|
117 | + $extra_stats[$site_pre.'all_tkt_count'] = $all_tkt_count; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | $free_tkt_count = get_option('uxip_ee_free_tkt_count'); |
121 | - if (! empty($free_tkt_count)) { |
|
122 | - $extra_stats[$site_pre . 'free_tkt_count'] = $free_tkt_count; |
|
121 | + if ( ! empty($free_tkt_count)) { |
|
122 | + $extra_stats[$site_pre.'free_tkt_count'] = $free_tkt_count; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | $paid_tkt_count = get_option('uxip_ee_paid_tkt_count'); |
126 | - if (! empty($paid_tkt_count)) { |
|
127 | - $extra_stats[$site_pre . 'paid_tkt_count'] = $paid_tkt_count; |
|
126 | + if ( ! empty($paid_tkt_count)) { |
|
127 | + $extra_stats[$site_pre.'paid_tkt_count'] = $paid_tkt_count; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | $tkt_sold = get_option('uxip_ee_tkt_sold'); |
131 | - if (! empty($tkt_sold)) { |
|
132 | - $extra_stats[$site_pre . 'tkt_sold'] = $tkt_sold; |
|
131 | + if ( ! empty($tkt_sold)) { |
|
132 | + $extra_stats[$site_pre.'tkt_sold'] = $tkt_sold; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | //phpversion checking |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | |
143 | 143 | |
144 | 144 | // PUE Auto Upgrades stuff |
145 | - if (is_readable(EE_THIRD_PARTY . 'pue/pue-client.php')) { //include the file |
|
146 | - require_once(EE_THIRD_PARTY . 'pue/pue-client.php'); |
|
145 | + if (is_readable(EE_THIRD_PARTY.'pue/pue-client.php')) { //include the file |
|
146 | + require_once(EE_THIRD_PARTY.'pue/pue-client.php'); |
|
147 | 147 | |
148 | - $api_key = isset(EE_Registry::instance()->NET_CFG->core->site_license_key) |
|
148 | + $api_key = isset(EE_Registry::instance()->NET_CFG->core->site_license_key) |
|
149 | 149 | ? EE_Registry::instance()->NET_CFG->core->site_license_key |
150 | 150 | : ''; |
151 | 151 | //this needs to be the host server where plugin update engine is installed. Note, if you leave this blank |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | */ |
209 | 209 | public static function espresso_data_collection_optin_text($extra = true) |
210 | 210 | { |
211 | - if (! $extra) { |
|
211 | + if ( ! $extra) { |
|
212 | 212 | echo '<h2 class="ee-admin-settings-hdr" ' |
213 | - . (! $extra ? 'id="UXIP_settings"' : '') |
|
213 | + . ( ! $extra ? 'id="UXIP_settings"' : '') |
|
214 | 214 | . '>' |
215 | 215 | . esc_html__('User eXperience Improvement Program (UXIP)', 'event_espresso') |
216 | 216 | . EEH_Template::get_help_tab_link('organization_logo_info') |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | ), |
242 | 242 | '<a href="https://eventespresso.com/about/user-experience-improvement-program-uxip/" target="_blank">', |
243 | 243 | '</a>', |
244 | - '<a href="' . $settings_url . '" target="_blank">', |
|
244 | + '<a href="'.$settings_url.'" target="_blank">', |
|
245 | 245 | '</a>' |
246 | 246 | ); |
247 | 247 | } |
@@ -282,14 +282,14 @@ discard block |
||
282 | 282 | { |
283 | 283 | wp_register_script( |
284 | 284 | 'ee-data-optin-js', |
285 | - EE_GLOBAL_ASSETS_URL . 'scripts/ee-data-optin.js', |
|
285 | + EE_GLOBAL_ASSETS_URL.'scripts/ee-data-optin.js', |
|
286 | 286 | array('jquery'), |
287 | 287 | EVENT_ESPRESSO_VERSION, |
288 | 288 | true |
289 | 289 | ); |
290 | 290 | wp_register_style( |
291 | 291 | 'ee-data-optin-css', |
292 | - EE_GLOBAL_ASSETS_URL . 'css/ee-data-optin.css', |
|
292 | + EE_GLOBAL_ASSETS_URL.'css/ee-data-optin.css', |
|
293 | 293 | array(), |
294 | 294 | EVENT_ESPRESSO_VERSION |
295 | 295 | ); |
@@ -337,19 +337,19 @@ discard block |
||
337 | 337 | $update = false; |
338 | 338 | |
339 | 339 | // should take "event-espresso-core/espresso.php" and change to "/event-espresso-core" |
340 | - $folder = DS . dirname($basename); |
|
340 | + $folder = DS.dirname($basename); |
|
341 | 341 | |
342 | 342 | $plugins = get_plugins($folder); |
343 | 343 | $current = get_site_transient('update_plugins'); |
344 | 344 | |
345 | - foreach ((array)$plugins as $plugin_file => $plugin_data) { |
|
345 | + foreach ((array) $plugins as $plugin_file => $plugin_data) { |
|
346 | 346 | if (isset($current->response['plugin_file'])) { |
347 | 347 | $update = true; |
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
351 | 351 | //it's possible that there is an update but an invalid site-license-key is in use |
352 | - if (get_site_option('pue_json_error_' . $basename)) { |
|
352 | + if (get_site_option('pue_json_error_'.$basename)) { |
|
353 | 353 | $update = true; |
354 | 354 | } |
355 | 355 |
@@ -38,217 +38,217 @@ |
||
38 | 38 | * @since 4.0 |
39 | 39 | */ |
40 | 40 | if (function_exists('espresso_version')) { |
41 | - if (! function_exists('espresso_duplicate_plugin_error')) { |
|
42 | - /** |
|
43 | - * espresso_duplicate_plugin_error |
|
44 | - * displays if more than one version of EE is activated at the same time |
|
45 | - */ |
|
46 | - function espresso_duplicate_plugin_error() |
|
47 | - { |
|
48 | - ?> |
|
41 | + if (! function_exists('espresso_duplicate_plugin_error')) { |
|
42 | + /** |
|
43 | + * espresso_duplicate_plugin_error |
|
44 | + * displays if more than one version of EE is activated at the same time |
|
45 | + */ |
|
46 | + function espresso_duplicate_plugin_error() |
|
47 | + { |
|
48 | + ?> |
|
49 | 49 | <div class="error"> |
50 | 50 | <p> |
51 | 51 | <?php |
52 | - echo esc_html__( |
|
53 | - 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
54 | - 'event_espresso' |
|
55 | - ); ?> |
|
52 | + echo esc_html__( |
|
53 | + 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
54 | + 'event_espresso' |
|
55 | + ); ?> |
|
56 | 56 | </p> |
57 | 57 | </div> |
58 | 58 | <?php |
59 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | - } |
|
61 | - } |
|
62 | - add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
59 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | + } |
|
61 | + } |
|
62 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
63 | 63 | |
64 | 64 | } else { |
65 | - define('EE_MIN_PHP_VER_REQUIRED', '5.3.9'); |
|
66 | - if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
67 | - /** |
|
68 | - * espresso_minimum_php_version_error |
|
69 | - * |
|
70 | - * @return void |
|
71 | - */ |
|
72 | - function espresso_minimum_php_version_error() |
|
73 | - { |
|
74 | - ?> |
|
65 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.9'); |
|
66 | + if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
67 | + /** |
|
68 | + * espresso_minimum_php_version_error |
|
69 | + * |
|
70 | + * @return void |
|
71 | + */ |
|
72 | + function espresso_minimum_php_version_error() |
|
73 | + { |
|
74 | + ?> |
|
75 | 75 | <div class="error"> |
76 | 76 | <p> |
77 | 77 | <?php |
78 | - printf( |
|
79 | - esc_html__( |
|
80 | - 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
81 | - 'event_espresso' |
|
82 | - ), |
|
83 | - EE_MIN_PHP_VER_REQUIRED, |
|
84 | - PHP_VERSION, |
|
85 | - '<br/>', |
|
86 | - '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
87 | - ); |
|
88 | - ?> |
|
78 | + printf( |
|
79 | + esc_html__( |
|
80 | + 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
81 | + 'event_espresso' |
|
82 | + ), |
|
83 | + EE_MIN_PHP_VER_REQUIRED, |
|
84 | + PHP_VERSION, |
|
85 | + '<br/>', |
|
86 | + '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
87 | + ); |
|
88 | + ?> |
|
89 | 89 | </p> |
90 | 90 | </div> |
91 | 91 | <?php |
92 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
93 | - } |
|
92 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
93 | + } |
|
94 | 94 | |
95 | - add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
96 | - } else { |
|
97 | - define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
98 | - /** |
|
99 | - * espresso_version |
|
100 | - * Returns the plugin version |
|
101 | - * |
|
102 | - * @return string |
|
103 | - */ |
|
104 | - function espresso_version() |
|
105 | - { |
|
106 | - return apply_filters('FHEE__espresso__espresso_version', '4.9.50.rc.003'); |
|
107 | - } |
|
95 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
96 | + } else { |
|
97 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
98 | + /** |
|
99 | + * espresso_version |
|
100 | + * Returns the plugin version |
|
101 | + * |
|
102 | + * @return string |
|
103 | + */ |
|
104 | + function espresso_version() |
|
105 | + { |
|
106 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.50.rc.003'); |
|
107 | + } |
|
108 | 108 | |
109 | - /** |
|
110 | - * espresso_plugin_activation |
|
111 | - * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
112 | - */ |
|
113 | - function espresso_plugin_activation() |
|
114 | - { |
|
115 | - update_option('ee_espresso_activation', true); |
|
116 | - } |
|
109 | + /** |
|
110 | + * espresso_plugin_activation |
|
111 | + * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
112 | + */ |
|
113 | + function espresso_plugin_activation() |
|
114 | + { |
|
115 | + update_option('ee_espresso_activation', true); |
|
116 | + } |
|
117 | 117 | |
118 | - register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
119 | - /** |
|
120 | - * espresso_load_error_handling |
|
121 | - * this function loads EE's class for handling exceptions and errors |
|
122 | - */ |
|
123 | - function espresso_load_error_handling() |
|
124 | - { |
|
125 | - static $error_handling_loaded = false; |
|
126 | - if ($error_handling_loaded) { |
|
127 | - return; |
|
128 | - } |
|
129 | - // load debugging tools |
|
130 | - if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
131 | - require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
132 | - \EEH_Debug_Tools::instance(); |
|
133 | - } |
|
134 | - // load error handling |
|
135 | - if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
136 | - require_once EE_CORE . 'EE_Error.core.php'; |
|
137 | - } else { |
|
138 | - wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
139 | - } |
|
140 | - $error_handling_loaded = true; |
|
141 | - } |
|
118 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
119 | + /** |
|
120 | + * espresso_load_error_handling |
|
121 | + * this function loads EE's class for handling exceptions and errors |
|
122 | + */ |
|
123 | + function espresso_load_error_handling() |
|
124 | + { |
|
125 | + static $error_handling_loaded = false; |
|
126 | + if ($error_handling_loaded) { |
|
127 | + return; |
|
128 | + } |
|
129 | + // load debugging tools |
|
130 | + if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
131 | + require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
132 | + \EEH_Debug_Tools::instance(); |
|
133 | + } |
|
134 | + // load error handling |
|
135 | + if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
136 | + require_once EE_CORE . 'EE_Error.core.php'; |
|
137 | + } else { |
|
138 | + wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
139 | + } |
|
140 | + $error_handling_loaded = true; |
|
141 | + } |
|
142 | 142 | |
143 | - /** |
|
144 | - * espresso_load_required |
|
145 | - * given a class name and path, this function will load that file or throw an exception |
|
146 | - * |
|
147 | - * @param string $classname |
|
148 | - * @param string $full_path_to_file |
|
149 | - * @throws EE_Error |
|
150 | - */ |
|
151 | - function espresso_load_required($classname, $full_path_to_file) |
|
152 | - { |
|
153 | - if (is_readable($full_path_to_file)) { |
|
154 | - require_once $full_path_to_file; |
|
155 | - } else { |
|
156 | - throw new \EE_Error ( |
|
157 | - sprintf( |
|
158 | - esc_html__( |
|
159 | - 'The %s class file could not be located or is not readable due to file permissions.', |
|
160 | - 'event_espresso' |
|
161 | - ), |
|
162 | - $classname |
|
163 | - ) |
|
164 | - ); |
|
165 | - } |
|
166 | - } |
|
143 | + /** |
|
144 | + * espresso_load_required |
|
145 | + * given a class name and path, this function will load that file or throw an exception |
|
146 | + * |
|
147 | + * @param string $classname |
|
148 | + * @param string $full_path_to_file |
|
149 | + * @throws EE_Error |
|
150 | + */ |
|
151 | + function espresso_load_required($classname, $full_path_to_file) |
|
152 | + { |
|
153 | + if (is_readable($full_path_to_file)) { |
|
154 | + require_once $full_path_to_file; |
|
155 | + } else { |
|
156 | + throw new \EE_Error ( |
|
157 | + sprintf( |
|
158 | + esc_html__( |
|
159 | + 'The %s class file could not be located or is not readable due to file permissions.', |
|
160 | + 'event_espresso' |
|
161 | + ), |
|
162 | + $classname |
|
163 | + ) |
|
164 | + ); |
|
165 | + } |
|
166 | + } |
|
167 | 167 | |
168 | - /** |
|
169 | - * @since 4.9.27 |
|
170 | - * @throws \EE_Error |
|
171 | - * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
|
172 | - * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
173 | - * @throws \EventEspresso\core\exceptions\InvalidIdentifierException |
|
174 | - * @throws \EventEspresso\core\exceptions\InvalidClassException |
|
175 | - * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
176 | - * @throws \EventEspresso\core\services\container\exceptions\ServiceExistsException |
|
177 | - * @throws \EventEspresso\core\services\container\exceptions\ServiceNotFoundException |
|
178 | - * @throws \OutOfBoundsException |
|
179 | - */ |
|
180 | - function bootstrap_espresso() |
|
181 | - { |
|
182 | - require_once __DIR__ . '/core/espresso_definitions.php'; |
|
183 | - try { |
|
184 | - espresso_load_error_handling(); |
|
185 | - espresso_load_required( |
|
186 | - 'EEH_Base', |
|
187 | - EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
188 | - ); |
|
189 | - espresso_load_required( |
|
190 | - 'EEH_File', |
|
191 | - EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
192 | - ); |
|
193 | - espresso_load_required( |
|
194 | - 'EEH_File', |
|
195 | - EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
196 | - ); |
|
197 | - espresso_load_required( |
|
198 | - 'EEH_Array', |
|
199 | - EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
200 | - ); |
|
201 | - // instantiate and configure PSR4 autoloader |
|
202 | - espresso_load_required( |
|
203 | - 'Psr4Autoloader', |
|
204 | - EE_CORE . 'Psr4Autoloader.php' |
|
205 | - ); |
|
206 | - espresso_load_required( |
|
207 | - 'EE_Psr4AutoloaderInit', |
|
208 | - EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
209 | - ); |
|
210 | - $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
|
211 | - $AutoloaderInit->initializeAutoloader(); |
|
212 | - espresso_load_required( |
|
213 | - 'EE_Request', |
|
214 | - EE_CORE . 'request_stack' . DS . 'EE_Request.core.php' |
|
215 | - ); |
|
216 | - espresso_load_required( |
|
217 | - 'EE_Response', |
|
218 | - EE_CORE . 'request_stack' . DS . 'EE_Response.core.php' |
|
219 | - ); |
|
220 | - espresso_load_required( |
|
221 | - 'EE_Bootstrap', |
|
222 | - EE_CORE . 'EE_Bootstrap.core.php' |
|
223 | - ); |
|
224 | - // bootstrap EE and the request stack |
|
225 | - new EE_Bootstrap( |
|
226 | - new EE_Request($_GET, $_POST, $_COOKIE), |
|
227 | - new EE_Response() |
|
228 | - ); |
|
229 | - } catch (Exception $e) { |
|
230 | - require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
231 | - new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
|
232 | - } |
|
233 | - } |
|
234 | - bootstrap_espresso(); |
|
235 | - } |
|
168 | + /** |
|
169 | + * @since 4.9.27 |
|
170 | + * @throws \EE_Error |
|
171 | + * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
|
172 | + * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
173 | + * @throws \EventEspresso\core\exceptions\InvalidIdentifierException |
|
174 | + * @throws \EventEspresso\core\exceptions\InvalidClassException |
|
175 | + * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
176 | + * @throws \EventEspresso\core\services\container\exceptions\ServiceExistsException |
|
177 | + * @throws \EventEspresso\core\services\container\exceptions\ServiceNotFoundException |
|
178 | + * @throws \OutOfBoundsException |
|
179 | + */ |
|
180 | + function bootstrap_espresso() |
|
181 | + { |
|
182 | + require_once __DIR__ . '/core/espresso_definitions.php'; |
|
183 | + try { |
|
184 | + espresso_load_error_handling(); |
|
185 | + espresso_load_required( |
|
186 | + 'EEH_Base', |
|
187 | + EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
188 | + ); |
|
189 | + espresso_load_required( |
|
190 | + 'EEH_File', |
|
191 | + EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
192 | + ); |
|
193 | + espresso_load_required( |
|
194 | + 'EEH_File', |
|
195 | + EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
196 | + ); |
|
197 | + espresso_load_required( |
|
198 | + 'EEH_Array', |
|
199 | + EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
200 | + ); |
|
201 | + // instantiate and configure PSR4 autoloader |
|
202 | + espresso_load_required( |
|
203 | + 'Psr4Autoloader', |
|
204 | + EE_CORE . 'Psr4Autoloader.php' |
|
205 | + ); |
|
206 | + espresso_load_required( |
|
207 | + 'EE_Psr4AutoloaderInit', |
|
208 | + EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
209 | + ); |
|
210 | + $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
|
211 | + $AutoloaderInit->initializeAutoloader(); |
|
212 | + espresso_load_required( |
|
213 | + 'EE_Request', |
|
214 | + EE_CORE . 'request_stack' . DS . 'EE_Request.core.php' |
|
215 | + ); |
|
216 | + espresso_load_required( |
|
217 | + 'EE_Response', |
|
218 | + EE_CORE . 'request_stack' . DS . 'EE_Response.core.php' |
|
219 | + ); |
|
220 | + espresso_load_required( |
|
221 | + 'EE_Bootstrap', |
|
222 | + EE_CORE . 'EE_Bootstrap.core.php' |
|
223 | + ); |
|
224 | + // bootstrap EE and the request stack |
|
225 | + new EE_Bootstrap( |
|
226 | + new EE_Request($_GET, $_POST, $_COOKIE), |
|
227 | + new EE_Response() |
|
228 | + ); |
|
229 | + } catch (Exception $e) { |
|
230 | + require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
231 | + new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
|
232 | + } |
|
233 | + } |
|
234 | + bootstrap_espresso(); |
|
235 | + } |
|
236 | 236 | } |
237 | 237 | if (! function_exists('espresso_deactivate_plugin')) { |
238 | - /** |
|
239 | - * deactivate_plugin |
|
240 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
241 | - * |
|
242 | - * @access public |
|
243 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
244 | - * @return void |
|
245 | - */ |
|
246 | - function espresso_deactivate_plugin($plugin_basename = '') |
|
247 | - { |
|
248 | - if (! function_exists('deactivate_plugins')) { |
|
249 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
250 | - } |
|
251 | - unset($_GET['activate'], $_REQUEST['activate']); |
|
252 | - deactivate_plugins($plugin_basename); |
|
253 | - } |
|
238 | + /** |
|
239 | + * deactivate_plugin |
|
240 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
241 | + * |
|
242 | + * @access public |
|
243 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
244 | + * @return void |
|
245 | + */ |
|
246 | + function espresso_deactivate_plugin($plugin_basename = '') |
|
247 | + { |
|
248 | + if (! function_exists('deactivate_plugins')) { |
|
249 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
250 | + } |
|
251 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
252 | + deactivate_plugins($plugin_basename); |
|
253 | + } |
|
254 | 254 | } |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | */ |
12 | 12 | class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base{ |
13 | 13 | |
14 | - const HTML_TAG_BUTTON = 'button'; |
|
15 | - const HTML_TAG_INPUT = 'input'; |
|
14 | + const HTML_TAG_BUTTON = 'button'; |
|
15 | + const HTML_TAG_INPUT = 'input'; |
|
16 | 16 | |
17 | 17 | |
18 | 18 | /** |
@@ -20,19 +20,19 @@ discard block |
||
20 | 20 | * @return string of html to display the input |
21 | 21 | */ |
22 | 22 | public function display(){ |
23 | - $button_text = $this->_input->html_label_text(); |
|
24 | - $button_text = ! empty($button_text) |
|
25 | - ? $button_text |
|
26 | - : $this->_input->raw_value_in_form(); |
|
27 | - $tag = apply_filters( |
|
28 | - 'FHEE__EE_Submit_Input_Display_Strategy__display__submit_input_html_tag', |
|
29 | - EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON |
|
30 | - ); |
|
31 | - // verify result is one of the two valid options |
|
32 | - $tag = $tag === EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON |
|
33 | - || $tag === EE_Submit_Input_Display_Strategy::HTML_TAG_INPUT |
|
34 | - ? $tag |
|
35 | - : EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON; |
|
23 | + $button_text = $this->_input->html_label_text(); |
|
24 | + $button_text = ! empty($button_text) |
|
25 | + ? $button_text |
|
26 | + : $this->_input->raw_value_in_form(); |
|
27 | + $tag = apply_filters( |
|
28 | + 'FHEE__EE_Submit_Input_Display_Strategy__display__submit_input_html_tag', |
|
29 | + EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON |
|
30 | + ); |
|
31 | + // verify result is one of the two valid options |
|
32 | + $tag = $tag === EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON |
|
33 | + || $tag === EE_Submit_Input_Display_Strategy::HTML_TAG_INPUT |
|
34 | + ? $tag |
|
35 | + : EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON; |
|
36 | 36 | $html = '<' . $tag . ' type="submit" '; |
37 | 37 | $html .= 'name="' . $this->_input->html_name() . '" '; |
38 | 38 | $html .= 'value="' . $this->_input->raw_value_in_form() . '" '; |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | $html .= 'style="' . $this->_input->html_style() . '" '; |
42 | 42 | $html .= $this->_input->other_html_attributes(); |
43 | 43 | if($tag === EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON) { |
44 | - $html .= '>'; |
|
45 | - $html .= $button_text; |
|
46 | - $html .= '</button>'; |
|
47 | - } else { |
|
48 | - $html .= '/>'; |
|
49 | - } |
|
50 | - return $html; |
|
44 | + $html .= '>'; |
|
45 | + $html .= $button_text; |
|
46 | + $html .= '</button>'; |
|
47 | + } else { |
|
48 | + $html .= '/>'; |
|
49 | + } |
|
50 | + return $html; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @package Event Espresso |
10 | 10 | * @author Mike Nelson |
11 | 11 | */ |
12 | -class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base{ |
|
12 | +class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base { |
|
13 | 13 | |
14 | 14 | const HTML_TAG_BUTTON = 'button'; |
15 | 15 | const HTML_TAG_INPUT = 'input'; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @return string of html to display the input |
21 | 21 | */ |
22 | - public function display(){ |
|
22 | + public function display() { |
|
23 | 23 | $button_text = $this->_input->html_label_text(); |
24 | 24 | $button_text = ! empty($button_text) |
25 | 25 | ? $button_text |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | || $tag === EE_Submit_Input_Display_Strategy::HTML_TAG_INPUT |
34 | 34 | ? $tag |
35 | 35 | : EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON; |
36 | - $html = '<' . $tag . ' type="submit" '; |
|
37 | - $html .= 'name="' . $this->_input->html_name() . '" '; |
|
38 | - $html .= 'value="' . $this->_input->raw_value_in_form() . '" '; |
|
39 | - $html .= 'id="' . $this->_input->html_id() . '-submit" '; |
|
40 | - $html .= 'class="' . $this->_input->html_class() . ' ' . $this->_input->button_css_attributes() . '" '; |
|
41 | - $html .= 'style="' . $this->_input->html_style() . '" '; |
|
36 | + $html = '<'.$tag.' type="submit" '; |
|
37 | + $html .= 'name="'.$this->_input->html_name().'" '; |
|
38 | + $html .= 'value="'.$this->_input->raw_value_in_form().'" '; |
|
39 | + $html .= 'id="'.$this->_input->html_id().'-submit" '; |
|
40 | + $html .= 'class="'.$this->_input->html_class().' '.$this->_input->button_css_attributes().'" '; |
|
41 | + $html .= 'style="'.$this->_input->html_style().'" '; |
|
42 | 42 | $html .= $this->_input->other_html_attributes(); |
43 | - if($tag === EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON) { |
|
43 | + if ($tag === EE_Submit_Input_Display_Strategy::HTML_TAG_BUTTON) { |
|
44 | 44 | $html .= '>'; |
45 | 45 | $html .= $button_text; |
46 | 46 | $html .= '</button>'; |