Completed
Push — master ( 71159f...86ffa1 )
by
unknown
06:54
created
includes/admin/metaboxes/newsletter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Meta_Box;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @param \WP_Post $post
28 28
 	 */
29
-	public static function html( $post ) {
29
+	public static function html($post) {
30 30
 		simcal_newsletter_signup();
31 31
 	}
32 32
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 * @param int      $post_id
39 39
 	 * @param \WP_Post $post
40 40
 	 */
41
-	public static function save( $post_id, $post ) {
41
+	public static function save($post_id, $post) {
42 42
 		// This meta box has no persistent settings.
43 43
 	}
44 44
 
Please login to merge, or discard this patch.
includes/admin/notice.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 namespace SimpleCalendar\Admin;
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
@@ -106,43 +106,43 @@  discard block
 block discarded – undo
106 106
 	 *
107 107
 	 * @param array $notice
108 108
 	 */
109
-	public function __construct( $notice ) {
109
+	public function __construct($notice) {
110 110
 
111
-		if ( ! empty( $notice['id'] ) && ! empty( $notice['content'] ) ) {
111
+		if ( ! empty($notice['id']) && ! empty($notice['content'])) {
112 112
 
113 113
 			// Content.
114
-			$this->id = is_array( $notice['id'] ) ? array_map( 'sanitize_key', $notice['id'] ) : sanitize_key( $notice['id'] );
115
-			$this->content = wp_kses_post( $notice['content'] );
116
-			if ( ! empty( $notice['class'] ) ) {
117
-				$this->class = is_array( $notice['class'] ) ? join( ' ', array_map( 'esc_attr', $notice['class'] ) ) : esc_attr( $notice['class'] );
114
+			$this->id = is_array($notice['id']) ? array_map('sanitize_key', $notice['id']) : sanitize_key($notice['id']);
115
+			$this->content = wp_kses_post($notice['content']);
116
+			if ( ! empty($notice['class'])) {
117
+				$this->class = is_array($notice['class']) ? join(' ', array_map('esc_attr', $notice['class'])) : esc_attr($notice['class']);
118 118
 			}
119 119
 
120 120
 			// Type.
121 121
 			$default = 'notice';
122
-			$type = isset( $notice['type'] ) ? esc_attr( $notice['type'] ) : $default;
122
+			$type = isset($notice['type']) ? esc_attr($notice['type']) : $default;
123 123
 			$types = array(
124 124
 				'error',
125 125
 				'notice',
126 126
 				'updated',
127 127
 				'update-nag',
128 128
 			);
129
-			$this->type = in_array( $type, $types ) ? $type : $default;
129
+			$this->type = in_array($type, $types) ? $type : $default;
130 130
 
131 131
 			// Visibility.
132
-			if ( ! empty( $notice['capability'] ) ) {
133
-				$this->capability = esc_attr( $notice['capability'] );
132
+			if ( ! empty($notice['capability'])) {
133
+				$this->capability = esc_attr($notice['capability']);
134 134
 			}
135
-			if ( ! empty( $notice['screen'] ) ) {
136
-				$this->screen = is_array( $notice['screen'] ) ? array_map( 'esc_attr', $notice['screens'] ) : array( esc_attr( $notice['screen'] ) );
135
+			if ( ! empty($notice['screen'])) {
136
+				$this->screen = is_array($notice['screen']) ? array_map('esc_attr', $notice['screens']) : array(esc_attr($notice['screen']));
137 137
 			}
138
-			if ( ! empty( $notice['post'] ) ) {
139
-				$this->post = is_array( $notice['post'] ) ? array_map( 'intval', $notice['post'] ) : array( intval( $notice['post'] ) );
138
+			if ( ! empty($notice['post'])) {
139
+				$this->post = is_array($notice['post']) ? array_map('intval', $notice['post']) : array(intval($notice['post']));
140 140
 			}
141
-			if ( ! empty( $notice['dismissible'] ) ) {
142
-				$this->dismissible = $notice['dismissible'] === false ? false: true;
141
+			if ( ! empty($notice['dismissible'])) {
142
+				$this->dismissible = $notice['dismissible'] === false ? false : true;
143 143
 			}
144
-			if ( ! empty( $notice['visible'] ) ) {
145
-				$this->visible = $notice['visible'] === false ? false: true;
144
+			if ( ! empty($notice['visible'])) {
145
+				$this->visible = $notice['visible'] === false ? false : true;
146 146
 			}
147 147
 		}
148 148
 
@@ -154,16 +154,16 @@  discard block
 block discarded – undo
154 154
 	 * @since 3.0.0
155 155
 	 */
156 156
 	public function add() {
157
-		if ( ! empty( $this->id ) && ! empty( $this->content ) ) {
158
-			$notices = get_option( 'simple-calendar_admin_notices', array() );
159
-			if ( is_array( $this->id ) ) {
160
-				foreach ( $this->id as $k => $v ) {
161
-					$notices[ $k ][ $v ] = $this;
157
+		if ( ! empty($this->id) && ! empty($this->content)) {
158
+			$notices = get_option('simple-calendar_admin_notices', array());
159
+			if (is_array($this->id)) {
160
+				foreach ($this->id as $k => $v) {
161
+					$notices[$k][$v] = $this;
162 162
 				}
163 163
 			} else {
164
-				$notices[ $this->id ][] = $this;
164
+				$notices[$this->id][] = $this;
165 165
 			}
166
-			update_option( 'simple-calendar_admin_notices', $notices );
166
+			update_option('simple-calendar_admin_notices', $notices);
167 167
 		}
168 168
 	}
169 169
 
@@ -173,16 +173,16 @@  discard block
 block discarded – undo
173 173
 	 * @since 3.0.0
174 174
 	 */
175 175
 	public function remove() {
176
-		if ( ! empty( $this->id ) && ! empty( $this->content ) ) {
177
-			$notices = get_option( 'simple-calendar_admin_notices', array() );
178
-			if ( is_array( $this->id ) ) {
179
-				foreach ( $this->id as $k => $v ) {
180
-					unset( $notices[ $k ] );
176
+		if ( ! empty($this->id) && ! empty($this->content)) {
177
+			$notices = get_option('simple-calendar_admin_notices', array());
178
+			if (is_array($this->id)) {
179
+				foreach ($this->id as $k => $v) {
180
+					unset($notices[$k]);
181 181
 				}
182 182
 			} else {
183
-				unset( $notices[ $this->id ] );
183
+				unset($notices[$this->id]);
184 184
 			}
185
-			update_option( 'simple-calendar_admin_notices', $notices );
185
+			update_option('simple-calendar_admin_notices', $notices);
186 186
 		}
187 187
 	}
188 188
 
Please login to merge, or discard this patch.
includes/admin/notices.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 namespace SimpleCalendar\Admin;
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 	 * @since 3.0.0
26 26
 	 */
27 27
 	public function __construct() {
28
-		add_action( 'admin_init', array( $this, 'remove_notice' ), 10 );
29
-		add_action( 'admin_init', array( $this, 'process_notices' ), 40 );
28
+		add_action('admin_init', array($this, 'remove_notice'), 10);
29
+		add_action('admin_init', array($this, 'process_notices'), 40);
30 30
 	}
31 31
 
32 32
 	/**
@@ -38,35 +38,35 @@  discard block
 block discarded – undo
38 38
 
39 39
 		$notices = $this->get_notices();
40 40
 
41
-		if ( ! empty( $notices ) && is_array( $notices ) ) {
41
+		if ( ! empty($notices) && is_array($notices)) {
42 42
 
43
-			foreach ( $notices as $group ) {
44
-				foreach ( $group as $notice ) {
43
+			foreach ($notices as $group) {
44
+				foreach ($group as $notice) {
45 45
 
46
-					if ( $notice instanceof Notice ) {
46
+					if ($notice instanceof Notice) {
47 47
 
48
-						if ( $notice->visible === false ) {
48
+						if ($notice->visible === false) {
49 49
 							continue;
50 50
 						}
51 51
 
52
-						if ( ! empty( $notice->capability ) ) {
53
-							if ( ! current_user_can( $notice->capability ) ) {
52
+						if ( ! empty($notice->capability)) {
53
+							if ( ! current_user_can($notice->capability)) {
54 54
 								continue;
55 55
 							}
56 56
 						}
57 57
 
58
-						if ( ! empty( $notice->screen ) && is_array( $notice->screen ) && function_exists( 'get_current_screen' ) ) {
58
+						if ( ! empty($notice->screen) && is_array($notice->screen) && function_exists('get_current_screen')) {
59 59
 							$screen = get_current_screen();
60
-							if ( isset( $screen->id ) ) {
61
-								if ( ! in_array( $screen->id, $notice->screen ) ) {
60
+							if (isset($screen->id)) {
61
+								if ( ! in_array($screen->id, $notice->screen)) {
62 62
 									continue;
63 63
 								}
64 64
 							}
65 65
 						}
66 66
 
67
-						if ( ! empty( $notice->post ) && is_array( $notice->post ) ) {
68
-							if ( isset( $_GET['post'] ) ) {
69
-								if ( ! in_array( intval( $_GET['post'] ), $notice->post ) ) {
67
+						if ( ! empty($notice->post) && is_array($notice->post)) {
68
+							if (isset($_GET['post'])) {
69
+								if ( ! in_array(intval($_GET['post']), $notice->post)) {
70 70
 									continue;
71 71
 								}
72 72
 							} else {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 							}
75 75
 						}
76 76
 
77
-						$this->add_notice( $notice );
77
+						$this->add_notice($notice);
78 78
 					}
79 79
 				}
80 80
 			}
@@ -92,19 +92,19 @@  discard block
 block discarded – undo
92 92
 	 *
93 93
 	 * @return void
94 94
 	 */
95
-	public function add_notice( $notice ) {
95
+	public function add_notice($notice) {
96 96
 
97
-		if ( $notice instanceof Notice ) {
97
+		if ($notice instanceof Notice) {
98 98
 
99
-			add_action( 'admin_notices', $print_notice = function() use ( $notice ) {
99
+			add_action('admin_notices', $print_notice = function() use ($notice) {
100 100
 
101
-				$name         = is_array( $notice->id ) ? key( $notice->id ) : $notice->id;
102
-				$url          = add_query_arg( array( 'dismiss_simcal_notice' => $name ) );
101
+				$name         = is_array($notice->id) ? key($notice->id) : $notice->id;
102
+				$url          = add_query_arg(array('dismiss_simcal_notice' => $name));
103 103
 				$dismiss_link = $notice->dismissible === true
104
-					? sprintf( '<a class="dashicons-before dashicons-dismiss simcal-dismiss-notice" href="%1$s"></a>', $url )
104
+					? sprintf('<a class="dashicons-before dashicons-dismiss simcal-dismiss-notice" href="%1$s"></a>', $url)
105 105
 					: '';
106 106
 
107
-				echo '<div class="' . $notice->type . ' ' . $notice->class . ' simcal-admin-notice" data-notice-id="' . $name . '">' . $dismiss_link . $notice->content . '</div>';
107
+				echo '<div class="'.$notice->type.' '.$notice->class.' simcal-admin-notice" data-notice-id="'.$name.'">'.$dismiss_link.$notice->content.'</div>';
108 108
 			} );
109 109
 
110 110
 		}
@@ -121,27 +121,27 @@  discard block
 block discarded – undo
121 121
 	 *
122 122
 	 * @return void
123 123
 	 */
124
-	public function remove_notice( $notice = '' ) {
124
+	public function remove_notice($notice = '') {
125 125
 
126 126
 		$notices = $this->get_notices();
127 127
 		$update = false;
128 128
 
129
-		if ( ! empty( $notice ) ) {
130
-			if ( isset( $notices[ $notice ] ) ) {
131
-				unset( $notices[ $notice ] );
129
+		if ( ! empty($notice)) {
130
+			if (isset($notices[$notice])) {
131
+				unset($notices[$notice]);
132 132
 				$update = true;
133 133
 			}
134 134
 		}
135 135
 
136
-		if ( isset( $_GET['dismiss_simcal_notice'] ) ) {
137
-			if ( isset( $notices[ $_GET['dismiss_simcal_notice'] ] ) ) {
138
-				unset( $notices[ esc_attr( $_GET['dismiss_simcal_notice'] ) ] );
136
+		if (isset($_GET['dismiss_simcal_notice'])) {
137
+			if (isset($notices[$_GET['dismiss_simcal_notice']])) {
138
+				unset($notices[esc_attr($_GET['dismiss_simcal_notice'])]);
139 139
 				$update = true;
140 140
 			}
141 141
 		}
142 142
 
143
-		if ( $update === true ) {
144
-			update_option( 'simple-calendar_admin_notices', $notices );
143
+		if ($update === true) {
144
+			update_option('simple-calendar_admin_notices', $notices);
145 145
 		}
146 146
 	}
147 147
 
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
 	 *
155 155
 	 * @return void
156 156
 	 */
157
-	public function show_notice( $notice ) {
157
+	public function show_notice($notice) {
158 158
 
159 159
 		$notices = $this->get_notices();
160 160
 
161
-		if ( isset( $notices[ $notice ]->visible ) ) {
162
-			$notices[ $notice ]->visible = true;
163
-			update_option( 'simple-calendar_admin_notices', $notices );
161
+		if (isset($notices[$notice]->visible)) {
162
+			$notices[$notice]->visible = true;
163
+			update_option('simple-calendar_admin_notices', $notices);
164 164
 		}
165 165
 	}
166 166
 
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
 	 *
174 174
 	 * @return void
175 175
 	 */
176
-	public function hide_notice( $notice ) {
176
+	public function hide_notice($notice) {
177 177
 
178 178
 		$notices = $this->get_notices();
179 179
 
180
-		if ( isset( $notices[ $notice ]->visible ) ) {
181
-			$notices[ $notice ]->visible = false;
182
-			update_option( 'simple-calendar_admin_notices', $notices );
180
+		if (isset($notices[$notice]->visible)) {
181
+			$notices[$notice]->visible = false;
182
+			update_option('simple-calendar_admin_notices', $notices);
183 183
 		}
184 184
 	}
185 185
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	public function get_notices() {
194 194
 		return apply_filters(
195 195
 			'simcal_admin_notices',
196
-			get_option( 'simple-calendar_admin_notices', array() )
196
+			get_option('simple-calendar_admin_notices', array())
197 197
 		);
198 198
 	}
199 199
 
Please login to merge, or discard this patch.
includes/admin/pages.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use SimpleCalendar\Abstracts\Field;
10 10
 use SimpleCalendar\Abstracts\Admin_Page;
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @param string $page
55 55
 	 */
56
-	public function __construct( $page = 'settings' ) {
56
+	public function __construct($page = 'settings') {
57 57
 
58 58
 		$this->page = $page;
59
-		$settings_pages = ! is_null( \SimpleCalendar\plugin()->objects ) ? simcal_get_admin_pages() : '';
59
+		$settings_pages = ! is_null(\SimpleCalendar\plugin()->objects) ? simcal_get_admin_pages() : '';
60 60
 		$settings_page_tabs = array();
61
-		$tabs = isset( $settings_pages[ $page ] ) ? $settings_pages[ $page ] : false;
61
+		$tabs = isset($settings_pages[$page]) ? $settings_pages[$page] : false;
62 62
 
63
-		if ( $tabs && is_array( $tabs ) ) {
64
-			foreach ( $tabs as $tab ) {
63
+		if ($tabs && is_array($tabs)) {
64
+			foreach ($tabs as $tab) {
65 65
 
66
-				$settings_page = simcal_get_admin_page( $tab );
66
+				$settings_page = simcal_get_admin_page($tab);
67 67
 
68
-				if ( $settings_page instanceof Admin_Page ) {
69
-					$settings_page_tabs[ $settings_page->id ] = $settings_page;
68
+				if ($settings_page instanceof Admin_Page) {
69
+					$settings_page_tabs[$settings_page->id] = $settings_page;
70 70
 				}
71 71
 			}
72 72
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 		}
75 75
 
76 76
 		// The first tab is the default tab when opening a page.
77
-		$this->tab = isset( $tabs[0] ) ? $tabs[0] : '';
77
+		$this->tab = isset($tabs[0]) ? $tabs[0] : '';
78 78
 
79
-		do_action( 'simcal_admin_pages', $page );
79
+		do_action('simcal_admin_pages', $page);
80 80
 	}
81 81
 
82 82
 	/**
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$settings = array();
93 93
 
94
-		if ( ! empty( $this->settings ) && is_array( $this->settings ) ) {
95
-			foreach ( $this->settings as $id => $object ) {
94
+		if ( ! empty($this->settings) && is_array($this->settings)) {
95
+			foreach ($this->settings as $id => $object) {
96 96
 
97
-				if ( $object instanceof Admin_Page ) {
97
+				if ($object instanceof Admin_Page) {
98 98
 
99 99
 					$settings_page = $object->get_settings();
100 100
 
101
-					if ( isset( $settings_page[ $id ] ) ) {
102
-						$settings[ $id ] = $settings_page[ $id ];
101
+					if (isset($settings_page[$id])) {
102
+						$settings[$id] = $settings_page[$id];
103 103
 					}
104 104
 				}
105 105
 
@@ -118,48 +118,48 @@  discard block
 block discarded – undo
118 118
 	 *
119 119
 	 * @param array $settings
120 120
 	 */
121
-	public function register_settings( $settings = array() ) {
121
+	public function register_settings($settings = array()) {
122 122
 
123 123
 		$settings = $settings ? $settings : $this->get_settings();
124 124
 
125
-		if ( ! empty( $settings ) && is_array( $settings ) ) {
125
+		if ( ! empty($settings) && is_array($settings)) {
126 126
 
127
-			foreach ( $settings as $tab_id => $settings_page ) {
127
+			foreach ($settings as $tab_id => $settings_page) {
128 128
 
129
-				if ( isset( $settings_page['sections'] ) ) {
129
+				if (isset($settings_page['sections'])) {
130 130
 
131 131
 					$sections = $settings_page['sections'];
132 132
 
133
-					if ( ! empty( $sections ) && is_array( $sections ) ) {
133
+					if ( ! empty($sections) && is_array($sections)) {
134 134
 
135
-						foreach ( $sections as $section_id => $section ) {
135
+						foreach ($sections as $section_id => $section) {
136 136
 
137 137
 							add_settings_section(
138 138
 								$section_id,
139
-								isset( $section['title'] ) ? $section['title'] : '',
140
-								isset( $section['callback'] ) ? $section['callback'] : '',
141
-								'simple-calendar_' . $this->page . '_' . $tab_id
139
+								isset($section['title']) ? $section['title'] : '',
140
+								isset($section['callback']) ? $section['callback'] : '',
141
+								'simple-calendar_'.$this->page.'_'.$tab_id
142 142
 							);
143 143
 
144
-							if ( isset( $section['fields'] ) ) {
144
+							if (isset($section['fields'])) {
145 145
 
146 146
 								$fields = $section['fields'];
147 147
 
148
-								if ( ! empty( $fields ) && is_array( $fields ) ) {
148
+								if ( ! empty($fields) && is_array($fields)) {
149 149
 
150
-									foreach ( $fields as $field ) {
150
+									foreach ($fields as $field) {
151 151
 
152
-										if ( isset( $field['id'] ) && isset( $field['type'] ) ) {
152
+										if (isset($field['id']) && isset($field['type'])) {
153 153
 
154
-											$field_object = simcal_get_field( $field, $field['type'] );
154
+											$field_object = simcal_get_field($field, $field['type']);
155 155
 
156
-											if ( $field_object instanceof Field ) {
156
+											if ($field_object instanceof Field) {
157 157
 
158 158
 												add_settings_field(
159 159
 													$field['id'],
160
-													isset( $field['title'] ) ? $field['title'] : '',
161
-													array( $field_object, 'html' ),
162
-													'simple-calendar_' . $this->page . '_' . $tab_id,
160
+													isset($field['title']) ? $field['title'] : '',
161
+													array($field_object, 'html'),
162
+													'simple-calendar_'.$this->page.'_'.$tab_id,
163 163
 													$section_id
164 164
 												);
165 165
 
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 
174 174
 							} // are there fields?
175 175
 
176
-							$page = simcal_get_admin_page( $tab_id );
176
+							$page = simcal_get_admin_page($tab_id);
177 177
 
178 178
 							register_setting(
179
-								'simple-calendar_' . $this->page . '_' . $tab_id,
180
-								'simple-calendar_' . $this->page . '_' . $tab_id,
181
-								$page instanceof Admin_Page ? array( $page, 'validate' ) : ''
179
+								'simple-calendar_'.$this->page.'_'.$tab_id,
180
+								'simple-calendar_'.$this->page.'_'.$tab_id,
181
+								$page instanceof Admin_Page ? array($page, 'validate') : ''
182 182
 							);
183 183
 
184 184
 						} // loop sections
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		global $current_tab;
204 204
 
205 205
 		// Get current tab/section
206
-		$current_tab = empty( $_GET['tab'] ) ? $this->tab : sanitize_title( $_GET['tab'] );
206
+		$current_tab = empty($_GET['tab']) ? $this->tab : sanitize_title($_GET['tab']);
207 207
 		$this->tab = $current_tab;
208 208
 
209 209
 		?>
@@ -215,45 +215,45 @@  discard block
 block discarded – undo
215 215
 
216 216
 				// Include settings pages
217 217
 				$settings_pages = self::get_settings();
218
-				if ( ! empty( $settings_pages ) && is_array( $settings_pages ) ) {
218
+				if ( ! empty($settings_pages) && is_array($settings_pages)) {
219 219
 
220 220
 					echo '<h2 class="nav-tab-wrapper simcal-nav-tab-wrapper">';
221 221
 
222 222
 					// Get tabs for the settings page
223
-					if ( ! empty( $settings_pages ) && is_array( $settings_pages ) ) {
223
+					if ( ! empty($settings_pages) && is_array($settings_pages)) {
224 224
 
225
-						foreach ( $settings_pages as $id => $settings ) {
225
+						foreach ($settings_pages as $id => $settings) {
226 226
 
227
-							$tab_id    = isset( $id ) ? $id : '';
228
-							$tab_label = isset( $settings['label'] ) ? $settings['label'] : '';
229
-							$tab_link  = admin_url( 'edit.php?post_type=calendar&page=simple-calendar_' . $this->page . '&tab=' . $tab_id );
227
+							$tab_id    = isset($id) ? $id : '';
228
+							$tab_label = isset($settings['label']) ? $settings['label'] : '';
229
+							$tab_link  = admin_url('edit.php?post_type=calendar&page=simple-calendar_'.$this->page.'&tab='.$tab_id);
230 230
 
231
-							echo '<a href="' . $tab_link . '" class="nav-tab ' . ( $current_tab == $tab_id ? 'nav-tab-active' : '' ) . '">' . $tab_label . '</a>';
231
+							echo '<a href="'.$tab_link.'" class="nav-tab '.($current_tab == $tab_id ? 'nav-tab-active' : '').'">'.$tab_label.'</a>';
232 232
 						}
233 233
 
234 234
 					}
235 235
 
236
-					do_action( 'simcal_admin_page_' . $this->page . '_tabs' );
236
+					do_action('simcal_admin_page_'.$this->page.'_tabs');
237 237
 
238 238
 					echo '</h2>';
239 239
 
240 240
 					settings_errors();
241 241
 
242
-					foreach ( $settings_pages as $tab_id => $contents ) {
242
+					foreach ($settings_pages as $tab_id => $contents) {
243 243
 
244
-						if ( $tab_id === $current_tab ) {
244
+						if ($tab_id === $current_tab) {
245 245
 
246
-							echo isset( $contents['description'] ) ? '<p>' . $contents['description'] . '</p>' : '';
246
+							echo isset($contents['description']) ? '<p>'.$contents['description'].'</p>' : '';
247 247
 
248
-							do_action( 'simcal_admin_page_' .  $this->page . '_' . $current_tab . '_start' );
248
+							do_action('simcal_admin_page_'.$this->page.'_'.$current_tab.'_start');
249 249
 
250
-							settings_fields( 'simple-calendar_' . $this->page . '_' . $tab_id );
251
-							do_settings_sections( 'simple-calendar_' . $this->page . '_' . $tab_id );
250
+							settings_fields('simple-calendar_'.$this->page.'_'.$tab_id);
251
+							do_settings_sections('simple-calendar_'.$this->page.'_'.$tab_id);
252 252
 
253
-							do_action( 'simcal_admin_page_' .  $this->page . '_' . $current_tab . '_end' );
253
+							do_action('simcal_admin_page_'.$this->page.'_'.$current_tab.'_end');
254 254
 
255
-							$submit = apply_filters( 'simcal_admin_page_' . $this->page . '_' . $current_tab . '_submit', true );
256
-							if ( true === $submit ) {
255
+							$submit = apply_filters('simcal_admin_page_'.$this->page.'_'.$current_tab.'_submit', true);
256
+							if (true === $submit) {
257 257
 								submit_button();
258 258
 							}
259 259
 						}
Please login to merge, or discard this patch.
includes/admin/pages/add-ons.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Admin_Page;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 
29 29
 		$this->id           = $tab = 'add-ons';
30 30
 		$this->option_group = $page = 'add-ons';
31
-		$this->label        = __( 'Add-ons', 'google-calendar-events' );
31
+		$this->label        = __('Add-ons', 'google-calendar-events');
32 32
 		$this->description  = '';
33 33
 		$this->sections     = $this->add_sections();
34 34
 		$this->fields       = $this->add_fields();
35 35
 
36 36
 		// Disable the submit button for this page.
37
-		add_filter( 'simcal_admin_page_' . $page . '_' . $tab . '_submit', function() { return false; } );
37
+		add_filter('simcal_admin_page_'.$page.'_'.$tab.'_submit', function() { return false; } );
38 38
 
39 39
 		// Add html.
40
-		add_action( 'simcal_admin_page_' . $page . '_' . $tab . '_end', array( $this, 'html' ) );
40
+		add_action('simcal_admin_page_'.$page.'_'.$tab.'_end', array($this, 'html'));
41 41
 
42 42
 	}
43 43
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 		// @todo pull data from simplecalendar.io to showcase add-ons
52 52
 		$js_redirect = '<script type="text/javascript">';
53
-		$js_redirect .= 'window.location = "' . simcal_ga_campaign_url( simcal_get_url( 'add-ons' ), 'core-plugin', 'plugin-submenu-link', true ) . '"';
53
+		$js_redirect .= 'window.location = "'.simcal_ga_campaign_url(simcal_get_url('add-ons'), 'core-plugin', 'plugin-submenu-link', true).'"';
54 54
 		$js_redirect .= '</script>';
55 55
 
56 56
 		echo $js_redirect;
Please login to merge, or discard this patch.
includes/admin/pages/calendars.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use SimpleCalendar\Abstracts\Calendar;
10 10
 use SimpleCalendar\Abstracts\Admin_Page;
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -39,20 +39,20 @@  discard block
 block discarded – undo
39 39
 
40 40
 		$this->id               = 'calendars';
41 41
 		$this->option_group     = 'settings';
42
-		$this->label            = __( 'Calendars', 'google-calendar-events' );
42
+		$this->label            = __('Calendars', 'google-calendar-events');
43 43
 		//$this->description      = __( 'Manage calendar preferences and calendar types settings and options.', 'google-calendar-events' );
44 44
 
45 45
 		$calendars = simcal_get_calendar_types();
46 46
 		$calendar_settings = array();
47
-		if ( ! empty( $calendars ) && is_array( $calendars ) ) {
48
-			foreach ( $calendars as $calendar => $views ) {
47
+		if ( ! empty($calendars) && is_array($calendars)) {
48
+			foreach ($calendars as $calendar => $views) {
49 49
 
50
-				$calendar_type = simcal_get_calendar( $calendar );
50
+				$calendar_type = simcal_get_calendar($calendar);
51 51
 
52
-				if ( $calendar_type instanceof Calendar ) {
52
+				if ($calendar_type instanceof Calendar) {
53 53
 					$settings = $calendar_type->settings_fields();
54
-					if ( ! empty( $settings ) ) {
55
-						$calendar_settings[ $calendar ] = $settings;
54
+					if ( ! empty($settings)) {
55
+						$calendar_settings[$calendar] = $settings;
56 56
 					}
57 57
 				}
58 58
 			}
@@ -74,17 +74,17 @@  discard block
 block discarded – undo
74 74
 
75 75
 		$sections = array(
76 76
 			'general' => array(
77
-				'title'       => __( 'General', 'google-calendar-events' ),
77
+				'title'       => __('General', 'google-calendar-events'),
78 78
 				'description' => '',
79 79
 			),
80 80
 		);
81 81
 
82 82
 		$calendar_types = $this->calendar_types;
83 83
 
84
-		if ( ! empty( $calendar_types ) && is_array( $calendar_types ) ) {
85
-			foreach ( $calendar_types as $calendar_type => $type ) {
84
+		if ( ! empty($calendar_types) && is_array($calendar_types)) {
85
+			foreach ($calendar_types as $calendar_type => $type) {
86 86
 
87
-				$sections[ $calendar_type ] = array(
87
+				$sections[$calendar_type] = array(
88 88
 					'title' => $type['name'],
89 89
 					'description' => $type['description'],
90 90
 				);
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
 			}
93 93
 		}
94 94
 
95
-		arsort( $calendar_types );
95
+		arsort($calendar_types);
96 96
 
97 97
 		$sections['poweredby'] = array(
98
-			'title' => __( 'Show Some Love', 'google-calendar-events' ),
98
+			'title' => __('Show Some Love', 'google-calendar-events'),
99 99
 			'description' => '',
100 100
 		);
101 101
 
102
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', $sections );
102
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_sections', $sections);
103 103
 	}
104 104
 
105 105
 	/**
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
 
114 114
 		$fields       = array();
115 115
 		$feed_types   = $this->calendar_types;
116
-		$this->values = get_option( 'simple-calendar_' . $this->option_group . '_' . $this->id );
116
+		$this->values = get_option('simple-calendar_'.$this->option_group.'_'.$this->id);
117 117
 
118
-		foreach ( $this->sections as $section => $contents ) :
118
+		foreach ($this->sections as $section => $contents) :
119 119
 
120
-			if ( 'general' == $section ) {
120
+			if ('general' == $section) {
121 121
 
122 122
 				$options    = array();
123 123
 				$post_types = get_post_types(
@@ -129,54 +129,54 @@  discard block
 block discarded – undo
129 129
 					'objects',
130 130
 					'not'
131 131
 				);
132
-				unset( $post_types['attachment'] );
133
-				unset( $post_types['calendar'] );
134
-				unset( $post_types['gce_feed'] );
135
-				foreach ( $post_types as $slug => $post_type ) {
136
-					$options[ $slug ] = $post_type->label;
132
+				unset($post_types['attachment']);
133
+				unset($post_types['calendar']);
134
+				unset($post_types['gce_feed']);
135
+				foreach ($post_types as $slug => $post_type) {
136
+					$options[$slug] = $post_type->label;
137 137
 				}
138
-				asort( $options );
138
+				asort($options);
139 139
 
140
-				$fields[ $section ][] = array(
140
+				$fields[$section][] = array(
141 141
 					'type'        => 'select',
142 142
 					'multiselect' => 'multiselect',
143 143
 					'enhanced'    => 'enhanced',
144
-					'title'       => __( 'Attach Calendars', 'google-calendar-events' ),
145
-					'tooltip'     => __( 'You can choose on which content types to add the ability to attach calendars.', 'google-calendar-events' ),
146
-					'name'        => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][attach_calendars_posts]',
147
-					'id'          => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-attach-calendars-posts',
148
-					'value'       => $this->get_option_value( $section, 'attach_calendars_posts' ),
144
+					'title'       => __('Attach Calendars', 'google-calendar-events'),
145
+					'tooltip'     => __('You can choose on which content types to add the ability to attach calendars.', 'google-calendar-events'),
146
+					'name'        => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.'][attach_calendars_posts]',
147
+					'id'          => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-attach-calendars-posts',
148
+					'value'       => $this->get_option_value($section, 'attach_calendars_posts'),
149 149
 					'default'     => 'post,page',
150 150
 					'options'     => $options,
151 151
 				);
152 152
 
153
-			} elseif ( isset( $feed_types[ $section ]['fields'] ) ) {
153
+			} elseif (isset($feed_types[$section]['fields'])) {
154 154
 
155
-				foreach ( $feed_types[ $section ]['fields'] as $key => $args ) {
155
+				foreach ($feed_types[$section]['fields'] as $key => $args) {
156 156
 
157
-					$fields[ $section ][] = array_merge( $args, array(
158
-						'name'  => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][' . $key . ']',
159
-						'id'    => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $key,
160
-						'value' => $this->get_option_value( $section, $key )
161
-					) );
157
+					$fields[$section][] = array_merge($args, array(
158
+						'name'  => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.']['.$key.']',
159
+						'id'    => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-'.$key,
160
+						'value' => $this->get_option_value($section, $key)
161
+					));
162 162
 
163 163
 				}
164 164
 
165
-			} elseif ( 'poweredby' == $section ) {
165
+			} elseif ('poweredby' == $section) {
166 166
 
167
-				$fields[ $section ][] = array(
167
+				$fields[$section][] = array(
168 168
 					'type'      => 'checkbox',
169
-					'title'     => __( 'Powered by Simple Calendar', 'google-calendar-events' ),
170
-					'tooltip'   => __( 'Help our plugin get noticed and display a small link to our plugin below your calendars. Thanks!', 'google-calendar-events' ),
171
-					'name'      => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][opt_in]',
172
-					'id'        => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-poweredby-optin',
173
-					'value'     => $this->get_option_value( $section, 'opt_in' ),
169
+					'title'     => __('Powered by Simple Calendar', 'google-calendar-events'),
170
+					'tooltip'   => __('Help our plugin get noticed and display a small link to our plugin below your calendars. Thanks!', 'google-calendar-events'),
171
+					'name'      => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.'][opt_in]',
172
+					'id'        => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-poweredby-optin',
173
+					'value'     => $this->get_option_value($section, 'opt_in'),
174 174
 				);
175 175
 			}
176 176
 
177 177
 		endforeach;
178 178
 
179
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id . '_fields', $fields );
179
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_fields', $fields);
180 180
 	}
181 181
 
182 182
 }
Please login to merge, or discard this patch.
includes/admin/pages/feeds.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use SimpleCalendar\Abstracts\Feed;
10 10
 use SimpleCalendar\Abstracts\Admin_Page;
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -39,20 +39,20 @@  discard block
 block discarded – undo
39 39
 
40 40
 		$this->id           = 'feeds';
41 41
 		$this->option_group = 'settings';
42
-		$this->label        = __( 'Event Sources', 'google-calendar-events' );
42
+		$this->label        = __('Event Sources', 'google-calendar-events');
43 43
 		//$this->description  = __( 'Manage calendar event sources settings.', 'google-calendar-events' );
44 44
 
45 45
 		$feeds_settings = array();
46 46
 		$feeds = simcal_get_feed_types();
47
-		if ( ! empty( $feeds ) && is_array( $feeds ) ) {
48
-			foreach ( $feeds as $feed ) {
47
+		if ( ! empty($feeds) && is_array($feeds)) {
48
+			foreach ($feeds as $feed) {
49 49
 
50
-				$feed_type = simcal_get_feed( $feed );
50
+				$feed_type = simcal_get_feed($feed);
51 51
 
52
-				if ( $feed_type instanceof Feed ) {
52
+				if ($feed_type instanceof Feed) {
53 53
 					$settings = $feed_type->settings_fields();
54
-					if ( ! empty( $settings ) ) {
55
-						$feeds_settings[ $feed ] = $settings;
54
+					if ( ! empty($settings)) {
55
+						$feeds_settings[$feed] = $settings;
56 56
 					}
57 57
 				}
58 58
 			}
@@ -74,18 +74,18 @@  discard block
 block discarded – undo
74 74
 
75 75
 		$sections = array();
76 76
 
77
-		foreach ( $this->feed_types as $feed_type => $type ) {
77
+		foreach ($this->feed_types as $feed_type => $type) {
78 78
 
79
-			$sections[ $feed_type ] = array(
79
+			$sections[$feed_type] = array(
80 80
 				'title'       => $type['name'],
81 81
 				'description' => $type['description'],
82 82
 			);
83 83
 
84 84
 		}
85 85
 
86
-		arsort( $sections );
86
+		arsort($sections);
87 87
 
88
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', $sections );
88
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_sections', $sections);
89 89
 	}
90 90
 
91 91
 	/**
@@ -99,25 +99,25 @@  discard block
 block discarded – undo
99 99
 
100 100
 		$fields       = array();
101 101
 		$feed_types   = $this->feed_types;
102
-		$this->values = get_option( 'simple-calendar_' . $this->option_group . '_' . $this->id );
102
+		$this->values = get_option('simple-calendar_'.$this->option_group.'_'.$this->id);
103 103
 
104
-		foreach ( $this->sections as $type => $contents ) :
104
+		foreach ($this->sections as $type => $contents) :
105 105
 
106
-			if ( isset( $feed_types[ $type ]['fields'] ) ) {
107
-				foreach ( $feed_types[ $type ]['fields'] as $key => $args ) {
106
+			if (isset($feed_types[$type]['fields'])) {
107
+				foreach ($feed_types[$type]['fields'] as $key => $args) {
108 108
 
109
-					$fields[ $type ][] = array_merge( $args, array(
110
-						'name'  => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $type . '][' . $key . ']',
111
-						'id'    => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $type . '-' . $key,
112
-						'value' => $this->get_option_value( $type, $key )
113
-					) );
109
+					$fields[$type][] = array_merge($args, array(
110
+						'name'  => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$type.']['.$key.']',
111
+						'id'    => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-'.$type.'-'.$key,
112
+						'value' => $this->get_option_value($type, $key)
113
+					));
114 114
 
115 115
 				}
116 116
 			}
117 117
 
118 118
 		endforeach;
119 119
 
120
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id . '_fields', $fields );
120
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_fields', $fields);
121 121
 	}
122 122
 
123 123
 }
Please login to merge, or discard this patch.
includes/admin/pages/licenses.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,8 @@
 block discarded – undo
75 75
 			'keys' => array(
76 76
 				'title' => __( 'Premium Add-on License Keys', 'google-calendar-events' ),
77 77
 				'description' => __( 'Enter your add-on license keys below, making sure to activate each one to ensure they are valid.', 'google-calendar-events' ) .
78
-				                 '<br/><br/>' .
79
-				                 '<em>' . __( 'Your license keys are used for access to automatic upgrades and premium support.', 'google-calendar-events' ) . '</em>',
78
+								 '<br/><br/>' .
79
+								 '<em>' . __( 'Your license keys are used for access to automatic upgrades and premium support.', 'google-calendar-events' ) . '</em>',
80 80
 			),
81 81
 		);
82 82
 		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', $sections );
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Admin_Page;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 
31 31
 		$this->id           = $tab = 'licenses';
32 32
 		$this->option_group = $page = 'settings';
33
-		$this->label        = __( 'Add-on Licenses', 'google-calendar-events' );
33
+		$this->label        = __('Add-on Licenses', 'google-calendar-events');
34 34
 		//$this->description  = __( 'Manage your premium add-on license keys.', 'google-calendar-events' );
35 35
 		$this->sections     = $this->add_sections();
36 36
 		$this->fields       = $this->add_fields();
37 37
 
38 38
 		// Disabled the 'save changes' button for this page.
39
-		add_filter( 'simcal_admin_page_' . $page . '_' . $tab . '_submit', function() { return false; } );
39
+		add_filter('simcal_admin_page_'.$page.'_'.$tab.'_submit', function() { return false; } );
40 40
 
41 41
 		// Add html to page.
42
-		add_action( 'simcal_admin_page_' . $page . '_' . $tab . '_end', array( __CLASS__, 'html' ) );
42
+		add_action('simcal_admin_page_'.$page.'_'.$tab.'_end', array(__CLASS__, 'html'));
43 43
 	}
44 44
 
45 45
 	/**
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @return void
51 51
 	 */
52
-	public static function html()  {
52
+	public static function html() {
53 53
 		// Add a nonce field used in ajax.
54
-		wp_nonce_field( 'simcal_license_manager', 'simcal_license_manager' );
54
+		wp_nonce_field('simcal_license_manager', 'simcal_license_manager');
55 55
 		// Add a license 'reset' button.
56 56
 		?>
57 57
 		<br><br>
58
-		<a href="#" id="simcal-reset-licenses" data-dialog="<?php _e( 'WARNING: Are you sure you want to start over and delete all license keys from the settings?', 'google-calendar-events' ) ?>">
59
-			<?php _e( 'Delete your license keys', 'google-calendar-events' ) ?>
58
+		<a href="#" id="simcal-reset-licenses" data-dialog="<?php _e('WARNING: Are you sure you want to start over and delete all license keys from the settings?', 'google-calendar-events') ?>">
59
+			<?php _e('Delete your license keys', 'google-calendar-events') ?>
60 60
 			<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i>
61 61
 		</a>
62 62
 		<?php
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 	public function add_sections() {
74 74
 		$sections = array(
75 75
 			'keys' => array(
76
-				'title' => __( 'Premium Add-on License Keys', 'google-calendar-events' ),
77
-				'description' => __( 'Enter your add-on license keys below, making sure to activate each one to ensure they are valid.', 'google-calendar-events' ) .
78
-				                 '<br/><br/>' .
79
-				                 '<em>' . __( 'Your license keys are used for access to automatic upgrades and premium support.', 'google-calendar-events' ) . '</em>',
76
+				'title' => __('Premium Add-on License Keys', 'google-calendar-events'),
77
+				'description' => __('Enter your add-on license keys below, making sure to activate each one to ensure they are valid.', 'google-calendar-events').
78
+				                 '<br/><br/>'.
79
+				                 '<em>'.__('Your license keys are used for access to automatic upgrades and premium support.', 'google-calendar-events').'</em>',
80 80
 			),
81 81
 		);
82
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', $sections );
82
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_sections', $sections);
83 83
 	}
84 84
 
85 85
 	/**
@@ -92,25 +92,25 @@  discard block
 block discarded – undo
92 92
 	public function add_fields() {
93 93
 
94 94
 		$fields = array();
95
-		$this->values = get_option( 'simple-calendar_' . $this->option_group . '_' . $this->id );
95
+		$this->values = get_option('simple-calendar_'.$this->option_group.'_'.$this->id);
96 96
 
97
-		foreach ( $this->sections as $section => $contents ) {
97
+		foreach ($this->sections as $section => $contents) {
98 98
 
99
-			if ( 'keys' == $section ) {
99
+			if ('keys' == $section) {
100 100
 
101
-				$addons = apply_filters( 'simcal_installed_addons', array() );
101
+				$addons = apply_filters('simcal_installed_addons', array());
102 102
 
103
-				if ( ! empty( $addons ) && is_array( $addons ) ) {
103
+				if ( ! empty($addons) && is_array($addons)) {
104 104
 
105
-					foreach ( $addons as $addon_id => $addon_name ) {
105
+					foreach ($addons as $addon_id => $addon_name) {
106 106
 
107
-						$fields[ $section ][ $addon_id ] = array(
107
+						$fields[$section][$addon_id] = array(
108 108
 							'type'      => 'license',
109 109
 							'addon'     => $addon_id,
110
-							'title'     => esc_attr( $addon_name ),
111
-							'name'      => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][' . $addon_id . ']',
112
-							'id'        => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $section . '-' . sanitize_key( $addon_id ),
113
-							'value'     => $this->get_option_value( $section, $addon_id ),
110
+							'title'     => esc_attr($addon_name),
111
+							'name'      => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.']['.$addon_id.']',
112
+							'id'        => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-'.$section.'-'.sanitize_key($addon_id),
113
+							'value'     => $this->get_option_value($section, $addon_id),
114 114
 							'class'     => array(
115 115
 								'regular-text',
116 116
 								'ltr',
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 		}
127 127
 
128
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id . '_fields', $fields );
128
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_fields', $fields);
129 129
 	}
130 130
 
131 131
 }
Please login to merge, or discard this patch.
includes/admin/pages/system-status.php 1 patch
Spacing   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Admin_Page;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 
31 31
 		$this->id           = $tab = 'system-status';
32 32
 		$this->option_group = $page = 'tools';
33
-		$this->label        = __( 'System Report', 'google-calendar-events' );
33
+		$this->label        = __('System Report', 'google-calendar-events');
34 34
 		$this->description  = '';
35 35
 		$this->sections     = $this->add_sections();
36 36
 		$this->fields       = $this->add_fields();
37 37
 
38 38
 		// Disable the submit button for this page.
39
-		add_filter( 'simcal_admin_page_' . $page . '_' . $tab . '_submit', function() { return false; } );
39
+		add_filter('simcal_admin_page_'.$page.'_'.$tab.'_submit', function() { return false; } );
40 40
 
41 41
 		// Add html.
42
-		add_action( 'simcal_admin_page_' . $page . '_' . $tab . '_end', array( $this, 'html' ) );
42
+		add_action('simcal_admin_page_'.$page.'_'.$tab.'_end', array($this, 'html'));
43 43
 	}
44 44
 
45 45
 	/**
@@ -51,37 +51,37 @@  discard block
 block discarded – undo
51 51
 
52 52
 		?>
53 53
 		<div id="simcal-system-status-report">
54
-			<p><?php _e( 'Please copy and paste this information when contacting support:', 'google-calendar-events' ); ?> </p>
54
+			<p><?php _e('Please copy and paste this information when contacting support:', 'google-calendar-events'); ?> </p>
55 55
 			<textarea readonly="readonly" onclick="this.select();"></textarea>
56
-			<p><?php _e( 'You can also download your information as a text file to attach, or simply view it below.', 'google-calendar-events' ); ?></p>
57
-			<p><a href="#" id="simcal-system-status-report-download" class="button button-primary"><?php _e( 'Download System Report', 'google-calendar-events' ); ?></a></p>
56
+			<p><?php _e('You can also download your information as a text file to attach, or simply view it below.', 'google-calendar-events'); ?></p>
57
+			<p><a href="#" id="simcal-system-status-report-download" class="button button-primary"><?php _e('Download System Report', 'google-calendar-events'); ?></a></p>
58 58
 		</div>
59 59
 		<hr>
60 60
 		<?php
61 61
 
62 62
 		global $wpdb;
63
-		$wp_version = get_bloginfo( 'version' );
63
+		$wp_version = get_bloginfo('version');
64 64
 
65 65
 		$sections = array();
66 66
 		$panels   = array(
67 67
 			'wordpress' => array(
68
-				'label'  => __( 'WordPress Installation', 'google-calendar-events' ),
68
+				'label'  => __('WordPress Installation', 'google-calendar-events'),
69 69
 				'export' => 'WordPress Installation',
70 70
 			),
71 71
 			'theme'     => array(
72
-				'label'  => __( 'Active Theme', 'google-calendar-events' ),
72
+				'label'  => __('Active Theme', 'google-calendar-events'),
73 73
 				'export' => 'Active Theme',
74 74
 			),
75 75
 			'plugins'   => array(
76
-				'label'  => __( 'Active Plugins', 'google-calendar-events' ),
76
+				'label'  => __('Active Plugins', 'google-calendar-events'),
77 77
 				'export' => 'Active Plugins',
78 78
 			),
79 79
 			'server'    => array(
80
-				'label'  => __( 'Server Environment', 'google-calendar-events' ),
80
+				'label'  => __('Server Environment', 'google-calendar-events'),
81 81
 				'export' => 'Server Environment',
82 82
 			),
83 83
 			'client'    => array(
84
-				'label'  => __( 'Client Information', 'google-calendar-events' ),
84
+				'label'  => __('Client Information', 'google-calendar-events'),
85 85
 				'export' => 'Client Information',
86 86
 			)
87 87
 		);
@@ -98,68 +98,68 @@  discard block
 block discarded – undo
98 98
 		 * ======================
99 99
 		 */
100 100
 
101
-		$debug_mode = $script_debug = __( 'No', 'google-calendar-events' );
102
-		if ( defined( 'WP_DEBUG' ) ) {
103
-			$debug_mode = true === WP_DEBUG ? __( 'Yes', 'google-calendar-events' ) : $debug_mode;
101
+		$debug_mode = $script_debug = __('No', 'google-calendar-events');
102
+		if (defined('WP_DEBUG')) {
103
+			$debug_mode = true === WP_DEBUG ? __('Yes', 'google-calendar-events') : $debug_mode;
104 104
 		}
105
-		if ( defined( 'SCRIPT_DEBUG' ) ) {
106
-			$script_debug = true === SCRIPT_DEBUG ? __( 'Yes', 'google-calendar-events' ) : $script_debug;
105
+		if (defined('SCRIPT_DEBUG')) {
106
+			$script_debug = true === SCRIPT_DEBUG ? __('Yes', 'google-calendar-events') : $script_debug;
107 107
 		}
108 108
 
109
-		$memory = $this->let_to_num( WP_MEMORY_LIMIT );
110
-		$memory_export = size_format( $memory );
111
-		if ( $memory < 67108864 ) {
112
-			$memory = '<mark class="error">' . sprintf( __( '%1$s - It is recomendend to set memory to at least 64MB. See: <a href="%2$s" target="_blank">Increasing memory allocated to PHP</a>', 'google-calendar-events' ), $memory_export, 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) . '</mark>';
109
+		$memory = $this->let_to_num(WP_MEMORY_LIMIT);
110
+		$memory_export = size_format($memory);
111
+		if ($memory < 67108864) {
112
+			$memory = '<mark class="error">'.sprintf(__('%1$s - It is recomendend to set memory to at least 64MB. See: <a href="%2$s" target="_blank">Increasing memory allocated to PHP</a>', 'google-calendar-events'), $memory_export, 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP').'</mark>';
113 113
 		} else {
114
-			$memory = '<mark class="ok">' . $memory_export . '</mark>';
114
+			$memory = '<mark class="ok">'.$memory_export.'</mark>';
115 115
 		}
116 116
 
117
-		$permalinks = get_option( 'permalink_structure' );
118
-		$permalinks = empty( $permalinks ) ? '/?' : $permalinks;
117
+		$permalinks = get_option('permalink_structure');
118
+		$permalinks = empty($permalinks) ? '/?' : $permalinks;
119 119
 
120 120
 		$is_multisite = is_multisite();
121 121
 
122 122
 		$sections['wordpress'] = array(
123 123
 			'name'          => array(
124
-				'label'  => __( 'Site Name', 'google-calendar-events' ),
124
+				'label'  => __('Site Name', 'google-calendar-events'),
125 125
 				'label_export' => 'Site Name',
126
-				'result' => get_bloginfo( 'name' ),
126
+				'result' => get_bloginfo('name'),
127 127
 			),
128 128
 			'home_url'      => array(
129
-				'label'  => __( 'Home URL', 'google-calendar-events' ),
129
+				'label'  => __('Home URL', 'google-calendar-events'),
130 130
 				'label_export' => 'Home URL',
131 131
 				'result' => home_url(),
132 132
 			),
133 133
 			'site_url'      => array(
134
-				'label'  => __( 'Site URL', 'google-calendar-events' ),
134
+				'label'  => __('Site URL', 'google-calendar-events'),
135 135
 				'label_export' => 'Site URL',
136 136
 				'result' => site_url(),
137 137
 			),
138 138
 			'version'       => array(
139
-				'label'  => __( 'Version', 'google-calendar-events' ),
139
+				'label'  => __('Version', 'google-calendar-events'),
140 140
 				'label_export' => 'Version',
141 141
 				'result' => $wp_version,
142 142
 			),
143 143
 			'locale'        => array(
144
-				'label'  => __( 'Locale', 'google-calendar-events' ),
144
+				'label'  => __('Locale', 'google-calendar-events'),
145 145
 				'label_export' => 'Locale',
146 146
 				'result' => get_locale(),
147 147
 			),
148 148
 			'wp_timezone'   => array(
149
-				'label'  => __( 'Timezone', 'google-calendar-events' ),
149
+				'label'  => __('Timezone', 'google-calendar-events'),
150 150
 				'label_export' => 'Timezone',
151 151
 				'result' => simcal_get_wp_timezone(),
152 152
 			),
153 153
 			'multisite'     => array(
154
-				'label'  => __( 'Multisite', 'google-calendar-events' ),
154
+				'label'  => __('Multisite', 'google-calendar-events'),
155 155
 				'label_export' => 'Multisite',
156
-				'result' => $is_multisite ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
156
+				'result' => $is_multisite ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
157 157
 				'result_export' => $is_multisite ? 'Yes' : 'No'
158 158
 			),
159 159
 			'permalink'     => array(
160
-				'label'  => __( 'Permalinks', 'google-calendar-events' ),
160
+				'label'  => __('Permalinks', 'google-calendar-events'),
161 161
 				'label_export' => 'Permalinks',
162
-				'result' => '<code>' . $permalinks . '</code>',
162
+				'result' => '<code>'.$permalinks.'</code>',
163 163
 				'result_export' => $permalinks,
164 164
 			),
165 165
 			'memory_limit'  => array(
@@ -182,86 +182,86 @@  discard block
 block discarded – undo
182 182
 		 * ============
183 183
 		 */
184 184
 
185
-		include_once ABSPATH . 'wp-admin/includes/theme-install.php';
185
+		include_once ABSPATH.'wp-admin/includes/theme-install.php';
186 186
 
187
-		if ( version_compare( $wp_version, '3.4', '<' ) ) {
188
-			$active_theme  = get_theme_data( get_stylesheet_directory() . '/style.css' );
189
-			$theme_name    = '<a href="' . $active_theme['URI'] . '" target="_blank">' . $active_theme['Name'] . '</a>';
187
+		if (version_compare($wp_version, '3.4', '<')) {
188
+			$active_theme  = get_theme_data(get_stylesheet_directory().'/style.css');
189
+			$theme_name    = '<a href="'.$active_theme['URI'].'" target="_blank">'.$active_theme['Name'].'</a>';
190 190
 			$theme_version = $active_theme['Version'];
191
-			$theme_author  = '<a href="' . $active_theme['AuthorURI'] . '" target="_blank">' . $active_theme['Author'] . '</a>';
192
-			$theme_export  = $active_theme['Name'] . ' - ' . $theme_version;
191
+			$theme_author  = '<a href="'.$active_theme['AuthorURI'].'" target="_blank">'.$active_theme['Author'].'</a>';
192
+			$theme_export  = $active_theme['Name'].' - '.$theme_version;
193 193
 		} else {
194 194
 			$active_theme  = wp_get_theme();
195
-			$theme_name    = '<a href="' . $active_theme->ThemeURI . '" target="_blank">' . $active_theme->Name . '</a>';
195
+			$theme_name    = '<a href="'.$active_theme->ThemeURI.'" target="_blank">'.$active_theme->Name.'</a>';
196 196
 			$theme_version = $active_theme->Version;
197 197
 			$theme_author  = $active_theme->Author;
198
-			$theme_export  = $active_theme->Name . ' - ' . $theme_version;
198
+			$theme_export  = $active_theme->Name.' - '.$theme_version;
199 199
 		}
200 200
 
201 201
 		$theme_update_version = $theme_version;
202 202
 
203
-		$api = themes_api( 'theme_information', array(
203
+		$api = themes_api('theme_information', array(
204 204
 			'slug'   => get_template(),
205
-			'fields' => array( 'sections' => false, 'tags' => false ),
206
-		) );
207
-		if ( $api && ! is_wp_error( $api ) ) {
205
+			'fields' => array('sections' => false, 'tags' => false),
206
+		));
207
+		if ($api && ! is_wp_error($api)) {
208 208
 			$theme_update_version = $api->version;
209 209
 		}
210 210
 
211
-		if ( version_compare( $theme_version, $theme_update_version, '<' ) ) {
212
-			$theme_version = '<mark class="error">' . $theme_version . ' (' . sprintf( __( '%s is available', 'google-calendar-events' ), esc_html( $theme_update_version ) ) . ')</mark>';
211
+		if (version_compare($theme_version, $theme_update_version, '<')) {
212
+			$theme_version = '<mark class="error">'.$theme_version.' ('.sprintf(__('%s is available', 'google-calendar-events'), esc_html($theme_update_version)).')</mark>';
213 213
 		} else {
214
-			$theme_version = '<mark class="ok">' . $theme_version . '</mark>';
214
+			$theme_version = '<mark class="ok">'.$theme_version.'</mark>';
215 215
 		}
216 216
 
217 217
 		$theme  = '<dl>';
218
-		$theme .= '<dt>' . __( 'Name', 'google-calendar-events' ) . '</dt>';
219
-		$theme .= '<dd>' . $theme_name . '</dd>';
220
-		$theme .= '<dt>' . __( 'Author', 'google-calendar-events' ) . '</dt>';
221
-		$theme .= '<dd>' . $theme_author . '</dd>';
222
-		$theme .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>';
223
-		$theme .= '<dd>' . $theme_version . '</dd>';
218
+		$theme .= '<dt>'.__('Name', 'google-calendar-events').'</dt>';
219
+		$theme .= '<dd>'.$theme_name.'</dd>';
220
+		$theme .= '<dt>'.__('Author', 'google-calendar-events').'</dt>';
221
+		$theme .= '<dd>'.$theme_author.'</dd>';
222
+		$theme .= '<dt>'.__('Version', 'google-calendar-events').'</dt>';
223
+		$theme .= '<dd>'.$theme_version.'</dd>';
224 224
 		$theme .= '</dl>';
225 225
 
226 226
 		$is_child_theme = is_child_theme();
227 227
 		$parent_theme = $parent_theme_export = '-';
228 228
 
229
-		if ( $is_child_theme ) {
230
-			if ( version_compare( $wp_version, '3.4', '<' ) ) {
229
+		if ($is_child_theme) {
230
+			if (version_compare($wp_version, '3.4', '<')) {
231 231
 
232 232
 				$parent_theme = $parent_theme_export = $active_theme['Template'];
233 233
 
234 234
 			} else {
235 235
 
236
-				$parent = wp_get_theme( $active_theme->Template );
236
+				$parent = wp_get_theme($active_theme->Template);
237 237
 				$parent_theme  = '<dl>';
238
-				$parent_theme .= '<dt>' . __( 'Name', 'google-calendar-events' ) .    '</dt>';
239
-				$parent_theme .= '<dd>' . $parent->Name .          '</dd>';
240
-				$parent_theme .= '<dt>' . __( 'Author', 'google-calendar-events' ) .  '</dt>';
241
-				$parent_theme .= '<dd>' . $parent->Author .        '</dd>';
242
-				$parent_theme .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>';
243
-				$parent_theme .= '<dd>' . $parent->Version .       '</dd>';
238
+				$parent_theme .= '<dt>'.__('Name', 'google-calendar-events').'</dt>';
239
+				$parent_theme .= '<dd>'.$parent->Name.'</dd>';
240
+				$parent_theme .= '<dt>'.__('Author', 'google-calendar-events').'</dt>';
241
+				$parent_theme .= '<dd>'.$parent->Author.'</dd>';
242
+				$parent_theme .= '<dt>'.__('Version', 'google-calendar-events').'</dt>';
243
+				$parent_theme .= '<dd>'.$parent->Version.'</dd>';
244 244
 				$parent_theme .= '</dl>';
245 245
 
246
-				$parent_theme_export = strip_tags( $parent->Name ) . ' - ' .  $parent->Version;
246
+				$parent_theme_export = strip_tags($parent->Name).' - '.$parent->Version;
247 247
 			}
248 248
 		}
249 249
 
250 250
 		$sections['theme'] = array(
251 251
 			'theme'    => array(
252
-				'label'  => __( 'Theme Information', 'google-calendar-events' ),
252
+				'label'  => __('Theme Information', 'google-calendar-events'),
253 253
 				'label_export' => 'Theme',
254 254
 				'result' => $theme,
255 255
 				'result_export' => $theme_export,
256 256
 			),
257 257
 			'theme_child'   => array(
258
-				'label'  => __( 'Child Theme', 'google-calendar-events' ),
258
+				'label'  => __('Child Theme', 'google-calendar-events'),
259 259
 				'label_export' => 'Child Theme',
260
-				'result' => $is_child_theme ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
260
+				'result' => $is_child_theme ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
261 261
 				'result_export' => $is_child_theme ? 'Yes' : 'No',
262 262
 			),
263 263
 			'theme_parent'   => array(
264
-				'label'  => __( 'Parent Theme', 'google-calendar-events' ),
264
+				'label'  => __('Parent Theme', 'google-calendar-events'),
265 265
 				'label_export' => 'Parent Theme',
266 266
 				'result' => $parent_theme,
267 267
 				'result_export' => $parent_theme_export,
@@ -273,61 +273,61 @@  discard block
 block discarded – undo
273 273
 		 * ==============
274 274
 		 */
275 275
 
276
-		include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
276
+		include_once ABSPATH.'wp-admin/includes/plugin-install.php';
277 277
 
278
-		$active_plugins = (array) get_option( 'active_plugins', array() );
279
-		if ( is_multisite() ) {
280
-			$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
278
+		$active_plugins = (array) get_option('active_plugins', array());
279
+		if (is_multisite()) {
280
+			$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
281 281
 		}
282 282
 
283
-		foreach ( $active_plugins as $plugin ) {
283
+		foreach ($active_plugins as $plugin) {
284 284
 
285
-			$plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
285
+			$plugin_data = @get_plugin_data(WP_PLUGIN_DIR.'/'.$plugin);
286 286
 
287
-			if ( ! empty( $plugin_data['Name'] ) ) {
287
+			if ( ! empty($plugin_data['Name'])) {
288 288
 
289 289
 				$plugin_name    = $plugin_data['Title'];
290 290
 				$plugin_author  = $plugin_data['Author'];
291 291
 				$plugin_version = $plugin_update_version = $plugin_data['Version'];
292 292
 
293 293
 				// Afraid that querying many plugins may risk a timeout.
294
-				if ( count( $active_plugins ) <= 10 ) {
295
-					$api = plugins_api( 'plugin_information', array(
294
+				if (count($active_plugins) <= 10) {
295
+					$api = plugins_api('plugin_information', array(
296 296
 						'slug'   => $plugin_data['Name'],
297 297
 						'fields' => array(
298 298
 							'version' => true,
299 299
 						),
300
-					) );
301
-					if ( $api && ! is_wp_error( $api ) ) {
302
-						if ( ! empty( $api->version ) ) {
300
+					));
301
+					if ($api && ! is_wp_error($api)) {
302
+						if ( ! empty($api->version)) {
303 303
 							$plugin_update_version = $api->version;
304
-							if ( version_compare( $plugin_version, $plugin_update_version, '<' ) ) {
305
-								$plugin_version = '<mark class="error">' . $plugin_version . ' (' . sprintf( __( '%s is available', 'google-calendar-events' ), esc_html( $plugin_update_version ) ) . ')</mark>';
304
+							if (version_compare($plugin_version, $plugin_update_version, '<')) {
305
+								$plugin_version = '<mark class="error">'.$plugin_version.' ('.sprintf(__('%s is available', 'google-calendar-events'), esc_html($plugin_update_version)).')</mark>';
306 306
 							} else {
307
-								$plugin_version = '<mark class="ok">' . $plugin_version . '</mark>';
307
+								$plugin_version = '<mark class="ok">'.$plugin_version.'</mark>';
308 308
 							}
309 309
 						}
310 310
 					}
311 311
 				}
312 312
 
313 313
 				$plugin  = '<dl>';
314
-				$plugin .= '<dt>' . __( 'Author', 'google-calendar-events' ) .  '</dt>';
315
-				$plugin .= '<dd>' . $plugin_author .         '</dd>';
316
-				$plugin .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>';
317
-				$plugin .= '<dd>' . $plugin_version .        '</dd>';
314
+				$plugin .= '<dt>'.__('Author', 'google-calendar-events').'</dt>';
315
+				$plugin .= '<dd>'.$plugin_author.'</dd>';
316
+				$plugin .= '<dt>'.__('Version', 'google-calendar-events').'</dt>';
317
+				$plugin .= '<dd>'.$plugin_version.'</dd>';
318 318
 				$plugin .= '</dl>';
319 319
 
320
-				$sections['plugins'][ sanitize_key( strip_tags( $plugin_name ) ) ] = array(
320
+				$sections['plugins'][sanitize_key(strip_tags($plugin_name))] = array(
321 321
 					'label'  => $plugin_name,
322
-					'label_export' => strip_tags( $plugin_data['Title'] ),
322
+					'label_export' => strip_tags($plugin_data['Title']),
323 323
 					'result' => $plugin,
324 324
 					'result_export' => $plugin_data['Version'],
325 325
 				);
326 326
 			}
327 327
 		}
328 328
 
329
-		if ( isset( $sections['plugins'] ) ) {
330
-			rsort( $sections['plugins'] );
329
+		if (isset($sections['plugins'])) {
330
+			rsort($sections['plugins']);
331 331
 		}
332 332
 
333 333
 		/**
@@ -335,51 +335,51 @@  discard block
 block discarded – undo
335 335
 		 * ==================
336 336
 		 */
337 337
 
338
-		if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
339
-			$php = '<mark class="error">' . sprintf( __( '%1$s - It is recomendend to upgrade at least to PHP version 5.4 for security reasons. <a href="%2$s" target="_blank">Read more.</a>', 'google-calendar-events' ), PHP_VERSION, 'http://www.wpupdatephp.com/update/' ) . '</mark>';
338
+		if (version_compare(PHP_VERSION, '5.4', '<')) {
339
+			$php = '<mark class="error">'.sprintf(__('%1$s - It is recomendend to upgrade at least to PHP version 5.4 for security reasons. <a href="%2$s" target="_blank">Read more.</a>', 'google-calendar-events'), PHP_VERSION, 'http://www.wpupdatephp.com/update/').'</mark>';
340 340
 		} else {
341
-			$php = '<mark class="ok">' . PHP_VERSION . '</mark>';
341
+			$php = '<mark class="ok">'.PHP_VERSION.'</mark>';
342 342
 		}
343 343
 
344
-		if ( $wpdb->use_mysqli ) {
345
-			$mysql = @mysqli_get_server_info( $wpdb->dbh );
344
+		if ($wpdb->use_mysqli) {
345
+			$mysql = @mysqli_get_server_info($wpdb->dbh);
346 346
 		} else {
347 347
 			$mysql = @mysql_get_server_info();
348 348
 		}
349 349
 
350 350
 		$host = $_SERVER['SERVER_SOFTWARE'];
351
-		if ( defined( 'WPE_APIKEY' ) ) {
351
+		if (defined('WPE_APIKEY')) {
352 352
 			$host .= ' (WP Engine)';
353
-		} elseif ( defined( 'PAGELYBIN' ) ) {
353
+		} elseif (defined('PAGELYBIN')) {
354 354
 			$host .= ' (Pagely)';
355 355
 		}
356 356
 
357 357
 		$default_timezone = $server_timezone_export = date_default_timezone_get();
358
-		if ( 'UTC' !== $default_timezone ) {
359
-			$server_timezone = '<mark class="error">' . sprintf( __( 'Server default timezone is %s - it should be UTC', 'google-calendar-events' ), $default_timezone ) . '</mark>';
358
+		if ('UTC' !== $default_timezone) {
359
+			$server_timezone = '<mark class="error">'.sprintf(__('Server default timezone is %s - it should be UTC', 'google-calendar-events'), $default_timezone).'</mark>';
360 360
 		} else {
361 361
 			$server_timezone = '<mark class="ok">UTC</mark>';
362 362
 		}
363 363
 
364 364
 		// WP Remote POST test.
365
-		$response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array(
365
+		$response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array(
366 366
 			'timeout'    => 60,
367 367
 			'body'       => array(
368 368
 				'cmd'    => '_notify-validate',
369 369
 			),
370
-		) );
371
-		if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
370
+		));
371
+		if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
372 372
 			$wp_post_export = 'Yes';
373
-			$wp_post = '<mark class="ok">' . __( 'Yes', 'google-calendar-events' ) . '</mark>';
373
+			$wp_post = '<mark class="ok">'.__('Yes', 'google-calendar-events').'</mark>';
374 374
 		} else {
375 375
 			$wp_post_export = 'No';
376
-			$wp_post = '<mark class="error">' . __( 'No', 'google-calendar-events' );
377
-			if ( is_wp_error( $response ) ) {
378
-				$error = ' (' . $response->get_error_message() . ')';
376
+			$wp_post = '<mark class="error">'.__('No', 'google-calendar-events');
377
+			if (is_wp_error($response)) {
378
+				$error = ' ('.$response->get_error_message().')';
379 379
 				$wp_post .= $error;
380 380
 				$wp_post_export .= $error;
381 381
 			} else {
382
-				$error = ' (' . $response['response']['code'] . ')';
382
+				$error = ' ('.$response['response']['code'].')';
383 383
 				$wp_post .= $error;
384 384
 				$wp_post_export .= $error;
385 385
 			}
@@ -387,64 +387,64 @@  discard block
 block discarded – undo
387 387
 		}
388 388
 
389 389
 		// WP Remote GET test.
390
-		$response = wp_safe_remote_get( get_home_url( '/?p=1' ) );
391
-		if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
390
+		$response = wp_safe_remote_get(get_home_url('/?p=1'));
391
+		if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
392 392
 			$wp_get_export = 'Yes';
393
-			$wp_get = '<mark class="ok">' . __( 'Yes', 'google-calendar-events' ) . '</mark>';
393
+			$wp_get = '<mark class="ok">'.__('Yes', 'google-calendar-events').'</mark>';
394 394
 		} else {
395 395
 			$wp_get_export = 'No';
396
-			$wp_get = '<mark class="error">' . __( 'No', 'google-calendar-events' );
397
-			if ( is_wp_error( $response ) ) {
398
-				$error = ' (' . $response->get_error_message() . ')';
396
+			$wp_get = '<mark class="error">'.__('No', 'google-calendar-events');
397
+			if (is_wp_error($response)) {
398
+				$error = ' ('.$response->get_error_message().')';
399 399
 				$wp_get .= $error;
400 400
 				$wp_get_export .= $error;
401 401
 			} else {
402
-				$error = ' (' . $response['response']['code'] . ')';
402
+				$error = ' ('.$response['response']['code'].')';
403 403
 				$wp_get .= $error;
404 404
 				$wp_get_export .= $error;
405 405
 			}
406 406
 			$wp_get .= '</mark>';
407 407
 		}
408 408
 
409
-		$php_memory_limit        = ini_get( 'memory_limit' );
410
-		$php_max_upload_filesize = ini_get( 'upload_max_filesize' );
411
-		$php_post_max_size       = ini_get( 'post_max_size' );
412
-		$php_max_execution_time  = ini_get( 'max_execution_time' );
413
-		$php_max_input_vars      = ini_get( 'max_input_vars' );
409
+		$php_memory_limit        = ini_get('memory_limit');
410
+		$php_max_upload_filesize = ini_get('upload_max_filesize');
411
+		$php_post_max_size       = ini_get('post_max_size');
412
+		$php_max_execution_time  = ini_get('max_execution_time');
413
+		$php_max_input_vars      = ini_get('max_input_vars');
414 414
 
415 415
 		$sections['server'] = array(
416 416
 			'host'                => array(
417
-				'label'  => __( 'Web Server', 'google-calendar-events' ),
417
+				'label'  => __('Web Server', 'google-calendar-events'),
418 418
 				'label_export' => 'Web Server',
419 419
 				'result' => $host,
420 420
 			),
421 421
 			'php_version'         => array(
422
-				'label'  => __( 'PHP Version', 'google-calendar-events' ),
422
+				'label'  => __('PHP Version', 'google-calendar-events'),
423 423
 				'label_export' => 'PHP Version',
424 424
 				'result' => $php,
425 425
 				'result_export' => PHP_VERSION,
426 426
 			),
427 427
 			'mysql_version'       => array(
428
-				'label'  => __( 'MySQL Version', 'google-calendar-events' ),
428
+				'label'  => __('MySQL Version', 'google-calendar-events'),
429 429
 				'label_export' => 'MySQL Version',
430
-				'result' => version_compare( $mysql, '5.5', '>' ) ? '<mark class="ok">' . $mysql . '</mark>' : $mysql,
430
+				'result' => version_compare($mysql, '5.5', '>') ? '<mark class="ok">'.$mysql.'</mark>' : $mysql,
431 431
 				'result_export' => $mysql,
432 432
 			),
433 433
 			'server_timezone'     => array(
434
-				'label'  => __( 'Server Timezone', 'google-calendar-events' ),
434
+				'label'  => __('Server Timezone', 'google-calendar-events'),
435 435
 				'label_export' => 'Server Timezone',
436 436
 				'result' => $server_timezone,
437 437
 				'result_export' => $server_timezone_export,
438 438
 			),
439 439
 			'display_errors'      => array(
440 440
 				'label'  => 'Display Errors',
441
-				'result' => ( ini_get( 'display_errors' ) ) ? __( 'Yes', 'google-calendar-events' ) . ' (' . ini_get( 'display_errors' ) . ')' : '-',
442
-				'result_export' => ( ini_get( 'display_errors' ) ) ? 'Yes' : 'No',
441
+				'result' => (ini_get('display_errors')) ? __('Yes', 'google-calendar-events').' ('.ini_get('display_errors').')' : '-',
442
+				'result_export' => (ini_get('display_errors')) ? 'Yes' : 'No',
443 443
 			),
444 444
 			'php_safe_mode'       => array(
445 445
 				'label'  => 'Safe Mode',
446
-				'result' => ( ini_get( 'safe_mode' ) ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
447
-				'result_export' => ( ini_get( 'safe_mode' ) ) ? 'Yes' : 'No',
446
+				'result' => (ini_get('safe_mode')) ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
447
+				'result_export' => (ini_get('safe_mode')) ? 'Yes' : 'No',
448 448
 			),
449 449
 			'php_memory_limit'    => array(
450 450
 				'label'  => 'Memory Limit',
@@ -468,23 +468,23 @@  discard block
 block discarded – undo
468 468
 			),
469 469
 			'fsockopen'           => array(
470 470
 				'label'  => 'fsockopen',
471
-				'result' => function_exists( 'fsockopen' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
472
-				'result_export' => function_exists( 'fsockopen' ) ? 'Yes' : 'No',
471
+				'result' => function_exists('fsockopen') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
472
+				'result_export' => function_exists('fsockopen') ? 'Yes' : 'No',
473 473
 			),
474 474
 			'curl_init'           => array(
475 475
 				'label'  => 'cURL',
476
-				'result' => function_exists( 'curl_init' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
477
-				'result_export' => function_exists( 'curl_init' ) ? 'Yes' : 'No',
476
+				'result' => function_exists('curl_init') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
477
+				'result_export' => function_exists('curl_init') ? 'Yes' : 'No',
478 478
 			),
479 479
 			'soap'                => array(
480 480
 				'label'  => 'SOAP',
481
-				'result' => class_exists( 'SoapClient' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
482
-				'result_export' => class_exists( 'SoapClient' ) ? 'Yes' : 'No',
481
+				'result' => class_exists('SoapClient') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
482
+				'result_export' => class_exists('SoapClient') ? 'Yes' : 'No',
483 483
 			),
484 484
 			'suhosin'             => array(
485 485
 				'label'  => 'SUHOSIN',
486
-				'result' => extension_loaded( 'suhosin' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
487
-				'result_export' => extension_loaded( 'suhosin' ) ? 'Yes' : 'No',
486
+				'result' => extension_loaded('suhosin') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
487
+				'result_export' => extension_loaded('suhosin') ? 'Yes' : 'No',
488 488
 			),
489 489
 			'wp_remote_post'      => array(
490 490
 				'label'  => 'WP Remote POST',
@@ -506,26 +506,26 @@  discard block
 block discarded – undo
506 506
 		$user_client = new \Browser();
507 507
 
508 508
 		$browser  = '<dl>';
509
-		$browser .= '<dt>' . __( 'Name:', 'google-calendar-events' ) .         '</dt>';
510
-		$browser .= '<dd>' . $user_client->getBrowser() .   '</dd>';
511
-		$browser .= '<dt>' . __( 'Version:', 'google-calendar-events' ) .      '</dt>';
512
-		$browser .= '<dd>' . $user_client->getVersion() .   '</dd>';
513
-		$browser .= '<dt>' . __( 'User Agent:', 'google-calendar-events' ) .   '</dt>';
514
-		$browser .= '<dd>' . $user_client->getUserAgent() . '</dd>';
515
-		$browser .= '<dt>' . __( 'Platform:', 'google-calendar-events' ) .     '</dt>';
516
-		$browser .= '<dd>' . $user_client->getPlatform() .  '</dd>';
509
+		$browser .= '<dt>'.__('Name:', 'google-calendar-events').'</dt>';
510
+		$browser .= '<dd>'.$user_client->getBrowser().'</dd>';
511
+		$browser .= '<dt>'.__('Version:', 'google-calendar-events').'</dt>';
512
+		$browser .= '<dd>'.$user_client->getVersion().'</dd>';
513
+		$browser .= '<dt>'.__('User Agent:', 'google-calendar-events').'</dt>';
514
+		$browser .= '<dd>'.$user_client->getUserAgent().'</dd>';
515
+		$browser .= '<dt>'.__('Platform:', 'google-calendar-events').'</dt>';
516
+		$browser .= '<dd>'.$user_client->getPlatform().'</dd>';
517 517
 		$browser .= '</dl>';
518 518
 
519
-		$browser_export = $user_client->getBrowser() . ' ' . $user_client->getVersion() . ' (' . $user_client->getPlatform() . ')';
519
+		$browser_export = $user_client->getBrowser().' '.$user_client->getVersion().' ('.$user_client->getPlatform().')';
520 520
 
521 521
 		$sections['client'] = array(
522 522
 			'user_ip' => array(
523
-				'label'  => __( 'IP Address', 'google-calendar-events' ),
523
+				'label'  => __('IP Address', 'google-calendar-events'),
524 524
 				'label_export' => 'IP Address',
525 525
 				'result' => $_SERVER['SERVER_ADDR'],
526 526
 			),
527 527
 			'browser' => array(
528
-				'label'  => __( 'Browser', 'google-calendar-events' ),
528
+				'label'  => __('Browser', 'google-calendar-events'),
529 529
 				'result' => $browser,
530 530
 				'result_export' => $browser_export,
531 531
 			)
@@ -536,12 +536,12 @@  discard block
 block discarded – undo
536 536
 		 * ============
537 537
 		 */
538 538
 
539
-		$panels   = apply_filters( 'simcal_system_status_report_panels', $panels );
540
-		$sections = apply_filters( 'simcal_system_status_report_sections', $sections );
539
+		$panels   = apply_filters('simcal_system_status_report_panels', $panels);
540
+		$sections = apply_filters('simcal_system_status_report_sections', $sections);
541 541
 
542
-		foreach ( $panels as $panel => $v ) :
542
+		foreach ($panels as $panel => $v) :
543 543
 
544
-			if ( isset( $sections[ $panel ] ) ) :
544
+			if (isset($sections[$panel])) :
545 545
 
546 546
 				?>
547 547
 				<table class="widefat simcal-system-status-report-panel">
@@ -551,15 +551,15 @@  discard block
 block discarded – undo
551 551
 						</tr>
552 552
 					</thead>
553 553
 					<tbody>
554
-						<?php foreach ( $sections[ $panel ] as $row => $cell ) : ?>
554
+						<?php foreach ($sections[$panel] as $row => $cell) : ?>
555 555
 							<tr>
556 556
 								<?php
557
-								$label_export  = isset( $cell['label_export']  ) ? $cell['label_export']  : $cell['label'];
558
-								$result_export = isset( $cell['result_export'] ) ? $cell['result_export'] : $cell['result'];
557
+								$label_export  = isset($cell['label_export']) ? $cell['label_export'] : $cell['label'];
558
+								$result_export = isset($cell['result_export']) ? $cell['result_export'] : $cell['result'];
559 559
 								?>
560
-								<td class="tooltip"><?php echo isset( $cell['tooltip'] ) ? ' <i class="simcal-icon-help simcal-help-tip" data-tip="' . $cell['tooltip'] . '"></i> ' : ''; ?></td>
561
-								<td class="label" data-export="<?php echo trim( $label_export ); ?>"><?php echo $cell['label']; ?></td>
562
-								<td class="result" data-export="<?php echo trim( $result_export ); ?>"><?php echo $cell['result']; ?></td>
560
+								<td class="tooltip"><?php echo isset($cell['tooltip']) ? ' <i class="simcal-icon-help simcal-help-tip" data-tip="'.$cell['tooltip'].'"></i> ' : ''; ?></td>
561
+								<td class="label" data-export="<?php echo trim($label_export); ?>"><?php echo $cell['label']; ?></td>
562
+								<td class="result" data-export="<?php echo trim($result_export); ?>"><?php echo $cell['result']; ?></td>
563 563
 							</tr>
564 564
 						<?php endforeach; ?>
565 565
 					</tbody>
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 			jQuery( '#simcal-system-status-report-download' ).on( 'click', function() {
638 638
 				var file = new Blob( [ report ], { type: 'text/plain' } );
639 639
 				jQuery( this ).attr( 'href', URL.createObjectURL( file ) );
640
-				jQuery( this ).attr( 'download', '<?php echo sanitize_title( str_replace( array( 'http://', 'https://' ), '', get_bloginfo( 'url' ) ) . '-system-report-' . date( 'Y-m-d', time() ) ); ?>' );
640
+				jQuery( this ).attr( 'download', '<?php echo sanitize_title(str_replace(array('http://', 'https://'), '', get_bloginfo('url')).'-system-report-'.date('Y-m-d', time())); ?>' );
641 641
 			} );
642 642
 
643 643
 		</script>
@@ -657,13 +657,13 @@  discard block
 block discarded – undo
657 657
 	 *
658 658
 	 * @return int|double|string
659 659
 	 */
660
-	private function let_to_num( $size ) {
660
+	private function let_to_num($size) {
661 661
 
662
-		$l   = substr( $size, -1 );
663
-		$ret = substr( $size, 0, -1 );
662
+		$l   = substr($size, -1);
663
+		$ret = substr($size, 0, -1);
664 664
 
665 665
 		// Note: do not insert break or default in this switch loop.
666
-		switch ( strtoupper( $l ) ) {
666
+		switch (strtoupper($l)) {
667 667
 			case 'P':
668 668
 				$ret *= 1024;
669 669
 				// no break
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 				$ret *= 1024;
678 678
 				// no break
679 679
 			case 'K':
680
-				$ret *= 1024;;
680
+				$ret *= 1024; ;
681 681
 				// no break
682 682
 		}
683 683
 
Please login to merge, or discard this patch.