@@ -426,7 +426,7 @@ |
||
426 | 426 | * |
427 | 427 | * @since 4.3.1 |
428 | 428 | * |
429 | - * @return array |
|
429 | + * @return string[] |
|
430 | 430 | */ |
431 | 431 | private function _parse_from() { |
432 | 432 | if ( strpos( $this->_from, '<' ) !== false ) { |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | |
61 | 61 | /** |
62 | - * @return boolean |
|
62 | + * @return boolean|null |
|
63 | 63 | */ |
64 | 64 | public function process_reg_step() { |
65 | 65 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | |
70 | 70 | /** |
71 | - * @return boolean |
|
71 | + * @return boolean|null |
|
72 | 72 | */ |
73 | 73 | public function update_reg_step() { |
74 | 74 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_SPCO_Reg_Step_Registration_Confirmation |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since 4.5.0 |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_SPCO_Reg_Step_Registration_Confirmation |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since 4.5.0 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_SPCO_Reg_Step_Registration_Confirmation extends EE_SPCO_Reg_Step { |
15 | 15 | |
16 | 16 | /** |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | * @param EE_Checkout $checkout |
21 | 21 | * @return \EE_SPCO_Reg_Step_Registration_Confirmation |
22 | 22 | */ |
23 | - public function __construct( EE_Checkout $checkout ) { |
|
23 | + public function __construct(EE_Checkout $checkout) { |
|
24 | 24 | $this->_slug = 'registration_confirmation'; |
25 | 25 | $this->_name = __('Registration Confirmation', 'event_espresso'); |
26 | - $this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'registration_page_confirmation.template.php'; |
|
26 | + $this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'registration_page_confirmation.template.php'; |
|
27 | 27 | $this->checkout = $checkout; |
28 | 28 | } |
29 | 29 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return boolean |
44 | 44 | */ |
45 | 45 | public function initialize_reg_step() { |
46 | - $this->checkout->remove_reg_step( $this->_slug ); |
|
46 | + $this->checkout->remove_reg_step($this->_slug); |
|
47 | 47 | return false; |
48 | 48 | } |
49 | 49 |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | public function __construct() { |
50 | 50 | // throw new EE_Error('error'); |
51 | 51 | |
52 | - do_action( 'AHEE_log', __CLASS__, __FUNCTION__ ); |
|
52 | + do_action('AHEE_log', __CLASS__, __FUNCTION__); |
|
53 | 53 | |
54 | 54 | //wp have no MONTH_IN_SECONDS constant. So we approximate our own assuming all months are 4 weeks long. |
55 | - if ( !defined('MONTH_IN_SECONDS' ) ) |
|
56 | - define( 'MONTH_IN_SECONDS', WEEK_IN_SECONDS * 4 ); |
|
55 | + if ( ! defined('MONTH_IN_SECONDS')) |
|
56 | + define('MONTH_IN_SECONDS', WEEK_IN_SECONDS * 4); |
|
57 | 57 | |
58 | - if(EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance){ |
|
58 | + if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
59 | 59 | $this->_uxip_hooks(); |
60 | 60 | } |
61 | 61 | |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | $ueip_has_notified = EE_Registry::instance()->CFG->core->ee_ueip_has_notified; |
65 | 65 | |
66 | 66 | //has optin been selected for data collection? |
67 | - $espresso_data_optin = !empty($ueip_optin) ? $ueip_optin : NULL; |
|
67 | + $espresso_data_optin = ! empty($ueip_optin) ? $ueip_optin : NULL; |
|
68 | 68 | |
69 | - if ( empty($ueip_has_notified) && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_mode::level_2_complete_maintenance ) { |
|
70 | - add_action('admin_notices', array( $this, 'espresso_data_collection_optin_notice' ), 10 ); |
|
71 | - add_action('admin_enqueue_scripts', array( $this, 'espresso_data_collection_enqueue_scripts' ), 10 ); |
|
72 | - add_action('wp_ajax_espresso_data_optin', array( $this, 'espresso_data_optin_ajax_handler' ), 10 ); |
|
69 | + if (empty($ueip_has_notified) && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_mode::level_2_complete_maintenance) { |
|
70 | + add_action('admin_notices', array($this, 'espresso_data_collection_optin_notice'), 10); |
|
71 | + add_action('admin_enqueue_scripts', array($this, 'espresso_data_collection_enqueue_scripts'), 10); |
|
72 | + add_action('wp_ajax_espresso_data_optin', array($this, 'espresso_data_optin_ajax_handler'), 10); |
|
73 | 73 | update_option('ee_ueip_optin', 'yes'); |
74 | 74 | $espresso_data_optin = 'yes'; |
75 | 75 | } |
@@ -78,80 +78,80 @@ discard block |
||
78 | 78 | $extra_stats = array(); |
79 | 79 | |
80 | 80 | //only collect extra stats if the plugin user has opted in. |
81 | - if ( !empty($espresso_data_optin) && $espresso_data_optin == 'yes' ) { |
|
81 | + if ( ! empty($espresso_data_optin) && $espresso_data_optin == 'yes') { |
|
82 | 82 | //let's only setup extra data if transient has expired |
83 | - if ( false === ( $transient = get_transient('ee_extra_data') ) && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ) { |
|
83 | + if (false === ($transient = get_transient('ee_extra_data')) && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
84 | 84 | |
85 | 85 | $current_site = is_multisite() ? get_current_site() : NULL; |
86 | - $site_pre = ! is_main_site() && ! empty($current_site) ? trim( preg_replace('/\b\w\S\w\b/', '', $current_site->domain ), '.' ) . '_' : ''; |
|
86 | + $site_pre = ! is_main_site() && ! empty($current_site) ? trim(preg_replace('/\b\w\S\w\b/', '', $current_site->domain), '.').'_' : ''; |
|
87 | 87 | |
88 | 88 | |
89 | 89 | //active gateways |
90 | 90 | $active_gateways = get_option('event_espresso_active_gateways'); |
91 | - if ( !empty($active_gateways ) ) { |
|
92 | - foreach ( (array) $active_gateways as $gateway => $ignore ) { |
|
93 | - $extra_stats[$site_pre . $gateway . '_gateway_active'] = 1; |
|
91 | + if ( ! empty($active_gateways)) { |
|
92 | + foreach ((array) $active_gateways as $gateway => $ignore) { |
|
93 | + $extra_stats[$site_pre.$gateway.'_gateway_active'] = 1; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | - if ( is_multisite() && is_main_site() ) { |
|
97 | + if (is_multisite() && is_main_site()) { |
|
98 | 98 | $extra_stats['is_multisite'] = true; |
99 | 99 | } |
100 | 100 | |
101 | 101 | //what is the current active theme? |
102 | 102 | $active_theme = get_option('uxip_ee_active_theme'); |
103 | - if ( !empty( $active_theme ) ) |
|
104 | - $extra_stats[$site_pre . 'active_theme'] = $active_theme; |
|
103 | + if ( ! empty($active_theme)) |
|
104 | + $extra_stats[$site_pre.'active_theme'] = $active_theme; |
|
105 | 105 | |
106 | 106 | //event info regarding an all event count and all "active" event count |
107 | 107 | $all_events_count = get_option('uxip_ee4_all_events_count'); |
108 | - if ( !empty( $all_events_count ) ) |
|
109 | - $extra_stats[$site_pre . 'ee4_all_events_count'] = $all_events_count; |
|
108 | + if ( ! empty($all_events_count)) |
|
109 | + $extra_stats[$site_pre.'ee4_all_events_count'] = $all_events_count; |
|
110 | 110 | $active_events_count = get_option('uxip_ee4_active_events_count'); |
111 | - if ( !empty( $active_events_count ) ) |
|
112 | - $extra_stats[$site_pre . 'ee4_active_events_count'] = $active_events_count; |
|
111 | + if ( ! empty($active_events_count)) |
|
112 | + $extra_stats[$site_pre.'ee4_active_events_count'] = $active_events_count; |
|
113 | 113 | |
114 | 114 | //datetime stuff |
115 | 115 | $dtt_count = get_option('uxip_ee_all_dtts_count'); |
116 | - if ( !empty( $dtt_count ) ) |
|
117 | - $extra_stats[$site_pre . 'all_dtts_count'] = $dtt_count; |
|
116 | + if ( ! empty($dtt_count)) |
|
117 | + $extra_stats[$site_pre.'all_dtts_count'] = $dtt_count; |
|
118 | 118 | |
119 | 119 | $dtt_sold = get_option('uxip_ee_dtt_sold'); |
120 | - if ( !empty( $dtt_sold ) ) |
|
121 | - $extra_stats[$site_pre . 'dtt_sold'] = $dtt_sold; |
|
120 | + if ( ! empty($dtt_sold)) |
|
121 | + $extra_stats[$site_pre.'dtt_sold'] = $dtt_sold; |
|
122 | 122 | |
123 | 123 | //ticket stuff |
124 | 124 | $all_tkt_count = get_option('uxip_ee_all_tkt_count'); |
125 | - if ( !empty( $all_tkt_count ) ) |
|
126 | - $extra_stats[$site_pre . 'all_tkt_count'] = $all_tkt_count; |
|
125 | + if ( ! empty($all_tkt_count)) |
|
126 | + $extra_stats[$site_pre.'all_tkt_count'] = $all_tkt_count; |
|
127 | 127 | |
128 | 128 | $free_tkt_count = get_option('uxip_ee_free_tkt_count'); |
129 | - if ( !empty( $free_tkt_count ) ) |
|
130 | - $extra_stats[$site_pre . 'free_tkt_count'] = $free_tkt_count; |
|
129 | + if ( ! empty($free_tkt_count)) |
|
130 | + $extra_stats[$site_pre.'free_tkt_count'] = $free_tkt_count; |
|
131 | 131 | |
132 | 132 | $paid_tkt_count = get_option('uxip_ee_paid_tkt_count'); |
133 | - if ( !empty( $paid_tkt_count ) ) |
|
134 | - $extra_stats[$site_pre . 'paid_tkt_count'] = $paid_tkt_count; |
|
133 | + if ( ! empty($paid_tkt_count)) |
|
134 | + $extra_stats[$site_pre.'paid_tkt_count'] = $paid_tkt_count; |
|
135 | 135 | |
136 | - $tkt_sold = get_option('uxip_ee_tkt_sold' ); |
|
137 | - if ( !empty($tkt_sold) ) |
|
138 | - $extra_stats[$site_pre . 'tkt_sold'] = $tkt_sold; |
|
136 | + $tkt_sold = get_option('uxip_ee_tkt_sold'); |
|
137 | + if ( ! empty($tkt_sold)) |
|
138 | + $extra_stats[$site_pre.'tkt_sold'] = $tkt_sold; |
|
139 | 139 | |
140 | 140 | //phpversion checking |
141 | 141 | $extra_stats['phpversion'] = function_exists('phpversion') ? phpversion() : 'unknown'; |
142 | 142 | |
143 | 143 | //set transient |
144 | - set_transient( 'ee_extra_data', $extra_stats, WEEK_IN_SECONDS ); |
|
144 | + set_transient('ee_extra_data', $extra_stats, WEEK_IN_SECONDS); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | 148 | |
149 | 149 | |
150 | 150 | // PUE Auto Upgrades stuff |
151 | - if (is_readable(EE_THIRD_PARTY . 'pue/pue-client.php')) { //include the file |
|
152 | - require_once(EE_THIRD_PARTY . 'pue/pue-client.php' ); |
|
151 | + if (is_readable(EE_THIRD_PARTY.'pue/pue-client.php')) { //include the file |
|
152 | + require_once(EE_THIRD_PARTY.'pue/pue-client.php'); |
|
153 | 153 | |
154 | - $api_key = isset( EE_Registry::instance()->NET_CFG->core->site_license_key ) ? EE_Registry::instance()->NET_CFG->core->site_license_key : ''; |
|
154 | + $api_key = isset(EE_Registry::instance()->NET_CFG->core->site_license_key) ? EE_Registry::instance()->NET_CFG->core->site_license_key : ''; |
|
155 | 155 | $host_server_url = 'https://eventespresso.com'; //this needs to be the host server where plugin update engine is installed. Note, if you leave this blank then it is assumed the WordPress repo will be used and we'll just check there. |
156 | 156 | |
157 | 157 | //Note: PUE uses a simple preg_match to determine what type is currently installed based on version number. So it's important that you use a key for the version type that is unique and not found in another key. |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | //$plugin_slug['prerelease']['b'] = 'some-pre-release-slug'; |
164 | 164 | //..WOULD work! |
165 | 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' ) |
|
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 | 169 | ); |
170 | 170 | |
171 | 171 | |
@@ -192,14 +192,14 @@ discard block |
||
192 | 192 | * The purpose of this function is to display information about Event Espresso data collection and a optin selection for extra data collecting by users. |
193 | 193 | * @return string html. |
194 | 194 | */ |
195 | - public static function espresso_data_collection_optin_text( $extra = TRUE ) { |
|
196 | - if ( ! $extra ) { |
|
197 | - echo '<h2 class="ee-admin-settings-hdr" '. (!$extra ? 'id="UXIP_settings"' : '').'>'.__('User eXperience Improvement Program (UXIP)', 'event_espresso').EEH_Template::get_help_tab_link('organization_logo_info').'</h2>'; |
|
198 | - echo sprintf( __('%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.', 'event_espresso'), '<p><em>', '</em></p>','<a href="http://eventespresso.com/about/user-experience-improvement-program-uxip/" target="_blank">','</a>','<br><br>','<a href="http://eventespresso.com/about/privacy-policy/" target="_blank">','</a>' ); |
|
195 | + public static function espresso_data_collection_optin_text($extra = TRUE) { |
|
196 | + if ( ! $extra) { |
|
197 | + echo '<h2 class="ee-admin-settings-hdr" '.( ! $extra ? 'id="UXIP_settings"' : '').'>'.__('User eXperience Improvement Program (UXIP)', 'event_espresso').EEH_Template::get_help_tab_link('organization_logo_info').'</h2>'; |
|
198 | + echo sprintf(__('%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.', 'event_espresso'), '<p><em>', '</em></p>', '<a href="http://eventespresso.com/about/user-experience-improvement-program-uxip/" target="_blank">', '</a>', '<br><br>', '<a href="http://eventespresso.com/about/privacy-policy/" target="_blank">', '</a>'); |
|
199 | 199 | } else { |
200 | - $settings_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default'), admin_url( 'admin.php?page=espresso_general_settings') ); |
|
200 | + $settings_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), admin_url('admin.php?page=espresso_general_settings')); |
|
201 | 201 | $settings_url .= '#UXIP_settings'; |
202 | - echo sprintf( __( 'The Event Espresso UXIP feature is active on your site. For %smore info%s and to opt-out %sclick here%s.', 'event_espresso' ), '<a href="http://eventespresso.com/about/user-experience-improvement-program-uxip/" traget="_blank">', '</a>', '<a href="' . $settings_url . '" target="_blank">', '</a>' ); |
|
202 | + echo sprintf(__('The Event Espresso UXIP feature is active on your site. For %smore info%s and to opt-out %sclick here%s.', 'event_espresso'), '<a href="http://eventespresso.com/about/user-experience-improvement-program-uxip/" traget="_blank">', '</a>', '<a href="'.$settings_url.'" target="_blank">', '</a>'); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | |
209 | 209 | function espresso_data_collection_optin_notice() { |
210 | 210 | $ueip_has_notified = EE_Registry::instance()->CFG->core->ee_ueip_has_notified; |
211 | - if ( $ueip_has_notified ) return; |
|
212 | - $settings_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default'), admin_url( 'admin.php?page=espresso_general_settings') ); |
|
213 | - $settings_url = $settings_url . '#UXIP_settings'; |
|
211 | + if ($ueip_has_notified) return; |
|
212 | + $settings_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), admin_url('admin.php?page=espresso_general_settings')); |
|
213 | + $settings_url = $settings_url.'#UXIP_settings'; |
|
214 | 214 | ?> |
215 | 215 | <div class="updated data-collect-optin" id="espresso-data-collect-optin-container"> |
216 | 216 | <div id="data-collect-optin-options-container"> |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | * @return void |
233 | 233 | */ |
234 | 234 | function espresso_data_collection_enqueue_scripts() { |
235 | - wp_register_script( 'ee-data-optin-js', EE_GLOBAL_ASSETS_URL . 'scripts/ee-data-optin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
236 | - wp_register_style( 'ee-data-optin-css', EE_GLOBAL_ASSETS_URL . 'css/ee-data-optin.css', array(), EVENT_ESPRESSO_VERSION ); |
|
235 | + wp_register_script('ee-data-optin-js', EE_GLOBAL_ASSETS_URL.'scripts/ee-data-optin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
236 | + wp_register_style('ee-data-optin-css', EE_GLOBAL_ASSETS_URL.'css/ee-data-optin.css', array(), EVENT_ESPRESSO_VERSION); |
|
237 | 237 | |
238 | 238 | wp_enqueue_script('ee-data-optin-js'); |
239 | 239 | wp_enqueue_style('ee-data-optin-css'); |
@@ -248,14 +248,14 @@ discard block |
||
248 | 248 | function espresso_data_optin_ajax_handler() { |
249 | 249 | |
250 | 250 | //verify nonce |
251 | - if ( isset($_POST['nonce']) && !wp_verify_nonce($_POST['nonce'], 'ee-data-optin') ) exit(); |
|
251 | + if (isset($_POST['nonce']) && ! wp_verify_nonce($_POST['nonce'], 'ee-data-optin')) exit(); |
|
252 | 252 | |
253 | 253 | //made it here so let's save the selection |
254 | - $ueip_optin = isset( $_POST['selection'] ) ? $_POST['selection'] : 'no'; |
|
254 | + $ueip_optin = isset($_POST['selection']) ? $_POST['selection'] : 'no'; |
|
255 | 255 | |
256 | 256 | //update_option('ee_ueip_optin', $ueip_optin); |
257 | 257 | EE_Registry::instance()->CFG->core->ee_ueip_has_notified = 1; |
258 | - EE_Registry::instance()->CFG->update_espresso_config( FALSE, FALSE ); |
|
258 | + EE_Registry::instance()->CFG->update_espresso_config(FALSE, FALSE); |
|
259 | 259 | exit(); |
260 | 260 | } |
261 | 261 | |
@@ -268,22 +268,22 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public static function is_update_available($basename = '') { |
270 | 270 | |
271 | - $basename = ! empty( $basename ) ? $basename : EE_PLUGIN_BASENAME; |
|
271 | + $basename = ! empty($basename) ? $basename : EE_PLUGIN_BASENAME; |
|
272 | 272 | |
273 | 273 | $update = false; |
274 | 274 | |
275 | - $folder = DS . dirname($basename); // should take "event-espresso-core/espresso.php" and change to "/event-espresso-core" |
|
275 | + $folder = DS.dirname($basename); // should take "event-espresso-core/espresso.php" and change to "/event-espresso-core" |
|
276 | 276 | |
277 | 277 | $plugins = get_plugins($folder); |
278 | - $current = get_site_transient( 'update_plugins' ); |
|
278 | + $current = get_site_transient('update_plugins'); |
|
279 | 279 | |
280 | - foreach ( (array) $plugins as $plugin_file => $plugin_data ) { |
|
281 | - if ( isset( $current->response['plugin_file'] ) ) |
|
280 | + foreach ((array) $plugins as $plugin_file => $plugin_data) { |
|
281 | + if (isset($current->response['plugin_file'])) |
|
282 | 282 | $update = true; |
283 | 283 | } |
284 | 284 | |
285 | 285 | //it's possible that there is an update but an invalid site-license-key is in use |
286 | - if ( get_site_option('pue_json_error_' . $basename ) ) |
|
286 | + if (get_site_option('pue_json_error_'.$basename)) |
|
287 | 287 | $update = true; |
288 | 288 | |
289 | 289 | return $update; |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | * @return void |
302 | 302 | */ |
303 | 303 | public function _uxip_hooks() { |
304 | - if ( EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ) { |
|
305 | - add_action('admin_init', array( $this, 'track_active_theme' ) ); |
|
306 | - add_action('admin_init', array( $this, 'track_event_info' ) ); |
|
304 | + if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
305 | + add_action('admin_init', array($this, 'track_active_theme')); |
|
306 | + add_action('admin_init', array($this, 'track_event_info')); |
|
307 | 307 | } |
308 | 308 | } |
309 | 309 | |
@@ -312,65 +312,65 @@ discard block |
||
312 | 312 | |
313 | 313 | public function track_active_theme() { |
314 | 314 | //we only check this once a month. |
315 | - if ( false === ( $transient = get_transient( 'ee_active_theme_check' ) ) ) { |
|
315 | + if (false === ($transient = get_transient('ee_active_theme_check'))) { |
|
316 | 316 | $theme = wp_get_theme(); |
317 | - update_option('uxip_ee_active_theme', $theme->get('Name') ); |
|
318 | - set_transient('ee_active_theme_check', 1, MONTH_IN_SECONDS ); |
|
317 | + update_option('uxip_ee_active_theme', $theme->get('Name')); |
|
318 | + set_transient('ee_active_theme_check', 1, MONTH_IN_SECONDS); |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | |
322 | 322 | |
323 | 323 | public function track_event_info() { |
324 | 324 | //we only check this once every couple weeks. |
325 | - if ( false === ( $transient = get_transient( 'ee4_event_info_check') ) ) { |
|
325 | + if (false === ($transient = get_transient('ee4_event_info_check'))) { |
|
326 | 326 | //first let's get the number for ALL events |
327 | 327 | $EVT = EE_Registry::instance()->load_model('Event'); |
328 | 328 | $DTT = EE_Registry::instance()->load_model('Datetime'); |
329 | 329 | $TKT = EE_Registry::instance()->load_model('Ticket'); |
330 | 330 | $count = $EVT->count(); |
331 | - if ( $count > 0 ) |
|
331 | + if ($count > 0) |
|
332 | 332 | update_option('uxip_ee4_all_events_count', $count); |
333 | 333 | |
334 | 334 | //next let's just get the number of ACTIVE events |
335 | 335 | $count_active = $EVT->get_active_events(array(), TRUE); |
336 | - if ( $count_active > 0 ) |
|
336 | + if ($count_active > 0) |
|
337 | 337 | update_option('uxip_ee4_active_events_count', $count_active); |
338 | 338 | |
339 | 339 | //datetimes! |
340 | 340 | $dtt_count = $DTT->count(); |
341 | - if ( $dtt_count > 0 ) |
|
342 | - update_option( 'uxip_ee_all_dtts_count', $dtt_count ); |
|
341 | + if ($dtt_count > 0) |
|
342 | + update_option('uxip_ee_all_dtts_count', $dtt_count); |
|
343 | 343 | |
344 | 344 | |
345 | 345 | //dttsold |
346 | 346 | $dtt_sold = $DTT->sum(array(), 'DTT_sold'); |
347 | - if ( $dtt_sold > 0 ) |
|
348 | - update_option( 'uxip_ee_dtt_sold', $dtt_sold ); |
|
347 | + if ($dtt_sold > 0) |
|
348 | + update_option('uxip_ee_dtt_sold', $dtt_sold); |
|
349 | 349 | |
350 | 350 | //allticketcount |
351 | 351 | $all_tkt_count = $TKT->count(); |
352 | - if ( $all_tkt_count > 0 ) |
|
353 | - update_option( 'uxip_ee_all_tkt_count', $all_tkt_count ); |
|
352 | + if ($all_tkt_count > 0) |
|
353 | + update_option('uxip_ee_all_tkt_count', $all_tkt_count); |
|
354 | 354 | |
355 | 355 | //freetktcount |
356 | - $_where = array( 'TKT_price' => 0 ); |
|
356 | + $_where = array('TKT_price' => 0); |
|
357 | 357 | $free_tkt_count = $TKT->count(array($_where)); |
358 | - if ( $free_tkt_count > 0 ) |
|
359 | - update_option( 'uxip_ee_free_tkt_count', $free_tkt_count ); |
|
358 | + if ($free_tkt_count > 0) |
|
359 | + update_option('uxip_ee_free_tkt_count', $free_tkt_count); |
|
360 | 360 | |
361 | 361 | //paidtktcount |
362 | - $_where = array( 'TKT_price' => array('>', 0) ); |
|
363 | - $paid_tkt_count = $TKT->count( array( $_where ) ); |
|
364 | - if ( $paid_tkt_count > 0 ) |
|
365 | - update_option( 'uxip_ee_paid_tkt_count', $paid_tkt_count ); |
|
362 | + $_where = array('TKT_price' => array('>', 0)); |
|
363 | + $paid_tkt_count = $TKT->count(array($_where)); |
|
364 | + if ($paid_tkt_count > 0) |
|
365 | + update_option('uxip_ee_paid_tkt_count', $paid_tkt_count); |
|
366 | 366 | |
367 | 367 | //tktsold |
368 | - $tkt_sold = $TKT->sum( array(), 'TKT_sold' ); |
|
369 | - if( $tkt_sold > 0 ) |
|
370 | - update_option( 'uxip_ee_tkt_sold', $tkt_sold ); |
|
368 | + $tkt_sold = $TKT->sum(array(), 'TKT_sold'); |
|
369 | + if ($tkt_sold > 0) |
|
370 | + update_option('uxip_ee_tkt_sold', $tkt_sold); |
|
371 | 371 | |
372 | 372 | |
373 | - set_transient( 'ee4_event_info_check', 1, WEEK_IN_SECONDS * 2 ); |
|
373 | + set_transient('ee4_event_info_check', 1, WEEK_IN_SECONDS * 2); |
|
374 | 374 | } |
375 | 375 | } |
376 | 376 |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -52,8 +54,9 @@ discard block |
||
52 | 54 | do_action( 'AHEE_log', __CLASS__, __FUNCTION__ ); |
53 | 55 | |
54 | 56 | //wp have no MONTH_IN_SECONDS constant. So we approximate our own assuming all months are 4 weeks long. |
55 | - if ( !defined('MONTH_IN_SECONDS' ) ) |
|
56 | - define( 'MONTH_IN_SECONDS', WEEK_IN_SECONDS * 4 ); |
|
57 | + if ( !defined('MONTH_IN_SECONDS' ) ) { |
|
58 | + define( 'MONTH_IN_SECONDS', WEEK_IN_SECONDS * 4 ); |
|
59 | + } |
|
57 | 60 | |
58 | 61 | if(EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance){ |
59 | 62 | $this->_uxip_hooks(); |
@@ -100,42 +103,51 @@ discard block |
||
100 | 103 | |
101 | 104 | //what is the current active theme? |
102 | 105 | $active_theme = get_option('uxip_ee_active_theme'); |
103 | - if ( !empty( $active_theme ) ) |
|
104 | - $extra_stats[$site_pre . 'active_theme'] = $active_theme; |
|
106 | + if ( !empty( $active_theme ) ) { |
|
107 | + $extra_stats[$site_pre . 'active_theme'] = $active_theme; |
|
108 | + } |
|
105 | 109 | |
106 | 110 | //event info regarding an all event count and all "active" event count |
107 | 111 | $all_events_count = get_option('uxip_ee4_all_events_count'); |
108 | - if ( !empty( $all_events_count ) ) |
|
109 | - $extra_stats[$site_pre . 'ee4_all_events_count'] = $all_events_count; |
|
112 | + if ( !empty( $all_events_count ) ) { |
|
113 | + $extra_stats[$site_pre . 'ee4_all_events_count'] = $all_events_count; |
|
114 | + } |
|
110 | 115 | $active_events_count = get_option('uxip_ee4_active_events_count'); |
111 | - if ( !empty( $active_events_count ) ) |
|
112 | - $extra_stats[$site_pre . 'ee4_active_events_count'] = $active_events_count; |
|
116 | + if ( !empty( $active_events_count ) ) { |
|
117 | + $extra_stats[$site_pre . 'ee4_active_events_count'] = $active_events_count; |
|
118 | + } |
|
113 | 119 | |
114 | 120 | //datetime stuff |
115 | 121 | $dtt_count = get_option('uxip_ee_all_dtts_count'); |
116 | - if ( !empty( $dtt_count ) ) |
|
117 | - $extra_stats[$site_pre . 'all_dtts_count'] = $dtt_count; |
|
122 | + if ( !empty( $dtt_count ) ) { |
|
123 | + $extra_stats[$site_pre . 'all_dtts_count'] = $dtt_count; |
|
124 | + } |
|
118 | 125 | |
119 | 126 | $dtt_sold = get_option('uxip_ee_dtt_sold'); |
120 | - if ( !empty( $dtt_sold ) ) |
|
121 | - $extra_stats[$site_pre . 'dtt_sold'] = $dtt_sold; |
|
127 | + if ( !empty( $dtt_sold ) ) { |
|
128 | + $extra_stats[$site_pre . 'dtt_sold'] = $dtt_sold; |
|
129 | + } |
|
122 | 130 | |
123 | 131 | //ticket stuff |
124 | 132 | $all_tkt_count = get_option('uxip_ee_all_tkt_count'); |
125 | - if ( !empty( $all_tkt_count ) ) |
|
126 | - $extra_stats[$site_pre . 'all_tkt_count'] = $all_tkt_count; |
|
133 | + if ( !empty( $all_tkt_count ) ) { |
|
134 | + $extra_stats[$site_pre . 'all_tkt_count'] = $all_tkt_count; |
|
135 | + } |
|
127 | 136 | |
128 | 137 | $free_tkt_count = get_option('uxip_ee_free_tkt_count'); |
129 | - if ( !empty( $free_tkt_count ) ) |
|
130 | - $extra_stats[$site_pre . 'free_tkt_count'] = $free_tkt_count; |
|
138 | + if ( !empty( $free_tkt_count ) ) { |
|
139 | + $extra_stats[$site_pre . 'free_tkt_count'] = $free_tkt_count; |
|
140 | + } |
|
131 | 141 | |
132 | 142 | $paid_tkt_count = get_option('uxip_ee_paid_tkt_count'); |
133 | - if ( !empty( $paid_tkt_count ) ) |
|
134 | - $extra_stats[$site_pre . 'paid_tkt_count'] = $paid_tkt_count; |
|
143 | + if ( !empty( $paid_tkt_count ) ) { |
|
144 | + $extra_stats[$site_pre . 'paid_tkt_count'] = $paid_tkt_count; |
|
145 | + } |
|
135 | 146 | |
136 | 147 | $tkt_sold = get_option('uxip_ee_tkt_sold' ); |
137 | - if ( !empty($tkt_sold) ) |
|
138 | - $extra_stats[$site_pre . 'tkt_sold'] = $tkt_sold; |
|
148 | + if ( !empty($tkt_sold) ) { |
|
149 | + $extra_stats[$site_pre . 'tkt_sold'] = $tkt_sold; |
|
150 | + } |
|
139 | 151 | |
140 | 152 | //phpversion checking |
141 | 153 | $extra_stats['phpversion'] = function_exists('phpversion') ? phpversion() : 'unknown'; |
@@ -208,7 +220,9 @@ discard block |
||
208 | 220 | |
209 | 221 | function espresso_data_collection_optin_notice() { |
210 | 222 | $ueip_has_notified = EE_Registry::instance()->CFG->core->ee_ueip_has_notified; |
211 | - if ( $ueip_has_notified ) return; |
|
223 | + if ( $ueip_has_notified ) { |
|
224 | + return; |
|
225 | + } |
|
212 | 226 | $settings_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default'), admin_url( 'admin.php?page=espresso_general_settings') ); |
213 | 227 | $settings_url = $settings_url . '#UXIP_settings'; |
214 | 228 | ?> |
@@ -248,7 +262,9 @@ discard block |
||
248 | 262 | function espresso_data_optin_ajax_handler() { |
249 | 263 | |
250 | 264 | //verify nonce |
251 | - if ( isset($_POST['nonce']) && !wp_verify_nonce($_POST['nonce'], 'ee-data-optin') ) exit(); |
|
265 | + if ( isset($_POST['nonce']) && !wp_verify_nonce($_POST['nonce'], 'ee-data-optin') ) { |
|
266 | + exit(); |
|
267 | + } |
|
252 | 268 | |
253 | 269 | //made it here so let's save the selection |
254 | 270 | $ueip_optin = isset( $_POST['selection'] ) ? $_POST['selection'] : 'no'; |
@@ -278,13 +294,15 @@ discard block |
||
278 | 294 | $current = get_site_transient( 'update_plugins' ); |
279 | 295 | |
280 | 296 | foreach ( (array) $plugins as $plugin_file => $plugin_data ) { |
281 | - if ( isset( $current->response['plugin_file'] ) ) |
|
282 | - $update = true; |
|
297 | + if ( isset( $current->response['plugin_file'] ) ) { |
|
298 | + $update = true; |
|
299 | + } |
|
283 | 300 | } |
284 | 301 | |
285 | 302 | //it's possible that there is an update but an invalid site-license-key is in use |
286 | - if ( get_site_option('pue_json_error_' . $basename ) ) |
|
287 | - $update = true; |
|
303 | + if ( get_site_option('pue_json_error_' . $basename ) ) { |
|
304 | + $update = true; |
|
305 | + } |
|
288 | 306 | |
289 | 307 | return $update; |
290 | 308 | } |
@@ -328,46 +346,54 @@ discard block |
||
328 | 346 | $DTT = EE_Registry::instance()->load_model('Datetime'); |
329 | 347 | $TKT = EE_Registry::instance()->load_model('Ticket'); |
330 | 348 | $count = $EVT->count(); |
331 | - if ( $count > 0 ) |
|
332 | - update_option('uxip_ee4_all_events_count', $count); |
|
349 | + if ( $count > 0 ) { |
|
350 | + update_option('uxip_ee4_all_events_count', $count); |
|
351 | + } |
|
333 | 352 | |
334 | 353 | //next let's just get the number of ACTIVE events |
335 | 354 | $count_active = $EVT->get_active_events(array(), TRUE); |
336 | - if ( $count_active > 0 ) |
|
337 | - update_option('uxip_ee4_active_events_count', $count_active); |
|
355 | + if ( $count_active > 0 ) { |
|
356 | + update_option('uxip_ee4_active_events_count', $count_active); |
|
357 | + } |
|
338 | 358 | |
339 | 359 | //datetimes! |
340 | 360 | $dtt_count = $DTT->count(); |
341 | - if ( $dtt_count > 0 ) |
|
342 | - update_option( 'uxip_ee_all_dtts_count', $dtt_count ); |
|
361 | + if ( $dtt_count > 0 ) { |
|
362 | + update_option( 'uxip_ee_all_dtts_count', $dtt_count ); |
|
363 | + } |
|
343 | 364 | |
344 | 365 | |
345 | 366 | //dttsold |
346 | 367 | $dtt_sold = $DTT->sum(array(), 'DTT_sold'); |
347 | - if ( $dtt_sold > 0 ) |
|
348 | - update_option( 'uxip_ee_dtt_sold', $dtt_sold ); |
|
368 | + if ( $dtt_sold > 0 ) { |
|
369 | + update_option( 'uxip_ee_dtt_sold', $dtt_sold ); |
|
370 | + } |
|
349 | 371 | |
350 | 372 | //allticketcount |
351 | 373 | $all_tkt_count = $TKT->count(); |
352 | - if ( $all_tkt_count > 0 ) |
|
353 | - update_option( 'uxip_ee_all_tkt_count', $all_tkt_count ); |
|
374 | + if ( $all_tkt_count > 0 ) { |
|
375 | + update_option( 'uxip_ee_all_tkt_count', $all_tkt_count ); |
|
376 | + } |
|
354 | 377 | |
355 | 378 | //freetktcount |
356 | 379 | $_where = array( 'TKT_price' => 0 ); |
357 | 380 | $free_tkt_count = $TKT->count(array($_where)); |
358 | - if ( $free_tkt_count > 0 ) |
|
359 | - update_option( 'uxip_ee_free_tkt_count', $free_tkt_count ); |
|
381 | + if ( $free_tkt_count > 0 ) { |
|
382 | + update_option( 'uxip_ee_free_tkt_count', $free_tkt_count ); |
|
383 | + } |
|
360 | 384 | |
361 | 385 | //paidtktcount |
362 | 386 | $_where = array( 'TKT_price' => array('>', 0) ); |
363 | 387 | $paid_tkt_count = $TKT->count( array( $_where ) ); |
364 | - if ( $paid_tkt_count > 0 ) |
|
365 | - update_option( 'uxip_ee_paid_tkt_count', $paid_tkt_count ); |
|
388 | + if ( $paid_tkt_count > 0 ) { |
|
389 | + update_option( 'uxip_ee_paid_tkt_count', $paid_tkt_count ); |
|
390 | + } |
|
366 | 391 | |
367 | 392 | //tktsold |
368 | 393 | $tkt_sold = $TKT->sum( array(), 'TKT_sold' ); |
369 | - if( $tkt_sold > 0 ) |
|
370 | - update_option( 'uxip_ee_tkt_sold', $tkt_sold ); |
|
394 | + if( $tkt_sold > 0 ) { |
|
395 | + update_option( 'uxip_ee_tkt_sold', $tkt_sold ); |
|
396 | + } |
|
371 | 397 | |
372 | 398 | |
373 | 399 | set_transient( 'ee4_event_info_check', 1, WEEK_IN_SECONDS * 2 ); |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | * @param string $shortcode |
62 | 62 | * @return string |
63 | 63 | */ |
64 | - protected function _parser( $shortcode ) { |
|
64 | + protected function _parser($shortcode) { |
|
65 | 65 | |
66 | - if ( ! $this->_data instanceof EE_Datetime ) { |
|
66 | + if ( ! $this->_data instanceof EE_Datetime) { |
|
67 | 67 | return ''; //get out cause we can only parse with the datetime object. |
68 | 68 | } |
69 | 69 | |
70 | - switch ( $shortcode ) { |
|
70 | + switch ($shortcode) { |
|
71 | 71 | |
72 | 72 | case '[DATETIME_START]' : |
73 | 73 | return $this->_data->get_i18n_datetime('DTT_EVT_start'); |
@@ -81,27 +81,27 @@ discard block |
||
81 | 81 | return $this->_data->get_timezone(); |
82 | 82 | break; |
83 | 83 | case '[DATE_START]' : |
84 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'date_format' ) ); |
|
84 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('date_format')); |
|
85 | 85 | break; |
86 | 86 | case '[DATE_END]' : |
87 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'date_format' ) ); |
|
87 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('date_format')); |
|
88 | 88 | break; |
89 | 89 | case '[TIME_START]' : |
90 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'time_format' ) ); |
|
90 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('time_format')); |
|
91 | 91 | break; |
92 | 92 | case '[TIME_END]' : |
93 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'time_format' ) ); |
|
93 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('time_format')); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | |
97 | - if ( strpos( $shortcode, '[ICAL_LINK_*') !== FALSE ) { |
|
98 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
97 | + if (strpos($shortcode, '[ICAL_LINK_*') !== FALSE) { |
|
98 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
99 | 99 | |
100 | - $link_text = empty( $attrs['link_text'] ) ? __( 'Add to iCal Calendar', 'event_espresso' ) : $attrs['link_text']; |
|
100 | + $link_text = empty($attrs['link_text']) ? __('Add to iCal Calendar', 'event_espresso') : $attrs['link_text']; |
|
101 | 101 | |
102 | - $URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $this->_data->ID() ), site_url() ); |
|
102 | + $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $this->_data->ID()), site_url()); |
|
103 | 103 | |
104 | - return '<a class="ee-ical" href="' . $URL . '">' . $link_text . '</a>'; |
|
104 | + return '<a class="ee-ical" href="'.$URL.'">'.$link_text.'</a>'; |
|
105 | 105 | |
106 | 106 | } |
107 | 107 |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $model_names = $this->models_for_requested_version(); |
232 | 232 | if( isset( $model_names[ $model_name ] ) ) { |
233 | 233 | return true; |
234 | - }else{ |
|
234 | + } else{ |
|
235 | 235 | return false; |
236 | 236 | } |
237 | 237 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | public function load_model( $model_name ) { |
250 | 250 | if( $this->is_model_name_in_this_version( $model_name ) ) { |
251 | 251 | return \EE_Registry::instance()->load_model( $model_name ); |
252 | - }else{ |
|
252 | + } else{ |
|
253 | 253 | throw new \EE_Error( |
254 | 254 | sprintf( |
255 | 255 | __( |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\libraries\rest_api; |
3 | 3 | |
4 | -if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | protected $_cached_fields_on_models = array(); |
89 | 89 | |
90 | 90 | |
91 | - public function __construct( $requested_version ) { |
|
91 | + public function __construct($requested_version) { |
|
92 | 92 | $this->_requested_version = $requested_version; |
93 | 93 | $this->_model_changes = array( |
94 | 94 | '4.8.29' => array( |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | 'table_column' => 'N/A', |
111 | 111 | 'always_available' => true, |
112 | 112 | ); |
113 | - foreach( $this->_resource_changes as $version => $model_classnames ) { |
|
114 | - foreach( $model_classnames as $model_classname => $extra_fields ) { |
|
115 | - foreach( $extra_fields as $fieldname => $field_data ) { |
|
116 | - $this->_resource_changes[ $model_classname ][ $fieldname ][ 'name' ] = $fieldname; |
|
117 | - foreach( $defaults as $attribute => $default_value ) { |
|
118 | - if( ! isset( $this->_resource_changes[ $model_classname ][ $fieldname ][ $attribute ] ) ) { |
|
119 | - $this->_resource_changes[ $model_classname ][ $fieldname ][ $attribute ] = $default_value; |
|
113 | + foreach ($this->_resource_changes as $version => $model_classnames) { |
|
114 | + foreach ($model_classnames as $model_classname => $extra_fields) { |
|
115 | + foreach ($extra_fields as $fieldname => $field_data) { |
|
116 | + $this->_resource_changes[$model_classname][$fieldname]['name'] = $fieldname; |
|
117 | + foreach ($defaults as $attribute => $default_value) { |
|
118 | + if ( ! isset($this->_resource_changes[$model_classname][$fieldname][$attribute])) { |
|
119 | + $this->_resource_changes[$model_classname][$fieldname][$attribute] = $default_value; |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | } |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | * @return array |
133 | 133 | */ |
134 | 134 | public function model_changes_between_requested_version_and_current() { |
135 | - if( $this->_cached_model_changes_between_requested_version_and_current === null ) { |
|
135 | + if ($this->_cached_model_changes_between_requested_version_and_current === null) { |
|
136 | 136 | $model_changes = array(); |
137 | - foreach( $this->model_changes() as $version => $models_changed_in_version ) { |
|
138 | - if( $version <= \EED_Core_Rest_Api::core_version() && $version > $this->requested_version() ) { |
|
139 | - $model_changes[ $version ] = $models_changed_in_version; |
|
137 | + foreach ($this->model_changes() as $version => $models_changed_in_version) { |
|
138 | + if ($version <= \EED_Core_Rest_Api::core_version() && $version > $this->requested_version()) { |
|
139 | + $model_changes[$version] = $models_changed_in_version; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | $this->_cached_model_changes_between_requested_version_and_current = $model_changes; |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | * @return array |
153 | 153 | */ |
154 | 154 | public function resource_changes_between_requested_version_and_current() { |
155 | - if( $this->_cached_resource_changes_between_requested_version_and_current === null ) { |
|
155 | + if ($this->_cached_resource_changes_between_requested_version_and_current === null) { |
|
156 | 156 | $resource_changes = array(); |
157 | - foreach( $this->resource_changes() as $version => $model_classnames ) { |
|
158 | - if( $version <= \EED_Core_Rest_Api::core_version() && $version > $this->requested_version() ) { |
|
159 | - $resource_changes[ $version ] = $model_classnames; |
|
157 | + foreach ($this->resource_changes() as $version => $model_classnames) { |
|
158 | + if ($version <= \EED_Core_Rest_Api::core_version() && $version > $this->requested_version()) { |
|
159 | + $resource_changes[$version] = $model_classnames; |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | $this->_cached_resource_changes_between_requested_version_and_current = $resource_changes; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * If a request was sent to 'wp-json/ee/v4.7/events' this would be '4.7' |
169 | 169 | * @return string like '4.6' |
170 | 170 | */ |
171 | - public function requested_version(){ |
|
171 | + public function requested_version() { |
|
172 | 172 | return $this->_requested_version; |
173 | 173 | } |
174 | 174 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * If a version is missing then we don't know anything about what changes it introduced from the previous version |
183 | 183 | * @return array |
184 | 184 | */ |
185 | - public function model_changes(){ |
|
185 | + public function model_changes() { |
|
186 | 186 | return $this->_model_changes; |
187 | 187 | } |
188 | 188 | |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | * @return array keys are model names, values are their classname |
194 | 194 | */ |
195 | 195 | public function models_for_requested_version() { |
196 | - if( $this->_cached_models_for_requested_version === null ) { |
|
196 | + if ($this->_cached_models_for_requested_version === null) { |
|
197 | 197 | $all_models_in_current_version = \EE_Registry::instance()->non_abstract_db_models; |
198 | - foreach( $this->model_changes_between_requested_version_and_current() as $version => $models_changed ) { |
|
199 | - foreach( $models_changed as $model_name => $new_indicator_or_fields_added ) { |
|
200 | - if( $new_indicator_or_fields_added === Model_Version_Info::model_added ) { |
|
201 | - unset( $all_models_in_current_version[ $model_name ] ); |
|
198 | + foreach ($this->model_changes_between_requested_version_and_current() as $version => $models_changed) { |
|
199 | + foreach ($models_changed as $model_name => $new_indicator_or_fields_added) { |
|
200 | + if ($new_indicator_or_fields_added === Model_Version_Info::model_added) { |
|
201 | + unset($all_models_in_current_version[$model_name]); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | } |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | * @param string $model_name eg 'Event' |
218 | 218 | * @return boolean |
219 | 219 | */ |
220 | - public function is_model_name_in_this_version( $model_name ) { |
|
220 | + public function is_model_name_in_this_version($model_name) { |
|
221 | 221 | $model_names = $this->models_for_requested_version(); |
222 | - if( isset( $model_names[ $model_name ] ) ) { |
|
222 | + if (isset($model_names[$model_name])) { |
|
223 | 223 | return true; |
224 | - }else{ |
|
224 | + } else { |
|
225 | 225 | return false; |
226 | 226 | } |
227 | 227 | } |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | * @return \EEM_Base |
237 | 237 | * @throws \EE_Error |
238 | 238 | */ |
239 | - public function load_model( $model_name ) { |
|
240 | - if( $this->is_model_name_in_this_version( $model_name ) ) { |
|
241 | - return \EE_Registry::instance()->load_model( $model_name ); |
|
242 | - }else{ |
|
239 | + public function load_model($model_name) { |
|
240 | + if ($this->is_model_name_in_this_version($model_name)) { |
|
241 | + return \EE_Registry::instance()->load_model($model_name); |
|
242 | + } else { |
|
243 | 243 | throw new \EE_Error( |
244 | 244 | sprintf( |
245 | 245 | __( |
@@ -261,21 +261,21 @@ discard block |
||
261 | 261 | * @param \EEM_Base $model |
262 | 262 | * @return array|\EE_Model_Field_Base[] |
263 | 263 | */ |
264 | - public function fields_on_model_in_this_version( $model ) { |
|
265 | - if( ! isset( $this->_cached_fields_on_models[ $model->get_this_model_name() ] ) ) { |
|
264 | + public function fields_on_model_in_this_version($model) { |
|
265 | + if ( ! isset($this->_cached_fields_on_models[$model->get_this_model_name()])) { |
|
266 | 266 | //get all model changes between the requested version and current core version |
267 | 267 | $changes = $this->model_changes_between_requested_version_and_current(); |
268 | 268 | //fetch all fields currently on this model |
269 | 269 | $current_fields = $model->field_settings(); |
270 | 270 | //remove all fields that have been added since |
271 | - foreach( $changes as $version => $changes_in_version ) { |
|
272 | - if( |
|
273 | - isset( $changes_in_version[ $model->get_this_model_name() ] ) |
|
274 | - && $changes_in_version[ $model->get_this_model_name() ] !== Model_Version_Info::model_added |
|
271 | + foreach ($changes as $version => $changes_in_version) { |
|
272 | + if ( |
|
273 | + isset($changes_in_version[$model->get_this_model_name()]) |
|
274 | + && $changes_in_version[$model->get_this_model_name()] !== Model_Version_Info::model_added |
|
275 | 275 | ) { |
276 | 276 | $current_fields = array_diff_key( |
277 | 277 | $current_fields, |
278 | - array_flip( $changes_in_version[ $model->get_this_model_name() ] ) |
|
278 | + array_flip($changes_in_version[$model->get_this_model_name()]) |
|
279 | 279 | ); |
280 | 280 | } |
281 | 281 | } |
@@ -293,9 +293,9 @@ discard block |
||
293 | 293 | * @param array $classnames |
294 | 294 | * @return boolean |
295 | 295 | */ |
296 | - public function is_subclass_of_one( $object, $classnames ) { |
|
297 | - foreach( $classnames as $classname ) { |
|
298 | - if( is_a( $object, $classname ) ) { |
|
296 | + public function is_subclass_of_one($object, $classnames) { |
|
297 | + foreach ($classnames as $classname) { |
|
298 | + if (is_a($object, $classname)) { |
|
299 | 299 | return true; |
300 | 300 | } |
301 | 301 | } |
@@ -306,10 +306,10 @@ discard block |
||
306 | 306 | * Returns the list of model field classes that that the API basically ignores |
307 | 307 | * @return array |
308 | 308 | */ |
309 | - public function fields_ignored(){ |
|
309 | + public function fields_ignored() { |
|
310 | 310 | return apply_filters( |
311 | 311 | 'FHEE__Controller_Model_Read_fields_ignored', |
312 | - array( 'EE_Foreign_Key_Field_Base', 'EE_Any_Foreign_Model_Name_Field' ) |
|
312 | + array('EE_Foreign_Key_Field_Base', 'EE_Any_Foreign_Model_Name_Field') |
|
313 | 313 | ); |
314 | 314 | } |
315 | 315 | |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | * @param EE_Model_Field_Base |
319 | 319 | * @return boolean |
320 | 320 | */ |
321 | - public function field_is_ignored( $field_obj ){ |
|
322 | - return $this->is_subclass_of_one( $field_obj, $this->fields_ignored() ); |
|
321 | + public function field_is_ignored($field_obj) { |
|
322 | + return $this->is_subclass_of_one($field_obj, $this->fields_ignored()); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | public function fields_that_have_rendered_format() { |
331 | 331 | return apply_filters( |
332 | 332 | 'FHEE__Controller_Model_Read__fields_raw', |
333 | - array( 'EE_Post_Content_Field', 'EE_Full_HTML_Field' ) |
|
333 | + array('EE_Post_Content_Field', 'EE_Full_HTML_Field') |
|
334 | 334 | ); |
335 | 335 | } |
336 | 336 | |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | * @param EE_Model_Field_Base |
340 | 340 | * @return boolean |
341 | 341 | */ |
342 | - public function field_has_rendered_format( $field_obj ){ |
|
343 | - return $this->is_subclass_of_one( $field_obj, $this->fields_that_have_rendered_format() ); |
|
342 | + public function field_has_rendered_format($field_obj) { |
|
343 | + return $this->is_subclass_of_one($field_obj, $this->fields_that_have_rendered_format()); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | public function fields_that_have_pretty_format() { |
353 | 353 | return apply_filters( |
354 | 354 | 'FHEE__Controller_Model_Read__fields_pretty', |
355 | - array( 'EE_Enum_Integer_Field', 'EE_Enum_Text_Field', 'EE_Money_Field' ) |
|
355 | + array('EE_Enum_Integer_Field', 'EE_Enum_Text_Field', 'EE_Money_Field') |
|
356 | 356 | ); |
357 | 357 | } |
358 | 358 | |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | * @param EE_Model_Field_Base |
362 | 362 | * @return boolean |
363 | 363 | */ |
364 | - public function field_has_pretty_format( $field_obj ){ |
|
365 | - return $this->is_subclass_of_one( $field_obj, $this->fields_that_have_pretty_format() ); |
|
364 | + public function field_has_pretty_format($field_obj) { |
|
365 | + return $this->is_subclass_of_one($field_obj, $this->fields_that_have_pretty_format()); |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
@@ -379,12 +379,12 @@ discard block |
||
379 | 379 | * @param \EEM_Base $model |
380 | 380 | * @return array |
381 | 381 | */ |
382 | - public function extra_resource_properties_for_model( $model ) { |
|
382 | + public function extra_resource_properties_for_model($model) { |
|
383 | 383 | $extra_properties = array(); |
384 | - foreach( $this->resource_changes_between_requested_version_and_current() as $version => $model_classnames ) { |
|
385 | - foreach( $model_classnames as $model_classname => $properties_added_in_this_version ) { |
|
386 | - if( is_subclass_of( $model, $model_classname ) ) { |
|
387 | - $extra_properties = array_merge( $extra_properties, $properties_added_in_this_version ); |
|
384 | + foreach ($this->resource_changes_between_requested_version_and_current() as $version => $model_classnames) { |
|
385 | + foreach ($model_classnames as $model_classname => $properties_added_in_this_version) { |
|
386 | + if (is_subclass_of($model, $model_classname)) { |
|
387 | + $extra_properties = array_merge($extra_properties, $properties_added_in_this_version); |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 | } |
@@ -13,8 +13,8 @@ |
||
13 | 13 | */ |
14 | 14 | namespace EventEspressoBatchRequest\JobHandlerBaseClasses; |
15 | 15 | |
16 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
17 | - exit( 'No direct script access allowed' ); |
|
16 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
17 | + exit('No direct script access allowed'); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | * @param null $timezone |
23 | 23 | * @return EE_Extra_Join|mixed |
24 | 24 | */ |
25 | - public static function new_instance( $props_n_values = array(), $timezone = NULL ) { |
|
26 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone ); |
|
27 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
25 | + public static function new_instance($props_n_values = array(), $timezone = NULL) { |
|
26 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
27 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | * @param null $timezone |
35 | 35 | * @return EE_Extra_Join |
36 | 36 | */ |
37 | - public static function new_instance_from_db ( $props_n_values = array(), $timezone = NULL ) { |
|
38 | - return new self( $props_n_values, TRUE, $timezone ); |
|
37 | + public static function new_instance_from_db($props_n_values = array(), $timezone = NULL) { |
|
38 | + return new self($props_n_values, TRUE, $timezone); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | } |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Contains definition for EE_Extra_Join model object |
4 | 6 | * @package Event Espresso |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | <div id="espresso-event-details-dv" class="" > |
20 | 20 | <?php |
21 | 21 | // Start the Loop. |
22 | - while ( have_posts() ) : the_post(); |
|
22 | + while (have_posts()) : the_post(); |
|
23 | 23 | // Include the post TYPE-specific template for the content. |
24 | - espresso_get_template_part( 'content', 'espresso_events' ); |
|
24 | + espresso_get_template_part('content', 'espresso_events'); |
|
25 | 25 | // If comments are open or we have at least one comment, load up the comment template. |
26 | - if ( comments_open() || get_comments_number() ) { |
|
26 | + if (comments_open() || get_comments_number()) { |
|
27 | 27 | comments_template(); |
28 | 28 | } |
29 | 29 | endwhile; |
@@ -35,6 +35,6 @@ discard block |
||
35 | 35 | </div><!-- #primary --> |
36 | 36 | |
37 | 37 | <?php |
38 | -get_sidebar( 'content' ); |
|
38 | +get_sidebar('content'); |
|
39 | 39 | get_sidebar(); |
40 | 40 | get_footer(); |
41 | 41 | \ No newline at end of file |