Completed
Branch BUG-9715-shortcode-resources (0cf20f)
by
unknown
695:33 queued 678:11
created
core/CPTs/EE_CPT_Event_Strategy.core.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
 	 * @param WP_Query $wp_query
40 40
 	 * @param array $CPT
41 41
 	 */
42
-	public function __construct( $wp_query, $CPT = array() ) {
43
-		if ( $wp_query instanceof WP_Query ) {
42
+	public function __construct($wp_query, $CPT = array()) {
43
+		if ($wp_query instanceof WP_Query) {
44 44
 			$WP_Query = $wp_query;
45 45
 			$this->CPT = $CPT;
46 46
 		} else {
47
-			$WP_Query = isset( $wp_query[ 'WP_Query' ] ) ? $wp_query[ 'WP_Query' ] : null;
48
-			$this->CPT = isset( $wp_query[ 'CPT' ] ) ? $wp_query[ 'CPT' ] : null;
47
+			$WP_Query = isset($wp_query['WP_Query']) ? $wp_query['WP_Query'] : null;
48
+			$this->CPT = isset($wp_query['CPT']) ? $wp_query['CPT'] : null;
49 49
 		}
50 50
 		// !!!!!!!!!!  IMPORTANT !!!!!!!!!!!!
51 51
 		// here's the list of available filters in the WP_Query object
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 		// 'posts_fields'
60 60
 		// 'posts_join'
61 61
 		$this->_add_filters();
62
-		if ( $WP_Query instanceof WP_Query ) {
63
-			$WP_Query->is_espresso_event_single = is_singular() && isset( $WP_Query->query->post_type ) && $WP_Query->query->post_type == 'espresso_events' ? TRUE : FALSE;
62
+		if ($WP_Query instanceof WP_Query) {
63
+			$WP_Query->is_espresso_event_single = is_singular() && isset($WP_Query->query->post_type) && $WP_Query->query->post_type == 'espresso_events' ? TRUE : FALSE;
64 64
 			$WP_Query->is_espresso_event_archive = is_post_type_archive('espresso_events') ? TRUE : FALSE;
65
-			$WP_Query->is_espresso_event_taxonomy = is_tax( 'espresso_event_categories' ) ? TRUE : FALSE;
65
+			$WP_Query->is_espresso_event_taxonomy = is_tax('espresso_event_categories') ? TRUE : FALSE;
66 66
 		}
67 67
 
68 68
 	}
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 	 * (which will get removed in case the next call to get_posts ISN'T
75 75
 	 * for event CPTs)
76 76
 	 */
77
-	protected function _add_filters(){
78
-		add_filter( 'posts_fields', array( $this, 'posts_fields' ), 1, 2 );
79
-		add_filter( 'posts_join', array( $this, 'posts_join' ), 1, 2 );
80
-		add_filter( 'posts_where', array( $this, 'posts_where' ), 10, 2 );
77
+	protected function _add_filters() {
78
+		add_filter('posts_fields', array($this, 'posts_fields'), 1, 2);
79
+		add_filter('posts_join', array($this, 'posts_join'), 1, 2);
80
+		add_filter('posts_where', array($this, 'posts_where'), 10, 2);
81 81
 		// add_filter( 'the_posts', array( $this, 'the_posts' ), 1, 2 );
82
-		add_filter( 'posts_orderby', array( $this, 'posts_orderby' ), 1, 2 );
83
-		add_filter( 'posts_groupby', array( $this, 'posts_groupby' ), 1, 2 );
82
+		add_filter('posts_orderby', array($this, 'posts_orderby'), 1, 2);
83
+		add_filter('posts_groupby', array($this, 'posts_groupby'), 1, 2);
84 84
 	}
85 85
 
86 86
 
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 	 * This is to avoid applying this CPT strategy for other posts or CPTs (eg,
91 91
 	 * we don't want to join to the datetime table when querying for venues, do we!?)
92 92
 	 */
93
-	protected function _remove_filters(){
94
-		remove_filter( 'posts_fields', array( $this, 'posts_fields' ), 1 );
95
-		remove_filter( 'posts_join', array( $this, 'posts_join' ), 1 );
96
-		remove_filter( 'posts_where', array( $this, 'posts_where' ), 10 );
93
+	protected function _remove_filters() {
94
+		remove_filter('posts_fields', array($this, 'posts_fields'), 1);
95
+		remove_filter('posts_join', array($this, 'posts_join'), 1);
96
+		remove_filter('posts_where', array($this, 'posts_where'), 10);
97 97
 		// remove_filter( 'the_posts', array( $this, 'the_posts' ), 1 );
98
-		remove_filter( 'posts_orderby', array( $this, 'posts_orderby' ), 1 );
99
-		remove_filter( 'posts_groupby', array( $this, 'posts_groupby' ), 1 );
98
+		remove_filter('posts_orderby', array($this, 'posts_orderby'), 1);
99
+		remove_filter('posts_groupby', array($this, 'posts_groupby'), 1);
100 100
 	}
101 101
 
102 102
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @param WP_Query $wp_query
110 110
 	 * @return    string
111 111
 	 */
112
-	public function posts_fields( $SQL, WP_Query $wp_query ) {
112
+	public function posts_fields($SQL, WP_Query $wp_query) {
113 113
 		if (
114 114
 			$wp_query instanceof WP_Query
115 115
 			&&
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 			)
121 121
 		) {
122 122
 			// adds something like ", wp_esp_datetime.* " to WP Query SELECT statement
123
-			$SQL .= ', ' . EEM_Datetime::instance()->table() . '.* ' ;
124
-			if ( $wp_query->is_espresso_event_archive || $wp_query->is_espresso_event_taxonomy ) {
123
+			$SQL .= ', '.EEM_Datetime::instance()->table().'.* ';
124
+			if ($wp_query->is_espresso_event_archive || $wp_query->is_espresso_event_taxonomy) {
125 125
 				// because we only want to retrieve the next upcoming datetime for each event:
126 126
 				// add something like ", MIN( wp_esp_datetime.DTT_EVT_start ) as event_start_date " to WP Query SELECT statement
127
-				$SQL .= ', MIN( ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start ) as event_start_date ' ;
127
+				$SQL .= ', MIN( '.EEM_Datetime::instance()->table().'.DTT_EVT_start ) as event_start_date ';
128 128
 			}
129 129
 		}
130 130
 		return $SQL;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * @internal  param \WP_Query $WP_Query
142 142
 	 * @return    string
143 143
 	 */
144
-	public function posts_join( $SQL, WP_Query $wp_query ) {
144
+	public function posts_join($SQL, WP_Query $wp_query) {
145 145
 		if (
146 146
 			$wp_query instanceof WP_Query
147 147
 			&&
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			)
153 153
 		) {
154 154
 			// adds something like " LEFT JOIN wp_esp_datetime ON ( wp_esp_datetime.EVT_ID = wp_posts.ID ) " to WP Query JOIN statement
155
-			$SQL .= ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . EEM_Event::instance()->table() . '.ID = ' . EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name() . ' ) ';
155
+			$SQL .= ' INNER JOIN '.EEM_Datetime::instance()->table().' ON ( '.EEM_Event::instance()->table().'.ID = '.EEM_Datetime::instance()->table().'.'.EEM_Event::instance()->primary_key_name().' ) ';
156 156
 		}
157 157
 		return $SQL;
158 158
 	}
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 * @param WP_Query $wp_query
168 168
 	 * @return    string
169 169
 	 */
170
-	public function posts_where( $SQL, WP_Query $wp_query ) {
170
+	public function posts_where($SQL, WP_Query $wp_query) {
171 171
 //		global $wpdb;
172 172
 		if (
173 173
 			$wp_query instanceof WP_Query
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 				|| $wp_query->is_espresso_event_taxonomy
178 178
 			)
179 179
 		) {
180
-			if ( ! isset( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive ) || ! isset( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->display_expired_events ) || ! EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->display_expired_events ) {
181
-				$SQL .=  ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . current_time( 'mysql', true ) . '" ';
180
+			if ( ! isset(EE_Registry::instance()->CFG->template_settings->EED_Events_Archive) || ! isset(EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->display_expired_events) || ! EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->display_expired_events) {
181
+				$SQL .= ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end > "'.current_time('mysql', true).'" ';
182 182
 			}
183 183
 		}
184 184
 		return $SQL;
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	 * @param 	WP_Query $wp_query
195 195
 	 * @return 	string
196 196
 	 */
197
-	public function posts_orderby( $SQL, WP_Query $wp_query ) {
197
+	public function posts_orderby($SQL, WP_Query $wp_query) {
198 198
 		if (
199 199
 			$wp_query instanceof WP_Query
200 200
 			&&
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 * @param WP_Query $wp_query
219 219
 	 * @return    string
220 220
 	 */
221
-	public function posts_groupby( $SQL, WP_Query $wp_query ) {
221
+	public function posts_groupby($SQL, WP_Query $wp_query) {
222 222
 		if (
223 223
 			$wp_query instanceof WP_Query
224 224
 			&&
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 			// we're joining to the datetimes table, where there can be MANY datetimes for a single event, but we want to only show each event only once
232 232
 			// (whereas if we didn't group them by the post's ID, then we would end up with many repeats)
233 233
 			global $wpdb;
234
-			$SQL = $wpdb->posts . '.ID ';
234
+			$SQL = $wpdb->posts.'.ID ';
235 235
 		}
236 236
 		return $SQL;
237 237
 	}
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 * @param WP_Query $wp_query
247 247
 	 * @return    array
248 248
 	 */
249
-	public function the_posts( $posts, WP_Query $wp_query ) {
249
+	public function the_posts($posts, WP_Query $wp_query) {
250 250
 		return $posts;
251 251
 	}
252 252
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 * @param      $single
263 263
 	 * @return    string
264 264
 	 */
265
-	public function get_EE_post_type_metadata( $meta_value = NULL, $post_id, $meta_key, $single ) {
265
+	public function get_EE_post_type_metadata($meta_value = NULL, $post_id, $meta_key, $single) {
266 266
 		return $meta_value;
267 267
 	}
268 268
 
Please login to merge, or discard this patch.
core/CPTs/EE_CPT_Venue_Strategy.core.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,15 +39,15 @@  discard block
 block discarded – undo
39 39
 	 * @param 	array 	$arguments
40 40
 	 * @return \EE_CPT_Venue_Strategy
41 41
 	 */
42
-	public function __construct( $arguments = array() ) {
43
-		$this->CPT = isset( $arguments['CPT'] ) ? $arguments['CPT'] : NULL;
44
-		$WP_Query = isset( $arguments['WP_Query'] ) ? $arguments['WP_Query'] : NULL;
45
-		if ( $WP_Query instanceof WP_Query && ! $WP_Query->is_tag ) {
46
-			$WP_Query->is_espresso_venue_single = is_singular() && isset( $WP_Query->query->post_type ) && $WP_Query->query->post_type == 'espresso_venues' ? TRUE : FALSE;
42
+	public function __construct($arguments = array()) {
43
+		$this->CPT = isset($arguments['CPT']) ? $arguments['CPT'] : NULL;
44
+		$WP_Query = isset($arguments['WP_Query']) ? $arguments['WP_Query'] : NULL;
45
+		if ($WP_Query instanceof WP_Query && ! $WP_Query->is_tag) {
46
+			$WP_Query->is_espresso_venue_single = is_singular() && isset($WP_Query->query->post_type) && $WP_Query->query->post_type == 'espresso_venues' ? TRUE : FALSE;
47 47
 			$WP_Query->is_espresso_venue_archive = is_post_type_archive('espresso_venues') ? TRUE : FALSE;
48
-			$WP_Query->is_espresso_venue_taxonomy = is_tax( 'espresso_venue_categories' ) ? TRUE : FALSE;
48
+			$WP_Query->is_espresso_venue_taxonomy = is_tax('espresso_venue_categories') ? TRUE : FALSE;
49 49
 		}
50
-		add_filter( 'the_posts', array( $this, 'the_posts' ), 1, 2 );
50
+		add_filter('the_posts', array($this, 'the_posts'), 1, 2);
51 51
 	}
52 52
 
53 53
 
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 	 * @param WP_Query $wp_query
61 61
 	 * @return    void
62 62
 	 */
63
-	public function the_posts( $posts, WP_Query $wp_query) {
63
+	public function the_posts($posts, WP_Query $wp_query) {
64 64
 		// automagically load the EEH_Venue_View helper so that it's functions are available
65
-		if ( isset( EE_Registry::instance()->CFG->map_settings->use_google_maps ) && EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
65
+		if (isset(EE_Registry::instance()->CFG->map_settings->use_google_maps) && EE_Registry::instance()->CFG->map_settings->use_google_maps) {
66 66
 			EEH_Maps::espresso_google_map_js();
67 67
 		}
68
-		remove_filter( 'the_posts', array( $this, 'the_posts' ), 1, 2 );
68
+		remove_filter('the_posts', array($this, 'the_posts'), 1, 2);
69 69
 		return $posts;
70 70
 	}
71 71
 
Please login to merge, or discard this patch.
core/EES_Shortcode.shortcode.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @param WP $WP
43 43
 	 * @return    void
44 44
 	 */
45
-	public abstract function run( WP $WP );
45
+	public abstract function run(WP $WP);
46 46
 
47 47
 
48 48
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 *  @param		array 	$attributes
55 55
 	 *  @return 	mixed
56 56
 	 */
57
-	public abstract function process_shortcode( $attributes = array() );
57
+	public abstract function process_shortcode($attributes = array());
58 58
 
59 59
 
60 60
 
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 	 * @param 	string $shortcode_class
66 66
 	 * @return 	\EES_Shortcode
67 67
 	 */
68
-	final public static function instance( $shortcode_class = NULL ) {
69
-		$shortcode_class = ! empty( $shortcode_class ) ? $shortcode_class : get_called_class();
70
-		if ( $shortcode_class == 'EES_Shortcode' || empty( $shortcode_class )) {
68
+	final public static function instance($shortcode_class = NULL) {
69
+		$shortcode_class = ! empty($shortcode_class) ? $shortcode_class : get_called_class();
70
+		if ($shortcode_class == 'EES_Shortcode' || empty($shortcode_class)) {
71 71
 			return NULL;
72 72
 		}
73
-		$shortcode = str_replace( 'EES_', '', strtoupper( $shortcode_class ));
74
-		$shortcode_obj = isset( EE_Registry::instance()->shortcodes->{$shortcode} ) ? EE_Registry::instance()->shortcodes->{$shortcode} : NULL;
73
+		$shortcode = str_replace('EES_', '', strtoupper($shortcode_class));
74
+		$shortcode_obj = isset(EE_Registry::instance()->shortcodes->{$shortcode} ) ? EE_Registry::instance()->shortcodes->{$shortcode} : NULL;
75 75
 		return $shortcode_obj instanceof $shortcode_class || $shortcode_class == 'self' ? $shortcode_obj : new $shortcode_class();
76 76
 	}
77 77
 
@@ -86,23 +86,23 @@  discard block
 block discarded – undo
86 86
 	 * @param 	$attributes
87 87
 	 * @return 	mixed
88 88
 	 */
89
-	final public static function fallback_shortcode_processor( $attributes ) {
90
-		if ( EE_Maintenance_Mode::disable_frontend_for_maintenance() ) {
89
+	final public static function fallback_shortcode_processor($attributes) {
90
+		if (EE_Maintenance_Mode::disable_frontend_for_maintenance()) {
91 91
 			return null;
92 92
 		}
93 93
 		// what shortcode was actually parsed ?
94 94
 		$shortcode_class = get_called_class();
95 95
 		// notify rest of system that fallback processor was triggered
96
-		add_filter( 'FHEE__fallback_shortcode_processor__' . $shortcode_class, '__return_true' );
96
+		add_filter('FHEE__fallback_shortcode_processor__'.$shortcode_class, '__return_true');
97 97
 		// get instance of actual shortcode
98
-		$shortcode_obj = self::instance( $shortcode_class );
98
+		$shortcode_obj = self::instance($shortcode_class);
99 99
 		// verify class
100
-		if ( $shortcode_obj instanceof EES_Shortcode ) {
100
+		if ($shortcode_obj instanceof EES_Shortcode) {
101 101
 			global $wp;
102
-			$shortcode_obj->run( $wp );
102
+			$shortcode_obj->run($wp);
103 103
 			// set attributes and run the shortcode
104
-			$shortcode_obj->_attributes = (array)$attributes;
105
-			return $shortcode_obj->process_shortcode( $shortcode_obj->_attributes );
104
+			$shortcode_obj->_attributes = (array) $attributes;
105
+			return $shortcode_obj->process_shortcode($shortcode_obj->_attributes);
106 106
 		} else {
107 107
 			return NULL;
108 108
 		}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 * @param 	$attributes
119 119
 	 * @return 	string
120 120
 	 */
121
-	final public static function invalid_shortcode_processor( $attributes ) {
121
+	final public static function invalid_shortcode_processor($attributes) {
122 122
 		return '';
123 123
 	}
124 124
 
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 	 */
133 133
 	final public function __construct() {
134 134
 		// get classname, remove EES_prefix, and convert to UPPERCASE
135
-		$shortcode = strtoupper( str_replace( 'EES_', '', get_class( $this )));
135
+		$shortcode = strtoupper(str_replace('EES_', '', get_class($this)));
136 136
 		// assign shortcode to the preferred callback, which overwrites the "fallback shortcode processor" assigned earlier
137
-		add_shortcode( $shortcode, array( $this, 'process_shortcode' ));
137
+		add_shortcode($shortcode, array($this, 'process_shortcode'));
138 138
 		// make sure system knows this is an EE page
139
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
139
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
140 140
 	}
141 141
 
142 142
 
Please login to merge, or discard this patch.
core/EE_Addon.core.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		//so in case teh IPN is arriving later, let's try to process an IPN!
91 91
 		if($_SERVER['REQUEST_METHOD'] == 'POST'){
92 92
 			return $this->handle_ipn($_POST, $transaction );
93
-		}else{
93
+		} else{
94 94
 			return parent::finalize_payment_for( $transaction );
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  *
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 *    class constructor
96 96
 	 */
97 97
 	public function __construct() {
98
-		add_action( 'AHEE__EE_System__load_controllers__load_admin_controllers', array( $this, 'admin_init' ) );
98
+		add_action('AHEE__EE_System__load_controllers__load_admin_controllers', array($this, 'admin_init'));
99 99
 	}
100 100
 
101 101
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	/**
104 104
 	 * @param mixed $version
105 105
 	 */
106
-	public function set_version( $version = NULL ) {
106
+	public function set_version($version = NULL) {
107 107
 		$this->_version = $version;
108 108
 	}
109 109
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	/**
122 122
 	 * @param mixed $min_core_version
123 123
 	 */
124
-	public function set_min_core_version( $min_core_version = NULL ) {
124
+	public function set_min_core_version($min_core_version = NULL) {
125 125
 		$this->_min_core_version = $min_core_version;
126 126
 	}
127 127
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 * @param string $addon_name
143 143
 	 * @return boolean
144 144
 	 */
145
-	function set_name( $addon_name ) {
145
+	function set_name($addon_name) {
146 146
 		return $this->_addon_name = $addon_name;
147 147
 	}
148 148
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	/**
171 171
 	 * @param string $plugin_basename
172 172
 	 */
173
-	public function set_plugin_basename( $plugin_basename ) {
173
+	public function set_plugin_basename($plugin_basename) {
174 174
 
175 175
 		$this->_plugin_basename = $plugin_basename;
176 176
 	}
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	/**
191 191
 	 * @param string $plugin_slug
192 192
 	 */
193
-	public function set_plugin_slug( $plugin_slug ) {
193
+	public function set_plugin_slug($plugin_slug) {
194 194
 
195 195
 		$this->_plugin_slug = $plugin_slug;
196 196
 	}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	/**
211 211
 	 * @param string $plugin_action_slug
212 212
 	 */
213
-	public function set_plugin_action_slug( $plugin_action_slug ) {
213
+	public function set_plugin_action_slug($plugin_action_slug) {
214 214
 
215 215
 		$this->_plugin_action_slug = $plugin_action_slug;
216 216
 	}
@@ -230,9 +230,9 @@  discard block
 block discarded – undo
230 230
 	/**
231 231
 	 * @param array $plugins_page_row
232 232
 	 */
233
-	public function set_plugins_page_row( $plugins_page_row = array() ) {
233
+	public function set_plugins_page_row($plugins_page_row = array()) {
234 234
 		// sigh.... check for example content that I stupidly merged to master and remove it if found
235
-		if ( ! is_array( $plugins_page_row ) && strpos( $plugins_page_row, '<h3>Promotions Addon Upsell Info</h3>' ) !== false ) {
235
+		if ( ! is_array($plugins_page_row) && strpos($plugins_page_row, '<h3>Promotions Addon Upsell Info</h3>') !== false) {
236 236
 			$plugins_page_row = '';
237 237
 		}
238 238
 		$this->_plugins_page_row = $plugins_page_row;
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 		do_action("AHEE__{$classname}__new_install");
252 252
 		do_action("AHEE__EE_Addon__new_install", $this);
253 253
 		EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
254
-		add_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations', array( $this, 'initialize_db_if_no_migrations_required' ) );
254
+		add_action('AHEE__EE_System__perform_activations_upgrades_and_migrations', array($this, 'initialize_db_if_no_migrations_required'));
255 255
 	}
256 256
 
257 257
 
@@ -266,16 +266,16 @@  discard block
 block discarded – undo
266 266
 		do_action("AHEE__{$classname}__reactivation");
267 267
 		do_action("AHEE__EE_Addon__reactivation", $this);
268 268
 		EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
269
-		add_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations', array( $this, 'initialize_db_if_no_migrations_required' ) );
269
+		add_action('AHEE__EE_System__perform_activations_upgrades_and_migrations', array($this, 'initialize_db_if_no_migrations_required'));
270 270
 	}
271 271
 
272
-	public function deactivation(){
272
+	public function deactivation() {
273 273
 		$classname = get_class($this);
274 274
 //		echo "Deactivating $classname";die;
275 275
 		do_action("AHEE__{$classname}__deactivation");
276 276
 		do_action("AHEE__EE_Addon__deactivation", $this);
277 277
 		//check if the site no longer needs to be in maintenance mode
278
-		EE_Register_Addon::deregister( $this->name() );
278
+		EE_Register_Addon::deregister($this->name());
279 279
 		EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
280 280
 	}
281 281
 
@@ -289,16 +289,16 @@  discard block
 block discarded – undo
289 289
 	 * This is a resource-intensive job so we prefer to only do it when necessary
290 290
 	 * @return void
291 291
 	 */
292
-	public function initialize_db_if_no_migrations_required( $verify_schema = true ) {
293
-		if( $verify_schema === '' ) {
292
+	public function initialize_db_if_no_migrations_required($verify_schema = true) {
293
+		if ($verify_schema === '') {
294 294
 			//wp core bug imo: if no args are passed to `do_action('some_hook_name')` besides the hook's name
295 295
 			//(ie, no 2nd or 3rd arguments), instead of calling the registered callbacks with no arguments, it
296 296
 			//calls them with an argument of an empty string (ie ""), which evaluates to false
297 297
 			//so we need to treat the empty string as if nothing had been passed, and should instead use the default
298 298
 			$verify_schema = true;
299 299
 		}
300
-		if ( EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ) {
301
-			if( $verify_schema ) {
300
+		if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) {
301
+			if ($verify_schema) {
302 302
 				$this->initialize_db();
303 303
 			}
304 304
 			$this->initialize_default_data();
@@ -312,15 +312,15 @@  discard block
 block discarded – undo
312 312
 			 */
313 313
 			EE_Registry::instance()->load_helper('Activation');
314 314
 			EEH_Activation::initialize_db_content();
315
-			update_option( 'ee_flush_rewrite_rules', TRUE );
315
+			update_option('ee_flush_rewrite_rules', TRUE);
316 316
 			//in case there are lots of addons being activated at once, let's force garbage collection
317 317
 			//to help avoid memory limit errors
318 318
 			//EEH_Debug_Tools::instance()->measure_memory( 'db content initialized for ' . get_class( $this), true );
319 319
 			gc_collect_cycles();
320
-		}else{
320
+		} else {
321 321
 			//ask the data migration manager to init this addon's data
322 322
 			//when migrations are finished because we can't do it now
323
-			EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for( $this->name() );
323
+			EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for($this->name());
324 324
 		}
325 325
 	}
326 326
 
@@ -334,20 +334,20 @@  discard block
 block discarded – undo
334 334
 	 */
335 335
 	public function initialize_db() {
336 336
 		//find the migration script that sets the database to be compatible with the code
337
-		$current_dms_name = EE_Data_Migration_Manager::instance()->get_most_up_to_date_dms( $this->name() );
338
-		if( $current_dms_name ){
339
-			$current_data_migration_script = EE_Registry::instance()->load_dms( $current_dms_name );
340
-			$current_data_migration_script->set_migrating( FALSE );
337
+		$current_dms_name = EE_Data_Migration_Manager::instance()->get_most_up_to_date_dms($this->name());
338
+		if ($current_dms_name) {
339
+			$current_data_migration_script = EE_Registry::instance()->load_dms($current_dms_name);
340
+			$current_data_migration_script->set_migrating(FALSE);
341 341
 			$current_data_migration_script->schema_changes_before_migration();
342 342
 			$current_data_migration_script->schema_changes_after_migration();
343
-			if ( $current_data_migration_script->get_errors() ) {
344
-				foreach( $current_data_migration_script->get_errors() as $error ) {
345
-					EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ );
343
+			if ($current_data_migration_script->get_errors()) {
344
+				foreach ($current_data_migration_script->get_errors() as $error) {
345
+					EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__);
346 346
 				}
347 347
 			}
348 348
 		}
349 349
 		//if not DMS was found that should be ok. This addon just doesn't require any database changes
350
-		EE_Data_Migration_Manager::instance()->update_current_database_state_to( array( 'slug' => $this->name(), 'version' => $this->version() ) );
350
+		EE_Data_Migration_Manager::instance()->update_current_database_state_to(array('slug' => $this->name(), 'version' => $this->version()));
351 351
 	}
352 352
 
353 353
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 		 * default data)
370 370
 		 * @param EE_Addon $addon the addon that called this
371 371
 		 */
372
-		do_action( 'AHEE__EE_Addon__initialize_default_data__begin', $this );
372
+		do_action('AHEE__EE_Addon__initialize_default_data__begin', $this);
373 373
 		//override to insert default data. It is safe to use the models here
374 374
 		//because the site should not be in maintenance mode
375 375
 	}
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 		do_action("AHEE__EE_Addon__upgrade", $this);
389 389
 		EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
390 390
 		//also it's possible there is new default data that needs to be added
391
-		add_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations', array( $this, 'initialize_db_if_no_migrations_required' ) );
391
+		add_action('AHEE__EE_System__perform_activations_upgrades_and_migrations', array($this, 'initialize_db_if_no_migrations_required'));
392 392
 	}
393 393
 
394 394
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 		do_action("AHEE__{$classname}__downgrade");
402 402
 		do_action("AHEE__EE_Addon__downgrade", $this);
403 403
 		//it's possible there's old default data that needs to be double-checked
404
-		add_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations', array( $this, 'initialize_db_if_no_migrations_required' ) );
404
+		add_action('AHEE__EE_System__perform_activations_upgrades_and_migrations', array($this, 'initialize_db_if_no_migrations_required'));
405 405
 	}
406 406
 
407 407
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 * plugin activation only. In the future, we'll want to do it on plugin updates too
413 413
 	 * @return bool
414 414
 	 */
415
-	public function set_db_update_option_name(){
415
+	public function set_db_update_option_name() {
416 416
 		EE_Error::doing_it_wrong(__FUNCTION__, __('EE_Addon::set_db_update_option_name was renamed to EE_Addon::set_activation_indicator_option', 'event_espresso'), '4.3.0.alpha.016');
417 417
 		//let's just handle this on the next request, ok? right now we're just not really ready
418 418
 		return $this->set_activation_indicator_option();
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	 */
441 441
 	public function set_activation_indicator_option() {
442 442
 		// let's just handle this on the next request, ok? right now we're just not really ready
443
-		return update_option( $this->get_activation_indicator_option_name(), TRUE );
443
+		return update_option($this->get_activation_indicator_option_name(), TRUE);
444 444
 	}
445 445
 
446 446
 
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
 	 * Gets the name of the wp option which is used to temporarily indicate that this addon was activated
449 449
 	 * @return string
450 450
 	 */
451
-	public function get_activation_indicator_option_name(){
452
-		return 'ee_activation_' . $this->name();
451
+	public function get_activation_indicator_option_name() {
452
+		return 'ee_activation_'.$this->name();
453 453
 	}
454 454
 
455 455
 
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 	 * Used by EE_System to set the request type of this addon. Should not be used by addon developers
460 460
 	 * @param int $req_type
461 461
 	 */
462
-	function set_req_type( $req_type ) {
462
+	function set_req_type($req_type) {
463 463
 		$this->_req_type = $req_type;
464 464
 	}
465 465
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 	 * of addons
471 471
 	 */
472 472
 	function detect_req_type() {
473
-		if( ! $this->_req_type ){
473
+		if ( ! $this->_req_type) {
474 474
 			$this->detect_activation_or_upgrade();
475 475
 		}
476 476
 		return $this->_req_type;
@@ -483,36 +483,36 @@  discard block
 block discarded – undo
483 483
 	 * Should only be called once per request
484 484
 	 * @return void
485 485
 	 */
486
-	function detect_activation_or_upgrade(){
486
+	function detect_activation_or_upgrade() {
487 487
 		$activation_history_for_addon = $this->get_activation_history();
488 488
 //		d($activation_history_for_addon);
489 489
 		$request_type = EE_System::detect_req_type_given_activation_history($activation_history_for_addon, $this->get_activation_indicator_option_name(), $this->version());
490 490
 		$this->set_req_type($request_type);
491 491
 		$classname = get_class($this);
492
-		switch($request_type){
492
+		switch ($request_type) {
493 493
 			case EE_System::req_type_new_activation:
494
-				do_action( "AHEE__{$classname}__detect_activations_or_upgrades__new_activation" );
495
-				do_action( "AHEE__EE_Addon__detect_activations_or_upgrades__new_activation", $this );
494
+				do_action("AHEE__{$classname}__detect_activations_or_upgrades__new_activation");
495
+				do_action("AHEE__EE_Addon__detect_activations_or_upgrades__new_activation", $this);
496 496
 				$this->new_install();
497
-				$this->update_list_of_installed_versions( $activation_history_for_addon );
497
+				$this->update_list_of_installed_versions($activation_history_for_addon);
498 498
 				break;
499 499
 			case EE_System::req_type_reactivation:
500
-				do_action( "AHEE__{$classname}__detect_activations_or_upgrades__reactivation" );
501
-				do_action( "AHEE__EE_Addon__detect_activations_or_upgrades__reactivation", $this );
500
+				do_action("AHEE__{$classname}__detect_activations_or_upgrades__reactivation");
501
+				do_action("AHEE__EE_Addon__detect_activations_or_upgrades__reactivation", $this);
502 502
 				$this->reactivation();
503
-				$this->update_list_of_installed_versions( $activation_history_for_addon );
503
+				$this->update_list_of_installed_versions($activation_history_for_addon);
504 504
 				break;
505 505
 			case EE_System::req_type_upgrade:
506
-				do_action( "AHEE__{$classname}__detect_activations_or_upgrades__upgrade" );
507
-				do_action( "AHEE__EE_Addon__detect_activations_or_upgrades__upgrade", $this );
506
+				do_action("AHEE__{$classname}__detect_activations_or_upgrades__upgrade");
507
+				do_action("AHEE__EE_Addon__detect_activations_or_upgrades__upgrade", $this);
508 508
 				$this->upgrade();
509
-				$this->update_list_of_installed_versions($activation_history_for_addon );
509
+				$this->update_list_of_installed_versions($activation_history_for_addon);
510 510
 				break;
511 511
 			case EE_System::req_type_downgrade:
512
-				do_action( "AHEE__{$classname}__detect_activations_or_upgrades__downgrade" );
513
-				do_action( "AHEE__EE_Addon__detect_activations_or_upgrades__downgrade", $this );
512
+				do_action("AHEE__{$classname}__detect_activations_or_upgrades__downgrade");
513
+				do_action("AHEE__EE_Addon__detect_activations_or_upgrades__downgrade", $this);
514 514
 				$this->downgrade();
515
-				$this->update_list_of_installed_versions($activation_history_for_addon );
515
+				$this->update_list_of_installed_versions($activation_history_for_addon);
516 516
 				break;
517 517
 			case EE_System::req_type_normal:
518 518
 			default:
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 				break;
521 521
 		}
522 522
 
523
-		do_action( "AHEE__{$classname}__detect_if_activation_or_upgrade__complete" );
523
+		do_action("AHEE__{$classname}__detect_if_activation_or_upgrade__complete");
524 524
 	}
525 525
 
526 526
 	/**
@@ -529,17 +529,17 @@  discard block
 block discarded – undo
529 529
 	 * @param string $current_version_to_add
530 530
 	 * @return boolean success
531 531
 	 */
532
-	public function update_list_of_installed_versions($version_history = NULL,$current_version_to_add = NULL) {
533
-		if( ! $version_history ) {
532
+	public function update_list_of_installed_versions($version_history = NULL, $current_version_to_add = NULL) {
533
+		if ( ! $version_history) {
534 534
 			$version_history = $this->get_activation_history();
535 535
 		}
536
-		if( $current_version_to_add == NULL){
536
+		if ($current_version_to_add == NULL) {
537 537
 			$current_version_to_add = $this->version();
538 538
 		}
539
-		$version_history[ $current_version_to_add ][] = date( 'Y-m-d H:i:s',time() );
539
+		$version_history[$current_version_to_add][] = date('Y-m-d H:i:s', time());
540 540
 		// resave
541 541
 //		echo "updating list of installed versions:".$this->get_activation_history_option_name();d($version_history);
542
-		return update_option( $this->get_activation_history_option_name(), $version_history );
542
+		return update_option($this->get_activation_history_option_name(), $version_history);
543 543
 	}
544 544
 
545 545
 	/**
@@ -547,8 +547,8 @@  discard block
 block discarded – undo
547 547
 	 * of this addon
548 548
 	 * @return string
549 549
 	 */
550
-	function get_activation_history_option_name(){
551
-		return self::ee_addon_version_history_option_prefix . $this->name();
550
+	function get_activation_history_option_name() {
551
+		return self::ee_addon_version_history_option_prefix.$this->name();
552 552
 	}
553 553
 
554 554
 
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 	 * Gets the wp option which stores the activation history for this addon
558 558
 	 * @return array
559 559
 	 */
560
-	function get_activation_history(){
560
+	function get_activation_history() {
561 561
 		return get_option($this->get_activation_history_option_name(), NULL);
562 562
 	}
563 563
 
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
 	/**
567 567
 	 * @param string $config_section
568 568
 	 */
569
-	public function set_config_section( $config_section = '' ) {
570
-		$this->_config_section = ! empty( $config_section ) ? $config_section : 'addons';
569
+	public function set_config_section($config_section = '') {
570
+		$this->_config_section = ! empty($config_section) ? $config_section : 'addons';
571 571
 	}
572 572
 	/**
573 573
 	 *	filepath to the main file, which can be used for register_activation_hook, register_deactivation_hook, etc.
@@ -580,14 +580,14 @@  discard block
 block discarded – undo
580 580
 	 * Sets the filepath to the main plugin file
581 581
 	 * @param string $filepath
582 582
 	 */
583
-	public function set_main_plugin_file( $filepath ) {
583
+	public function set_main_plugin_file($filepath) {
584 584
 		$this->_main_plugin_file = $filepath;
585 585
 	}
586 586
 	/**
587 587
 	 * gets the filepath to teh main file
588 588
 	 * @return string
589 589
 	 */
590
-	public function get_main_plugin_file(){
590
+	public function get_main_plugin_file() {
591 591
 		return $this->_main_plugin_file;
592 592
 	}
593 593
 
@@ -597,15 +597,15 @@  discard block
 block discarded – undo
597 597
 	 * @return string
598 598
 	 */
599 599
 	public function get_main_plugin_file_basename() {
600
-		return plugin_basename( $this->get_main_plugin_file() );
600
+		return plugin_basename($this->get_main_plugin_file());
601 601
 	}
602 602
 
603 603
 	/**
604 604
 	 * Gets the folder name which contains the main plugin file
605 605
 	 * @return string
606 606
 	 */
607
-	public function get_main_plugin_file_dirname(){
608
-		return dirname( $this->get_main_plugin_file() );
607
+	public function get_main_plugin_file_dirname() {
608
+		return dirname($this->get_main_plugin_file());
609 609
 	}
610 610
 
611 611
 
@@ -614,11 +614,11 @@  discard block
 block discarded – undo
614 614
 	 *
615 615
 *@return string
616 616
 	 */
617
-	public function admin_init(){
617
+	public function admin_init() {
618 618
 		// is admin and not in M-Mode ?
619
-		if ( is_admin() && ! EE_Maintenance_Mode::instance()->level() ) {
620
-			add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2 );
621
-			add_filter( 'after_plugin_row_' . $this->_plugin_basename, array( $this, 'after_plugin_row' ), 10, 3 );
619
+		if (is_admin() && ! EE_Maintenance_Mode::instance()->level()) {
620
+			add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
621
+			add_filter('after_plugin_row_'.$this->_plugin_basename, array($this, 'after_plugin_row'), 10, 3);
622 622
 		}
623 623
 	}
624 624
 
@@ -633,10 +633,10 @@  discard block
 block discarded – undo
633 633
 	 * @param $file
634 634
 	 * @return array
635 635
 	 */
636
-	public function plugin_action_links( $links, $file ) {
637
-		if ( $file == $this->plugin_basename() && $this->plugin_action_slug() != '' ) {
636
+	public function plugin_action_links($links, $file) {
637
+		if ($file == $this->plugin_basename() && $this->plugin_action_slug() != '') {
638 638
 			// before other links
639
-			array_unshift( $links, '<a href="admin.php?page=' . $this->plugin_action_slug() . '">' . __( 'Settings' ) . '</a>' );
639
+			array_unshift($links, '<a href="admin.php?page='.$this->plugin_action_slug().'">'.__('Settings').'</a>');
640 640
 		}
641 641
 		return $links;
642 642
 	}
@@ -654,17 +654,17 @@  discard block
 block discarded – undo
654 654
 	 * @param $status
655 655
 	 * @return string
656 656
 	 */
657
-	public function after_plugin_row( $plugin_file, $plugin_data, $status ) {
657
+	public function after_plugin_row($plugin_file, $plugin_data, $status) {
658 658
 
659 659
 		$after_plugin_row = '';
660
-		if ( $plugin_file == $this->plugin_basename() && $this->get_plugins_page_row() != '' ) {
660
+		if ($plugin_file == $this->plugin_basename() && $this->get_plugins_page_row() != '') {
661 661
 			$class = $status ? 'active' : 'inactive';
662 662
 			$plugins_page_row = $this->get_plugins_page_row();
663
-			$link_text = isset( $plugins_page_row[ 'link_text' ] ) ? $plugins_page_row[ 'link_text' ] : '';
664
-			$link_url = isset( $plugins_page_row[ 'link_url' ] ) ? $plugins_page_row[ 'link_url' ] : '';
665
-			$description = isset( $plugins_page_row[ 'description' ] ) ? $plugins_page_row[ 'description' ] : $plugins_page_row;
666
-			if ( ! empty( $link_text ) && ! empty( $link_url ) && ! empty( $description )) {
667
-				$after_plugin_row .= '<tr id="' . sanitize_title( $plugin_file ) . '-ee-addon" class="' . $class . '">';
663
+			$link_text = isset($plugins_page_row['link_text']) ? $plugins_page_row['link_text'] : '';
664
+			$link_url = isset($plugins_page_row['link_url']) ? $plugins_page_row['link_url'] : '';
665
+			$description = isset($plugins_page_row['description']) ? $plugins_page_row['description'] : $plugins_page_row;
666
+			if ( ! empty($link_text) && ! empty($link_url) && ! empty($description)) {
667
+				$after_plugin_row .= '<tr id="'.sanitize_title($plugin_file).'-ee-addon" class="'.$class.'">';
668 668
 				$after_plugin_row .= '<th class="check-column" scope="row"></th>';
669 669
 				$after_plugin_row .= '<td class="ee-addon-upsell-info-title-td plugin-title column-primary">';
670 670
 				$after_plugin_row .= '<style>
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 </style>';
707 707
 				$after_plugin_row .= '
708 708
 <p class="ee-addon-upsell-info-dv">
709
-	<a class="ee-button" href="' . $link_url . '">' . $link_text . ' &nbsp;<span class="dashicons dashicons-arrow-right-alt2" style="margin:0;"></span></a>
709
+	<a class="ee-button" href="' . $link_url.'">'.$link_text.' &nbsp;<span class="dashicons dashicons-arrow-right-alt2" style="margin:0;"></span></a>
710 710
 </p>';
711 711
 				$after_plugin_row .= '</td>';
712 712
 				$after_plugin_row .= '<td class="ee-addon-upsell-info-desc-td column-description desc">';
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 
121 121
 	/**
122
-	 * @param mixed $min_core_version
122
+	 * @param string $min_core_version
123 123
 	 */
124 124
 	public function set_min_core_version( $min_core_version = NULL ) {
125 125
 		$this->_min_core_version = $min_core_version;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	/**
141 141
 	 * Sets addon_name
142 142
 	 * @param string $addon_name
143
-	 * @return boolean
143
+	 * @return string
144 144
 	 */
145 145
 	function set_name( $addon_name ) {
146 146
 		return $this->_addon_name = $addon_name;
Please login to merge, or discard this patch.
core/EE_Base.core.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 	 *		@ override magic methods
34 34
 	 *		@ return void
35 35
 	 */	
36
-	public function __set($a,$b) { return FALSE; }
36
+	public function __set($a, $b) { return FALSE; }
37 37
 	public function __get($a) { return FALSE; }
38 38
 	public function __isset($a) { return FALSE; }
39 39
 	public function __unset($a) { return FALSE; }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
core/EE_Config.core.php 4 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
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
  *
4 6
  * Class EE_Payment_Method_Manager
@@ -139,7 +141,7 @@  discard block
 block discarded – undo
139 141
 		if(isset($this->_payment_method_types[$payment_method_name])){
140 142
 			require_once($this->_payment_method_types[$payment_method_name]);
141 143
 			return true;
142
-		}else{
144
+		} else{
143 145
 			return false;
144 146
 		}
145 147
 	}
@@ -159,7 +161,7 @@  discard block
 block discarded – undo
159 161
 				$payment_methods[] = $this->payment_method_class_from_type($classname);
160 162
 			}
161 163
 			return $payment_methods;
162
-		}else{
164
+		} else{
163 165
 			return array_keys($this->_payment_method_types);
164 166
 		}
165 167
 	}
@@ -242,7 +244,7 @@  discard block
 block discarded – undo
242 244
 				}
243 245
 			}
244 246
 
245
-		}else{
247
+		} else{
246 248
 			$payment_method->set_active();
247 249
 			$payment_method->save();
248 250
 		}
Please login to merge, or discard this patch.
Indentation   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 	public $map_settings = null;
90 90
 
91 91
 	/**
92
-	*
93
-	* @deprecated
94
-	* @var EE_Gateway_Config
95
-	*/
92
+	 *
93
+	 * @deprecated
94
+	 * @var EE_Gateway_Config
95
+	 */
96 96
 	public $gateway = null;
97 97
 
98 98
 	/**
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 
583 583
 	/**
584 584
 	 *    update_config
585
-         * Important: the config object must ALREADY be set, otherwise this will produce an error.
585
+	 * Important: the config object must ALREADY be set, otherwise this will produce an error.
586 586
 	 *
587 587
 	 * @access    public
588 588
 	 * @param    string                 $section
@@ -1606,51 +1606,51 @@  discard block
 block discarded – undo
1606 1606
 class EE_Organization_Config extends EE_Config_Base {
1607 1607
 
1608 1608
 	/**
1609
-	* @var string  $name
1610
-	* eg EE4.1
1611
-	*/
1609
+	 * @var string  $name
1610
+	 * eg EE4.1
1611
+	 */
1612 1612
 	public $name;
1613 1613
 
1614 1614
 	/**
1615
-	* @var string $address_1
1616
-	* eg 123 Onna Road
1617
-	*/
1615
+	 * @var string $address_1
1616
+	 * eg 123 Onna Road
1617
+	 */
1618 1618
 	public $address_1;
1619 1619
 
1620 1620
 	/**
1621
-	* @var string $address_2
1622
-	* eg PO Box 123
1623
-	*/
1621
+	 * @var string $address_2
1622
+	 * eg PO Box 123
1623
+	 */
1624 1624
 	public $address_2;
1625 1625
 
1626 1626
 	/**
1627
-	* @var string $city
1628
-	* eg Inna City
1629
-	*/
1627
+	 * @var string $city
1628
+	 * eg Inna City
1629
+	 */
1630 1630
 	public $city;
1631 1631
 
1632 1632
 	/**
1633
-	* @var int $STA_ID
1634
-	* eg 4
1635
-	*/
1633
+	 * @var int $STA_ID
1634
+	 * eg 4
1635
+	 */
1636 1636
 	public $STA_ID;
1637 1637
 
1638 1638
 	/**
1639
-	* @var string  $CNT_ISO
1640
-	* eg US
1641
-	*/
1639
+	 * @var string  $CNT_ISO
1640
+	 * eg US
1641
+	 */
1642 1642
 	public $CNT_ISO;
1643 1643
 
1644 1644
 	/**
1645
-	* @var string $zip
1646
-	* eg 12345  or V1A 2B3
1647
-	*/
1645
+	 * @var string $zip
1646
+	 * eg 12345  or V1A 2B3
1647
+	 */
1648 1648
 	public $zip;
1649 1649
 
1650 1650
 	/**
1651
-	* @var string  $email
1652
-	* eg [email protected]
1653
-	*/
1651
+	 * @var string  $email
1652
+	 * eg [email protected]
1653
+	 */
1654 1654
 	public $email;
1655 1655
 
1656 1656
 
@@ -1669,9 +1669,9 @@  discard block
 block discarded – undo
1669 1669
 	public $vat;
1670 1670
 
1671 1671
 	/**
1672
-	* @var string  $logo_url
1673
-	* eg http://www.somedomain.com/wp-content/uploads/kittehs.jpg
1674
-	*/
1672
+	 * @var string  $logo_url
1673
+	 * eg http://www.somedomain.com/wp-content/uploads/kittehs.jpg
1674
+	 */
1675 1675
 	public $logo_url;
1676 1676
 
1677 1677
 
@@ -1765,55 +1765,55 @@  discard block
 block discarded – undo
1765 1765
 class EE_Currency_Config extends EE_Config_Base {
1766 1766
 
1767 1767
 	/**
1768
-	* @var string  $code
1769
-	* eg 'US'
1770
-	*/
1768
+	 * @var string  $code
1769
+	 * eg 'US'
1770
+	 */
1771 1771
 	public $code;
1772 1772
 
1773 1773
 	/**
1774
-	* @var string $name
1775
-	* eg 'Dollar'
1776
-	*/
1774
+	 * @var string $name
1775
+	 * eg 'Dollar'
1776
+	 */
1777 1777
 	public $name;
1778 1778
 
1779 1779
 	/**
1780
-	* plural name
1781
-	* @var string $plural
1782
-	* eg 'Dollars'
1783
-	*/
1780
+	 * plural name
1781
+	 * @var string $plural
1782
+	 * eg 'Dollars'
1783
+	 */
1784 1784
 	public $plural;
1785 1785
 
1786 1786
 	/**
1787
-	* currency sign
1788
-	* @var string  $sign
1789
-	* eg '$'
1790
-	*/
1787
+	 * currency sign
1788
+	 * @var string  $sign
1789
+	 * eg '$'
1790
+	 */
1791 1791
 	public $sign;
1792 1792
 
1793 1793
 	/**
1794
-	* Whether the currency sign should come before the number or not
1795
-	* @var boolean $sign_b4
1796
-	*/
1794
+	 * Whether the currency sign should come before the number or not
1795
+	 * @var boolean $sign_b4
1796
+	 */
1797 1797
 	public $sign_b4;
1798 1798
 
1799 1799
 	/**
1800
-	* How many digits should come after the decimal place
1801
-	* @var int $dec_plc
1802
-	*/
1800
+	 * How many digits should come after the decimal place
1801
+	 * @var int $dec_plc
1802
+	 */
1803 1803
 	public $dec_plc;
1804 1804
 
1805 1805
 	/**
1806
-	* Symbol to use for decimal mark
1807
-	* @var string $dec_mrk
1808
-	* eg '.'
1809
-	*/
1806
+	 * Symbol to use for decimal mark
1807
+	 * @var string $dec_mrk
1808
+	 * eg '.'
1809
+	 */
1810 1810
 	public $dec_mrk;
1811 1811
 
1812 1812
 	/**
1813
-	* Symbol to use for thousands
1814
-	* @var string $thsnds
1815
-	* eg ','
1816
-	*/
1813
+	 * Symbol to use for thousands
1814
+	 * @var string $thsnds
1815
+	 * eg ','
1816
+	 */
1817 1817
 	public $thsnds;
1818 1818
 
1819 1819
 
@@ -1881,13 +1881,13 @@  discard block
 block discarded – undo
1881 1881
 	 * 	whether or not to show alternate payment options during the reg process if payment status is pending
1882 1882
 	 * @var boolean $show_pending_payment_options
1883 1883
 	 */
1884
-      public $show_pending_payment_options;
1884
+	  public $show_pending_payment_options;
1885 1885
 
1886 1886
 	/**
1887 1887
 	 * Whether to skip the registration confirmation page
1888 1888
 	 * @var boolean $skip_reg_confirmation
1889 1889
 	 */
1890
-      public $skip_reg_confirmation;
1890
+	  public $skip_reg_confirmation;
1891 1891
 
1892 1892
 	/**
1893 1893
 	 * an array of SPCO reg steps where:
@@ -1898,64 +1898,64 @@  discard block
 block discarded – undo
1898 1898
 	 * 			"slug" => the URL param used to trigger the reg step
1899 1899
 	 * @var array $reg_steps
1900 1900
 	 */
1901
-      public $reg_steps;
1901
+	  public $reg_steps;
1902 1902
 
1903 1903
 	/**
1904 1904
 	 * Whether registration confirmation should be the last page of SPCO
1905 1905
 	 * @var boolean $reg_confirmation_last
1906 1906
 	 */
1907
-      public $reg_confirmation_last;
1907
+	  public $reg_confirmation_last;
1908 1908
 
1909 1909
 	  /**
1910 1910
 	   * Whether or not to enable the EE Bot Trap
1911 1911
 	   * @var boolean $use_bot_trap
1912 1912
 	   */
1913
-      public $use_bot_trap;
1913
+	  public $use_bot_trap;
1914 1914
 
1915 1915
 	  /**
1916 1916
 	   * Whether or not to encrypt some data sent by the EE Bot Trap
1917 1917
 	   * @var boolean $use_encryption
1918 1918
 	   */
1919
-      public $use_encryption;
1919
+	  public $use_encryption;
1920 1920
 
1921 1921
 	  /**
1922 1922
 	   * Whether or not to use ReCaptcha
1923 1923
 	   * @var boolean $use_captcha
1924 1924
 	   */
1925
-      public $use_captcha;
1925
+	  public $use_captcha;
1926 1926
 
1927 1927
 	  /**
1928 1928
 	   * ReCaptcha Theme
1929 1929
 	   * @var string $recaptcha_theme
1930 1930
 	   * 	options: 'dark	', 'light'
1931 1931
 	   */
1932
-      public $recaptcha_theme;
1932
+	  public $recaptcha_theme;
1933 1933
 
1934 1934
 	  /**
1935 1935
 	   * ReCaptcha Type
1936 1936
 	   * @var string $recaptcha_type
1937 1937
 	   * 	options: 'audio', 'image'
1938 1938
 	   */
1939
-      public $recaptcha_type;
1939
+	  public $recaptcha_type;
1940 1940
 
1941 1941
 	  /**
1942 1942
 	   * ReCaptcha language
1943 1943
 	   * @var string $recaptcha_language
1944 1944
 	   * eg 'en'
1945 1945
 	   */
1946
-      public $recaptcha_language;
1946
+	  public $recaptcha_language;
1947 1947
 
1948 1948
 	  /**
1949 1949
 	   * ReCaptcha public key
1950 1950
 	   * @var string $recaptcha_publickey
1951 1951
 	   */
1952
-      public $recaptcha_publickey;
1952
+	  public $recaptcha_publickey;
1953 1953
 
1954 1954
 	  /**
1955 1955
 	   * ReCaptcha private key
1956 1956
 	   * @var string $recaptcha_privatekey
1957 1957
 	   */
1958
-      public $recaptcha_privatekey;
1958
+	  public $recaptcha_privatekey;
1959 1959
 
1960 1960
 	/**
1961 1961
 	 * ReCaptcha width
@@ -2021,58 +2021,58 @@  discard block
 block discarded – undo
2021 2021
 class EE_Admin_Config extends EE_Config_Base {
2022 2022
 
2023 2023
 	/**
2024
-	* @var boolean $use_personnel_manager
2025
-	*/
2024
+	 * @var boolean $use_personnel_manager
2025
+	 */
2026 2026
 	public $use_personnel_manager;
2027 2027
 
2028 2028
 	/**
2029
-	* @var boolean $use_dashboard_widget
2030
-	*/
2029
+	 * @var boolean $use_dashboard_widget
2030
+	 */
2031 2031
 	public $use_dashboard_widget;
2032 2032
 
2033 2033
 	/**
2034
-	* @var int $events_in_dashboard
2035
-	*/
2034
+	 * @var int $events_in_dashboard
2035
+	 */
2036 2036
 	public $events_in_dashboard;
2037 2037
 
2038 2038
 	/**
2039
-	* @var boolean $use_event_timezones
2040
-	*/
2039
+	 * @var boolean $use_event_timezones
2040
+	 */
2041 2041
 	public $use_event_timezones;
2042 2042
 
2043 2043
 	/**
2044
-	* @var boolean $use_full_logging
2045
-	*/
2044
+	 * @var boolean $use_full_logging
2045
+	 */
2046 2046
 	public $use_full_logging;
2047 2047
 
2048 2048
 	/**
2049
-	* @var string $log_file_name
2050
-	*/
2049
+	 * @var string $log_file_name
2050
+	 */
2051 2051
 	public $log_file_name;
2052 2052
 
2053 2053
 	/**
2054
-	* @var string $debug_file_name
2055
-	*/
2054
+	 * @var string $debug_file_name
2055
+	 */
2056 2056
 	public $debug_file_name;
2057 2057
 
2058 2058
 	/**
2059
-	* @var boolean $use_remote_logging
2060
-	*/
2059
+	 * @var boolean $use_remote_logging
2060
+	 */
2061 2061
 	public $use_remote_logging;
2062 2062
 
2063 2063
 	/**
2064
-	* @var string $remote_logging_url
2065
-	*/
2064
+	 * @var string $remote_logging_url
2065
+	 */
2066 2066
 	public $remote_logging_url;
2067 2067
 
2068 2068
 	/**
2069
-	* @var boolean $show_reg_footer
2070
-	*/
2069
+	 * @var boolean $show_reg_footer
2070
+	 */
2071 2071
 	public $show_reg_footer;
2072 2072
 
2073 2073
 	/**
2074
-	* @var string $affiliate_id
2075
-	*/
2074
+	 * @var string $affiliate_id
2075
+	 */
2076 2076
 	public $affiliate_id;
2077 2077
 
2078 2078
 
@@ -2146,43 +2146,43 @@  discard block
 block discarded – undo
2146 2146
 class EE_Template_Config extends EE_Config_Base {
2147 2147
 
2148 2148
 	/**
2149
-	* @var boolean $enable_default_style
2150
-	*/
2149
+	 * @var boolean $enable_default_style
2150
+	 */
2151 2151
 	public $enable_default_style;
2152 2152
 
2153 2153
 	/**
2154
-	* @var string $custom_style_sheet
2155
-	*/
2154
+	 * @var string $custom_style_sheet
2155
+	 */
2156 2156
 	public $custom_style_sheet;
2157 2157
 
2158 2158
 	/**
2159
-	* @var boolean $display_address_in_regform
2160
-	*/
2159
+	 * @var boolean $display_address_in_regform
2160
+	 */
2161 2161
 	public $display_address_in_regform;
2162 2162
 
2163 2163
 	/**
2164
-	* @var int $display_description_on_multi_reg_page
2165
-	*/
2164
+	 * @var int $display_description_on_multi_reg_page
2165
+	 */
2166 2166
 	public $display_description_on_multi_reg_page;
2167 2167
 
2168 2168
 	/**
2169
-	* @var boolean $use_custom_templates
2170
-	*/
2169
+	 * @var boolean $use_custom_templates
2170
+	 */
2171 2171
 	public $use_custom_templates;
2172 2172
 
2173 2173
 	/**
2174
-	* @var string $current_espresso_theme
2175
-	*/
2174
+	 * @var string $current_espresso_theme
2175
+	 */
2176 2176
 	public $current_espresso_theme;
2177 2177
 
2178 2178
 	/**
2179
-	* @var EE_Event_Single_Config $EED_Event_Single
2180
-	*/
2179
+	 * @var EE_Event_Single_Config $EED_Event_Single
2180
+	 */
2181 2181
 	public $EED_Event_Single;
2182 2182
 
2183 2183
 	/**
2184
-	* @var EE_Events_Archive_Config $EED_Events_Archive
2185
-	*/
2184
+	 * @var EE_Events_Archive_Config $EED_Events_Archive
2185
+	 */
2186 2186
 	public $EED_Events_Archive;
2187 2187
 
2188 2188
 
@@ -2215,78 +2215,78 @@  discard block
 block discarded – undo
2215 2215
 class EE_Map_Config extends EE_Config_Base {
2216 2216
 
2217 2217
 	/**
2218
-	* @var boolean $use_google_maps
2219
-	*/
2218
+	 * @var boolean $use_google_maps
2219
+	 */
2220 2220
 	public $use_google_maps;
2221 2221
 
2222 2222
 	/**
2223
-	* @var int $event_details_map_width
2224
-	*/
2223
+	 * @var int $event_details_map_width
2224
+	 */
2225 2225
 	public $event_details_map_width;
2226 2226
 
2227 2227
 	/**
2228
-	* @var int $event_details_map_height
2229
-	*/
2228
+	 * @var int $event_details_map_height
2229
+	 */
2230 2230
 	public $event_details_map_height;
2231 2231
 
2232 2232
 	/**
2233
-	* @var int $event_details_map_zoom
2234
-	*/
2233
+	 * @var int $event_details_map_zoom
2234
+	 */
2235 2235
 	public $event_details_map_zoom;
2236 2236
 
2237 2237
 	/**
2238
-	* @var boolean $event_details_display_nav
2239
-	*/
2238
+	 * @var boolean $event_details_display_nav
2239
+	 */
2240 2240
 	public $event_details_display_nav;
2241 2241
 
2242 2242
 	/**
2243
-	* @var boolean $event_details_nav_size
2244
-	*/
2243
+	 * @var boolean $event_details_nav_size
2244
+	 */
2245 2245
 	public $event_details_nav_size;
2246 2246
 
2247 2247
 	/**
2248
-	* @var string $event_details_control_type
2249
-	*/
2248
+	 * @var string $event_details_control_type
2249
+	 */
2250 2250
 	public $event_details_control_type;
2251 2251
 
2252 2252
 	/**
2253
-	* @var string $event_details_map_align
2254
-	*/
2253
+	 * @var string $event_details_map_align
2254
+	 */
2255 2255
 	public $event_details_map_align;
2256 2256
 
2257 2257
 	/**
2258
-	* @var int $event_list_map_width
2259
-	*/
2258
+	 * @var int $event_list_map_width
2259
+	 */
2260 2260
 	public $event_list_map_width;
2261 2261
 
2262 2262
 	/**
2263
-	* @var int $event_list_map_height
2264
-	*/
2263
+	 * @var int $event_list_map_height
2264
+	 */
2265 2265
 	public $event_list_map_height;
2266 2266
 
2267 2267
 	/**
2268
-	* @var int $event_list_map_zoom
2269
-	*/
2268
+	 * @var int $event_list_map_zoom
2269
+	 */
2270 2270
 	public $event_list_map_zoom;
2271 2271
 
2272 2272
 	/**
2273
-	* @var boolean $event_list_display_nav
2274
-	*/
2273
+	 * @var boolean $event_list_display_nav
2274
+	 */
2275 2275
 	public $event_list_display_nav;
2276 2276
 
2277 2277
 	/**
2278
-	* @var boolean $event_list_nav_size
2279
-	*/
2278
+	 * @var boolean $event_list_nav_size
2279
+	 */
2280 2280
 	public $event_list_nav_size;
2281 2281
 
2282 2282
 	/**
2283
-	* @var string $event_list_control_type
2284
-	*/
2283
+	 * @var string $event_list_control_type
2284
+	 */
2285 2285
 	public $event_list_control_type;
2286 2286
 
2287 2287
 	/**
2288
-	* @var string $event_list_map_align
2289
-	*/
2288
+	 * @var string $event_list_map_align
2289
+	 */
2290 2290
 	public $event_list_map_align;
2291 2291
 
2292 2292
 
Please login to merge, or discard this patch.
Doc Comments   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	 *    update_espresso_config
373 373
 	 *
374 374
 	 * @access   public
375
-	 * @return   bool
375
+	 * @return   boolean|null
376 376
 	 */
377 377
 	protected function  _reset_espresso_addon_config() {
378 378
 		$this->_config_option_names = array();
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	 * @param    string                $name
453 453
 	 * @param    string                $config_class
454 454
 	 * @param    EE_Config_Base 	$config_obj
455
-	 * @param    array                 $tests_to_run
455
+	 * @param    integer[]                 $tests_to_run
456 456
 	 * @param    bool                  $display_errors
457 457
 	 * @return    bool    TRUE on success, FALSE on fail
458 458
 	 */
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 	 *
977 977
 	 *  @access 	public
978 978
 	 *  @param 	string 		$shortcode_path - full path up to and including shortcode folder
979
-	 *  @return 	bool
979
+	 *  @return 	boolean|null
980 980
 	 */
981 981
 	public static function register_shortcode( $shortcode_path = NULL ) {
982 982
 		EE_Config::instance()->_register_shortcode( $shortcode_path );
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
 	 *
1083 1083
 	 *  @access 	public
1084 1084
 	 *  @param 	string 		$module_path - full path up to and including module folder
1085
-	 *  @return 	bool
1085
+	 *  @return 	boolean|null
1086 1086
 	 */
1087 1087
 	public static function register_module( $module_path = NULL ) {
1088 1088
 		EE_Config::instance()->_register_module( $module_path );
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
 
1565 1565
 
1566 1566
 	/**
1567
-	 * @return array
1567
+	 * @return integer[]
1568 1568
 	 */
1569 1569
 	public function get_critical_pages_array() {
1570 1570
 		return array(
@@ -1577,7 +1577,7 @@  discard block
 block discarded – undo
1577 1577
 
1578 1578
 
1579 1579
 	/**
1580
-	 * @return array
1580
+	 * @return string[]
1581 1581
 	 */
1582 1582
 	public function get_critical_pages_shortcodes_array() {
1583 1583
 		return array(
@@ -1900,7 +1900,7 @@  discard block
 block discarded – undo
1900 1900
 	 *    class constructor
1901 1901
 	 *
1902 1902
 	 * @access    public
1903
-	 * @param null $CNT_ISO
1903
+	 * @param string $CNT_ISO
1904 1904
 	 * @return \EE_Currency_Config
1905 1905
 	 */
1906 1906
 	public function __construct( $CNT_ISO = NULL ) {
@@ -2547,7 +2547,7 @@  discard block
 block discarded – undo
2547 2547
 	 *
2548 2548
 	 * @param int $input_count the count of input vars.
2549 2549
 	 *
2550
-	 * @return array {
2550
+	 * @return string {
2551 2551
 	 *         An array that represents whether available space and if no available space the error message.
2552 2552
 	 *         @type bool $has_space		whether more inputs can be added.
2553 2553
 	 *         @type string $msg 		Any message to be displayed.
Please login to merge, or discard this patch.
Spacing   +390 added lines, -390 removed lines patch added patch discarded remove patch
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
 	 * @param \EE_Registry $registry
133 133
 	 * @return \EE_Config instance
134 134
 	 */
135
-	public static function instance( \EE_Registry $registry = null ) {
135
+	public static function instance(\EE_Registry $registry = null) {
136 136
 		// check if class object is instantiated, and instantiated properly
137
-		if ( ! self::$_instance instanceof EE_Config ) {
138
-			self::$_instance = new self( $registry );
137
+		if ( ! self::$_instance instanceof EE_Config) {
138
+			self::$_instance = new self($registry);
139 139
 		}
140 140
 		return self::$_instance;
141 141
 	}
@@ -153,22 +153,22 @@  discard block
 block discarded – undo
153 153
 	 * @param \EE_Registry $registry
154 154
 	 * @return \EE_Config
155 155
 	 */
156
-	public static function reset( $hard_reset = FALSE, $reinstantiate = TRUE, \EE_Registry $registry = null ){
157
-		if ( $hard_reset ) {
156
+	public static function reset($hard_reset = FALSE, $reinstantiate = TRUE, \EE_Registry $registry = null) {
157
+		if ($hard_reset) {
158 158
 			self::$_instance->_config_option_names = array();
159 159
 			self::$_instance->_initialize_config();
160 160
 			self::$_instance->update_espresso_config();
161 161
 		}
162
-		if( self::$_instance instanceof EE_Config ){
162
+		if (self::$_instance instanceof EE_Config) {
163 163
 			self::$_instance->shutdown();
164 164
 		}
165 165
 		self::$_instance = null;
166 166
 		//we don't need to reset the static properties imo because those should
167 167
 		//only change when a module is added or removed. Currently we don't
168 168
 		//support removing a module during a request when it previously existed
169
-		if( $reinstantiate ){
170
-			return self::instance( $registry );
171
-		}else{
169
+		if ($reinstantiate) {
170
+			return self::instance($registry);
171
+		} else {
172 172
 			return NULL;
173 173
 		}
174 174
 	}
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 	 * @access    private
182 182
 	 * @param \EE_Registry $registry
183 183
 	 */
184
-	private function __construct( \EE_Registry $registry ) {
185
-		do_action( 'AHEE__EE_Config__construct__begin',$this );
184
+	private function __construct(\EE_Registry $registry) {
185
+		do_action('AHEE__EE_Config__construct__begin', $this);
186 186
 		$this->registry = $registry;
187
-		$this->_config_option_names = get_option( 'ee_config_option_names', array() );
187
+		$this->_config_option_names = get_option('ee_config_option_names', array());
188 188
 		// setup empty config classes
189 189
 		$this->_initialize_config();
190 190
 		// load existing EE site settings
@@ -192,15 +192,15 @@  discard block
 block discarded – undo
192 192
 		// confirm everything loaded correctly and set filtered defaults if not
193 193
 		$this->_verify_config();
194 194
 		//  register shortcodes and modules
195
-		add_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets', array( $this, 'register_shortcodes_and_modules' ), 999 );
195
+		add_action('AHEE__EE_System__register_shortcodes_modules_and_widgets', array($this, 'register_shortcodes_and_modules'), 999);
196 196
 		//  initialize shortcodes and modules
197
-		add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'initialize_shortcodes_and_modules' ));
197
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'initialize_shortcodes_and_modules'));
198 198
 		// register widgets
199
-		add_action( 'widgets_init', array( $this, 'widgets_init' ), 10 );
199
+		add_action('widgets_init', array($this, 'widgets_init'), 10);
200 200
 		// shutdown
201
-		add_action( 'shutdown', array( $this, 'shutdown' ), 10 );
201
+		add_action('shutdown', array($this, 'shutdown'), 10);
202 202
 		// construct__end hook
203
-		do_action( 'AHEE__EE_Config__construct__end',$this );
203
+		do_action('AHEE__EE_Config__construct__end', $this);
204 204
 		// hardcoded hack
205 205
 		$this->template_settings->current_espresso_theme = 'Espresso_Arabica_2014';
206 206
 	}
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	 * @return string current theme set.
214 214
 	 */
215 215
 	public static function get_current_theme() {
216
-		return isset( self::$_instance->template_settings->current_espresso_theme ) ? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
216
+		return isset(self::$_instance->template_settings->current_espresso_theme) ? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
217 217
 	}
218 218
 
219 219
 
@@ -247,27 +247,27 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	private function _load_core_config() {
249 249
 		// load_core_config__start hook
250
-		do_action( 'AHEE__EE_Config___load_core_config__start', $this );
250
+		do_action('AHEE__EE_Config___load_core_config__start', $this);
251 251
 		$espresso_config = $this->get_espresso_config();
252
-		foreach ( $espresso_config as $config => $settings ) {
252
+		foreach ($espresso_config as $config => $settings) {
253 253
 			// load_core_config__start hook
254
-			$settings = apply_filters( 'FHEE__EE_Config___load_core_config__config_settings', $settings, $config, $this );
255
-			if ( is_object( $settings ) && property_exists( $this, $config ) ) {
256
-				$this->{$config} = apply_filters( 'FHEE__EE_Config___load_core_config__' . $config, $settings );
254
+			$settings = apply_filters('FHEE__EE_Config___load_core_config__config_settings', $settings, $config, $this);
255
+			if (is_object($settings) && property_exists($this, $config)) {
256
+				$this->{$config} = apply_filters('FHEE__EE_Config___load_core_config__'.$config, $settings);
257 257
 				//call configs populate method to ensure any defaults are set for empty values.
258
-				if ( method_exists( $settings, 'populate' ) ) {
258
+				if (method_exists($settings, 'populate')) {
259 259
 					$this->{$config}->populate();
260 260
 				}
261
-				if ( method_exists( $settings, 'do_hooks' ) ) {
261
+				if (method_exists($settings, 'do_hooks')) {
262 262
 					$this->{$config}->do_hooks();
263 263
 				}
264 264
 			}
265 265
 		}
266
-		if ( apply_filters( 'FHEE__EE_Config___load_core_config__update_espresso_config', FALSE ) ) {
266
+		if (apply_filters('FHEE__EE_Config___load_core_config__update_espresso_config', FALSE)) {
267 267
 			$this->update_espresso_config();
268 268
 		}
269 269
 		// load_core_config__end hook
270
-		do_action( 'AHEE__EE_Config___load_core_config__end', $this );
270
+		do_action('AHEE__EE_Config___load_core_config__end', $this);
271 271
 	}
272 272
 
273 273
 
@@ -281,40 +281,40 @@  discard block
 block discarded – undo
281 281
 	protected function _verify_config() {
282 282
 
283 283
 		$this->core = $this->core instanceof EE_Core_Config
284
-			? $this->core  : new EE_Core_Config();
285
-		$this->core = apply_filters( 'FHEE__EE_Config___initialize_config__core', $this->core );
284
+			? $this->core : new EE_Core_Config();
285
+		$this->core = apply_filters('FHEE__EE_Config___initialize_config__core', $this->core);
286 286
 
287 287
 		$this->organization = $this->organization instanceof EE_Organization_Config
288
-			? $this->organization  : new EE_Organization_Config();
289
-		$this->organization = apply_filters( 'FHEE__EE_Config___initialize_config__organization', $this->organization );
288
+			? $this->organization : new EE_Organization_Config();
289
+		$this->organization = apply_filters('FHEE__EE_Config___initialize_config__organization', $this->organization);
290 290
 
291 291
 		$this->currency = $this->currency instanceof EE_Currency_Config
292 292
 			? $this->currency : new EE_Currency_Config();
293
-		$this->currency = apply_filters( 'FHEE__EE_Config___initialize_config__currency', $this->currency );
293
+		$this->currency = apply_filters('FHEE__EE_Config___initialize_config__currency', $this->currency);
294 294
 
295 295
 		$this->registration = $this->registration instanceof EE_Registration_Config
296 296
 			? $this->registration : new EE_Registration_Config();
297
-		$this->registration = apply_filters( 'FHEE__EE_Config___initialize_config__registration', $this->registration );
297
+		$this->registration = apply_filters('FHEE__EE_Config___initialize_config__registration', $this->registration);
298 298
 
299 299
 		$this->admin = $this->admin instanceof EE_Admin_Config
300 300
 			? $this->admin : new EE_Admin_Config();
301
-		$this->admin = apply_filters( 'FHEE__EE_Config___initialize_config__admin', $this->admin );
301
+		$this->admin = apply_filters('FHEE__EE_Config___initialize_config__admin', $this->admin);
302 302
 
303 303
 		$this->template_settings = $this->template_settings instanceof EE_Template_Config
304 304
 			? $this->template_settings : new EE_Template_Config();
305
-		$this->template_settings = apply_filters( 'FHEE__EE_Config___initialize_config__template_settings', $this->template_settings );
305
+		$this->template_settings = apply_filters('FHEE__EE_Config___initialize_config__template_settings', $this->template_settings);
306 306
 
307 307
 		$this->map_settings = $this->map_settings instanceof EE_Map_Config
308 308
 			? $this->map_settings : new EE_Map_Config();
309
-		$this->map_settings = apply_filters( 'FHEE__EE_Config___initialize_config__map_settings', $this->map_settings );
309
+		$this->map_settings = apply_filters('FHEE__EE_Config___initialize_config__map_settings', $this->map_settings);
310 310
 
311 311
 		$this->environment = $this->environment instanceof EE_Environment_Config
312 312
 			? $this->environment : new EE_Environment_Config();
313
-		$this->environment = apply_filters( 'FHEE__EE_Config___initialize_config__environment', $this->environment );
313
+		$this->environment = apply_filters('FHEE__EE_Config___initialize_config__environment', $this->environment);
314 314
 
315 315
 		$this->gateway = $this->gateway instanceof EE_Gateway_Config
316 316
 			? $this->gateway : new EE_Gateway_Config();
317
-		$this->gateway = apply_filters( 'FHEE__EE_Config___initialize_config__gateway', $this->gateway );
317
+		$this->gateway = apply_filters('FHEE__EE_Config___initialize_config__gateway', $this->gateway);
318 318
 
319 319
 	}
320 320
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 */
329 329
 	public function get_espresso_config() {
330 330
 		// grab espresso configuration
331
-		return apply_filters( 'FHEE__EE_Config__get_espresso_config__CFG', get_option( 'ee_config', array() ));
331
+		return apply_filters('FHEE__EE_Config__get_espresso_config__CFG', get_option('ee_config', array()));
332 332
 	}
333 333
 
334 334
 
@@ -341,12 +341,12 @@  discard block
 block discarded – undo
341 341
 	 * @param        $old_value
342 342
 	 * @param        $value
343 343
 	 */
344
-	public function double_check_config_comparison( $option = '', $old_value, $value ) {
344
+	public function double_check_config_comparison($option = '', $old_value, $value) {
345 345
 		// make sure we're checking the ee config
346
-		if ( $option == 'ee_config' ) {
346
+		if ($option == 'ee_config') {
347 347
 			// run a loose comparison of the old value against the new value for type and properties,
348 348
 			// but NOT exact instance like WP update_option does
349
-			if ( $value != $old_value ) {
349
+			if ($value != $old_value) {
350 350
 				// if they are NOT the same, then remove the hook,
351 351
 				// which means the subsequent update results will be based solely on the update query results
352 352
 				// the reason we do this is because, as stated above,
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 				// the string it sees in the db looks the same as the new one it has been passed!!!
362 362
 				// This results in the query returning an "affected rows" value of ZERO,
363 363
 				// which gets returned immediately by WP update_option and looks like an error.
364
-				remove_action( 'update_option', array( $this, 'check_config_updated' ));
364
+				remove_action('update_option', array($this, 'check_config_updated'));
365 365
 			}
366 366
 		}
367 367
 	}
@@ -376,11 +376,11 @@  discard block
 block discarded – undo
376 376
 	 */
377 377
 	protected function  _reset_espresso_addon_config() {
378 378
 		$this->_config_option_names = array();
379
-		foreach( $this->addons as $addon_name => $addon_config_obj ) {
380
-			$addon_config_obj = maybe_unserialize( $addon_config_obj );
381
-			$config_class = get_class( $addon_config_obj );
382
-			if ( $addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class ) {
383
-				$this->update_config( 'addons', $addon_name, $addon_config_obj, FALSE );
379
+		foreach ($this->addons as $addon_name => $addon_config_obj) {
380
+			$addon_config_obj = maybe_unserialize($addon_config_obj);
381
+			$config_class = get_class($addon_config_obj);
382
+			if ($addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class) {
383
+				$this->update_config('addons', $addon_name, $addon_config_obj, FALSE);
384 384
 			}
385 385
 			$this->addons->{$addon_name} = NULL;
386 386
 		}
@@ -396,17 +396,17 @@  discard block
 block discarded – undo
396 396
 	 * @param   bool $add_error
397 397
 	 * @return   bool
398 398
 	 */
399
-	public function  update_espresso_config( $add_success = FALSE, $add_error = TRUE ) {
399
+	public function  update_espresso_config($add_success = FALSE, $add_error = TRUE) {
400 400
 		// commented out the following re: https://events.codebasehq.com/projects/event-espresso/tickets/8197
401 401
 		//$clone = clone( self::$_instance );
402 402
 		//self::$_instance = NULL;
403
-		do_action( 'AHEE__EE_Config__update_espresso_config__begin',$this );
403
+		do_action('AHEE__EE_Config__update_espresso_config__begin', $this);
404 404
 		$this->_reset_espresso_addon_config();
405 405
 		// hook into update_option because that happens AFTER the ( $value === $old_value ) conditional
406 406
 		// but BEFORE the actual update occurs
407
-		add_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1, 3 );
407
+		add_action('update_option', array($this, 'double_check_config_comparison'), 1, 3);
408 408
 		// now update "ee_config"
409
-		$saved = update_option( 'ee_config', $this );
409
+		$saved = update_option('ee_config', $this);
410 410
 		// if not saved... check if the hook we just added still exists;
411 411
 		// if it does, it means one of two things:
412 412
 		// 		that update_option bailed at the ( $value === $old_value ) conditional,
@@ -417,25 +417,25 @@  discard block
 block discarded – undo
417 417
 		// but just means no update occurred, so don't display an error to the user.
418 418
 		// BUT... if update_option returns FALSE, AND the hook is missing,
419 419
 		// then it means that something truly went wrong
420
-		$saved = ! $saved ? has_action( 'update_option', array( $this, 'double_check_config_comparison' )) : $saved;
420
+		$saved = ! $saved ? has_action('update_option', array($this, 'double_check_config_comparison')) : $saved;
421 421
 		// remove our action since we don't want it in the system anymore
422
-		remove_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1 );
423
-		do_action( 'AHEE__EE_Config__update_espresso_config__end', $this, $saved );
422
+		remove_action('update_option', array($this, 'double_check_config_comparison'), 1);
423
+		do_action('AHEE__EE_Config__update_espresso_config__end', $this, $saved);
424 424
 		//self::$_instance = $clone;
425 425
 		//unset( $clone );
426 426
 		// if config remains the same or was updated successfully
427
-		if ( $saved ) {
428
-			if ( $add_success ) {
427
+		if ($saved) {
428
+			if ($add_success) {
429 429
 				EE_Error::add_success(
430
-					__( 'The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso' ),
430
+					__('The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso'),
431 431
 					__FILE__, __FUNCTION__, __LINE__
432 432
 				);
433 433
 			}
434 434
 			return TRUE;
435 435
 		} else {
436
-			if ( $add_error ) {
436
+			if ($add_error) {
437 437
 				EE_Error::add_error(
438
-					__( 'The Event Espresso Configuration Settings were not updated.', 'event_espresso' ),
438
+					__('The Event Espresso Configuration Settings were not updated.', 'event_espresso'),
439 439
 					__FILE__, __FUNCTION__, __LINE__
440 440
 				);
441 441
 			}
@@ -461,20 +461,20 @@  discard block
 block discarded – undo
461 461
 		$name = '',
462 462
 		$config_class = '',
463 463
 		$config_obj = NULL,
464
-		$tests_to_run = array( 1, 2, 3, 4, 5, 6, 7, 8 ),
464
+		$tests_to_run = array(1, 2, 3, 4, 5, 6, 7, 8),
465 465
 		$display_errors = TRUE
466 466
 	) {
467 467
 		try {
468
-			foreach ( $tests_to_run as $test ) {
469
-				switch ( $test ) {
468
+			foreach ($tests_to_run as $test) {
469
+				switch ($test) {
470 470
 
471 471
 					// TEST #1 : check that section was set
472 472
 					case 1 :
473
-						if ( empty( $section ) ) {
474
-							if ( $display_errors ) {
473
+						if (empty($section)) {
474
+							if ($display_errors) {
475 475
 								throw new EE_Error(
476 476
 									sprintf(
477
-										__( 'No configuration section has been provided while attempting to save "%s".', 'event_espresso' ),
477
+										__('No configuration section has been provided while attempting to save "%s".', 'event_espresso'),
478 478
 										$config_class
479 479
 									)
480 480
 								);
@@ -485,11 +485,11 @@  discard block
 block discarded – undo
485 485
 
486 486
 					// TEST #2 : check that settings section exists
487 487
 					case 2 :
488
-						if ( ! isset( $this->{$section} ) ) {
489
-							if ( $display_errors ) {
488
+						if ( ! isset($this->{$section} )) {
489
+							if ($display_errors) {
490 490
 								throw new EE_Error(
491
-									sprintf( __( 'The "%s" configuration section does not exist.', 'event_espresso' ),
492
-											 $section )
491
+									sprintf(__('The "%s" configuration section does not exist.', 'event_espresso'),
492
+											 $section)
493 493
 								);
494 494
 							}
495 495
 							return false;
@@ -499,12 +499,12 @@  discard block
 block discarded – undo
499 499
 					// TEST #3 : check that section is the proper format
500 500
 					case 3 :
501 501
 						if (
502
-							! ( $this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass )
502
+							! ($this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass)
503 503
 						) {
504
-							if ( $display_errors ) {
504
+							if ($display_errors) {
505 505
 								throw new EE_Error(
506 506
 									sprintf(
507
-										__( 'The "%s" configuration settings have not been formatted correctly.', 'event_espresso' ),
507
+										__('The "%s" configuration settings have not been formatted correctly.', 'event_espresso'),
508 508
 										$section
509 509
 									)
510 510
 								);
@@ -515,10 +515,10 @@  discard block
 block discarded – undo
515 515
 
516 516
 					// TEST #4 : check that config section name has been set
517 517
 					case 4 :
518
-						if ( empty( $name ) ) {
519
-							if ( $display_errors ) {
518
+						if (empty($name)) {
519
+							if ($display_errors) {
520 520
 								throw new EE_Error(
521
-									__( 'No name has been provided for the specific configuration section.', 'event_espresso' )
521
+									__('No name has been provided for the specific configuration section.', 'event_espresso')
522 522
 								);
523 523
 							}
524 524
 							return false;
@@ -527,10 +527,10 @@  discard block
 block discarded – undo
527 527
 
528 528
 					// TEST #5 : check that a config class name has been set
529 529
 					case 5 :
530
-						if ( empty( $config_class ) ) {
531
-							if ( $display_errors ) {
530
+						if (empty($config_class)) {
531
+							if ($display_errors) {
532 532
 								throw new EE_Error(
533
-									__( 'No class name has been provided for the specific configuration section.', 'event_espresso' )
533
+									__('No class name has been provided for the specific configuration section.', 'event_espresso')
534 534
 								);
535 535
 							}
536 536
 							return false;
@@ -539,11 +539,11 @@  discard block
 block discarded – undo
539 539
 
540 540
 					// TEST #6 : verify config class is accessible
541 541
 					case 6 :
542
-						if ( ! class_exists( $config_class ) ) {
543
-							if ( $display_errors ) {
542
+						if ( ! class_exists($config_class)) {
543
+							if ($display_errors) {
544 544
 								throw new EE_Error(
545 545
 									sprintf(
546
-										__( 'The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso' ),
546
+										__('The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso'),
547 547
 										$config_class
548 548
 									)
549 549
 								);
@@ -554,11 +554,11 @@  discard block
 block discarded – undo
554 554
 
555 555
 					// TEST #7 : check that config has even been set
556 556
 					case 7 :
557
-						if ( ! isset( $this->{$section}->{$name} ) ) {
558
-							if ( $display_errors ) {
557
+						if ( ! isset($this->{$section}->{$name} )) {
558
+							if ($display_errors) {
559 559
 								throw new EE_Error(
560 560
 									sprintf(
561
-										__( 'No configuration has been set for "%1$s->%2$s".', 'event_espresso' ),
561
+										__('No configuration has been set for "%1$s->%2$s".', 'event_espresso'),
562 562
 										$section,
563 563
 										$name
564 564
 									)
@@ -567,17 +567,17 @@  discard block
 block discarded – undo
567 567
 							return false;
568 568
 						} else {
569 569
 							// and make sure it's not serialized
570
-							$this->{$section}->{$name} = maybe_unserialize( $this->{$section}->{$name} );
570
+							$this->{$section}->{$name} = maybe_unserialize($this->{$section}->{$name} );
571 571
 						}
572 572
 						break;
573 573
 
574 574
 					// TEST #8 : check that config is the requested type
575 575
 					case 8 :
576
-						if ( ! $this->{$section}->{$name} instanceof $config_class ) {
577
-							if ( $display_errors ) {
576
+						if ( ! $this->{$section}->{$name} instanceof $config_class) {
577
+							if ($display_errors) {
578 578
 								throw new EE_Error(
579 579
 									sprintf(
580
-										__( 'The configuration for "%1$s->%2$s" is not of the "%3$s" class.', 'event_espresso' ),
580
+										__('The configuration for "%1$s->%2$s" is not of the "%3$s" class.', 'event_espresso'),
581 581
 										$section,
582 582
 										$name,
583 583
 										$config_class
@@ -590,12 +590,12 @@  discard block
 block discarded – undo
590 590
 
591 591
 					// TEST #9 : verify config object
592 592
 					case 9 :
593
-						if ( ! $config_obj instanceof EE_Config_Base ) {
594
-							if ( $display_errors ) {
593
+						if ( ! $config_obj instanceof EE_Config_Base) {
594
+							if ($display_errors) {
595 595
 								throw new EE_Error(
596 596
 									sprintf(
597
-										__( 'The "%s" class is not an instance of EE_Config_Base.', 'event_espresso' ),
598
-										print_r( $config_obj, true )
597
+										__('The "%s" class is not an instance of EE_Config_Base.', 'event_espresso'),
598
+										print_r($config_obj, true)
599 599
 									)
600 600
 								);
601 601
 							}
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 				}
607 607
 			}
608 608
 
609
-		} catch( EE_Error $e ) {
609
+		} catch (EE_Error $e) {
610 610
 			$e->get_error();
611 611
 		}
612 612
 		// you have successfully run the gauntlet
@@ -623,8 +623,8 @@  discard block
 block discarded – undo
623 623
 	 * @param        string          $name
624 624
 	 * @return        string
625 625
 	 */
626
-	private function _generate_config_option_name( $section = '', $name = '' ) {
627
-		return 'ee_config-' . strtolower( $section . '-' . str_replace( array( 'EE_', 'EED_' ), '', $name ) );
626
+	private function _generate_config_option_name($section = '', $name = '') {
627
+		return 'ee_config-'.strtolower($section.'-'.str_replace(array('EE_', 'EED_'), '', $name));
628 628
 	}
629 629
 
630 630
 
@@ -638,10 +638,10 @@  discard block
 block discarded – undo
638 638
 	 * @param 	string $name
639 639
 	 * @return 	string
640 640
 	 */
641
-	private function _set_config_class( $config_class = '', $name = '' ) {
642
-		return ! empty( $config_class )
641
+	private function _set_config_class($config_class = '', $name = '') {
642
+		return ! empty($config_class)
643 643
 			? $config_class
644
-			: str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $name ) ) ) . '_Config';
644
+			: str_replace(' ', '_', ucwords(str_replace('_', ' ', $name))).'_Config';
645 645
 	}
646 646
 
647 647
 
@@ -655,34 +655,34 @@  discard block
 block discarded – undo
655 655
 	 * @param 	EE_Config_Base $config_obj
656 656
 	 * @return 	EE_Config_Base
657 657
 	 */
658
-	public function set_config( $section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null ) {
658
+	public function set_config($section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null) {
659 659
 		// ensure config class is set to something
660
-		$config_class = $this->_set_config_class( $config_class, $name );
660
+		$config_class = $this->_set_config_class($config_class, $name);
661 661
 		// run tests 1-4, 6, and 7 to verify all config params are set and valid
662
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, null, array( 1, 2, 3, 4, 5, 6 ))) {
662
+		if ( ! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
663 663
 			return null;
664 664
 		}
665
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
665
+		$config_option_name = $this->_generate_config_option_name($section, $name);
666 666
 		// if the config option name hasn't been added yet to the list of option names we're tracking, then do so now
667
-		if ( ! isset( $this->_config_option_names[ $config_option_name ] )) {
668
-			$this->_config_option_names[ $config_option_name ] = $config_class;
667
+		if ( ! isset($this->_config_option_names[$config_option_name])) {
668
+			$this->_config_option_names[$config_option_name] = $config_class;
669 669
 		}
670 670
 		// verify the incoming config object but suppress errors
671
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), false )) {
671
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
672 672
 			$config_obj = new $config_class();
673 673
 		}
674
-		if ( get_option( $config_option_name ) ) {
675
-			update_option( $config_option_name, $config_obj );
674
+		if (get_option($config_option_name)) {
675
+			update_option($config_option_name, $config_obj);
676 676
 			$this->{$section}->{$name} = $config_obj;
677 677
 			return $this->{$section}->{$name};
678 678
 		} else {
679 679
 			// create a wp-option for this config
680
-			if ( add_option( $config_option_name, $config_obj, '', 'no' )) {
681
-				$this->{$section}->{$name} = maybe_unserialize( $config_obj );
680
+			if (add_option($config_option_name, $config_obj, '', 'no')) {
681
+				$this->{$section}->{$name} = maybe_unserialize($config_obj);
682 682
 				return $this->{$section}->{$name};
683 683
 			} else {
684 684
 				EE_Error::add_error(
685
-					sprintf( __( 'The "%s" could not be saved to the database.', 'event_espresso' ), $config_class ),
685
+					sprintf(__('The "%s" could not be saved to the database.', 'event_espresso'), $config_class),
686 686
 					__FILE__, __FUNCTION__, __LINE__
687 687
 				);
688 688
 				return null;
@@ -703,37 +703,37 @@  discard block
 block discarded – undo
703 703
 	 * @param 	bool 					$throw_errors
704 704
 	 * @return 	bool
705 705
 	 */
706
-	public function update_config( $section = '', $name = '', $config_obj = '', $throw_errors = true ) {
707
-		$config_obj = maybe_unserialize( $config_obj );
706
+	public function update_config($section = '', $name = '', $config_obj = '', $throw_errors = true) {
707
+		$config_obj = maybe_unserialize($config_obj);
708 708
 		// get class name of the incoming object
709
-		$config_class = get_class( $config_obj );
709
+		$config_class = get_class($config_obj);
710 710
 		// run tests 1-5 and 9 to verify config
711
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 1, 2, 3, 4, 7, 9 ))) {
711
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(1, 2, 3, 4, 7, 9))) {
712 712
 			return false;
713 713
 		}
714
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
714
+		$config_option_name = $this->_generate_config_option_name($section, $name);
715 715
 		// check if config object has been added to db by seeing if config option name is in $this->_config_option_names array
716
-		if ( ! isset( $this->_config_option_names[ $config_option_name ] )) {
716
+		if ( ! isset($this->_config_option_names[$config_option_name])) {
717 717
 			// save new config to db
718
-			return $this->set_config( $section, $name, $config_class, $config_obj );
718
+			return $this->set_config($section, $name, $config_class, $config_obj);
719 719
 		} else {
720 720
 			// first check if the record already exists
721
-			$existing_config = get_option( $config_option_name );
722
-			$config_obj = serialize( $config_obj );
721
+			$existing_config = get_option($config_option_name);
722
+			$config_obj = serialize($config_obj);
723 723
 			// just return if db record is already up to date
724
-			if ( $existing_config == $config_obj ) {
724
+			if ($existing_config == $config_obj) {
725 725
 				$this->{$section}->{$name} = $config_obj;
726 726
 				return true;
727
-			} else if ( update_option( $config_option_name, $config_obj )) {
727
+			} else if (update_option($config_option_name, $config_obj)) {
728 728
 				// update wp-option for this config class
729 729
 				$this->{$section}->{$name} = $config_obj;
730 730
 				return true;
731
-			} elseif ( $throw_errors ) {
731
+			} elseif ($throw_errors) {
732 732
 				EE_Error::add_error(
733 733
 					sprintf(
734
-						__( 'The "%1$s" object stored at"%2$s" was not successfully updated in the database.', 'event_espresso' ),
734
+						__('The "%1$s" object stored at"%2$s" was not successfully updated in the database.', 'event_espresso'),
735 735
 						$config_class,
736
-						'EE_Config->' . $section . '->' . $name
736
+						'EE_Config->'.$section.'->'.$name
737 737
 					),
738 738
 					__FILE__, __FUNCTION__, __LINE__
739 739
 				);
@@ -753,34 +753,34 @@  discard block
 block discarded – undo
753 753
 	 * @param 	string 	$config_class
754 754
 	 * @return 	mixed EE_Config_Base | NULL
755 755
 	 */
756
-	public function get_config( $section = '', $name = '', $config_class = '' ) {
756
+	public function get_config($section = '', $name = '', $config_class = '') {
757 757
 		// ensure config class is set to something
758
-		$config_class = $this->_set_config_class( $config_class, $name );
758
+		$config_class = $this->_set_config_class($config_class, $name);
759 759
 		// run tests 1-4, 6 and 7 to verify that all params have been set
760
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, NULL, array( 1, 2, 3, 4, 5, 6 ))) {
760
+		if ( ! $this->_verify_config_params($section, $name, $config_class, NULL, array(1, 2, 3, 4, 5, 6))) {
761 761
 			return NULL;
762 762
 		}
763 763
 		// now test if the requested config object exists, but suppress errors
764
-		if ( $this->_verify_config_params( $section, $name, $config_class, NULL, array( 7, 8 ), FALSE )) {
764
+		if ($this->_verify_config_params($section, $name, $config_class, NULL, array(7, 8), FALSE)) {
765 765
 			// config already exists, so pass it back
766 766
 			return $this->{$section}->{$name};
767 767
 		}
768 768
 		// load config option from db if it exists
769
-		$config_obj = $this->get_config_option( $this->_generate_config_option_name( $section, $name ));
769
+		$config_obj = $this->get_config_option($this->_generate_config_option_name($section, $name));
770 770
 		// verify the newly retrieved config object, but suppress errors
771
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), FALSE )) {
771
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), FALSE)) {
772 772
 			// config is good, so set it and pass it back
773 773
 			$this->{$section}->{$name} = $config_obj;
774 774
 			return $this->{$section}->{$name};
775 775
 		}
776 776
 		// oops! $config_obj is not already set and does not exist in the db, so create a new one
777
-		$config_obj =$this->set_config( $section, $name, $config_class );
777
+		$config_obj = $this->set_config($section, $name, $config_class);
778 778
 		// verify the newly created config object
779
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ))) {
779
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9))) {
780 780
 			return $this->{$section}->{$name};
781 781
 		} else {
782 782
 			EE_Error::add_error(
783
-				sprintf( __( 'The "%s" could not be retrieved from the database.', 'event_espresso' ), $config_class ),
783
+				sprintf(__('The "%s" could not be retrieved from the database.', 'event_espresso'), $config_class),
784 784
 				__FILE__, __FUNCTION__, __LINE__
785 785
 			);
786 786
 		}
@@ -795,9 +795,9 @@  discard block
 block discarded – undo
795 795
 	 * @param 	string 	$config_option_name
796 796
 	 * @return 	mixed EE_Config_Base | FALSE
797 797
 	 */
798
-	public function get_config_option( $config_option_name = '' ) {
798
+	public function get_config_option($config_option_name = '') {
799 799
 		// retrieve the wp-option for this config class.
800
-		return maybe_unserialize( get_option( $config_option_name ));
800
+		return maybe_unserialize(get_option($config_option_name));
801 801
 	}
802 802
 
803 803
 
@@ -812,14 +812,14 @@  discard block
 block discarded – undo
812 812
 	 *  @return 	string
813 813
 	 */
814 814
 	public static function get_page_for_posts() {
815
-		$page_for_posts = get_option( 'page_for_posts' );
816
-		if ( ! $page_for_posts ) {
815
+		$page_for_posts = get_option('page_for_posts');
816
+		if ( ! $page_for_posts) {
817 817
 			return 'posts';
818 818
 		}
819 819
 		/** @type WPDB $wpdb */
820 820
 		global $wpdb;
821 821
 		$SQL = "SELECT post_name from $wpdb->posts WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d";
822
-		return $wpdb->get_var( $wpdb->prepare( $SQL, $page_for_posts ));
822
+		return $wpdb->get_var($wpdb->prepare($SQL, $page_for_posts));
823 823
 	}
824 824
 
825 825
 
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 	 */
837 837
 	public function register_shortcodes_and_modules() {
838 838
 		// allow shortcodes to register with WP and to set hooks for the rest of the system
839
-		$this->registry->shortcodes =$this->_register_shortcodes();
839
+		$this->registry->shortcodes = $this->_register_shortcodes();
840 840
 		// allow modules to set hooks for the rest of the system
841 841
 		$this->registry->modules = $this->_register_modules();
842 842
 	}
@@ -868,21 +868,21 @@  discard block
 block discarded – undo
868 868
 	public function widgets_init() {
869 869
 		//only init widgets on admin pages when not in complete maintenance, and
870 870
 		//on frontend when not in any maintenance mode
871
-		if (( is_admin() && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance)  || ! EE_Maintenance_Mode::instance()->level() ) {
871
+		if ((is_admin() && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) || ! EE_Maintenance_Mode::instance()->level()) {
872 872
 			// grab list of installed widgets
873
-			$widgets_to_register = glob( EE_WIDGETS . '*', GLOB_ONLYDIR );
873
+			$widgets_to_register = glob(EE_WIDGETS.'*', GLOB_ONLYDIR);
874 874
 			// filter list of modules to register
875
-			$widgets_to_register = apply_filters( 'FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register );
875
+			$widgets_to_register = apply_filters('FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register);
876 876
 
877
-			if ( ! empty( $widgets_to_register ) ) {
877
+			if ( ! empty($widgets_to_register)) {
878 878
 				// cycle thru widget folders
879
-				foreach ( $widgets_to_register as $widget_path ) {
879
+				foreach ($widgets_to_register as $widget_path) {
880 880
 					// add to list of installed widget modules
881
-					EE_Config::register_ee_widget( $widget_path );
881
+					EE_Config::register_ee_widget($widget_path);
882 882
 				}
883 883
 			}
884 884
 			// filter list of installed modules
885
-			$this->registry->widgets = apply_filters( 'FHEE__EE_Config__register_widgets__installed_widgets', $this->registry->widgets );
885
+			$this->registry->widgets = apply_filters('FHEE__EE_Config__register_widgets__installed_widgets', $this->registry->widgets);
886 886
 		}
887 887
 	}
888 888
 
@@ -895,54 +895,54 @@  discard block
 block discarded – undo
895 895
 	 *  @param 	string 	$widget_path - full path up to and including widget folder
896 896
 	 *  @return 	void
897 897
 	 */
898
-	public static function register_ee_widget( $widget_path = NULL ) {
899
-		do_action( 'AHEE__EE_Config__register_widget__begin', $widget_path );
898
+	public static function register_ee_widget($widget_path = NULL) {
899
+		do_action('AHEE__EE_Config__register_widget__begin', $widget_path);
900 900
 		$widget_ext = '.widget.php';
901 901
 		// make all separators match
902
-		$widget_path = rtrim( str_replace( '/\\', DS, $widget_path ), DS );
902
+		$widget_path = rtrim(str_replace('/\\', DS, $widget_path), DS);
903 903
 		// does the file path INCLUDE the actual file name as part of the path ?
904
-		if ( strpos( $widget_path, $widget_ext ) !== FALSE ) {
904
+		if (strpos($widget_path, $widget_ext) !== FALSE) {
905 905
 			// grab and shortcode file name from directory name and break apart at dots
906
-			$file_name = explode( '.', basename( $widget_path ));
906
+			$file_name = explode('.', basename($widget_path));
907 907
 			// take first segment from file name pieces and remove class prefix if it exists
908
-			$widget = strpos( $file_name[0], 'EEW_' ) === 0 ? substr( $file_name[0], 4 ) : $file_name[0];
908
+			$widget = strpos($file_name[0], 'EEW_') === 0 ? substr($file_name[0], 4) : $file_name[0];
909 909
 			// sanitize shortcode directory name
910
-			$widget = sanitize_key( $widget );
910
+			$widget = sanitize_key($widget);
911 911
 			// now we need to rebuild the shortcode path
912
-			$widget_path = explode( DS, $widget_path );
912
+			$widget_path = explode(DS, $widget_path);
913 913
 			// remove last segment
914
-			array_pop( $widget_path );
914
+			array_pop($widget_path);
915 915
 			// glue it back together
916
-			$widget_path = implode( DS, $widget_path );
916
+			$widget_path = implode(DS, $widget_path);
917 917
 		} else {
918 918
 			// grab and sanitize widget directory name
919
-			$widget = sanitize_key( basename( $widget_path ));
919
+			$widget = sanitize_key(basename($widget_path));
920 920
 		}
921 921
 		// create classname from widget directory name
922
-		$widget = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $widget )));
922
+		$widget = str_replace(' ', '_', ucwords(str_replace('_', ' ', $widget)));
923 923
 		// add class prefix
924
-		$widget_class = 'EEW_' . $widget;
924
+		$widget_class = 'EEW_'.$widget;
925 925
 		// does the widget exist ?
926
-		if ( ! is_readable( $widget_path . DS . $widget_class . $widget_ext )) {
926
+		if ( ! is_readable($widget_path.DS.$widget_class.$widget_ext)) {
927 927
 			$msg = sprintf(
928
-				__( 'The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s', 'event_espresso' ),
928
+				__('The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s', 'event_espresso'),
929 929
 				$widget_class,
930
-				$widget_path . DS . $widget_class . $widget_ext
930
+				$widget_path.DS.$widget_class.$widget_ext
931 931
 			);
932
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
932
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
933 933
 			return;
934 934
 		}
935 935
 		// load the widget class file
936
-		require_once( $widget_path . DS . $widget_class . $widget_ext );
936
+		require_once($widget_path.DS.$widget_class.$widget_ext);
937 937
 		// verify that class exists
938
-		if ( ! class_exists( $widget_class )) {
939
-			$msg = sprintf( __( 'The requested %s widget class does not exist.', 'event_espresso' ), $widget_class );
940
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
938
+		if ( ! class_exists($widget_class)) {
939
+			$msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
940
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
941 941
 			return;
942 942
 		}
943
-		register_widget( $widget_class );
943
+		register_widget($widget_class);
944 944
 		// add to array of registered widgets
945
-		EE_Config::instance()->registry->widgets->{$widget_class} = $widget_path . DS . $widget_class . $widget_ext;
945
+		EE_Config::instance()->registry->widgets->{$widget_class} = $widget_path.DS.$widget_class.$widget_ext;
946 946
 	}
947 947
 
948 948
 
@@ -955,18 +955,18 @@  discard block
 block discarded – undo
955 955
 	 */
956 956
 	private function _register_shortcodes() {
957 957
 		// grab list of installed shortcodes
958
-		$shortcodes_to_register = glob( EE_SHORTCODES . '*', GLOB_ONLYDIR );
958
+		$shortcodes_to_register = glob(EE_SHORTCODES.'*', GLOB_ONLYDIR);
959 959
 		// filter list of modules to register
960
-		$shortcodes_to_register = apply_filters( 'FHEE__EE_Config__register_shortcodes__shortcodes_to_register', $shortcodes_to_register );
961
-		if ( ! empty( $shortcodes_to_register ) ) {
960
+		$shortcodes_to_register = apply_filters('FHEE__EE_Config__register_shortcodes__shortcodes_to_register', $shortcodes_to_register);
961
+		if ( ! empty($shortcodes_to_register)) {
962 962
 			// cycle thru shortcode folders
963
-			foreach ( $shortcodes_to_register as $shortcode_path ) {
963
+			foreach ($shortcodes_to_register as $shortcode_path) {
964 964
 				// add to list of installed shortcode modules
965
-				$this->_register_shortcode( $shortcode_path );
965
+				$this->_register_shortcode($shortcode_path);
966 966
 			}
967 967
 		}
968 968
 		// filter list of installed modules
969
-		return apply_filters( 'FHEE__EE_Config___register_shortcodes__installed_shortcodes', $this->registry->shortcodes );
969
+		return apply_filters('FHEE__EE_Config___register_shortcodes__installed_shortcodes', $this->registry->shortcodes);
970 970
 	}
971 971
 
972 972
 
@@ -978,8 +978,8 @@  discard block
 block discarded – undo
978 978
 	 *  @param 	string 		$shortcode_path - full path up to and including shortcode folder
979 979
 	 *  @return 	bool
980 980
 	 */
981
-	public static function register_shortcode( $shortcode_path = NULL ) {
982
-		EE_Config::instance()->_register_shortcode( $shortcode_path );
981
+	public static function register_shortcode($shortcode_path = NULL) {
982
+		EE_Config::instance()->_register_shortcode($shortcode_path);
983 983
 	}
984 984
 
985 985
 
@@ -991,56 +991,56 @@  discard block
 block discarded – undo
991 991
 	 *  @param 	string 		$shortcode_path - full path up to and including shortcode folder
992 992
 	 *  @return 	bool
993 993
 	 */
994
-	public function _register_shortcode( $shortcode_path = NULL ) {
995
-		do_action( 'AHEE__EE_Config__register_shortcode__begin',$shortcode_path );
994
+	public function _register_shortcode($shortcode_path = NULL) {
995
+		do_action('AHEE__EE_Config__register_shortcode__begin', $shortcode_path);
996 996
 		$shortcode_ext = '.shortcode.php';
997 997
 		// make all separators match
998
-		$shortcode_path = str_replace( array( '\\', '/' ), DS, $shortcode_path );
998
+		$shortcode_path = str_replace(array('\\', '/'), DS, $shortcode_path);
999 999
 		// does the file path INCLUDE the actual file name as part of the path ?
1000
-		if ( strpos( $shortcode_path, $shortcode_ext ) !== FALSE ) {
1000
+		if (strpos($shortcode_path, $shortcode_ext) !== FALSE) {
1001 1001
 			// grab shortcode file name from directory name and break apart at dots
1002
-			$shortcode_file = explode( '.', basename( $shortcode_path ));
1002
+			$shortcode_file = explode('.', basename($shortcode_path));
1003 1003
 			// take first segment from file name pieces and remove class prefix if it exists
1004
-			$shortcode = strpos( $shortcode_file[0], 'EES_' ) === 0 ? substr( $shortcode_file[0], 4 ) : $shortcode_file[0];
1004
+			$shortcode = strpos($shortcode_file[0], 'EES_') === 0 ? substr($shortcode_file[0], 4) : $shortcode_file[0];
1005 1005
 			// sanitize shortcode directory name
1006
-			$shortcode = sanitize_key( $shortcode );
1006
+			$shortcode = sanitize_key($shortcode);
1007 1007
 			// now we need to rebuild the shortcode path
1008
-			$shortcode_path = explode( DS, $shortcode_path );
1008
+			$shortcode_path = explode(DS, $shortcode_path);
1009 1009
 			// remove last segment
1010
-			array_pop( $shortcode_path );
1010
+			array_pop($shortcode_path);
1011 1011
 			// glue it back together
1012
-			$shortcode_path = implode( DS, $shortcode_path ) . DS;
1012
+			$shortcode_path = implode(DS, $shortcode_path).DS;
1013 1013
 		} else {
1014 1014
 			// we need to generate the filename based off of the folder name
1015 1015
 			// grab and sanitize shortcode directory name
1016
-			$shortcode = sanitize_key( basename( $shortcode_path ));
1017
-			$shortcode_path = rtrim( $shortcode_path, DS ) . DS;
1016
+			$shortcode = sanitize_key(basename($shortcode_path));
1017
+			$shortcode_path = rtrim($shortcode_path, DS).DS;
1018 1018
 		}
1019 1019
 		// create classname from shortcode directory or file name
1020
-		$shortcode = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $shortcode )));
1020
+		$shortcode = str_replace(' ', '_', ucwords(str_replace('_', ' ', $shortcode)));
1021 1021
 		// add class prefix
1022
-		$shortcode_class = 'EES_' . $shortcode;
1022
+		$shortcode_class = 'EES_'.$shortcode;
1023 1023
 		// does the shortcode exist ?
1024
-		if ( ! is_readable( $shortcode_path . DS . $shortcode_class . $shortcode_ext )) {
1024
+		if ( ! is_readable($shortcode_path.DS.$shortcode_class.$shortcode_ext)) {
1025 1025
 			$msg = sprintf(
1026
-				__( 'The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s', 'event_espresso' ),
1026
+				__('The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s', 'event_espresso'),
1027 1027
 				$shortcode_class,
1028
-				$shortcode_path . DS . $shortcode_class . $shortcode_ext
1028
+				$shortcode_path.DS.$shortcode_class.$shortcode_ext
1029 1029
 			);
1030
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1030
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1031 1031
 			return FALSE;
1032 1032
 		}
1033 1033
 		// load the shortcode class file
1034
-		require_once( $shortcode_path . $shortcode_class . $shortcode_ext );
1034
+		require_once($shortcode_path.$shortcode_class.$shortcode_ext);
1035 1035
 		// verify that class exists
1036
-		if ( ! class_exists( $shortcode_class )) {
1037
-			$msg = sprintf( __( 'The requested %s shortcode class does not exist.', 'event_espresso' ), $shortcode_class );
1038
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1036
+		if ( ! class_exists($shortcode_class)) {
1037
+			$msg = sprintf(__('The requested %s shortcode class does not exist.', 'event_espresso'), $shortcode_class);
1038
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1039 1039
 			return FALSE;
1040 1040
 		}
1041
-		$shortcode = strtoupper( $shortcode );
1041
+		$shortcode = strtoupper($shortcode);
1042 1042
 		// add to array of registered shortcodes
1043
-		$this->registry->shortcodes->{$shortcode} = $shortcode_path . $shortcode_class . $shortcode_ext;
1043
+		$this->registry->shortcodes->{$shortcode} = $shortcode_path.$shortcode_class.$shortcode_ext;
1044 1044
 		return TRUE;
1045 1045
 	}
1046 1046
 
@@ -1055,23 +1055,23 @@  discard block
 block discarded – undo
1055 1055
 	 */
1056 1056
 	private function _register_modules() {
1057 1057
 		// grab list of installed modules
1058
-		$modules_to_register = glob( EE_MODULES . '*', GLOB_ONLYDIR );
1058
+		$modules_to_register = glob(EE_MODULES.'*', GLOB_ONLYDIR);
1059 1059
 		// filter list of modules to register
1060
-		$modules_to_register = apply_filters( 'FHEE__EE_Config__register_modules__modules_to_register', $modules_to_register );
1060
+		$modules_to_register = apply_filters('FHEE__EE_Config__register_modules__modules_to_register', $modules_to_register);
1061 1061
 
1062 1062
 
1063
-		if ( ! empty( $modules_to_register ) ) {
1063
+		if ( ! empty($modules_to_register)) {
1064 1064
 			// loop through folders
1065
-			foreach ( $modules_to_register as $module_path ) {
1065
+			foreach ($modules_to_register as $module_path) {
1066 1066
 				/**TEMPORARILY EXCLUDE gateways from modules for time being**/
1067
-				if ( $module_path !== EE_MODULES . 'zzz-copy-this-module-template' && $module_path !== EE_MODULES . 'gateways' ) {
1067
+				if ($module_path !== EE_MODULES.'zzz-copy-this-module-template' && $module_path !== EE_MODULES.'gateways') {
1068 1068
 					// add to list of installed modules
1069
-					$this->_register_module( $module_path );
1069
+					$this->_register_module($module_path);
1070 1070
 				}
1071 1071
 			}
1072 1072
 		}
1073 1073
 		// filter list of installed modules
1074
-		return apply_filters( 'FHEE__EE_Config___register_modules__installed_modules', $this->registry->modules );
1074
+		return apply_filters('FHEE__EE_Config___register_modules__installed_modules', $this->registry->modules);
1075 1075
 	}
1076 1076
 
1077 1077
 
@@ -1084,8 +1084,8 @@  discard block
 block discarded – undo
1084 1084
 	 *  @param 	string 		$module_path - full path up to and including module folder
1085 1085
 	 *  @return 	bool
1086 1086
 	 */
1087
-	public static function register_module( $module_path = NULL ) {
1088
-		EE_Config::instance()->_register_module( $module_path );
1087
+	public static function register_module($module_path = NULL) {
1088
+		EE_Config::instance()->_register_module($module_path);
1089 1089
 	}
1090 1090
 
1091 1091
 
@@ -1098,54 +1098,54 @@  discard block
 block discarded – undo
1098 1098
 	 *  @param 	string 		$module_path - full path up to and including module folder
1099 1099
 	 *  @return 	bool
1100 1100
 	 */
1101
-	public function _register_module( $module_path = NULL ) {
1102
-		do_action( 'AHEE__EE_Config__register_module__begin', $module_path );
1101
+	public function _register_module($module_path = NULL) {
1102
+		do_action('AHEE__EE_Config__register_module__begin', $module_path);
1103 1103
 		$module_ext = '.module.php';
1104 1104
 		// make all separators match
1105
-		$module_path = str_replace( array( '\\', '/' ), DS, $module_path );
1105
+		$module_path = str_replace(array('\\', '/'), DS, $module_path);
1106 1106
 		// does the file path INCLUDE the actual file name as part of the path ?
1107
-		if ( strpos( $module_path, $module_ext ) !== FALSE ) {
1107
+		if (strpos($module_path, $module_ext) !== FALSE) {
1108 1108
 			// grab and shortcode file name from directory name and break apart at dots
1109
-			$module_file = explode( '.', basename( $module_path ));
1109
+			$module_file = explode('.', basename($module_path));
1110 1110
 			// now we need to rebuild the shortcode path
1111
-			$module_path = explode( DS, $module_path );
1111
+			$module_path = explode(DS, $module_path);
1112 1112
 			// remove last segment
1113
-			array_pop( $module_path );
1113
+			array_pop($module_path);
1114 1114
 			// glue it back together
1115
-			$module_path = implode( DS, $module_path ) . DS;
1115
+			$module_path = implode(DS, $module_path).DS;
1116 1116
 			// take first segment from file name pieces and sanitize it
1117
-			$module = preg_replace( '/[^a-zA-Z0-9_\-]/', '', $module_file[0] );
1117
+			$module = preg_replace('/[^a-zA-Z0-9_\-]/', '', $module_file[0]);
1118 1118
 			// ensure class prefix is added
1119
-			$module_class = strpos( $module, 'EED_' ) !== 0 ? 'EED_' . $module : $module;
1119
+			$module_class = strpos($module, 'EED_') !== 0 ? 'EED_'.$module : $module;
1120 1120
 		} else {
1121 1121
 			// we need to generate the filename based off of the folder name
1122 1122
 			// grab and sanitize module name
1123
-			$module = strtolower( basename( $module_path ));
1124
-			$module = preg_replace( '/[^a-z0-9_\-]/', '', $module);
1123
+			$module = strtolower(basename($module_path));
1124
+			$module = preg_replace('/[^a-z0-9_\-]/', '', $module);
1125 1125
 			// like trailingslashit()
1126
-			$module_path = rtrim( $module_path, DS ) . DS;
1126
+			$module_path = rtrim($module_path, DS).DS;
1127 1127
 			// create classname from module directory name
1128
-			$module = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $module )));
1128
+			$module = str_replace(' ', '_', ucwords(str_replace('_', ' ', $module)));
1129 1129
 			// add class prefix
1130
-			$module_class = 'EED_' . $module;
1130
+			$module_class = 'EED_'.$module;
1131 1131
 		}
1132 1132
 		// does the module exist ?
1133
-		if ( ! is_readable( $module_path . DS . $module_class . $module_ext )) {
1134
-			$msg = sprintf( __( 'The requested %s module file could not be found or is not readable due to file permissions.', 'event_espresso' ), $module );
1135
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1133
+		if ( ! is_readable($module_path.DS.$module_class.$module_ext)) {
1134
+			$msg = sprintf(__('The requested %s module file could not be found or is not readable due to file permissions.', 'event_espresso'), $module);
1135
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1136 1136
 			return FALSE;
1137 1137
 		}
1138 1138
 		// load the module class file
1139
-		require_once( $module_path . $module_class . $module_ext );
1139
+		require_once($module_path.$module_class.$module_ext);
1140 1140
 		// verify that class exists
1141
-		if ( ! class_exists( $module_class )) {
1142
-			$msg = sprintf( __( 'The requested %s module class does not exist.', 'event_espresso' ), $module_class );
1143
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1141
+		if ( ! class_exists($module_class)) {
1142
+			$msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
1143
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1144 1144
 			return FALSE;
1145 1145
 		}
1146 1146
 		// add to array of registered modules
1147
-		$this->registry->modules->{$module_class} = $module_path . $module_class . $module_ext;
1148
-		do_action( 'AHEE__EE_Config__register_module__complete', $module_class, EE_Config::instance()->registry->modules->{$module_class} );
1147
+		$this->registry->modules->{$module_class} = $module_path.$module_class.$module_ext;
1148
+		do_action('AHEE__EE_Config__register_module__complete', $module_class, EE_Config::instance()->registry->modules->{$module_class} );
1149 1149
 		return TRUE;
1150 1150
 	}
1151 1151
 
@@ -1159,23 +1159,23 @@  discard block
 block discarded – undo
1159 1159
 	 */
1160 1160
 	private function _initialize_shortcodes() {
1161 1161
 		// cycle thru shortcode folders
1162
-		foreach ( $this->registry->shortcodes as $shortcode => $shortcode_path ) {
1162
+		foreach ($this->registry->shortcodes as $shortcode => $shortcode_path) {
1163 1163
 			// add class prefix
1164
-			$shortcode_class = 'EES_' . $shortcode;
1164
+			$shortcode_class = 'EES_'.$shortcode;
1165 1165
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1166 1166
 			// which set hooks ?
1167
-			if ( is_admin() ) {
1167
+			if (is_admin()) {
1168 1168
 				// fire immediately
1169
-				call_user_func( array( $shortcode_class, 'set_hooks_admin' ));
1169
+				call_user_func(array($shortcode_class, 'set_hooks_admin'));
1170 1170
 			} else {
1171 1171
 				// delay until other systems are online
1172
-				add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array( $shortcode_class,'set_hooks' ));
1172
+				add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array($shortcode_class, 'set_hooks'));
1173 1173
 				// convert classname to UPPERCASE and create WP shortcode.
1174
-				$shortcode_tag = strtoupper( $shortcode );
1174
+				$shortcode_tag = strtoupper($shortcode);
1175 1175
 				// but first check if the shortcode has already been added before assigning 'fallback_shortcode_processor'
1176
-				if ( ! shortcode_exists( $shortcode_tag )) {
1176
+				if ( ! shortcode_exists($shortcode_tag)) {
1177 1177
 					// NOTE: this shortcode declaration will get overridden if the shortcode is successfully detected in the post content in EE_Front_Controller->_initialize_shortcodes()
1178
-					add_shortcode( $shortcode_tag, array( $shortcode_class, 'fallback_shortcode_processor' ));
1178
+					add_shortcode($shortcode_tag, array($shortcode_class, 'fallback_shortcode_processor'));
1179 1179
 				}
1180 1180
 			}
1181 1181
 		}
@@ -1192,15 +1192,15 @@  discard block
 block discarded – undo
1192 1192
 	 */
1193 1193
 	private function _initialize_modules() {
1194 1194
 		// cycle thru shortcode folders
1195
-		foreach ( $this->registry->modules as $module_class => $module_path ) {
1195
+		foreach ($this->registry->modules as $module_class => $module_path) {
1196 1196
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1197 1197
 			// which set hooks ?
1198
-			if ( is_admin() ) {
1198
+			if (is_admin()) {
1199 1199
 				// fire immediately
1200
-				call_user_func( array( $module_class, 'set_hooks_admin' ));
1200
+				call_user_func(array($module_class, 'set_hooks_admin'));
1201 1201
 			} else {
1202 1202
 				// delay until other systems are online
1203
-				add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array( $module_class,'set_hooks' ));
1203
+				add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array($module_class, 'set_hooks'));
1204 1204
 			}
1205 1205
 		}
1206 1206
 	}
@@ -1218,26 +1218,26 @@  discard block
 block discarded – undo
1218 1218
 	 *  @param 	string 		$key - url param key indicating a route is being called
1219 1219
 	 *  @return 	bool
1220 1220
 	 */
1221
-	public static function register_route( $route = NULL, $module = NULL, $method_name = NULL, $key = 'ee' ) {
1222
-		do_action( 'AHEE__EE_Config__register_route__begin', $route, $module, $method_name );
1223
-		$module = str_replace( 'EED_', '', $module );
1224
-		$module_class = 'EED_' . $module;
1225
-		if ( ! isset( EE_Config::instance()->registry->modules->{$module_class} )) {
1226
-			$msg = sprintf( __( 'The module %s has not been registered.', 'event_espresso' ), $module );
1227
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1221
+	public static function register_route($route = NULL, $module = NULL, $method_name = NULL, $key = 'ee') {
1222
+		do_action('AHEE__EE_Config__register_route__begin', $route, $module, $method_name);
1223
+		$module = str_replace('EED_', '', $module);
1224
+		$module_class = 'EED_'.$module;
1225
+		if ( ! isset(EE_Config::instance()->registry->modules->{$module_class} )) {
1226
+			$msg = sprintf(__('The module %s has not been registered.', 'event_espresso'), $module);
1227
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1228 1228
 			return FALSE;
1229 1229
 		}
1230
-		if ( empty( $route )) {
1231
-			$msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route );
1232
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1230
+		if (empty($route)) {
1231
+			$msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1232
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1233 1233
 			return FALSE;
1234 1234
 		}
1235
-		if ( ! method_exists ( 'EED_' . $module, $method_name )) {
1236
-			$msg = sprintf( __( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ), $route );
1237
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1235
+		if ( ! method_exists('EED_'.$module, $method_name)) {
1236
+			$msg = sprintf(__('A valid class method for the %s route has not been supplied.', 'event_espresso'), $route);
1237
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1238 1238
 			return FALSE;
1239 1239
 		}
1240
-		EE_Config::$_module_route_map[ $key ][ $route ] = array( 'EED_' . $module, $method_name );
1240
+		EE_Config::$_module_route_map[$key][$route] = array('EED_'.$module, $method_name);
1241 1241
 		return TRUE;
1242 1242
 	}
1243 1243
 
@@ -1251,11 +1251,11 @@  discard block
 block discarded – undo
1251 1251
 	 *  @param 	string 		$key - url param key indicating a route is being called
1252 1252
 	 *  @return 	string
1253 1253
 	 */
1254
-	public static function get_route( $route = NULL, $key = 'ee' ) {
1255
-		do_action( 'AHEE__EE_Config__get_route__begin',$route );
1256
-		$route = apply_filters( 'FHEE__EE_Config__get_route',$route );
1257
-		if ( isset( EE_Config::$_module_route_map[ $key ][ $route ] )) {
1258
-			return EE_Config::$_module_route_map[ $key ][ $route ];
1254
+	public static function get_route($route = NULL, $key = 'ee') {
1255
+		do_action('AHEE__EE_Config__get_route__begin', $route);
1256
+		$route = apply_filters('FHEE__EE_Config__get_route', $route);
1257
+		if (isset(EE_Config::$_module_route_map[$key][$route])) {
1258
+			return EE_Config::$_module_route_map[$key][$route];
1259 1259
 		}
1260 1260
 		return NULL;
1261 1261
 	}
@@ -1284,35 +1284,35 @@  discard block
 block discarded – undo
1284 1284
 	 * @param    string 		$key - url param key indicating a route is being called
1285 1285
 	 * @return    bool
1286 1286
 	 */
1287
-	public static function register_forward( $route = NULL, $status = 0, $forward = NULL, $key = 'ee' ) {
1288
-		do_action( 'AHEE__EE_Config__register_forward',$route,$status,$forward );
1289
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ||  empty( $route )) {
1290
-			$msg = sprintf( __( 'The module route %s for this forward has not been registered.', 'event_espresso' ), $route );
1291
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1287
+	public static function register_forward($route = NULL, $status = 0, $forward = NULL, $key = 'ee') {
1288
+		do_action('AHEE__EE_Config__register_forward', $route, $status, $forward);
1289
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1290
+			$msg = sprintf(__('The module route %s for this forward has not been registered.', 'event_espresso'), $route);
1291
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1292 1292
 			return FALSE;
1293 1293
 		}
1294
-		if ( empty( $forward )) {
1295
-			$msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route );
1296
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1294
+		if (empty($forward)) {
1295
+			$msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1296
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1297 1297
 			return FALSE;
1298 1298
 		}
1299
-		if ( is_array( $forward )) {
1300
-			if ( ! isset( $forward[1] )) {
1301
-				$msg = sprintf( __( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ), $route );
1302
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1299
+		if (is_array($forward)) {
1300
+			if ( ! isset($forward[1])) {
1301
+				$msg = sprintf(__('A class method for the %s forwarding route has not been supplied.', 'event_espresso'), $route);
1302
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1303 1303
 				return FALSE;
1304 1304
 			}
1305
-			if ( ! method_exists( $forward[0], $forward[1] )) {
1306
-				$msg = sprintf( __( 'The class method %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward[1], $route );
1307
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1305
+			if ( ! method_exists($forward[0], $forward[1])) {
1306
+				$msg = sprintf(__('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'), $forward[1], $route);
1307
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1308 1308
 				return FALSE;
1309 1309
 			}
1310
-		} else if ( ! function_exists( $forward )) {
1311
-			$msg = sprintf( __( 'The function %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward, $route );
1312
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1310
+		} else if ( ! function_exists($forward)) {
1311
+			$msg = sprintf(__('The function %s for the %s forwarding route is in invalid.', 'event_espresso'), $forward, $route);
1312
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1313 1313
 			return FALSE;
1314 1314
 		}
1315
-		EE_Config::$_module_forward_map[ $key ][ $route ][ absint( $status ) ] = $forward;
1315
+		EE_Config::$_module_forward_map[$key][$route][absint($status)] = $forward;
1316 1316
 		return TRUE;
1317 1317
 	}
1318 1318
 
@@ -1327,10 +1327,10 @@  discard block
 block discarded – undo
1327 1327
 	 *  @param    string 		$key - url param key indicating a route is being called
1328 1328
 	 *  @return 	string
1329 1329
 	 */
1330
-	public static function get_forward( $route = NULL, $status = 0, $key = 'ee' ) {
1331
-		do_action( 'AHEE__EE_Config__get_forward__begin',$route,$status );
1332
-		if ( isset( EE_Config::$_module_forward_map[ $key ][ $route ][ $status ] )) {
1333
-			return apply_filters( 'FHEE__EE_Config__get_forward', EE_Config::$_module_forward_map[ $key ][ $route ][ $status ], $route,$status );
1330
+	public static function get_forward($route = NULL, $status = 0, $key = 'ee') {
1331
+		do_action('AHEE__EE_Config__get_forward__begin', $route, $status);
1332
+		if (isset(EE_Config::$_module_forward_map[$key][$route][$status])) {
1333
+			return apply_filters('FHEE__EE_Config__get_forward', EE_Config::$_module_forward_map[$key][$route][$status], $route, $status);
1334 1334
 		}
1335 1335
 		return NULL;
1336 1336
 	}
@@ -1347,19 +1347,19 @@  discard block
 block discarded – undo
1347 1347
 	 * @param    string 		$key - url param key indicating a route is being called
1348 1348
 	 * @return    bool
1349 1349
 	 */
1350
-	public static function register_view( $route = NULL, $status = 0, $view = NULL, $key = 'ee' ) {
1351
-		do_action( 'AHEE__EE_Config__register_view__begin',$route,$status,$view );
1352
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ||  empty( $route )) {
1353
-			$msg = sprintf( __( 'The module route %s for this view has not been registered.', 'event_espresso' ), $route );
1354
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1350
+	public static function register_view($route = NULL, $status = 0, $view = NULL, $key = 'ee') {
1351
+		do_action('AHEE__EE_Config__register_view__begin', $route, $status, $view);
1352
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1353
+			$msg = sprintf(__('The module route %s for this view has not been registered.', 'event_espresso'), $route);
1354
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1355 1355
 			return FALSE;
1356 1356
 		}
1357
-		if ( ! is_readable( $view )) {
1358
-			$msg = sprintf( __( 'The %s view file could not be found or is not readable due to file permissions.', 'event_espresso' ), $view );
1359
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1357
+		if ( ! is_readable($view)) {
1358
+			$msg = sprintf(__('The %s view file could not be found or is not readable due to file permissions.', 'event_espresso'), $view);
1359
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1360 1360
 			return FALSE;
1361 1361
 		}
1362
-		EE_Config::$_module_view_map[ $key ][ $route ][ absint( $status ) ] = $view;
1362
+		EE_Config::$_module_view_map[$key][$route][absint($status)] = $view;
1363 1363
 		return TRUE;
1364 1364
 	}
1365 1365
 
@@ -1376,10 +1376,10 @@  discard block
 block discarded – undo
1376 1376
 	 *  @param    string 		$key - url param key indicating a route is being called
1377 1377
 	 *  @return 	string
1378 1378
 	 */
1379
-	public static function get_view( $route = NULL, $status = 0, $key = 'ee' ) {
1380
-		do_action( 'AHEE__EE_Config__get_view__begin',$route,$status );
1381
-		if ( isset( EE_Config::$_module_view_map[ $key ][ $route ][ $status ] )) {
1382
-			return apply_filters( 'FHEE__EE_Config__get_view', EE_Config::$_module_view_map[ $key ][ $route ][ $status ], $route,$status );
1379
+	public static function get_view($route = NULL, $status = 0, $key = 'ee') {
1380
+		do_action('AHEE__EE_Config__get_view__begin', $route, $status);
1381
+		if (isset(EE_Config::$_module_view_map[$key][$route][$status])) {
1382
+			return apply_filters('FHEE__EE_Config__get_view', EE_Config::$_module_view_map[$key][$route][$status], $route, $status);
1383 1383
 		}
1384 1384
 		return NULL;
1385 1385
 	}
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
 
1388 1388
 
1389 1389
 	public function shutdown() {
1390
-		update_option( 'ee_config_option_names', $this->_config_option_names );
1390
+		update_option('ee_config_option_names', $this->_config_option_names);
1391 1391
 	}
1392 1392
 
1393 1393
 
@@ -1403,7 +1403,7 @@  discard block
 block discarded – undo
1403 1403
  * magic functions in use, except we'll allow them to magically set and get stuff...
1404 1404
  * basically, they should just be well-defined stdClasses
1405 1405
  */
1406
-class EE_Config_Base{
1406
+class EE_Config_Base {
1407 1407
 
1408 1408
 	/**
1409 1409
 	 * Utility function for escaping the value of a property and returning.
@@ -1412,13 +1412,13 @@  discard block
 block discarded – undo
1412 1412
 	 * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1413 1413
 	 * @throws \EE_Error
1414 1414
 	 */
1415
-	public function get_pretty( $property ) {
1416
-		if ( ! property_exists( $this, $property ) ) {
1417
-			throw new EE_Error( sprintf( __('%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.', 'event_espresso' ), get_class( $this ), $property ) );
1415
+	public function get_pretty($property) {
1416
+		if ( ! property_exists($this, $property)) {
1417
+			throw new EE_Error(sprintf(__('%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.', 'event_espresso'), get_class($this), $property));
1418 1418
 		}
1419 1419
 		//just handling escaping of strings for now.
1420
-		if ( is_string( $this->{$property} ) ) {
1421
-			return stripslashes( $this->{$property} );
1420
+		if (is_string($this->{$property} )) {
1421
+			return stripslashes($this->{$property} );
1422 1422
 		}
1423 1423
 		return $this->{$property};
1424 1424
 	}
@@ -1427,19 +1427,19 @@  discard block
 block discarded – undo
1427 1427
 
1428 1428
 	public function populate() {
1429 1429
 		//grab defaults via a new instance of this class.
1430
-		$class_name = get_class( $this );
1430
+		$class_name = get_class($this);
1431 1431
 		$defaults = new $class_name;
1432 1432
 
1433 1433
 		//loop through the properties for this class and see if they are set.  If they are NOT, then grab the
1434 1434
 		//default from our $defaults object.
1435
-		foreach ( get_object_vars( $defaults ) as $property => $value ) {
1436
-			if ( is_null( $this->{$property} ) ) {
1435
+		foreach (get_object_vars($defaults) as $property => $value) {
1436
+			if (is_null($this->{$property} )) {
1437 1437
 				$this->{$property} = $value;
1438 1438
 			}
1439 1439
 		}
1440 1440
 
1441 1441
 		//cleanup
1442
-		unset( $defaults );
1442
+		unset($defaults);
1443 1443
 	}
1444 1444
 
1445 1445
 
@@ -1531,12 +1531,12 @@  discard block
 block discarded – undo
1531 1531
 	 */
1532 1532
 	public function __construct() {
1533 1533
 		$current_network_main_site = is_multisite() ? get_current_site() : NULL;
1534
-		$current_main_site_id = !empty( $current_network_main_site ) ? $current_network_main_site->blog_id : 1;
1534
+		$current_main_site_id = ! empty($current_network_main_site) ? $current_network_main_site->blog_id : 1;
1535 1535
 		// set default organization settings
1536 1536
 		$this->current_blog_id = get_current_blog_id();
1537 1537
 		$this->current_blog_id = $this->current_blog_id === NULL ? 1 : $this->current_blog_id;
1538
-		$this->ee_ueip_optin = is_main_site() ? get_option( 'ee_ueip_optin', TRUE ) : get_blog_option( $current_main_site_id, 'ee_ueip_optin', TRUE );
1539
-		$this->ee_ueip_has_notified = is_main_site() ? get_option( 'ee_ueip_has_notified', FALSE ) : TRUE;
1538
+		$this->ee_ueip_optin = is_main_site() ? get_option('ee_ueip_optin', TRUE) : get_blog_option($current_main_site_id, 'ee_ueip_optin', TRUE);
1539
+		$this->ee_ueip_has_notified = is_main_site() ? get_option('ee_ueip_has_notified', FALSE) : TRUE;
1540 1540
 		$this->post_shortcodes = array();
1541 1541
 		$this->module_route_map = array();
1542 1542
 		$this->module_forward_map = array();
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
 		$this->event_cpt_slug = __('events', 'event_espresso');
1556 1556
 
1557 1557
 		//ueip constant check
1558
-		if ( defined( 'EE_DISABLE_UXIP' ) && EE_DISABLE_UXIP ) {
1558
+		if (defined('EE_DISABLE_UXIP') && EE_DISABLE_UXIP) {
1559 1559
 			$this->ee_ueip_optin = FALSE;
1560 1560
 			$this->ee_ueip_has_notified = TRUE;
1561 1561
 		}
@@ -1595,8 +1595,8 @@  discard block
 block discarded – undo
1595 1595
 	 *  @return 	string
1596 1596
 	 */
1597 1597
 	public function reg_page_url() {
1598
-		if ( ! $this->reg_page_url ) {
1599
-			$this->reg_page_url = get_permalink( $this->reg_page_id ) . '#checkout';
1598
+		if ( ! $this->reg_page_url) {
1599
+			$this->reg_page_url = get_permalink($this->reg_page_id).'#checkout';
1600 1600
 		}
1601 1601
 		return $this->reg_page_url;
1602 1602
 	}
@@ -1609,12 +1609,12 @@  discard block
 block discarded – undo
1609 1609
 	 *  @return 	string
1610 1610
 	 */
1611 1611
 	public function txn_page_url($query_args = array()) {
1612
-		if ( ! $this->txn_page_url ) {
1613
-			$this->txn_page_url = get_permalink( $this->txn_page_id );
1612
+		if ( ! $this->txn_page_url) {
1613
+			$this->txn_page_url = get_permalink($this->txn_page_id);
1614 1614
 		}
1615
-		if($query_args){
1616
-			return add_query_arg($query_args,$this->txn_page_url);
1617
-		}else{
1615
+		if ($query_args) {
1616
+			return add_query_arg($query_args, $this->txn_page_url);
1617
+		} else {
1618 1618
 			return $this->txn_page_url;
1619 1619
 		}
1620 1620
 	}
@@ -1626,12 +1626,12 @@  discard block
 block discarded – undo
1626 1626
 	 *  @return 	string
1627 1627
 	 */
1628 1628
 	public function thank_you_page_url($query_args = array()) {
1629
-		if ( ! $this->thank_you_page_url ) {
1630
-			$this->thank_you_page_url = get_permalink( $this->thank_you_page_id );
1629
+		if ( ! $this->thank_you_page_url) {
1630
+			$this->thank_you_page_url = get_permalink($this->thank_you_page_id);
1631 1631
 		}
1632
-		if($query_args){
1633
-			return add_query_arg($query_args,$this->thank_you_page_url);
1634
-		}else{
1632
+		if ($query_args) {
1633
+			return add_query_arg($query_args, $this->thank_you_page_url);
1634
+		} else {
1635 1635
 			return $this->thank_you_page_url;
1636 1636
 		}
1637 1637
 	}
@@ -1642,8 +1642,8 @@  discard block
 block discarded – undo
1642 1642
 	 *  @return 	string
1643 1643
 	 */
1644 1644
 	public function cancel_page_url() {
1645
-		if ( ! $this->cancel_page_url ) {
1646
-			$this->cancel_page_url = get_permalink( $this->cancel_page_id );
1645
+		if ( ! $this->cancel_page_url) {
1646
+			$this->cancel_page_url = get_permalink($this->cancel_page_id);
1647 1647
 		}
1648 1648
 		return $this->cancel_page_url;
1649 1649
 	}
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 		//reset all url properties
1672 1672
 		$this->_reset_urls();
1673 1673
 		//return what to save to db
1674
-		return array_keys( get_object_vars( $this ) );
1674
+		return array_keys(get_object_vars($this));
1675 1675
 	}
1676 1676
 
1677 1677
 }
@@ -1903,38 +1903,38 @@  discard block
 block discarded – undo
1903 1903
 	 * @param null $CNT_ISO
1904 1904
 	 * @return \EE_Currency_Config
1905 1905
 	 */
1906
-	public function __construct( $CNT_ISO = NULL ) {
1906
+	public function __construct($CNT_ISO = NULL) {
1907 1907
 
1908 1908
 		// get country code from organization settings or use default
1909
-		$ORG_CNT = isset( EE_Registry::instance()->CFG->organization ) && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ? EE_Registry::instance()->CFG->organization->CNT_ISO : NULL;
1909
+		$ORG_CNT = isset(EE_Registry::instance()->CFG->organization) && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ? EE_Registry::instance()->CFG->organization->CNT_ISO : NULL;
1910 1910
 		// but override if requested
1911
-		$CNT_ISO = ! empty( $CNT_ISO ) ? $CNT_ISO : $ORG_CNT;
1911
+		$CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : $ORG_CNT;
1912 1912
 		// so if that all went well, and we are not in M-Mode (cuz you can't query the db in M-Mode) and double-check the countries table exists
1913
-		if ( ! empty( $CNT_ISO ) && EE_Maintenance_Mode::instance()->models_can_query() && EEH_Activation::table_exists( EE_Registry::instance()->load_model( 'Country' )->table() ) ) {
1913
+		if ( ! empty($CNT_ISO) && EE_Maintenance_Mode::instance()->models_can_query() && EEH_Activation::table_exists(EE_Registry::instance()->load_model('Country')->table())) {
1914 1914
 			// retrieve the country settings from the db, just in case they have been customized
1915
-			$country = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $CNT_ISO );
1916
-			if ( $country instanceof EE_Country ) {
1917
-				$this->code = $country->currency_code(); 	// currency code: USD, CAD, EUR
1918
-				$this->name = $country->currency_name_single();	// Dollar
1919
-				$this->plural = $country->currency_name_plural(); 	// Dollars
1920
-				$this->sign =  $country->currency_sign(); 			// currency sign: $
1921
-				$this->sign_b4 = $country->currency_sign_before(); 		// currency sign before or after: $TRUE  or  FALSE$
1922
-				$this->dec_plc = $country->currency_decimal_places();	// decimal places: 2 = 0.00  3 = 0.000
1923
-				$this->dec_mrk = $country->currency_decimal_mark();	// decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1924
-				$this->thsnds = $country->currency_thousands_separator();	// thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1915
+			$country = EE_Registry::instance()->load_model('Country')->get_one_by_ID($CNT_ISO);
1916
+			if ($country instanceof EE_Country) {
1917
+				$this->code = $country->currency_code(); // currency code: USD, CAD, EUR
1918
+				$this->name = $country->currency_name_single(); // Dollar
1919
+				$this->plural = $country->currency_name_plural(); // Dollars
1920
+				$this->sign = $country->currency_sign(); // currency sign: $
1921
+				$this->sign_b4 = $country->currency_sign_before(); // currency sign before or after: $TRUE  or  FALSE$
1922
+				$this->dec_plc = $country->currency_decimal_places(); // decimal places: 2 = 0.00  3 = 0.000
1923
+				$this->dec_mrk = $country->currency_decimal_mark(); // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1924
+				$this->thsnds = $country->currency_thousands_separator(); // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1925 1925
 			}
1926 1926
 		}
1927 1927
 		// fallback to hardcoded defaults, in case the above failed
1928
-		if ( empty( $this->code )) {
1928
+		if (empty($this->code)) {
1929 1929
 			// set default currency settings
1930
-			$this->code = 'USD'; 	// currency code: USD, CAD, EUR
1931
-			$this->name = __( 'Dollar', 'event_espresso' ); 	// Dollar
1932
-			$this->plural = __( 'Dollars', 'event_espresso' ); 	// Dollars
1933
-			$this->sign =  '$'; 	// currency sign: $
1934
-			$this->sign_b4 = TRUE; 	// currency sign before or after: $TRUE  or  FALSE$
1935
-			$this->dec_plc = 2; 	// decimal places: 2 = 0.00  3 = 0.000
1936
-			$this->dec_mrk = '.'; 	// decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1937
-			$this->thsnds = ','; 	// thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1930
+			$this->code = 'USD'; // currency code: USD, CAD, EUR
1931
+			$this->name = __('Dollar', 'event_espresso'); // Dollar
1932
+			$this->plural = __('Dollars', 'event_espresso'); // Dollars
1933
+			$this->sign = '$'; // currency sign: $
1934
+			$this->sign_b4 = TRUE; // currency sign before or after: $TRUE  or  FALSE$
1935
+			$this->dec_plc = 2; // decimal places: 2 = 0.00  3 = 0.000
1936
+			$this->dec_mrk = '.'; // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1937
+			$this->thsnds = ','; // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1938 1938
 		}
1939 1939
 	}
1940 1940
 }
@@ -2083,7 +2083,7 @@  discard block
 block discarded – undo
2083 2083
 	 * @since 4.8.8.rc.019
2084 2084
 	 */
2085 2085
 	public function do_hooks() {
2086
-		add_action( 'AHEE__EE_Config___load_core_config__end', array( $this, 'set_default_reg_status_on_EEM_Event' ));
2086
+		add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_reg_status_on_EEM_Event'));
2087 2087
 	}
2088 2088
 
2089 2089
 
@@ -2091,7 +2091,7 @@  discard block
 block discarded – undo
2091 2091
 	 * @return void
2092 2092
 	 */
2093 2093
 	public function set_default_reg_status_on_EEM_Event() {
2094
-		EEM_Event::set_default_reg_status( $this->default_STS_ID );
2094
+		EEM_Event::set_default_reg_status($this->default_STS_ID);
2095 2095
 	}
2096 2096
 
2097 2097
 
@@ -2196,10 +2196,10 @@  discard block
 block discarded – undo
2196 2196
 	 * @param bool $reset
2197 2197
 	 * @return string
2198 2198
 	 */
2199
-	public function log_file_name( $reset = FALSE ) {
2200
-		if ( empty( $this->log_file_name ) || $reset ) {
2201
-			$this->log_file_name = sanitize_key( 'espresso_log_' . md5( uniqid( '', TRUE ))) . '.txt';
2202
-			EE_Config::instance()->update_espresso_config( FALSE, FALSE );
2199
+	public function log_file_name($reset = FALSE) {
2200
+		if (empty($this->log_file_name) || $reset) {
2201
+			$this->log_file_name = sanitize_key('espresso_log_'.md5(uniqid('', TRUE))).'.txt';
2202
+			EE_Config::instance()->update_espresso_config(FALSE, FALSE);
2203 2203
 		}
2204 2204
 		return $this->log_file_name;
2205 2205
 	}
@@ -2211,10 +2211,10 @@  discard block
 block discarded – undo
2211 2211
 	 * @param bool $reset
2212 2212
 	 * @return string
2213 2213
 	 */
2214
-	public function debug_file_name( $reset = FALSE ) {
2215
-		if ( empty( $this->debug_file_name ) || $reset ) {
2216
-			$this->debug_file_name = sanitize_key( 'espresso_debug_' . md5( uniqid( '', TRUE ))) . '.txt';
2217
-			EE_Config::instance()->update_espresso_config( FALSE, FALSE );
2214
+	public function debug_file_name($reset = FALSE) {
2215
+		if (empty($this->debug_file_name) || $reset) {
2216
+			$this->debug_file_name = sanitize_key('espresso_debug_'.md5(uniqid('', TRUE))).'.txt';
2217
+			EE_Config::instance()->update_espresso_config(FALSE, FALSE);
2218 2218
 		}
2219 2219
 		return $this->debug_file_name;
2220 2220
 	}
@@ -2387,21 +2387,21 @@  discard block
 block discarded – undo
2387 2387
 		// set default map settings
2388 2388
 		$this->use_google_maps = TRUE;
2389 2389
 		// for event details pages (reg page)
2390
-		$this->event_details_map_width = 585; 			// ee_map_width_single
2391
-		$this->event_details_map_height = 362; 			// ee_map_height_single
2392
-		$this->event_details_map_zoom = 14; 			// ee_map_zoom_single
2393
-		$this->event_details_display_nav = TRUE; 			// ee_map_nav_display_single
2394
-		$this->event_details_nav_size = FALSE; 			// ee_map_nav_size_single
2395
-		$this->event_details_control_type = 'default'; 		// ee_map_type_control_single
2396
-		$this->event_details_map_align = 'center'; 			// ee_map_align_single
2390
+		$this->event_details_map_width = 585; // ee_map_width_single
2391
+		$this->event_details_map_height = 362; // ee_map_height_single
2392
+		$this->event_details_map_zoom = 14; // ee_map_zoom_single
2393
+		$this->event_details_display_nav = TRUE; // ee_map_nav_display_single
2394
+		$this->event_details_nav_size = FALSE; // ee_map_nav_size_single
2395
+		$this->event_details_control_type = 'default'; // ee_map_type_control_single
2396
+		$this->event_details_map_align = 'center'; // ee_map_align_single
2397 2397
 		// for event list pages
2398
-		$this->event_list_map_width = 300; 			// ee_map_width
2399
-		$this->event_list_map_height = 185; 		// ee_map_height
2400
-		$this->event_list_map_zoom = 12; 			// ee_map_zoom
2401
-		$this->event_list_display_nav = FALSE; 		// ee_map_nav_display
2402
-		$this->event_list_nav_size = TRUE; 			// ee_map_nav_size
2403
-		$this->event_list_control_type = 'dropdown'; 		// ee_map_type_control
2404
-		$this->event_list_map_align = 'center'; 			// ee_map_align
2398
+		$this->event_list_map_width = 300; // ee_map_width
2399
+		$this->event_list_map_height = 185; // ee_map_height
2400
+		$this->event_list_map_zoom = 12; // ee_map_zoom
2401
+		$this->event_list_display_nav = FALSE; // ee_map_nav_display
2402
+		$this->event_list_nav_size = TRUE; // ee_map_nav_size
2403
+		$this->event_list_control_type = 'dropdown'; // ee_map_type_control
2404
+		$this->event_list_map_align = 'center'; // ee_map_align
2405 2405
 	}
2406 2406
 
2407 2407
 }
@@ -2412,7 +2412,7 @@  discard block
 block discarded – undo
2412 2412
 /**
2413 2413
  * stores Events_Archive settings
2414 2414
  */
2415
-class EE_Events_Archive_Config extends EE_Config_Base{
2415
+class EE_Events_Archive_Config extends EE_Config_Base {
2416 2416
 
2417 2417
 	public $display_status_banner;
2418 2418
 	public $display_description;
@@ -2431,7 +2431,7 @@  discard block
 block discarded – undo
2431 2431
 	/**
2432 2432
 	 *	class constructor
2433 2433
 	 */
2434
-	public function __construct(){
2434
+	public function __construct() {
2435 2435
 		$this->display_status_banner = 0;
2436 2436
 		$this->display_description = 1;
2437 2437
 		$this->display_ticket_selector = 0;
@@ -2451,7 +2451,7 @@  discard block
 block discarded – undo
2451 2451
 /**
2452 2452
  * Stores Event_Single_Config settings
2453 2453
  */
2454
-class EE_Event_Single_Config extends EE_Config_Base{
2454
+class EE_Event_Single_Config extends EE_Config_Base {
2455 2455
 
2456 2456
 	public $display_status_banner_single;
2457 2457
 	public $display_venue;
@@ -2480,7 +2480,7 @@  discard block
 block discarded – undo
2480 2480
 /**
2481 2481
  * Stores Ticket_Selector_Config settings
2482 2482
  */
2483
-class EE_Ticket_Selector_Config extends EE_Config_Base{
2483
+class EE_Ticket_Selector_Config extends EE_Config_Base {
2484 2484
 	public $show_ticket_sale_columns;
2485 2485
 	public $show_ticket_details;
2486 2486
 	public $show_expired_tickets;
@@ -2534,7 +2534,7 @@  discard block
 block discarded – undo
2534 2534
 	 * @return void
2535 2535
 	 */
2536 2536
 	protected function _set_php_values() {
2537
-		$this->php->max_input_vars = ini_get( 'max_input_vars' );
2537
+		$this->php->max_input_vars = ini_get('max_input_vars');
2538 2538
 		$this->php->version = phpversion();
2539 2539
 	}
2540 2540
 
@@ -2553,9 +2553,9 @@  discard block
 block discarded – undo
2553 2553
 	 *         @type string $msg 		Any message to be displayed.
2554 2554
 	 * }
2555 2555
 	 */
2556
-	public function max_input_vars_limit_check( $input_count = 0 ) {
2557
-		if ( ! empty( $this->php->max_input_vars ) && ( $input_count >= $this->php->max_input_vars ) && ( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >=9 ) ) {
2558
-			return  sprintf( __('The maximum number of inputs on this page has been exceeded.  You cannot add anymore items (i.e. tickets, datetimes, custom fields) on this page because of your servers PHP "max_input_vars" setting.%1$sThere are %2$d inputs and the maximum amount currently allowed by your server is %3$d.', 'event_espresso'), '<br>', $input_count, $this->php->max_input_vars);
2556
+	public function max_input_vars_limit_check($input_count = 0) {
2557
+		if ( ! empty($this->php->max_input_vars) && ($input_count >= $this->php->max_input_vars) && (PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >= 9)) {
2558
+			return  sprintf(__('The maximum number of inputs on this page has been exceeded.  You cannot add anymore items (i.e. tickets, datetimes, custom fields) on this page because of your servers PHP "max_input_vars" setting.%1$sThere are %2$d inputs and the maximum amount currently allowed by your server is %3$d.', 'event_espresso'), '<br>', $input_count, $this->php->max_input_vars);
2559 2559
 		} else {
2560 2560
 			return '';
2561 2561
 		}
@@ -2590,7 +2590,7 @@  discard block
 block discarded – undo
2590 2590
  * stores payment gateway info
2591 2591
  * @deprecated
2592 2592
  */
2593
-class EE_Gateway_Config extends EE_Config_Base{
2593
+class EE_Gateway_Config extends EE_Config_Base {
2594 2594
 
2595 2595
 	/**
2596 2596
 	 * Array with keys that are payment gateways slugs, and values are arrays
@@ -2612,9 +2612,9 @@  discard block
 block discarded – undo
2612 2612
 	 *	class constructor
2613 2613
 	 * @deprecated
2614 2614
 	 */
2615
-	public function __construct(){
2615
+	public function __construct() {
2616 2616
 		$this->payment_settings = array();
2617
-		$this->active_gateways = array( 'Invoice' => FALSE );
2617
+		$this->active_gateways = array('Invoice' => FALSE);
2618 2618
 	}
2619 2619
 }
2620 2620
 
Please login to merge, or discard this patch.
core/EE_Encryption.core.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
 do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
3 5
 /**
4 6
  * Event Espresso
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3 3
  * EE_Encryption class
4 4
  *
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 	 * @return \EE_Encryption
30 30
 	 */
31 31
   private function __construct() {
32
-		define( 'ESPRESSO_ENCRYPT', true );
33
-		if ( ! function_exists( 'mcrypt_encrypt' ) ) {
32
+		define('ESPRESSO_ENCRYPT', true);
33
+		if ( ! function_exists('mcrypt_encrypt')) {
34 34
 			$this->_use_mcrypt = false;
35 35
 		}
36 36
 	}
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 *	@access public
43 43
 	 * @return \EE_Encryption
44 44
 	 */
45
-	public static function instance ( ) {
45
+	public static function instance( ) {
46 46
 		// check if class object is instantiated
47
-		if ( ! self::$_instance instanceof EE_Encryption ) {
47
+		if ( ! self::$_instance instanceof EE_Encryption) {
48 48
 			self::$_instance = new self();
49 49
 		}
50 50
 		return self::$_instance;
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public  function get_encryption_key() {
61 61
 		// if encryption key has not been set
62
-		if ( empty( $this->_encryption_key )) {
62
+		if (empty($this->_encryption_key)) {
63 63
 			// retrieve encryption_key from db
64
-			$this->_encryption_key = get_option( 'ee_encryption_key', '' );
64
+			$this->_encryption_key = get_option('ee_encryption_key', '');
65 65
 			// WHAT?? No encryption_key in the db ??
66
-			if ( $this->_encryption_key == '' ) {
66
+			if ($this->_encryption_key == '') {
67 67
 				// let's make one. And md5 it to make it just the right size for a key
68
-				$new_key =  md5( self::generate_random_string() );
68
+				$new_key = md5(self::generate_random_string());
69 69
 				// now save it to the db for later
70
-				add_option( 'ee_encryption_key', $new_key );
70
+				add_option('ee_encryption_key', $new_key);
71 71
 				// here's the key - FINALLY !
72 72
 				$this->_encryption_key = $new_key;
73 73
 			}
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
 	 * @param string $text_string  - the text to be encrypted
84 84
 	 * @return string
85 85
 	 */
86
-	public function encrypt ( $text_string = '' ) {
86
+	public function encrypt($text_string = '') {
87 87
 		// you give me nothing??? GET OUT !
88
-		if  ( empty( $text_string ))  {
88
+		if (empty($text_string)) {
89 89
 			return $text_string;
90 90
 		}
91
-		if ( $this->_use_mcrypt ) {
92
-			$encrypted_text = $this->m_encrypt( $text_string );
91
+		if ($this->_use_mcrypt) {
92
+			$encrypted_text = $this->m_encrypt($text_string);
93 93
 		} else {
94
-			$encrypted_text = $this->acme_encrypt( $text_string );
94
+			$encrypted_text = $this->acme_encrypt($text_string);
95 95
 		}
96 96
 		return $encrypted_text;
97 97
 	}
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 	 * @param string $encrypted_text - the text to be decrypted
105 105
 	 * @return string
106 106
 	 */
107
-	public function decrypt  ( $encrypted_text = '' )  {
107
+	public function decrypt($encrypted_text = '') {
108 108
 		// you give me nothing??? GET OUT !
109
-		if  ( empty( $encrypted_text ))  {
109
+		if (empty($encrypted_text)) {
110 110
 			return $encrypted_text;
111 111
 		}
112 112
 		// if PHP's mcrypt functions are installed then we'll use them
113
-		if ( $this->_use_mcrypt ) {
114
-			$decrypted_text = $this->m_decrypt( $encrypted_text );
113
+		if ($this->_use_mcrypt) {
114
+			$decrypted_text = $this->m_decrypt($encrypted_text);
115 115
 		} else {
116
-			$decrypted_text = $this->acme_decrypt( $encrypted_text );
116
+			$decrypted_text = $this->acme_decrypt($encrypted_text);
117 117
 		}
118 118
 		return $decrypted_text;
119 119
  	}
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
 	 * @internal param $string - the text to be encoded
129 129
 	 * @return string
130 130
 	 */
131
-	public function base64_url_encode ( $text_string = '' ) {
131
+	public function base64_url_encode($text_string = '') {
132 132
 		// you give me nothing??? GET OUT !
133
-		if  ( ! $text_string )  {
133
+		if ( ! $text_string) {
134 134
 			return $text_string;
135 135
 		}
136 136
 		// encode
137
-		$encoded_string = base64_encode ( $text_string );
137
+		$encoded_string = base64_encode($text_string);
138 138
 		// remove chars to make encoding more URL friendly
139
-		$encoded_string = strtr ( $encoded_string, '+/=', '-_,' );
139
+		$encoded_string = strtr($encoded_string, '+/=', '-_,');
140 140
 		return $encoded_string;
141 141
 	}
142 142
 
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
 	 * @internal param $string - the text to be decoded
151 151
 	 * @return string
152 152
 	 */
153
-	public function base64_url_decode ( $encoded_string = '' ) {
153
+	public function base64_url_decode($encoded_string = '') {
154 154
 		// you give me nothing??? GET OUT !
155
-		if  ( ! $encoded_string )  {
155
+		if ( ! $encoded_string) {
156 156
 			return $encoded_string;
157 157
 		}
158 158
 		// replace previously removed characters
159
-		$encoded_string = strtr ( $encoded_string, '-_,', '+/=' );
159
+		$encoded_string = strtr($encoded_string, '-_,', '+/=');
160 160
 		// decode
161
-		$decoded_string = base64_decode ( $encoded_string );
161
+		$decoded_string = base64_decode($encoded_string);
162 162
 		return $decoded_string;
163 163
 	}
164 164
 
@@ -171,19 +171,19 @@  discard block
 block discarded – undo
171 171
 	 * @internal param $string - the text to be encrypted
172 172
 	 * @return string
173 173
 	 */
174
-	private function m_encrypt  ( $text_string = '' ) {
174
+	private function m_encrypt($text_string = '') {
175 175
 		// you give me nothing??? GET OUT !
176
-		if  ( ! $text_string )  {
176
+		if ( ! $text_string) {
177 177
 			return $text_string;
178 178
 		}
179 179
 		// get the initialization vector size
180
-		$iv_size = mcrypt_get_iv_size ( MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB );
180
+		$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
181 181
 		// initialization vector
182
-		$iv = mcrypt_create_iv ( $iv_size, MCRYPT_RAND );
182
+		$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
183 183
 		// encrypt it
184
-		$encrypted_text = mcrypt_encrypt ( MCRYPT_RIJNDAEL_256, $this->get_encryption_key(), $text_string, MCRYPT_MODE_ECB, $iv );
184
+		$encrypted_text = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->get_encryption_key(), $text_string, MCRYPT_MODE_ECB, $iv);
185 185
 		// trim and encode
186
-		$encrypted_text = trim ( base64_encode( $encrypted_text ) );
186
+		$encrypted_text = trim(base64_encode($encrypted_text));
187 187
 		return $encrypted_text;
188 188
 	}
189 189
 
@@ -196,19 +196,19 @@  discard block
 block discarded – undo
196 196
 	 * @internal param $string - the text to be decrypted
197 197
 	 * @return string
198 198
 	 */
199
-	private function m_decrypt  ( $encrypted_text = '' )  {
199
+	private function m_decrypt($encrypted_text = '') {
200 200
 		// you give me nothing??? GET OUT !
201
-		if  ( ! $encrypted_text )  {
201
+		if ( ! $encrypted_text) {
202 202
 			return $encrypted_text;
203 203
 		}
204 204
 		// decode
205
-		$encrypted_text = base64_decode ( $encrypted_text );
205
+		$encrypted_text = base64_decode($encrypted_text);
206 206
 		// get the initialization vector size
207
-		$iv_size = mcrypt_get_iv_size ( MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB );
208
-		$iv = mcrypt_create_iv ( $iv_size, MCRYPT_RAND );
207
+		$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
208
+		$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
209 209
 		// decrypt it
210
-		$decrypted_text = mcrypt_decrypt ( MCRYPT_RIJNDAEL_256, $this->get_encryption_key(), $encrypted_text, MCRYPT_MODE_ECB, $iv );
211
-		$decrypted_text = trim ( $decrypted_text );
210
+		$decrypted_text = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->get_encryption_key(), $encrypted_text, MCRYPT_MODE_ECB, $iv);
211
+		$decrypted_text = trim($decrypted_text);
212 212
 		return $decrypted_text;
213 213
 	}
214 214
 
@@ -222,18 +222,18 @@  discard block
 block discarded – undo
222 222
 	 * @internal param $string - the text to be decrypted
223 223
 	 * @return string
224 224
 	 */
225
-	private function acme_encrypt ( $text_string = '' ) {
225
+	private function acme_encrypt($text_string = '') {
226 226
 		// you give me nothing??? GET OUT !
227
-		if  ( ! $text_string )  {
227
+		if ( ! $text_string) {
228 228
 			return $text_string;
229 229
 		}
230
-		$key_bits = str_split ( str_pad ( '', strlen( $text_string ), $this->get_encryption_key(), STR_PAD_RIGHT ));
231
-		$string_bits = str_split( $text_string );
232
-		foreach ( $string_bits as $k =>$v ) {
233
-			$temp = ord( $v ) + ord ( $key_bits[$k] );
234
-			$string_bits[$k] = chr ( $temp > 255 ? ( $temp - 256 ) : $temp );
230
+		$key_bits = str_split(str_pad('', strlen($text_string), $this->get_encryption_key(), STR_PAD_RIGHT));
231
+		$string_bits = str_split($text_string);
232
+		foreach ($string_bits as $k =>$v) {
233
+			$temp = ord($v) + ord($key_bits[$k]);
234
+			$string_bits[$k] = chr($temp > 255 ? ($temp - 256) : $temp);
235 235
 		}
236
-		$encrypted = base64_encode( join( '', $string_bits ) );
236
+		$encrypted = base64_encode(join('', $string_bits));
237 237
 		return $encrypted;
238 238
 	}
239 239
 
@@ -247,19 +247,19 @@  discard block
 block discarded – undo
247 247
 	 * @internal param $string - the text to be decrypted
248 248
 	 * @return string
249 249
 	 */
250
-	private function acme_decrypt ( $encrypted_text = false ) {
250
+	private function acme_decrypt($encrypted_text = false) {
251 251
 		// you give me nothing??? GET OUT !
252
-		if  ( ! $encrypted_text )  {
252
+		if ( ! $encrypted_text) {
253 253
 			return false;
254 254
 		}
255
-		$encrypted_text = base64_decode ( $encrypted_text );
256
-		$key_bits = str_split ( str_pad ( '', strlen ( $encrypted_text ), $this->get_encryption_key(), STR_PAD_RIGHT ));
257
-		$string_bits = str_split ( $encrypted_text );
258
-		foreach ( $string_bits as $k => $v ) {
259
-			$temp = ord ( $v ) - ord ( $key_bits[$k] );
260
-			$string_bits[$k] = chr ( $temp < 0 ? ( $temp + 256 ) : $temp );
255
+		$encrypted_text = base64_decode($encrypted_text);
256
+		$key_bits = str_split(str_pad('', strlen($encrypted_text), $this->get_encryption_key(), STR_PAD_RIGHT));
257
+		$string_bits = str_split($encrypted_text);
258
+		foreach ($string_bits as $k => $v) {
259
+			$temp = ord($v) - ord($key_bits[$k]);
260
+			$string_bits[$k] = chr($temp < 0 ? ($temp + 256) : $temp);
261 261
 		}
262
-		$decrypted = join( '', $string_bits );
262
+		$decrypted = join('', $string_bits);
263 263
 		return $decrypted;
264 264
 	}
265 265
 
@@ -273,13 +273,13 @@  discard block
 block discarded – undo
273 273
 	 * @internal param $string - number of characters for random string
274 274
 	 * @return string
275 275
 	 */
276
-	public function generate_random_string ( $length = 40 ) {
277
-		$iterations = ceil ( $length / 40 );
276
+	public function generate_random_string($length = 40) {
277
+		$iterations = ceil($length / 40);
278 278
 		$random_string = '';
279
-		for ($i = 0; $i < $iterations; $i ++) {
280
-			$random_string .= sha1( microtime(TRUE) . mt_rand( 10000, 90000 ));
279
+		for ($i = 0; $i < $iterations; $i++) {
280
+			$random_string .= sha1(microtime(TRUE).mt_rand(10000, 90000));
281 281
 		}
282
-		$random_string =  substr( $random_string, 0, $length );
282
+		$random_string = substr($random_string, 0, $length);
283 283
 		return $random_string;
284 284
 	}
285 285
 
Please login to merge, or discard this patch.
core/EE_Error.core.php 4 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	/**
89 89
 	 *    error_handler
90 90
 	 * @access public
91
-	 * @param $code
91
+	 * @param integer $code
92 92
 	 * @param $message
93 93
 	 * @param $file
94 94
 	 * @param $line
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	/**
190 190
 	 *    _format_error
191 191
 	 * @access private
192
-	 * @param $code
192
+	 * @param string $code
193 193
 	 * @param $message
194 194
 	 * @param $file
195 195
 	 * @param $line
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 	 *
943 943
 	 * @access    public
944 944
 	 * @param string $return_url
945
-	 * @return    array
945
+	 * @return    string
946 946
 	 */
947 947
 	public static function get_persistent_admin_notices( $return_url = '' ) {
948 948
 		$notices = '';
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
 	 *
968 968
 	 * @access 	public
969 969
 	 * @param 	bool $force_print
970
-	 * @return 	void
970
+	 * @return 	null|string
971 971
 	 */
972 972
 	private static function _print_scripts( $force_print = FALSE ) {
973 973
 		if (( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' )) && ! $force_print ) {
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
 	
1106 1106
 	/**
1107 1107
 	 * Like get_notices, but returns an array of all the notices of the given type.
1108
-	 * @return array {
1108
+	 * @return boolean {
1109 1109
 	 *	@type array $success all the success messages
1110 1110
 	 *	@type array $errors all the error messages
1111 1111
 	 *	@type array $attention all the attention messages
Please login to merge, or discard this patch.
Indentation   +166 added lines, -166 removed lines patch added patch discarded remove patch
@@ -18,52 +18,52 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 	/**
21
-	* 	name of the file to log exceptions to
22
-	* 	@access	private
23
-    *	@var string
24
-	*/
21
+	 * 	name of the file to log exceptions to
22
+	 * 	@access	private
23
+	 *	@var string
24
+	 */
25 25
 	private static $_exception_log_file = 'espresso_error_log.txt';
26 26
 
27 27
 	/**
28
-	* 	the exception
29
-	* 	@access	private
30
-    *	@var object
31
-	*/
28
+	 * 	the exception
29
+	 * 	@access	private
30
+	 *	@var object
31
+	 */
32 32
 	private $_exception;
33 33
 
34 34
 	/**
35
-	* 	stores details for all exception
36
-	* 	@access	private
37
-    *	@var array
38
-	*/
35
+	 * 	stores details for all exception
36
+	 * 	@access	private
37
+	 *	@var array
38
+	 */
39 39
 	private static $_all_exceptions = array();
40 40
 
41 41
 	/**
42
-	* 	tracks number of errors
43
-	* 	@access	private
44
-    *	@var int
45
-	*/
42
+	 * 	tracks number of errors
43
+	 * 	@access	private
44
+	 *	@var int
45
+	 */
46 46
 	private static $_error_count = 0;
47 47
 
48 48
 	/**
49
-	* 	has JS been loaded ?
50
-	* 	@access	private
51
-    *	@var boolean
52
-	*/
49
+	 * 	has JS been loaded ?
50
+	 * 	@access	private
51
+	 *	@var boolean
52
+	 */
53 53
 	private static $_js_loaded = FALSE;
54 54
 
55 55
 	/**
56
-	* 	has shutdown action been added ?
57
-	* 	@access	private
58
-    *	@var boolean
59
-	*/
56
+	 * 	has shutdown action been added ?
57
+	 * 	@access	private
58
+	 *	@var boolean
59
+	 */
60 60
 	private static $_action_added = FALSE;
61 61
 
62 62
 	/**
63
-	* 	has shutdown action been added ?
64
-	* 	@access	private
65
-    *	@var boolean
66
-	*/
63
+	 * 	has shutdown action been added ?
64
+	 * 	@access	private
65
+	 *	@var boolean
66
+	 */
67 67
 	private static $_espresso_notices = array( 'success' => FALSE, 'errors' => FALSE, 'attention' => FALSE );
68 68
 
69 69
 
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 
72 72
 
73 73
 	/**
74
-	*	@override default exception handling
75
-	*	@access public
76
-	*	@echo string
77
-	*/
74
+	 *	@override default exception handling
75
+	 *	@access public
76
+	 *	@echo string
77
+	 */
78 78
 	function __construct( $message, $code = 0, Exception $previous = NULL ) {
79 79
 		if ( version_compare( phpversion(), '5.3.0', '<' )) {
80 80
 			parent::__construct( $message, $code );
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
 
174 174
 
175 175
 	/**
176
-	*	fatal_error_handler
177
-	*	@access public
178
-	*	@return void
179
-	*/
176
+	 *	fatal_error_handler
177
+	 *	@access public
178
+	 *	@return void
179
+	 */
180 180
 	public static function fatal_error_handler() {
181 181
 		$last_error = error_get_last();
182 182
 		if ( $last_error['type'] === E_ERROR ) {
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 
222 222
 
223 223
 	/**
224
-	*	_add_actions
225
-	*	@access public
226
-	*	@return void
227
-	*/
228
-    public function get_error() {
224
+	 *	_add_actions
225
+	 *	@access public
226
+	 *	@return void
227
+	 */
228
+	public function get_error() {
229 229
 
230 230
 		if( apply_filters( 'FHEE__EE_Error__get_error__show_normal_exceptions', FALSE ) ){
231 231
 			throw $this;
@@ -255,22 +255,22 @@  discard block
 block discarded – undo
255 255
 
256 256
 
257 257
 	/**
258
-	*	has_error
259
-	*	@access public
260
-	*	@return boolean
261
-	*/
262
-    public static function has_error(){
258
+	 *	has_error
259
+	 *	@access public
260
+	 *	@return boolean
261
+	 */
262
+	public static function has_error(){
263 263
 		return self::$_error_count ? TRUE : FALSE;
264 264
 	}
265 265
 
266 266
 
267 267
 
268 268
 	/**
269
-	*	display_errors
270
-	*	@access public
271
-	*	@echo string
272
-	*/
273
-    public function display_errors(){
269
+	 *	display_errors
270
+	 *	@access public
271
+	 *	@echo string
272
+	 */
273
+	public function display_errors(){
274 274
 
275 275
 		$trace_details = '';
276 276
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 			// process trace info
343 343
 			if ( empty( $ex['trace'] )) {
344 344
 
345
-	            $trace_details .= __( 'Sorry, but no trace information was available for this exception.', 'event_espresso' );
345
+				$trace_details .= __( 'Sorry, but no trace information was available for this exception.', 'event_espresso' );
346 346
 
347 347
 			} else {
348 348
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 					$function_dsply = ! empty( $function ) ? $function : '&nbsp;';
395 395
 					$args_dsply = ! empty( $args ) ? '( ' . $args . ' )' : '';
396 396
 
397
-		              $trace_details .= '
397
+					  $trace_details .= '
398 398
 					<tr>
399 399
 						<td align="right" class="' . $zebra . '">' . $nmbr_dsply . '</td>
400 400
 						<td align="right" class="' . $zebra . '">' . $line_dsply . '</td>
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
 				}
408 408
 
409
-	            $trace_details .= '
409
+				$trace_details .= '
410 410
 			 </table>
411 411
 			</div>';
412 412
 
@@ -486,12 +486,12 @@  discard block
 block discarded – undo
486 486
 
487 487
 
488 488
 	/**
489
-	*	generate string from exception trace args
490
-	*
491
-	*	@access private
492
-	*	@ param array $arguments
493
-	*	@ return string
494
-	*/
489
+	 *	generate string from exception trace args
490
+	 *
491
+	 *	@access private
492
+	 *	@ param array $arguments
493
+	 *	@ return string
494
+	 */
495 495
 	private function _convert_args_to_string ( $arguments = array(), $array = FALSE ) {
496 496
 
497 497
 		$arg_string = '';
@@ -535,15 +535,15 @@  discard block
 block discarded – undo
535 535
 
536 536
 
537 537
 	/**
538
-	* 	add error message
539
-	*
540
-	*	@access public
541
-	* 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
542
-	* 	@param		string		$file		the file that the error occurred in - just use __FILE__
543
-	* 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
544
-	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
545
-	* 	@return 		void
546
-	*/
538
+	 * 	add error message
539
+	 *
540
+	 *	@access public
541
+	 * 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
542
+	 * 	@param		string		$file		the file that the error occurred in - just use __FILE__
543
+	 * 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
544
+	 * 	@param		string		$line	the line number where the error occurred - just use __LINE__
545
+	 * 	@return 		void
546
+	 */
547 547
 	public static function add_error( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
548 548
 		self::_add_notice ( 'errors', $msg, $file, $func, $line );
549 549
 		self::$_error_count++;
@@ -554,15 +554,15 @@  discard block
 block discarded – undo
554 554
 
555 555
 
556 556
 	/**
557
-	* 	add success message
558
-	*
559
-	*	@access public
560
-	* 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
561
-	* 	@param		string		$file		the file that the error occurred in - just use __FILE__
562
-	* 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
563
-	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
564
-	* 	@return 		void
565
-	*/
557
+	 * 	add success message
558
+	 *
559
+	 *	@access public
560
+	 * 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
561
+	 * 	@param		string		$file		the file that the error occurred in - just use __FILE__
562
+	 * 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
563
+	 * 	@param		string		$line	the line number where the error occurred - just use __LINE__
564
+	 * 	@return 		void
565
+	 */
566 566
 	public static function add_success( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
567 567
 		self::_add_notice ( 'success', $msg, $file, $func, $line );
568 568
 	}
@@ -572,15 +572,15 @@  discard block
 block discarded – undo
572 572
 
573 573
 
574 574
 	/**
575
-	* 	add attention message
576
-	*
577
-	*	@access public
578
-	* 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
579
-	* 	@param		string		$file		the file that the error occurred in - just use __FILE__
580
-	* 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
581
-	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
582
-	* 	@return 		void
583
-	*/
575
+	 * 	add attention message
576
+	 *
577
+	 *	@access public
578
+	 * 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
579
+	 * 	@param		string		$file		the file that the error occurred in - just use __FILE__
580
+	 * 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
581
+	 * 	@param		string		$line	the line number where the error occurred - just use __LINE__
582
+	 * 	@return 		void
583
+	 */
584 584
 	public static function add_attention( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
585 585
 		self::_add_notice ( 'attention', $msg, $file, $func, $line );
586 586
 	}
@@ -590,16 +590,16 @@  discard block
 block discarded – undo
590 590
 
591 591
 
592 592
 	/**
593
-	* 	add success message
594
-	*
595
-	*	@access public
596
-	* 	@param		string		$type	whether the message is for a success or error notification
597
-	* 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
598
-	* 	@param		string		$file		the file that the error occurred in - just use __FILE__
599
-	* 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
600
-	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
601
-	* 	@return 		void
602
-	*/
593
+	 * 	add success message
594
+	 *
595
+	 *	@access public
596
+	 * 	@param		string		$type	whether the message is for a success or error notification
597
+	 * 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
598
+	 * 	@param		string		$file		the file that the error occurred in - just use __FILE__
599
+	 * 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
600
+	 * 	@param		string		$line	the line number where the error occurred - just use __LINE__
601
+	 * 	@return 		void
602
+	 */
603 603
 	private static function _add_notice( $type = 'success', $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
604 604
 		if ( empty( $msg )) {
605 605
 			EE_Error::doing_it_wrong(
@@ -648,11 +648,11 @@  discard block
 block discarded – undo
648 648
 
649 649
 
650 650
 	/**
651
-	* 	in some case it may be necessary to overwrite the existing success messages
652
-	*
653
-	*	@access public
654
-	* 	@return 		void
655
-	*/
651
+	 * 	in some case it may be necessary to overwrite the existing success messages
652
+	 *
653
+	 *	@access public
654
+	 * 	@return 		void
655
+	 */
656 656
 	public static function overwrite_success() {
657 657
 		self::$_espresso_notices['success'] = FALSE;
658 658
 	}
@@ -662,11 +662,11 @@  discard block
 block discarded – undo
662 662
 
663 663
 
664 664
 	/**
665
-	* 	in some case it may be necessary to overwrite the existing attention messages
666
-	*
667
-	*	@access public
668
-	* 	@return 		void
669
-	*/
665
+	 * 	in some case it may be necessary to overwrite the existing attention messages
666
+	 *
667
+	 *	@access public
668
+	 * 	@return 		void
669
+	 */
670 670
 	public static function overwrite_attention() {
671 671
 		self::$_espresso_notices['attention'] = FALSE;
672 672
 	}
@@ -676,11 +676,11 @@  discard block
 block discarded – undo
676 676
 
677 677
 
678 678
 	/**
679
-	* 	in some case it may be necessary to overwrite the existing error messages
680
-	*
681
-	*	@access public
682
-	* 	@return 		void
683
-	*/
679
+	 * 	in some case it may be necessary to overwrite the existing error messages
680
+	 *
681
+	 *	@access public
682
+	 * 	@return 		void
683
+	 */
684 684
 	public static function overwrite_errors() {
685 685
 		self::$_espresso_notices['errors'] = FALSE;
686 686
 	}
@@ -688,24 +688,24 @@  discard block
 block discarded – undo
688 688
 
689 689
 
690 690
 	/**
691
-	*	reset_notices
692
-	*	@access private
693
-	*	@return void
694
-	*/
691
+	 *	reset_notices
692
+	 *	@access private
693
+	 *	@return void
694
+	 */
695 695
 	public static function reset_notices(){
696
-    	self::$_espresso_notices['success'] = FALSE;
697
-    	self::$_espresso_notices['attention'] = FALSE;
698
-    	self::$_espresso_notices['errors'] = FALSE;
699
-    }
696
+		self::$_espresso_notices['success'] = FALSE;
697
+		self::$_espresso_notices['attention'] = FALSE;
698
+		self::$_espresso_notices['errors'] = FALSE;
699
+	}
700 700
 
701 701
 
702 702
 
703 703
 	/**
704
-	*	has_errors
705
-	*	@access public
706
-	*	@return int
707
-	*/
708
-    public static function has_notices(){
704
+	 *	has_errors
705
+	 *	@access public
706
+	 *	@return int
707
+	 */
708
+	public static function has_notices(){
709 709
 		$has_notices = 0;
710 710
 		// check for success messages
711 711
 		$has_notices = self::$_espresso_notices['success'] && ! empty(  self::$_espresso_notices['success'] ) ? 3 : $has_notices;
@@ -719,15 +719,15 @@  discard block
 block discarded – undo
719 719
 
720 720
 
721 721
 	/**
722
-	* 	compile all error or success messages into one string
723
-	*	@see EE_Error::get_raw_notices if you want the raw notices without any preparations made to them
724
-	*
725
-	*	@access public
726
-	* 	@param		boolean		$format_output		whether or not to format the messages for display in the WP admin
727
-	* 	@param		boolean		$save_to_transient	whether or not to save notices to the db for retrieval on next request - ONLY do this just before redirecting
728
-	* 	@param		boolean		$remove_empty		whether or not to unset empty messages
729
-	* 	@return 		array
730
-	*/
722
+	 * 	compile all error or success messages into one string
723
+	 *	@see EE_Error::get_raw_notices if you want the raw notices without any preparations made to them
724
+	 *
725
+	 *	@access public
726
+	 * 	@param		boolean		$format_output		whether or not to format the messages for display in the WP admin
727
+	 * 	@param		boolean		$save_to_transient	whether or not to save notices to the db for retrieval on next request - ONLY do this just before redirecting
728
+	 * 	@param		boolean		$remove_empty		whether or not to unset empty messages
729
+	 * 	@return 		array
730
+	 */
731 731
 	public static function get_notices( $format_output = TRUE, $save_to_transient = FALSE, $remove_empty = TRUE ) {
732 732
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
733 733
 
@@ -839,14 +839,14 @@  discard block
 block discarded – undo
839 839
 
840 840
 
841 841
 	/**
842
-	* 	add_persistent_admin_notice
843
-	*
844
-	*	@access 	public
845
-	* 	@param		string	$pan_name	the name, or key of the Persistent Admin Notice to be stored
846
-	* 	@param		string	$pan_message	the message to be stored persistently until dismissed
847
-	* 	@param bool $force_update allows one to enforce the reappearance of a persistent message.
848
-	* 	@return 		void
849
-	*/
842
+	 * 	add_persistent_admin_notice
843
+	 *
844
+	 *	@access 	public
845
+	 * 	@param		string	$pan_name	the name, or key of the Persistent Admin Notice to be stored
846
+	 * 	@param		string	$pan_message	the message to be stored persistently until dismissed
847
+	 * 	@param bool $force_update allows one to enforce the reappearance of a persistent message.
848
+	 * 	@return 		void
849
+	 */
850 850
 	public static function add_persistent_admin_notice( $pan_name = '', $pan_message, $force_update = FALSE ) {
851 851
 		if ( ! empty( $pan_name ) && ! empty( $pan_message )) {
852 852
 			$persistent_admin_notices = get_option( 'ee_pers_admin_notices', array() );
@@ -910,9 +910,9 @@  discard block
 block discarded – undo
910 910
 	 * 	display_persistent_admin_notices
911 911
 	 *
912 912
 	 *  	@access 	public
913
-	* 	@param		string	$pan_name	the name, or key of the Persistent Admin Notice to be stored
914
-	* 	@param		string	$pan_name	the message to be stored persistently until dismissed
915
-	* 	@param		string	$return_url	URL to go back to aftger nag notice is dismissed
913
+	 * 	@param		string	$pan_name	the name, or key of the Persistent Admin Notice to be stored
914
+	 * 	@param		string	$pan_name	the message to be stored persistently until dismissed
915
+	 * 	@param		string	$return_url	URL to go back to aftger nag notice is dismissed
916 916
 	 *  	@return 		string
917 917
 	 */
918 918
 	public static function display_persistent_admin_notices( $pan_name = '', $pan_message = '', $return_url = '' ) {
@@ -1008,11 +1008,11 @@  discard block
 block discarded – undo
1008 1008
 
1009 1009
 
1010 1010
 	/**
1011
-	* 	enqueue_error_scripts
1012
-	*
1013
-	*	@access public
1014
-	* 	@return 		void
1015
-	*/
1011
+	 * 	enqueue_error_scripts
1012
+	 *
1013
+	 *	@access public
1014
+	 * 	@return 		void
1015
+	 */
1016 1016
 	public static function enqueue_error_scripts() {
1017 1017
 		self::_print_scripts();
1018 1018
 	}
@@ -1020,15 +1020,15 @@  discard block
 block discarded – undo
1020 1020
 
1021 1021
 
1022 1022
 	/**
1023
-	*	create error code from filepath, function name,
1024
-	*	and line number where exception or error was thrown
1025
-	*
1026
-	*	@access public
1027
-	*	@ param string $file
1028
-	*	@ param string $func
1029
-	*	@ param string $line
1030
-	*	@ return string
1031
-	*/
1023
+	 *	create error code from filepath, function name,
1024
+	 *	and line number where exception or error was thrown
1025
+	 *
1026
+	 *	@access public
1027
+	 *	@ param string $file
1028
+	 *	@ param string $func
1029
+	 *	@ param string $line
1030
+	 *	@ return string
1031
+	 */
1032 1032
 	public static function generate_error_code ( $file = '', $func = '', $line = '' ) {
1033 1033
 		$file = explode( '.', basename( $file ));
1034 1034
 		$error_code = ! empty( $file[0] ) ? $file[0] : '';
@@ -1042,13 +1042,13 @@  discard block
 block discarded – undo
1042 1042
 
1043 1043
 
1044 1044
 	/**
1045
-	*	write exception details to log file
1046
-	*
1047
-	*	@access public
1048
-	*	@ param timestamp $time
1049
-	*	@ param object $ex
1050
-	*	@ return void
1051
-	*/
1045
+	 *	write exception details to log file
1046
+	 *
1047
+	 *	@access public
1048
+	 *	@ param timestamp $time
1049
+	 *	@ param object $ex
1050
+	 *	@ return void
1051
+	 */
1052 1052
 	public function write_to_error_log ( $time = FALSE, $ex = FALSE, $clear = FALSE ) {
1053 1053
 
1054 1054
 		if ( ! $ex ) {
Please login to merge, or discard this patch.
Spacing   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 // if you're a dev and want to receive all errors via email add this to your wp-config.php: define( 'EE_ERROR_EMAILS', TRUE );
3
-if ( defined( 'WP_DEBUG' ) && WP_DEBUG === TRUE && defined( 'EE_ERROR_EMAILS' ) && EE_ERROR_EMAILS === TRUE ) {
4
-	set_error_handler( array( 'EE_Error', 'error_handler' ));
5
-	register_shutdown_function( array( 'EE_Error', 'fatal_error_handler' ));
3
+if (defined('WP_DEBUG') && WP_DEBUG === TRUE && defined('EE_ERROR_EMAILS') && EE_ERROR_EMAILS === TRUE) {
4
+	set_error_handler(array('EE_Error', 'error_handler'));
5
+	register_shutdown_function(array('EE_Error', 'fatal_error_handler'));
6 6
 }
7 7
 /**
8 8
  *
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	* 	@access	private
65 65
     *	@var boolean
66 66
 	*/
67
-	private static $_espresso_notices = array( 'success' => FALSE, 'errors' => FALSE, 'attention' => FALSE );
67
+	private static $_espresso_notices = array('success' => FALSE, 'errors' => FALSE, 'attention' => FALSE);
68 68
 
69 69
 
70 70
 
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 	*	@access public
76 76
 	*	@echo string
77 77
 	*/
78
-	function __construct( $message, $code = 0, Exception $previous = NULL ) {
79
-		if ( version_compare( phpversion(), '5.3.0', '<' )) {
80
-			parent::__construct( $message, $code );
78
+	function __construct($message, $code = 0, Exception $previous = NULL) {
79
+		if (version_compare(phpversion(), '5.3.0', '<')) {
80
+			parent::__construct($message, $code);
81 81
 		} else {
82
-			parent::__construct( $message, $code, $previous );
82
+			parent::__construct($message, $code, $previous);
83 83
 		}
84 84
 	}
85 85
 
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
 	 * @param $line
95 95
 	 * @return void
96 96
 	 */
97
-	public static function error_handler( $code, $message, $file, $line ) {
98
-		$type = EE_Error::error_type( $code );
97
+	public static function error_handler($code, $message, $file, $line) {
98
+		$type = EE_Error::error_type($code);
99 99
 		$site = site_url();
100
-		switch ( $site ) {
100
+		switch ($site) {
101 101
 			case 'http://ee4.eventespresso.com/' :
102 102
 			case 'http://ee4decaf.eventespresso.com/' :
103 103
 			case 'http://ee4hf.eventespresso.com/' :
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 				$to = '[email protected]';
111 111
 				break;
112 112
 			default :
113
-				$to = get_option( 'admin_email' );
113
+				$to = get_option('admin_email');
114 114
 		}
115
-		$subject = $type . ' ' . $message . ' in ' . EVENT_ESPRESSO_VERSION . ' on ' . site_url();
116
-		$msg = EE_Error::_format_error( $type, $message, $file, $line );
117
-		if ( function_exists( 'wp_mail' )) {
118
-			add_filter( 'wp_mail_content_type', array( 'EE_Error', 'set_content_type' ));
119
-			wp_mail( $to, $subject, $msg );
115
+		$subject = $type.' '.$message.' in '.EVENT_ESPRESSO_VERSION.' on '.site_url();
116
+		$msg = EE_Error::_format_error($type, $message, $file, $line);
117
+		if (function_exists('wp_mail')) {
118
+			add_filter('wp_mail_content_type', array('EE_Error', 'set_content_type'));
119
+			wp_mail($to, $subject, $msg);
120 120
 		}
121 121
 		echo '<div id="message" class="espresso-notices error"><p>';
122
-		echo $type . ': ' . $message . '<br />' . $file . ' line ' . $line;
122
+		echo $type.': '.$message.'<br />'.$file.' line '.$line;
123 123
 		echo '<br /></p></div>';
124 124
 	}
125 125
 
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 	 * @param $code
133 133
 	 * @return string
134 134
 	 */
135
-	public static function error_type( $code ) {
136
-		switch( $code ) {
135
+	public static function error_type($code) {
136
+		switch ($code) {
137 137
 			case E_ERROR: // 1 //
138 138
 			return 'E_ERROR';
139 139
 			case E_WARNING: // 2 //
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 	*/
180 180
 	public static function fatal_error_handler() {
181 181
 		$last_error = error_get_last();
182
-		if ( $last_error['type'] === E_ERROR ) {
183
-			EE_Error::error_handler( E_ERROR, $last_error['message'], $last_error['file'], $last_error['line'] );
182
+		if ($last_error['type'] === E_ERROR) {
183
+			EE_Error::error_handler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']);
184 184
 		}
185 185
 	}
186 186
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 * @param $line
196 196
 	 * @return string
197 197
 	 */
198
-	private static function _format_error( $code, $message, $file, $line ) {
198
+	private static function _format_error($code, $message, $file, $line) {
199 199
 		$html  = "<table cellpadding='5'><thead bgcolor='#f8f8f8'><th>Item</th><th align='left'>Details</th></thead><tbody>";
200 200
 		$html .= "<tr valign='top'><td><b>Code</b></td><td>$code</td></tr>";
201 201
 		$html .= "<tr valign='top'><td><b>Error</b></td><td>$message</td></tr>";
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	 * @param $content_type
214 214
 	 * @return string
215 215
 	 */
216
-	public static function set_content_type( $content_type ) {
216
+	public static function set_content_type($content_type) {
217 217
 		return 'text/html';
218 218
 	}
219 219
 
@@ -227,24 +227,24 @@  discard block
 block discarded – undo
227 227
 	*/
228 228
     public function get_error() {
229 229
 
230
-		if( apply_filters( 'FHEE__EE_Error__get_error__show_normal_exceptions', FALSE ) ){
230
+		if (apply_filters('FHEE__EE_Error__get_error__show_normal_exceptions', FALSE)) {
231 231
 			throw $this;
232 232
 		}
233 233
 		// get separate user and developer messages if they exist
234
-		$msg = explode( '||', $this->getMessage() );
234
+		$msg = explode('||', $this->getMessage());
235 235
 		$user_msg = $msg[0];
236
-		$dev_msg = isset( $msg[1] ) ? $msg[1] : $msg[0];
236
+		$dev_msg = isset($msg[1]) ? $msg[1] : $msg[0];
237 237
 		$msg = WP_DEBUG ? $dev_msg : $user_msg;
238 238
 
239 239
 		// add details to _all_exceptions array
240 240
 		$x_time = time();
241
-		self::$_all_exceptions[ $x_time ]['name'] 	= get_class( $this );
242
-		self::$_all_exceptions[ $x_time ]['file'] 		= $this->getFile();
243
-		self::$_all_exceptions[ $x_time ]['line'] 		= $this->getLine();
244
-		self::$_all_exceptions[ $x_time ]['msg'] 	= $msg;
245
-		self::$_all_exceptions[ $x_time ]['code'] 	= $this->getCode();
246
-		self::$_all_exceptions[ $x_time ]['trace'] 	= $this->getTrace();
247
-		self::$_all_exceptions[ $x_time ]['string'] 	= $this->getTraceAsString();
241
+		self::$_all_exceptions[$x_time]['name'] = get_class($this);
242
+		self::$_all_exceptions[$x_time]['file'] 		= $this->getFile();
243
+		self::$_all_exceptions[$x_time]['line'] 		= $this->getLine();
244
+		self::$_all_exceptions[$x_time]['msg'] = $msg;
245
+		self::$_all_exceptions[$x_time]['code'] = $this->getCode();
246
+		self::$_all_exceptions[$x_time]['trace'] 	= $this->getTrace();
247
+		self::$_all_exceptions[$x_time]['string'] = $this->getTraceAsString();
248 248
 		self::$_error_count++;
249 249
 
250 250
 		//add_action( 'shutdown', array( $this, 'display_errors' ));
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	*	@access public
260 260
 	*	@return boolean
261 261
 	*/
262
-    public static function has_error(){
262
+    public static function has_error() {
263 263
 		return self::$_error_count ? TRUE : FALSE;
264 264
 	}
265 265
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	*	@access public
271 271
 	*	@echo string
272 272
 	*/
273
-    public function display_errors(){
273
+    public function display_errors() {
274 274
 
275 275
 		$trace_details = '';
276 276
 
@@ -331,18 +331,18 @@  discard block
 block discarded – undo
331 331
 </style>
332 332
 <div id="ee-error-message" class="error">';
333 333
 
334
-		if ( ! WP_DEBUG ) {
334
+		if ( ! WP_DEBUG) {
335 335
 			$output .= '
336 336
 	<p>';
337 337
 		}
338 338
 
339 339
 		// cycle thru errors
340
-		foreach ( self::$_all_exceptions as $time => $ex ) {
340
+		foreach (self::$_all_exceptions as $time => $ex) {
341 341
 
342 342
 			// process trace info
343
-			if ( empty( $ex['trace'] )) {
343
+			if (empty($ex['trace'])) {
344 344
 
345
-	            $trace_details .= __( 'Sorry, but no trace information was available for this exception.', 'event_espresso' );
345
+	            $trace_details .= __('Sorry, but no trace information was available for this exception.', 'event_espresso');
346 346
 
347 347
 			} else {
348 348
 
@@ -357,50 +357,50 @@  discard block
 block discarded – undo
357 357
 					<th scope="col" align="left">Method( arguments )</th>
358 358
 				</tr>';
359 359
 
360
-				$last_on_stack = count( $ex['trace'] ) - 1;
360
+				$last_on_stack = count($ex['trace']) - 1;
361 361
 				// reverse array so that stack is in proper chronological order
362
-				$sorted_trace = array_reverse( $ex['trace'] );
362
+				$sorted_trace = array_reverse($ex['trace']);
363 363
 
364
-				foreach ( $sorted_trace as $nmbr => $trace ) {
364
+				foreach ($sorted_trace as $nmbr => $trace) {
365 365
 
366
-					$file = isset( $trace['file'] ) ? $trace['file'] : '' ;
367
-					$class = isset( $trace['class'] ) ? $trace['class'] : '';
368
-					$type = isset( $trace['type'] ) ? $trace['type'] : '';
369
-					$function = isset( $trace['function'] ) ? $trace['function'] : '';
370
-					$args = isset( $trace['args'] ) ? $this->_convert_args_to_string( $trace['args'] ) : '';
371
-					$line = isset( $trace['line'] ) ? $trace['line'] : '';
366
+					$file = isset($trace['file']) ? $trace['file'] : '';
367
+					$class = isset($trace['class']) ? $trace['class'] : '';
368
+					$type = isset($trace['type']) ? $trace['type'] : '';
369
+					$function = isset($trace['function']) ? $trace['function'] : '';
370
+					$args = isset($trace['args']) ? $this->_convert_args_to_string($trace['args']) : '';
371
+					$line = isset($trace['line']) ? $trace['line'] : '';
372 372
 					$zebra = $nmbr % 2 ? ' odd' : '';
373 373
 
374
-					if ( empty( $file ) && ! empty( $class )) {
375
-						$a = new ReflectionClass( $class );
374
+					if (empty($file) && ! empty($class)) {
375
+						$a = new ReflectionClass($class);
376 376
 						$file = $a->getFileName();
377
-						if ( empty( $line ) && ! empty( $function )) {
378
-							$b = new ReflectionMethod( $class, $function );
377
+						if (empty($line) && ! empty($function)) {
378
+							$b = new ReflectionMethod($class, $function);
379 379
 							$line = $b->getStartLine();
380 380
 						}
381 381
 					}
382 382
 
383
-					if ( $nmbr == $last_on_stack ) {
383
+					if ($nmbr == $last_on_stack) {
384 384
 						$file = $ex['file'] != '' ? $ex['file'] : $file;
385 385
 						$line = $ex['line'] != '' ? $ex['line'] : $line;
386
-						$error_code = self::generate_error_code ( $file, $trace['function'], $line );
386
+						$error_code = self::generate_error_code($file, $trace['function'], $line);
387 387
 					}
388 388
 
389
-					$nmbr_dsply = ! empty( $nmbr ) ? $nmbr : '&nbsp;';
390
-					$line_dsply = ! empty( $line ) ? $line : '&nbsp;';
391
-					$file_dsply = ! empty( $file ) ? $file : '&nbsp;';
392
-					$class_dsply = ! empty( $class ) ? $class : '&nbsp;';
393
-					$type_dsply = ! empty( $type ) ? $type : '&nbsp;';
394
-					$function_dsply = ! empty( $function ) ? $function : '&nbsp;';
395
-					$args_dsply = ! empty( $args ) ? '( ' . $args . ' )' : '';
389
+					$nmbr_dsply = ! empty($nmbr) ? $nmbr : '&nbsp;';
390
+					$line_dsply = ! empty($line) ? $line : '&nbsp;';
391
+					$file_dsply = ! empty($file) ? $file : '&nbsp;';
392
+					$class_dsply = ! empty($class) ? $class : '&nbsp;';
393
+					$type_dsply = ! empty($type) ? $type : '&nbsp;';
394
+					$function_dsply = ! empty($function) ? $function : '&nbsp;';
395
+					$args_dsply = ! empty($args) ? '( '.$args.' )' : '';
396 396
 
397 397
 		              $trace_details .= '
398 398
 					<tr>
399
-						<td align="right" class="' . $zebra . '">' . $nmbr_dsply . '</td>
400
-						<td align="right" class="' . $zebra . '">' . $line_dsply . '</td>
401
-						<td align="left" class="' . $zebra . '">' . $file_dsply . '</td>
402
-						<td align="left" class="' . $zebra . '">' . $class_dsply . '</td>
403
-						<td align="left" class="' . $zebra . '">' . $type_dsply . $function_dsply . $args_dsply . '</td>
399
+						<td align="right" class="' . $zebra.'">'.$nmbr_dsply.'</td>
400
+						<td align="right" class="' . $zebra.'">'.$line_dsply.'</td>
401
+						<td align="left" class="' . $zebra.'">'.$file_dsply.'</td>
402
+						<td align="left" class="' . $zebra.'">'.$class_dsply.'</td>
403
+						<td align="left" class="' . $zebra.'">'.$type_dsply.$function_dsply.$args_dsply.'</td>
404 404
 					</tr>';
405 405
 
406 406
 
@@ -415,9 +415,9 @@  discard block
 block discarded – undo
415 415
 			$ex['code'] = $ex['code'] ? $ex['code'] : $error_code;
416 416
 
417 417
 			// add generic non-identifying messages for non-privileged uesrs
418
-			if ( ! WP_DEBUG ) {
418
+			if ( ! WP_DEBUG) {
419 419
 
420
-				$output .= '<span class="ee-error-user-msg-spn">' . trim( $ex['msg'] )  . '</span> &nbsp; <sup>' . $ex['code'] . '</sup><br />';
420
+				$output .= '<span class="ee-error-user-msg-spn">'.trim($ex['msg']).'</span> &nbsp; <sup>'.$ex['code'].'</sup><br />';
421 421
 
422 422
 			} else {
423 423
 
@@ -425,24 +425,24 @@  discard block
 block discarded – undo
425 425
 				$output .= '
426 426
 		<div class="ee-error-dev-msg-dv">
427 427
 			<p class="ee-error-dev-msg-pg">
428
-				<strong class="ee-error-dev-msg-str">An ' . $ex['name'] . ' exception was thrown!</strong>  &nbsp; <span>code: ' . $ex['code'] . '</span><br />
429
-				<span class="big-text">"' . trim( $ex['msg'] ) . '"</span><br/>
430
-				<a id="display-ee-error-trace-' . self::$_error_count . $time . '" class="display-ee-error-trace-lnk small-text" rel="ee-error-trace-' . self::$_error_count . $time . '">
431
-					' . __( 'click to view backtrace and class/method details', 'event_espresso' ) . '
428
+				<strong class="ee-error-dev-msg-str">An ' . $ex['name'].' exception was thrown!</strong>  &nbsp; <span>code: '.$ex['code'].'</span><br />
429
+				<span class="big-text">"' . trim($ex['msg']).'"</span><br/>
430
+				<a id="display-ee-error-trace-' . self::$_error_count.$time.'" class="display-ee-error-trace-lnk small-text" rel="ee-error-trace-'.self::$_error_count.$time.'">
431
+					' . __('click to view backtrace and class/method details', 'event_espresso').'
432 432
 				</a><br />
433 433
 				<span class="small-text lt-grey-text">'.$ex['file'].' &nbsp; ( line no: '.$ex['line'].' )</span>
434 434
 			</p>
435
-			<div id="ee-error-trace-' . self::$_error_count . $time . '-dv" class="ee-error-trace-dv" style="display: none;">
435
+			<div id="ee-error-trace-' . self::$_error_count.$time.'-dv" class="ee-error-trace-dv" style="display: none;">
436 436
 				' . $trace_details;
437 437
 
438
-				if ( ! empty( $class )) {
438
+				if ( ! empty($class)) {
439 439
 					$output .= '
440 440
 				<div style="padding:3px; margin:0 0 1em; border:1px solid #666; background:#fff; border-radius:3px;">
441 441
 					<div style="padding:1em 2em; border:1px solid #666; background:#f9f9f9;">
442 442
 						<h3>Class Details</h3>';
443
-						$a = new ReflectionClass( $class );
443
+						$a = new ReflectionClass($class);
444 444
 						$output .= '
445
-						<pre>' . $a . '</pre>
445
+						<pre>' . $a.'</pre>
446 446
 					</div>
447 447
 				</div>';
448 448
 				}
@@ -454,14 +454,14 @@  discard block
 block discarded – undo
454 454
 
455 455
 			}
456 456
 
457
-			$this->write_to_error_log( $time, $ex );
457
+			$this->write_to_error_log($time, $ex);
458 458
 
459 459
 		}
460 460
 
461 461
 		// remove last linebreak
462
-		$output = substr( $output, 0, ( count( $output ) - 7 ));
462
+		$output = substr($output, 0, (count($output) - 7));
463 463
 
464
-		if ( ! WP_DEBUG ) {
464
+		if ( ! WP_DEBUG) {
465 465
 			$output .= '
466 466
 	</p>';
467 467
 		}
@@ -469,10 +469,10 @@  discard block
 block discarded – undo
469 469
 		$output .= '
470 470
 </div>';
471 471
 
472
-		$output .= self::_print_scripts( TRUE );
472
+		$output .= self::_print_scripts(TRUE);
473 473
 
474
-		if ( defined( 'DOING_AJAX' )) {
475
-			echo json_encode( array( 'error' => $output ));
474
+		if (defined('DOING_AJAX')) {
475
+			echo json_encode(array('error' => $output));
476 476
 			exit();
477 477
 		}
478 478
 
@@ -492,29 +492,29 @@  discard block
 block discarded – undo
492 492
 	*	@ param array $arguments
493 493
 	*	@ return string
494 494
 	*/
495
-	private function _convert_args_to_string ( $arguments = array(), $array = FALSE ) {
495
+	private function _convert_args_to_string($arguments = array(), $array = FALSE) {
496 496
 
497 497
 		$arg_string = '';
498
-		if ( ! empty( $arguments )) {
498
+		if ( ! empty($arguments)) {
499 499
 
500 500
 			$args = array();
501 501
 
502
-			foreach ( $arguments as $arg ) {
502
+			foreach ($arguments as $arg) {
503 503
 
504
-				if ( ! empty( $arg )) {
504
+				if ( ! empty($arg)) {
505 505
 
506
-					if ( is_string( $arg )) {
507
-						$args[] = " '" . $arg . "'";
508
-					} elseif ( is_array( $arg )) {
509
-						$args[] = 'ARRAY(' . $this->_convert_args_to_string( $arg, TRUE );
510
-					} elseif ( is_null( $arg )) {
506
+					if (is_string($arg)) {
507
+						$args[] = " '".$arg."'";
508
+					} elseif (is_array($arg)) {
509
+						$args[] = 'ARRAY('.$this->_convert_args_to_string($arg, TRUE);
510
+					} elseif (is_null($arg)) {
511 511
 						$args[] = ' NULL';
512
-					} elseif ( is_bool( $arg )) {
513
-						$args[] = ( $arg ) ? ' TRUE' : ' FALSE';
514
-					} elseif ( is_object( $arg )) {
515
-						$args[] = ' OBJECT ' . get_class( $arg );
516
-					} elseif ( is_resource( $arg )) {
517
-						$args[] = get_resource_type( $arg );
512
+					} elseif (is_bool($arg)) {
513
+						$args[] = ($arg) ? ' TRUE' : ' FALSE';
514
+					} elseif (is_object($arg)) {
515
+						$args[] = ' OBJECT '.get_class($arg);
516
+					} elseif (is_resource($arg)) {
517
+						$args[] = get_resource_type($arg);
518 518
 					} else {
519 519
 						$args[] = $arg;
520 520
 					}
@@ -522,9 +522,9 @@  discard block
 block discarded – undo
522 522
 				}
523 523
 
524 524
 			}
525
-			$arg_string = implode( ', ', $args );
525
+			$arg_string = implode(', ', $args);
526 526
 		}
527
-		if ( $array ) {
527
+		if ($array) {
528 528
 			$arg_string .= ' )';
529 529
 		}
530 530
 		return $arg_string;
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
 	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
545 545
 	* 	@return 		void
546 546
 	*/
547
-	public static function add_error( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
548
-		self::_add_notice ( 'errors', $msg, $file, $func, $line );
547
+	public static function add_error($msg = NULL, $file = NULL, $func = NULL, $line = NULL) {
548
+		self::_add_notice('errors', $msg, $file, $func, $line);
549 549
 		self::$_error_count++;
550 550
 	}
551 551
 	
@@ -558,11 +558,11 @@  discard block
 block discarded – undo
558 558
 	 * @param string $line
559 559
 	 * @throws EE_Error
560 560
 	 */
561
-	public static function throw_exception_if_debugging( $msg = null, $file = null, $func = null, $line = null ) {
562
-		if( WP_DEBUG ) {
563
-			throw new EE_Error( $msg );
564
-		} else  {
565
-			EE_Error::add_error( $msg, $file, $func, $line );
561
+	public static function throw_exception_if_debugging($msg = null, $file = null, $func = null, $line = null) {
562
+		if (WP_DEBUG) {
563
+			throw new EE_Error($msg);
564
+		} else {
565
+			EE_Error::add_error($msg, $file, $func, $line);
566 566
 		}
567 567
 	}
568 568
 
@@ -580,8 +580,8 @@  discard block
 block discarded – undo
580 580
 	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
581 581
 	* 	@return 		void
582 582
 	*/
583
-	public static function add_success( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
584
-		self::_add_notice ( 'success', $msg, $file, $func, $line );
583
+	public static function add_success($msg = NULL, $file = NULL, $func = NULL, $line = NULL) {
584
+		self::_add_notice('success', $msg, $file, $func, $line);
585 585
 	}
586 586
 
587 587
 
@@ -598,8 +598,8 @@  discard block
 block discarded – undo
598 598
 	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
599 599
 	* 	@return 		void
600 600
 	*/
601
-	public static function add_attention( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
602
-		self::_add_notice ( 'attention', $msg, $file, $func, $line );
601
+	public static function add_attention($msg = NULL, $file = NULL, $func = NULL, $line = NULL) {
602
+		self::_add_notice('attention', $msg, $file, $func, $line);
603 603
 	}
604 604
 
605 605
 
@@ -617,12 +617,12 @@  discard block
 block discarded – undo
617 617
 	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
618 618
 	* 	@return 		void
619 619
 	*/
620
-	private static function _add_notice( $type = 'success', $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
621
-		if ( empty( $msg )) {
620
+	private static function _add_notice($type = 'success', $msg = NULL, $file = NULL, $func = NULL, $line = NULL) {
621
+		if (empty($msg)) {
622 622
 			EE_Error::doing_it_wrong(
623
-				'EE_Error::add_' . $type . '()',
623
+				'EE_Error::add_'.$type.'()',
624 624
 				sprintf(
625
-					__( 'Notifications are not much use without a message! Please add a message to the EE_Error::add_%s() call made in %s on line %d', 'event_espresso' ),
625
+					__('Notifications are not much use without a message! Please add a message to the EE_Error::add_%s() call made in %s on line %d', 'event_espresso'),
626 626
 					$type,
627 627
 					$file,
628 628
 					$line
@@ -630,32 +630,32 @@  discard block
 block discarded – undo
630 630
 				EVENT_ESPRESSO_VERSION
631 631
 			);
632 632
 		}
633
-		if ( $type == 'errors' && ( empty( $file ) || empty( $func ) || empty( $line ))) {
633
+		if ($type == 'errors' && (empty($file) || empty($func) || empty($line))) {
634 634
 			EE_Error::doing_it_wrong(
635 635
 				'EE_Error::add_error()',
636
-				__('You need to provide the file name, function name, and line number that the error occurred on in order to better assist with debugging.', 'event_espresso' ),
636
+				__('You need to provide the file name, function name, and line number that the error occurred on in order to better assist with debugging.', 'event_espresso'),
637 637
 				EVENT_ESPRESSO_VERSION
638 638
 			);
639 639
 		}
640 640
 		// get separate user and developer messages if they exist
641
-		$msg = explode( '||', $msg );
641
+		$msg = explode('||', $msg);
642 642
 		$user_msg = $msg[0];
643
-		$dev_msg = isset( $msg[1] ) ? $msg[1] : $msg[0];
643
+		$dev_msg = isset($msg[1]) ? $msg[1] : $msg[0];
644 644
 		$msg = WP_DEBUG ? $dev_msg : $user_msg;
645 645
 		// add notice if message exists
646
-		if ( ! empty( $msg )) {
646
+		if ( ! empty($msg)) {
647 647
 			// get error code
648
-			$notice_code = EE_Error::generate_error_code( $file, $func, $line );
649
-			if ( WP_DEBUG && $type == 'errors' ) {
650
-				$msg .= '<br/><span class="tiny-text">' . $notice_code . '</span>';
648
+			$notice_code = EE_Error::generate_error_code($file, $func, $line);
649
+			if (WP_DEBUG && $type == 'errors') {
650
+				$msg .= '<br/><span class="tiny-text">'.$notice_code.'</span>';
651 651
 			}
652 652
 			// add notice. Index by code if it's not blank
653
-			if( $notice_code ) {
654
-				self::$_espresso_notices[ $type ][ $notice_code ] = $msg;
653
+			if ($notice_code) {
654
+				self::$_espresso_notices[$type][$notice_code] = $msg;
655 655
 			} else {
656
-				self::$_espresso_notices[ $type ][] = $msg;
656
+				self::$_espresso_notices[$type][] = $msg;
657 657
 			}
658
-			add_action( 'wp_footer', array( 'EE_Error', 'enqueue_error_scripts' ), 1 );
658
+			add_action('wp_footer', array('EE_Error', 'enqueue_error_scripts'), 1);
659 659
 		}
660 660
 
661 661
 	}
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 	*	@access private
710 710
 	*	@return void
711 711
 	*/
712
-	public static function reset_notices(){
712
+	public static function reset_notices() {
713 713
     	self::$_espresso_notices['success'] = FALSE;
714 714
     	self::$_espresso_notices['attention'] = FALSE;
715 715
     	self::$_espresso_notices['errors'] = FALSE;
@@ -722,14 +722,14 @@  discard block
 block discarded – undo
722 722
 	*	@access public
723 723
 	*	@return int
724 724
 	*/
725
-    public static function has_notices(){
725
+    public static function has_notices() {
726 726
 		$has_notices = 0;
727 727
 		// check for success messages
728
-		$has_notices = self::$_espresso_notices['success'] && ! empty(  self::$_espresso_notices['success'] ) ? 3 : $has_notices;
728
+		$has_notices = self::$_espresso_notices['success'] && ! empty(self::$_espresso_notices['success']) ? 3 : $has_notices;
729 729
 		// check for attention messages
730
-		$has_notices = self::$_espresso_notices['attention'] && ! empty(  self::$_espresso_notices['attention'] ) ? 2 : $has_notices;
730
+		$has_notices = self::$_espresso_notices['attention'] && ! empty(self::$_espresso_notices['attention']) ? 2 : $has_notices;
731 731
 		// check for error messages
732
-		$has_notices = self::$_espresso_notices['errors'] && ! empty(  self::$_espresso_notices['errors'] ) ? 1 : $has_notices;
732
+		$has_notices = self::$_espresso_notices['errors'] && ! empty(self::$_espresso_notices['errors']) ? 1 : $has_notices;
733 733
 		return $has_notices;
734 734
 	}
735 735
 
@@ -744,9 +744,9 @@  discard block
 block discarded – undo
744 744
 	 */
745 745
 	public static function get_vanilla_notices() {
746 746
 		return array(
747
-			'success' => isset( self::$_espresso_notices['success'] ) ? self::$_espresso_notices['success'] : array(),
748
-			'attention' => isset( self::$_espresso_notices['attention'] )  ? self::$_espresso_notices['attention'] : array(),
749
-			'errors' => isset( self::$_espresso_notices['errors'] ) ? self::$_espresso_notices['errors'] : array(),
747
+			'success' => isset(self::$_espresso_notices['success']) ? self::$_espresso_notices['success'] : array(),
748
+			'attention' => isset(self::$_espresso_notices['attention']) ? self::$_espresso_notices['attention'] : array(),
749
+			'errors' => isset(self::$_espresso_notices['errors']) ? self::$_espresso_notices['errors'] : array(),
750 750
 		);
751 751
 	}
752 752
 
@@ -762,8 +762,8 @@  discard block
 block discarded – undo
762 762
 	* 	@param		boolean		$remove_empty		whether or not to unset empty messages
763 763
 	* 	@return 		array
764 764
 	*/
765
-	public static function get_notices( $format_output = TRUE, $save_to_transient = FALSE, $remove_empty = TRUE ) {
766
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
765
+	public static function get_notices($format_output = TRUE, $save_to_transient = FALSE, $remove_empty = TRUE) {
766
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
767 767
 
768 768
 		$success_messages = '';
769 769
 		$attention_messages = '';
@@ -773,44 +773,44 @@  discard block
 block discarded – undo
773 773
 		// EEH_Debug_Tools::printr( self::$_espresso_notices, 'espresso_notices  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
774 774
 
775 775
 		// either save notices to the db
776
-		if ( $save_to_transient ) {
777
-			update_option( 'ee_notices', self::$_espresso_notices );
776
+		if ($save_to_transient) {
777
+			update_option('ee_notices', self::$_espresso_notices);
778 778
 			return;
779 779
 		}
780 780
 		// grab any notices that have been previously saved
781
-		if ( $notices = get_option( 'ee_notices', FALSE )) {
782
-			foreach ( $notices as $type => $notice ) {
783
-				if ( is_array( $notice ) && ! empty( $notice )) {
781
+		if ($notices = get_option('ee_notices', FALSE)) {
782
+			foreach ($notices as $type => $notice) {
783
+				if (is_array($notice) && ! empty($notice)) {
784 784
 					// make sure that existsing notice type is an array
785
-					self::$_espresso_notices[ $type ] =  is_array( self::$_espresso_notices[ $type ] ) && ! empty( self::$_espresso_notices[ $type ] ) ? self::$_espresso_notices[ $type ] : array();
785
+					self::$_espresso_notices[$type] = is_array(self::$_espresso_notices[$type]) && ! empty(self::$_espresso_notices[$type]) ? self::$_espresso_notices[$type] : array();
786 786
 					// merge stored notices with any newly created ones
787
-					self::$_espresso_notices[ $type ] = array_merge( self::$_espresso_notices[ $type ], $notice );
787
+					self::$_espresso_notices[$type] = array_merge(self::$_espresso_notices[$type], $notice);
788 788
 					$print_scripts = TRUE;
789 789
 				}
790 790
 			}
791 791
 			// now clear any stored notices
792
-			update_option( 'ee_notices', FALSE );
792
+			update_option('ee_notices', FALSE);
793 793
 		}
794 794
 
795 795
 		// check for success messages
796
-		if ( self::$_espresso_notices['success'] && ! empty(  self::$_espresso_notices['success'] )) {
796
+		if (self::$_espresso_notices['success'] && ! empty(self::$_espresso_notices['success'])) {
797 797
 			// combine messages
798
-			$success_messages .= implode( self::$_espresso_notices['success'], '<br />' );
798
+			$success_messages .= implode(self::$_espresso_notices['success'], '<br />');
799 799
 			$print_scripts = TRUE;
800 800
 		}
801 801
 
802 802
 		// check for attention messages
803
-		if ( self::$_espresso_notices['attention'] && ! empty(  self::$_espresso_notices['attention'] ) ) {
803
+		if (self::$_espresso_notices['attention'] && ! empty(self::$_espresso_notices['attention'])) {
804 804
 			// combine messages
805
-			$attention_messages .= implode( self::$_espresso_notices['attention'], '<br />' );
805
+			$attention_messages .= implode(self::$_espresso_notices['attention'], '<br />');
806 806
 			$print_scripts = TRUE;
807 807
 		}
808 808
 
809 809
 		// check for error messages
810
-		if ( self::$_espresso_notices['errors'] && ! empty(  self::$_espresso_notices['errors'] ) ) {
811
-			$error_messages .= count( self::$_espresso_notices['errors'] ) > 1 ? __( 'The following errors have occurred:<br />', 'event_espresso' ) : __( 'An error has occurred:<br />', 'event_espresso' );
810
+		if (self::$_espresso_notices['errors'] && ! empty(self::$_espresso_notices['errors'])) {
811
+			$error_messages .= count(self::$_espresso_notices['errors']) > 1 ? __('The following errors have occurred:<br />', 'event_espresso') : __('An error has occurred:<br />', 'event_espresso');
812 812
 			// combine messages
813
-			$error_messages .= implode( self::$_espresso_notices['errors'], '<br />' );
813
+			$error_messages .= implode(self::$_espresso_notices['errors'], '<br />');
814 814
 			$print_scripts = TRUE;
815 815
 		}
816 816
 
@@ -824,21 +824,21 @@  discard block
 block discarded – undo
824 824
 				$css_id = is_admin() ? 'message' : 'espresso-notices-success';
825 825
 				$css_class = is_admin() ? 'updated fade' : 'success fade-away';
826 826
 				//showMessage( $success_messages );
827
-				$notices .= '<div id="' . $css_id . '" class="espresso-notices ' . $css_class . '" style="display:none;"><p>' . $success_messages . '</p>' . $close . '</div>';
827
+				$notices .= '<div id="'.$css_id.'" class="espresso-notices '.$css_class.'" style="display:none;"><p>'.$success_messages.'</p>'.$close.'</div>';
828 828
 			}
829 829
 
830 830
 			if ($attention_messages != '') {
831 831
 				$css_id = is_admin() ? 'message' : 'espresso-notices-attention';
832 832
 				$css_class = is_admin() ? 'updated ee-notices-attention' : 'attention fade-away';
833 833
 				//showMessage( $error_messages, TRUE );
834
-				$notices .= '<div id="' . $css_id . '" class="espresso-notices ' . $css_class . '" style="display:none;"><p>' . $attention_messages . '</p>' . $close . '</div>';
834
+				$notices .= '<div id="'.$css_id.'" class="espresso-notices '.$css_class.'" style="display:none;"><p>'.$attention_messages.'</p>'.$close.'</div>';
835 835
 			}
836 836
 
837 837
 			if ($error_messages != '') {
838 838
 				$css_id = is_admin() ? 'message' : 'espresso-notices-error';
839 839
 				$css_class = is_admin() ? 'error' : 'error fade-away';
840 840
 				//showMessage( $error_messages, TRUE );
841
-				$notices .= '<div id="' . $css_id . '" class="espresso-notices ' . $css_class . '" style="display:none;"><p>' . $error_messages . '</p>' . $close . '</div>';
841
+				$notices .= '<div id="'.$css_id.'" class="espresso-notices '.$css_class.'" style="display:none;"><p>'.$error_messages.'</p>'.$close.'</div>';
842 842
 			}
843 843
 
844 844
 			$notices .= '</div>';
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 					'errors' => $error_messages
852 852
 			);
853 853
 
854
-			if ( $remove_empty ) {
854
+			if ($remove_empty) {
855 855
 				// remove empty notices
856 856
 				foreach ($notices as $type => $notice) {
857 857
 					if (empty($notice)) {
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 			}
862 862
 		}
863 863
 
864
-		if ( $print_scripts ) {
864
+		if ($print_scripts) {
865 865
 			self::_print_scripts();
866 866
 		}
867 867
 
@@ -881,17 +881,17 @@  discard block
 block discarded – undo
881 881
 	* 	@param bool $force_update allows one to enforce the reappearance of a persistent message.
882 882
 	* 	@return 		void
883 883
 	*/
884
-	public static function add_persistent_admin_notice( $pan_name = '', $pan_message, $force_update = FALSE ) {
885
-		if ( ! empty( $pan_name ) && ! empty( $pan_message )) {
886
-			$persistent_admin_notices = get_option( 'ee_pers_admin_notices', array() );
884
+	public static function add_persistent_admin_notice($pan_name = '', $pan_message, $force_update = FALSE) {
885
+		if ( ! empty($pan_name) && ! empty($pan_message)) {
886
+			$persistent_admin_notices = get_option('ee_pers_admin_notices', array());
887 887
 			//maybe initialize persistent_admin_notices
888
-			if ( empty( $persistent_admin_notices )) {
889
-				add_option( 'ee_pers_admin_notices', array(), '', 'no' );
888
+			if (empty($persistent_admin_notices)) {
889
+				add_option('ee_pers_admin_notices', array(), '', 'no');
890 890
 			}
891
-			$pan_name = sanitize_key( $pan_name );
892
-			if ( ! array_key_exists( $pan_name, $persistent_admin_notices ) || $force_update ) {
893
-				$persistent_admin_notices[ $pan_name ] = $pan_message;
894
-				update_option( 'ee_pers_admin_notices', $persistent_admin_notices );
891
+			$pan_name = sanitize_key($pan_name);
892
+			if ( ! array_key_exists($pan_name, $persistent_admin_notices) || $force_update) {
893
+				$persistent_admin_notices[$pan_name] = $pan_message;
894
+				update_option('ee_pers_admin_notices', $persistent_admin_notices);
895 895
 			}
896 896
 		}
897 897
 	}
@@ -907,34 +907,34 @@  discard block
 block discarded – undo
907 907
 	 * @param bool          $return_immediately
908 908
 	 * @return        void
909 909
 	 */
910
-	public static function dismiss_persistent_admin_notice( $pan_name = '', $purge = FALSE, $return_immediately = FALSE ) {
911
-		$pan_name = EE_Registry::instance()->REQ->is_set( 'ee_nag_notice' ) ? EE_Registry::instance()->REQ->get( 'ee_nag_notice' ) : $pan_name;
912
-		if ( ! empty( $pan_name )) {
913
-			$persistent_admin_notices = get_option( 'ee_pers_admin_notices', array() );
910
+	public static function dismiss_persistent_admin_notice($pan_name = '', $purge = FALSE, $return_immediately = FALSE) {
911
+		$pan_name = EE_Registry::instance()->REQ->is_set('ee_nag_notice') ? EE_Registry::instance()->REQ->get('ee_nag_notice') : $pan_name;
912
+		if ( ! empty($pan_name)) {
913
+			$persistent_admin_notices = get_option('ee_pers_admin_notices', array());
914 914
 			// check if notice we wish to dismiss is actually in the $persistent_admin_notices array
915
-			if ( is_array( $persistent_admin_notices ) && isset( $persistent_admin_notices[ $pan_name ] )) {
915
+			if (is_array($persistent_admin_notices) && isset($persistent_admin_notices[$pan_name])) {
916 916
 				// completely delete nag notice, or just NULL message so that it can NOT be added again ?
917
-				if ( $purge ) {
918
-					unset( $persistent_admin_notices[ $pan_name ] );
917
+				if ($purge) {
918
+					unset($persistent_admin_notices[$pan_name]);
919 919
 				} else {
920
-					$persistent_admin_notices[ $pan_name ] = NULL;
920
+					$persistent_admin_notices[$pan_name] = NULL;
921 921
 				}
922
-				if ( update_option( 'ee_pers_admin_notices', $persistent_admin_notices ) === FALSE ) {
923
-					EE_Error::add_error( sprintf( __( 'The persistent admin notice for "%s" could not be deleted.', 'event_espresso' ), $pan_name ), __FILE__, __FUNCTION__, __LINE__ );
922
+				if (update_option('ee_pers_admin_notices', $persistent_admin_notices) === FALSE) {
923
+					EE_Error::add_error(sprintf(__('The persistent admin notice for "%s" could not be deleted.', 'event_espresso'), $pan_name), __FILE__, __FUNCTION__, __LINE__);
924 924
 				}
925 925
 			}
926 926
 		}
927
-		if ( $return_immediately ) {
927
+		if ($return_immediately) {
928 928
 			return;
929
-		} else if ( EE_Registry::instance()->REQ->ajax ) {
929
+		} else if (EE_Registry::instance()->REQ->ajax) {
930 930
 			// grab any notices and concatenate into string
931
-			echo json_encode( array( 'errors' => implode( '<br />', EE_Error::get_notices( FALSE ))));
931
+			echo json_encode(array('errors' => implode('<br />', EE_Error::get_notices(FALSE))));
932 932
 			exit();
933 933
 		} else {
934 934
 			// save errors to a transient to be displayed on next request (after redirect)
935
-			EE_Error::get_notices( FALSE, TRUE );
936
-			$return_url = EE_Registry::instance()->REQ->is_set( 'return_url' ) ? EE_Registry::instance()->REQ->get( 'return_url' ) : '';
937
-			wp_safe_redirect( urldecode( $return_url ));
935
+			EE_Error::get_notices(FALSE, TRUE);
936
+			$return_url = EE_Registry::instance()->REQ->is_set('return_url') ? EE_Registry::instance()->REQ->get('return_url') : '';
937
+			wp_safe_redirect(urldecode($return_url));
938 938
 		}
939 939
 	}
940 940
 
@@ -949,20 +949,20 @@  discard block
 block discarded – undo
949 949
 	* 	@param		string	$return_url	URL to go back to aftger nag notice is dismissed
950 950
 	 *  	@return 		string
951 951
 	 */
952
-	public static function display_persistent_admin_notices( $pan_name = '', $pan_message = '', $return_url = '' ) {
953
-		if ( ! empty( $pan_name ) && ! empty( $pan_message )) {
952
+	public static function display_persistent_admin_notices($pan_name = '', $pan_message = '', $return_url = '') {
953
+		if ( ! empty($pan_name) && ! empty($pan_message)) {
954 954
 			$args = array(
955 955
 				'nag_notice' => $pan_name,
956
-				'return_url' => urlencode( $return_url ),
956
+				'return_url' => urlencode($return_url),
957 957
 				'ajax_url' => WP_AJAX_URL,
958
-				'unknown_error' => __( 'An unknown error has occurred on the server while attempting to dismiss this notice.', 'event_espresso' )
958
+				'unknown_error' => __('An unknown error has occurred on the server while attempting to dismiss this notice.', 'event_espresso')
959 959
 			);
960
-			wp_localize_script( 'espresso_core', 'ee_dismiss', $args );
960
+			wp_localize_script('espresso_core', 'ee_dismiss', $args);
961 961
 			return '
962
-			<div id="' . $pan_name . '" class="espresso-notices updated ee-nag-notice clearfix" style="border-left: 4px solid #fcb93c;">
963
-				<p>' . $pan_message . '</p>
964
-				<a class="dismiss-ee-nag-notice hide-if-no-js" style="float: right; cursor: pointer; text-decoration:none;" rel="' . $pan_name . '">
965
-					<span class="dashicons dashicons-dismiss" style="position:relative; top:-1px; margin-right:.25em;"></span>'.__( 'Dismiss', 'event_espresso' ) .'
962
+			<div id="' . $pan_name.'" class="espresso-notices updated ee-nag-notice clearfix" style="border-left: 4px solid #fcb93c;">
963
+				<p>' . $pan_message.'</p>
964
+				<a class="dismiss-ee-nag-notice hide-if-no-js" style="float: right; cursor: pointer; text-decoration:none;" rel="' . $pan_name.'">
965
+					<span class="dashicons dashicons-dismiss" style="position:relative; top:-1px; margin-right:.25em;"></span>'.__('Dismiss', 'event_espresso').'
966 966
 				</a>
967 967
 				<div style="clear:both;"></div>
968 968
 			</div>';
@@ -978,24 +978,24 @@  discard block
 block discarded – undo
978 978
 	 * @param string $return_url
979 979
 	 * @return    array
980 980
 	 */
981
-	public static function get_persistent_admin_notices( $return_url = '' ) {
981
+	public static function get_persistent_admin_notices($return_url = '') {
982 982
 		$notices = '';
983 983
 		// check for persistent admin notices
984 984
 		//filter the list though so plugins can notify the admin in a different way if they want
985 985
 		$persistent_admin_notices = apply_filters( 
986 986
 			'FHEE__EE_Error__get_persistent_admin_notices',
987
-			get_option( 'ee_pers_admin_notices', FALSE ),
987
+			get_option('ee_pers_admin_notices', FALSE),
988 988
 			'ee_pers_admin_notices',
989 989
 			$return_url
990 990
 		);
991
-		if ( $persistent_admin_notices ) {
991
+		if ($persistent_admin_notices) {
992 992
 			// load scripts
993
-			wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
994
-			wp_register_script( 'ee_error_js', EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js', array('espresso_core'), EVENT_ESPRESSO_VERSION, TRUE );
995
-			wp_enqueue_script( 'ee_error_js' );
993
+			wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
994
+			wp_register_script('ee_error_js', EE_GLOBAL_ASSETS_URL.'scripts/EE_Error.js', array('espresso_core'), EVENT_ESPRESSO_VERSION, TRUE);
995
+			wp_enqueue_script('ee_error_js');
996 996
 			// and display notices
997
-			foreach( $persistent_admin_notices as $pan_name => $pan_message ) {
998
-				$notices .= self::display_persistent_admin_notices( $pan_name, $pan_message, $return_url );
997
+			foreach ($persistent_admin_notices as $pan_name => $pan_message) {
998
+				$notices .= self::display_persistent_admin_notices($pan_name, $pan_message, $return_url);
999 999
 			}
1000 1000
 		}
1001 1001
 		return $notices;
@@ -1010,26 +1010,26 @@  discard block
 block discarded – undo
1010 1010
 	 * @param 	bool $force_print
1011 1011
 	 * @return 	void
1012 1012
 	 */
1013
-	private static function _print_scripts( $force_print = FALSE ) {
1014
-		if (( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' )) && ! $force_print ) {
1015
-			if ( wp_script_is( 'ee_error_js', 'enqueued' )) {
1013
+	private static function _print_scripts($force_print = FALSE) {
1014
+		if ((did_action('admin_enqueue_scripts') || did_action('wp_enqueue_scripts')) && ! $force_print) {
1015
+			if (wp_script_is('ee_error_js', 'enqueued')) {
1016 1016
 				return;
1017
-			} else if ( wp_script_is( 'ee_error_js', 'registered' )) {
1018
-				add_filter( 'FHEE_load_css', '__return_true' );
1019
-				add_filter( 'FHEE_load_js', '__return_true' );
1020
-				wp_enqueue_script( 'ee_error_js' );
1021
-				wp_localize_script( 'ee_error_js','ee_settings', array( 'wp_debug'=>WP_DEBUG ));
1017
+			} else if (wp_script_is('ee_error_js', 'registered')) {
1018
+				add_filter('FHEE_load_css', '__return_true');
1019
+				add_filter('FHEE_load_js', '__return_true');
1020
+				wp_enqueue_script('ee_error_js');
1021
+				wp_localize_script('ee_error_js', 'ee_settings', array('wp_debug'=>WP_DEBUG));
1022 1022
 			}
1023 1023
 		} else {
1024 1024
 			return '
1025 1025
 <script>
1026 1026
 /* <![CDATA[ */
1027
-var ee_settings = {"wp_debug":"' . WP_DEBUG . '"};
1027
+var ee_settings = {"wp_debug":"' . WP_DEBUG.'"};
1028 1028
 /* ]]> */
1029 1029
 </script>
1030
-<script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script>
1031
-<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
1032
-<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
1030
+<script src="' . includes_url().'js/jquery/jquery.js" type="text/javascript"></script>
1031
+<script src="' . EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js'.'?ver='.espresso_version().'" type="text/javascript"></script>
1032
+<script src="' . EE_GLOBAL_ASSETS_URL.'scripts/EE_Error.js'.'?ver='.espresso_version().'" type="text/javascript"></script>
1033 1033
 ';
1034 1034
 
1035 1035
 		}
@@ -1063,11 +1063,11 @@  discard block
 block discarded – undo
1063 1063
 	*	@ param string $line
1064 1064
 	*	@ return string
1065 1065
 	*/
1066
-	public static function generate_error_code ( $file = '', $func = '', $line = '' ) {
1067
-		$file = explode( '.', basename( $file ));
1068
-		$error_code = ! empty( $file[0] ) ? $file[0] : '';
1069
-		$error_code .= ! empty( $func ) ? ' - ' . $func : '';
1070
-		$error_code .= ! empty( $line ) ? ' - ' . $line : '';
1066
+	public static function generate_error_code($file = '', $func = '', $line = '') {
1067
+		$file = explode('.', basename($file));
1068
+		$error_code = ! empty($file[0]) ? $file[0] : '';
1069
+		$error_code .= ! empty($func) ? ' - '.$func : '';
1070
+		$error_code .= ! empty($line) ? ' - '.$line : '';
1071 1071
 		return $error_code;
1072 1072
 	}
1073 1073
 
@@ -1083,36 +1083,36 @@  discard block
 block discarded – undo
1083 1083
 	*	@ param object $ex
1084 1084
 	*	@ return void
1085 1085
 	*/
1086
-	public function write_to_error_log ( $time = FALSE, $ex = FALSE, $clear = FALSE ) {
1086
+	public function write_to_error_log($time = FALSE, $ex = FALSE, $clear = FALSE) {
1087 1087
 
1088
-		if ( ! $ex ) {
1088
+		if ( ! $ex) {
1089 1089
 			return;
1090 1090
 		}
1091 1091
 
1092
-		if ( ! $time ) {
1092
+		if ( ! $time) {
1093 1093
 			$time = time();
1094 1094
 		}
1095 1095
 
1096
-		$exception_log = '----------------------------------------------------------------------------------------' . PHP_EOL;
1097
-		$exception_log .= '[' . date( 'Y-m-d H:i:s', $time ) . ']  Exception Details' . PHP_EOL;
1098
-		$exception_log .= 'Message: ' . $ex['msg'] . PHP_EOL;
1099
-		$exception_log .= 'Code: '. $ex['code'] . PHP_EOL;
1100
-		$exception_log .= 'File: '. $ex['file'] . PHP_EOL;
1101
-		$exception_log .= 'Line No: ' . $ex['line'] . PHP_EOL;
1102
-		$exception_log .= 'Stack trace: ' . PHP_EOL;
1103
-		$exception_log .= $ex['string'] . PHP_EOL;
1104
-		$exception_log .= '----------------------------------------------------------------------------------------' . PHP_EOL;
1096
+		$exception_log = '----------------------------------------------------------------------------------------'.PHP_EOL;
1097
+		$exception_log .= '['.date('Y-m-d H:i:s', $time).']  Exception Details'.PHP_EOL;
1098
+		$exception_log .= 'Message: '.$ex['msg'].PHP_EOL;
1099
+		$exception_log .= 'Code: '.$ex['code'].PHP_EOL;
1100
+		$exception_log .= 'File: '.$ex['file'].PHP_EOL;
1101
+		$exception_log .= 'Line No: '.$ex['line'].PHP_EOL;
1102
+		$exception_log .= 'Stack trace: '.PHP_EOL;
1103
+		$exception_log .= $ex['string'].PHP_EOL;
1104
+		$exception_log .= '----------------------------------------------------------------------------------------'.PHP_EOL;
1105 1105
 
1106 1106
 		try {
1107
-			EEH_File::ensure_file_exists_and_is_writable( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . self::$_exception_log_file );
1108
-			EEH_File::add_htaccess_deny_from_all( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' ); 
1109
-			if ( ! $clear ) {
1107
+			EEH_File::ensure_file_exists_and_is_writable(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.self::$_exception_log_file);
1108
+			EEH_File::add_htaccess_deny_from_all(EVENT_ESPRESSO_UPLOAD_DIR.'logs'); 
1109
+			if ( ! $clear) {
1110 1110
 				//get existing log file and append new log info
1111
-				$exception_log = EEH_File::get_file_contents( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . self::$_exception_log_file ) . $exception_log;
1111
+				$exception_log = EEH_File::get_file_contents(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.self::$_exception_log_file).$exception_log;
1112 1112
 			}
1113
-			EEH_File::write_to_file( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . self::$_exception_log_file, $exception_log );
1114
-		} catch( EE_Error $e ){
1115
-			EE_Error::add_error( sprintf( __(  'Event Espresso error logging could not be setup because: %s', 'event_espresso' ), $e->getMessage() ));
1113
+			EEH_File::write_to_file(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.self::$_exception_log_file, $exception_log);
1114
+		} catch (EE_Error $e) {
1115
+			EE_Error::add_error(sprintf(__('Event Espresso error logging could not be setup because: %s', 'event_espresso'), $e->getMessage()));
1116 1116
 			return;
1117 1117
 		}
1118 1118
 
@@ -1136,9 +1136,9 @@  discard block
 block discarded – undo
1136 1136
 	 * @param int     $error_type
1137 1137
 	 * @return void
1138 1138
 	 */
1139
-	public static function doing_it_wrong( $function, $message, $version, $error_type = E_USER_NOTICE ) {
1140
-		if ( defined('WP_DEBUG') && WP_DEBUG ) {
1141
-			EEH_Debug_Tools::instance()->doing_it_wrong( $function, $message, $version, $error_type );
1139
+	public static function doing_it_wrong($function, $message, $version, $error_type = E_USER_NOTICE) {
1140
+		if (defined('WP_DEBUG') && WP_DEBUG) {
1141
+			EEH_Debug_Tools::instance()->doing_it_wrong($function, $message, $version, $error_type);
1142 1142
 		}
1143 1143
 	}
1144 1144
 	
@@ -1170,13 +1170,13 @@  discard block
 block discarded – undo
1170 1170
  */
1171 1171
 function espresso_error_enqueue_scripts() {
1172 1172
 	// js for error handling
1173
-	wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, FALSE );
1174
-	wp_register_script( 'ee_error_js', EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js', array('espresso_core'), EVENT_ESPRESSO_VERSION, FALSE );
1173
+	wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, FALSE);
1174
+	wp_register_script('ee_error_js', EE_GLOBAL_ASSETS_URL.'scripts/EE_Error.js', array('espresso_core'), EVENT_ESPRESSO_VERSION, FALSE);
1175 1175
 }
1176
-if ( is_admin() ) {
1177
-	add_action( 'admin_enqueue_scripts', 'espresso_error_enqueue_scripts', 2 );
1176
+if (is_admin()) {
1177
+	add_action('admin_enqueue_scripts', 'espresso_error_enqueue_scripts', 2);
1178 1178
 } else {
1179
-	add_action( 'wp_enqueue_scripts', 'espresso_error_enqueue_scripts', 2 );
1179
+	add_action('wp_enqueue_scripts', 'espresso_error_enqueue_scripts', 2);
1180 1180
 }
1181 1181
 
1182 1182
 
Please login to merge, or discard this patch.
core/EE_Log.core.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
 do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
3 5
 /**
4 6
  * Event Espresso
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3 3
  *
4 4
  * Class EE_Log
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 * @return EE_Log
63 63
 	 */
64 64
 	public static function instance() {
65
-		if ( ! self::$_instance instanceof EE_Log ) {
65
+		if ( ! self::$_instance instanceof EE_Log) {
66 66
 			self::$_instance = new self();
67 67
 		}
68 68
 		return self::$_instance;
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	private function __construct() {
76 76
 
77
-		if ( ! EE_Registry::instance()->CFG->admin->use_full_logging && ! EE_Registry::instance()->CFG->admin->use_remote_logging ) {
77
+		if ( ! EE_Registry::instance()->CFG->admin->use_full_logging && ! EE_Registry::instance()->CFG->admin->use_remote_logging) {
78 78
 			return;
79 79
 		}
80 80
 
81
-		$this->_logs_folder = EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS;
81
+		$this->_logs_folder = EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS;
82 82
 		$this->_log_file = EE_Registry::instance()->CFG->admin->log_file_name();
83 83
 		$this->_log = '';
84 84
 		$this->_debug_file = EE_Registry::instance()->CFG->admin->debug_file_name();
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
 		$this->_remote_logging_url = EE_Registry::instance()->CFG->admin->remote_logging_url;
87 87
 		$this->_remote_log = '';
88 88
 
89
-		add_action( 'admin_init', array( $this, 'verify_filesystem' ), -10 );
90
-		add_action( 'AHEE_log', array( $this, 'log' ), 10, 4 );
91
-		if ( EE_Registry::instance()->CFG->admin->use_full_logging ) {
92
-			add_action( 'shutdown', array( $this, 'write_log' ), 9999 );
89
+		add_action('admin_init', array($this, 'verify_filesystem'), -10);
90
+		add_action('AHEE_log', array($this, 'log'), 10, 4);
91
+		if (EE_Registry::instance()->CFG->admin->use_full_logging) {
92
+			add_action('shutdown', array($this, 'write_log'), 9999);
93 93
 			// if WP_DEBUG
94
-			add_action( 'shutdown', array( $this, 'write_debug' ), 9999 );
94
+			add_action('shutdown', array($this, 'write_debug'), 9999);
95 95
 		}
96
-		if ( EE_Registry::instance()->CFG->admin->use_remote_logging ) {
97
-			add_action( 'shutdown', array( $this, 'send_log' ), 9999 );
96
+		if (EE_Registry::instance()->CFG->admin->use_remote_logging) {
97
+			add_action('shutdown', array($this, 'send_log'), 9999);
98 98
 		}
99 99
 
100 100
 	}
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	public function verify_filesystem() {
110 110
 		try {
111
-			EEH_File::ensure_file_exists_and_is_writable( $this->_logs_folder . $this->_log_file );
112
-			EEH_File::ensure_file_exists_and_is_writable( $this->_logs_folder . $this->_debug_file );
113
-			EEH_File::add_htaccess_deny_from_all( $this->_logs_folder );
114
-		} catch( EE_Error $e ){
115
-			EE_Error::add_error( sprintf( __(  'Event Espresso logging could not be setup because: %s', 'event_espresso' ), ' &nbsp; &nbsp; ' . $e->getMessage() ), __FILE__, __FUNCTION__, __LINE__ );
111
+			EEH_File::ensure_file_exists_and_is_writable($this->_logs_folder.$this->_log_file);
112
+			EEH_File::ensure_file_exists_and_is_writable($this->_logs_folder.$this->_debug_file);
113
+			EEH_File::add_htaccess_deny_from_all($this->_logs_folder);
114
+		} catch (EE_Error $e) {
115
+			EE_Error::add_error(sprintf(__('Event Espresso logging could not be setup because: %s', 'event_espresso'), ' &nbsp; &nbsp; '.$e->getMessage()), __FILE__, __FUNCTION__, __LINE__);
116 116
 			return;
117 117
 		}
118 118
 	}
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
 	 * @param string $type
130 130
 	 * @return string
131 131
 	 */
132
-	private function _format_message( $file = '', $function = '', $message = '', $type = '' ) {
133
-		$msg = '----------------------------------------------------------------------------------------' . PHP_EOL;
134
-		$msg .= '[' . current_time( 'mysql' ) . '] ';
135
-		$msg .= ! empty( $file ) ? basename( $file ) : '';
136
-		$msg .= ! empty( $file ) && ! empty( $function ) ? ' -> ' : '';
137
-		$msg .= ! empty( $function ) ? $function . '()' : '';
132
+	private function _format_message($file = '', $function = '', $message = '', $type = '') {
133
+		$msg = '----------------------------------------------------------------------------------------'.PHP_EOL;
134
+		$msg .= '['.current_time('mysql').'] ';
135
+		$msg .= ! empty($file) ? basename($file) : '';
136
+		$msg .= ! empty($file) && ! empty($function) ? ' -> ' : '';
137
+		$msg .= ! empty($function) ? $function.'()' : '';
138 138
 		$msg .= PHP_EOL;
139
-		$type = ! empty( $type ) ? $type : 'log message';
140
-		$msg .= ! empty( $message ) ? "\t" . '[' . $type . '] ' . $message . PHP_EOL : '';
139
+		$type = ! empty($type) ? $type : 'log message';
140
+		$msg .= ! empty($message) ? "\t".'['.$type.'] '.$message.PHP_EOL : '';
141 141
 		return $msg;
142 142
 	}
143 143
 
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 	 * @param string $message
153 153
 	 * @param string $type
154 154
 	 */
155
-	public function log( $file = '', $function = '', $message = '', $type = '' ) {
156
-		$this->_log .= $this->_format_message( $file, $function, $message, $type );
155
+	public function log($file = '', $function = '', $message = '', $type = '') {
156
+		$this->_log .= $this->_format_message($file, $function, $message, $type);
157 157
 	}
158 158
 
159 159
 
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
 	public function write_log() {
166 166
 		try {
167 167
 			//get existing log file and append new log info
168
-			$this->_log = EEH_File::get_file_contents( $this->_logs_folder . $this->_log_file ) . $this->_log;
169
-			EEH_File::write_to_file( $this->_logs_folder . $this->_log_file, $this->_log, 'Event Espresso Log' );
170
-		} catch( EE_Error $e ){
171
-			EE_Error::add_error( sprintf( __(  'Could not write to the Event Espresso log file because: %s', 'event_espresso' ), ' &nbsp; &nbsp; ' . $e->getMessage() ), __FILE__, __FUNCTION__, __LINE__ );
168
+			$this->_log = EEH_File::get_file_contents($this->_logs_folder.$this->_log_file).$this->_log;
169
+			EEH_File::write_to_file($this->_logs_folder.$this->_log_file, $this->_log, 'Event Espresso Log');
170
+		} catch (EE_Error $e) {
171
+			EE_Error::add_error(sprintf(__('Could not write to the Event Espresso log file because: %s', 'event_espresso'), ' &nbsp; &nbsp; '.$e->getMessage()), __FILE__, __FUNCTION__, __LINE__);
172 172
 			return;
173 173
 		}
174 174
 	}
@@ -181,31 +181,31 @@  discard block
 block discarded – undo
181 181
 	 */
182 182
 	public function send_log() {
183 183
 
184
-		if ( empty( $this->_remote_logging_url )) {
184
+		if (empty($this->_remote_logging_url)) {
185 185
 			return;
186 186
 		}
187 187
 
188
-		$data = 'domain=' . $_SERVER['HTTP_HOST'];
189
-		$data .= '&ip=' . $_SERVER['SERVER_ADDR'];
190
-		$data .= '&server_type=' . $_SERVER['SERVER_SOFTWARE'];
191
-		$data .= '&time=' . time();
192
-		$data .= '&remote_log=' . $this->_log;
193
-		$data .= '&request_array=' . json_encode( $_REQUEST );
188
+		$data = 'domain='.$_SERVER['HTTP_HOST'];
189
+		$data .= '&ip='.$_SERVER['SERVER_ADDR'];
190
+		$data .= '&server_type='.$_SERVER['SERVER_SOFTWARE'];
191
+		$data .= '&time='.time();
192
+		$data .= '&remote_log='.$this->_log;
193
+		$data .= '&request_array='.json_encode($_REQUEST);
194 194
 		$data .= '&action=save';
195 195
 
196
-		if ( defined( 'EELOGGING_PASS' )) {
197
-			$data .= '&pass=' . EELOGGING_PASS;
196
+		if (defined('EELOGGING_PASS')) {
197
+			$data .= '&pass='.EELOGGING_PASS;
198 198
 		}
199
-		if ( defined( 'EELOGGING_KEY' )) {
200
-			$data .= '&key=' . EELOGGING_KEY;
199
+		if (defined('EELOGGING_KEY')) {
200
+			$data .= '&key='.EELOGGING_KEY;
201 201
 		}
202 202
 
203
-		$c = curl_init( $this->_remote_logging_url );
204
-		curl_setopt( $c, CURLOPT_POST, TRUE );
205
-		curl_setopt( $c, CURLOPT_POSTFIELDS, $data );
206
-		curl_setopt( $c, CURLOPT_RETURNTRANSFER, TRUE );
207
-		curl_exec( $c );
208
-		curl_close( $c );
203
+		$c = curl_init($this->_remote_logging_url);
204
+		curl_setopt($c, CURLOPT_POST, TRUE);
205
+		curl_setopt($c, CURLOPT_POSTFIELDS, $data);
206
+		curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE);
207
+		curl_exec($c);
208
+		curl_close($c);
209 209
 	}
210 210
 
211 211
 
@@ -216,18 +216,18 @@  discard block
 block discarded – undo
216 216
 	 * previous entries are overwritten
217 217
 	 */
218 218
 	public function write_debug() {
219
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
219
+		if (defined('WP_DEBUG') && WP_DEBUG) {
220 220
 			$this->_debug_log = '';
221
-			foreach ( $_GET as $key => $value ) {
222
-				$this->_debug_log .= '$_GET["' . $key . '"] = "' . serialize($value) . '"' . PHP_EOL;
221
+			foreach ($_GET as $key => $value) {
222
+				$this->_debug_log .= '$_GET["'.$key.'"] = "'.serialize($value).'"'.PHP_EOL;
223 223
 			}
224
-			foreach ( $_POST as $key => $value ) {
225
-				$this->_debug_log .= '$_POST["' . $key . '"] = "' . serialize($value) . '"' . PHP_EOL;
224
+			foreach ($_POST as $key => $value) {
225
+				$this->_debug_log .= '$_POST["'.$key.'"] = "'.serialize($value).'"'.PHP_EOL;
226 226
 			}
227 227
 			try {
228
-				EEH_File::write_to_file( $this->_logs_folder . $this->_debug_file, $this->_debug_log, 'Event Espresso Debug Log' );
229
-			} catch( EE_Error $e ){
230
-				EE_Error::add_error( sprintf( __(  'Could not write to the Event Espresso debug log file because: %s', 'event_espresso' ), ' &nbsp; &nbsp; ' . $e->getMessage() ), __FILE__, __FUNCTION__, __LINE__ );
228
+				EEH_File::write_to_file($this->_logs_folder.$this->_debug_file, $this->_debug_log, 'Event Espresso Debug Log');
229
+			} catch (EE_Error $e) {
230
+				EE_Error::add_error(sprintf(__('Could not write to the Event Espresso debug log file because: %s', 'event_espresso'), ' &nbsp; &nbsp; '.$e->getMessage()), __FILE__, __FUNCTION__, __LINE__);
231 231
 				return;
232 232
 			}
233 233
 		}
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 * __clone
240 240
 	 */
241 241
 	public function __clone() {
242
-		trigger_error( __( 'Clone is not allowed.', 'event_espresso' ), E_USER_ERROR );
242
+		trigger_error(__('Clone is not allowed.', 'event_espresso'), E_USER_ERROR);
243 243
 	}
244 244
 
245 245
 
Please login to merge, or discard this patch.