GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#208)
by Dan
21:20
created
includes/EDD_SL_Plugin_Updater.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 	 * @uses api_request()
65 65
 	 *
66 66
 	 * @param array   $_transient_data Update array build by WordPress.
67
-	 * @return array Modified update array with custom plugin data.
67
+	 * @return stdClass Modified update array with custom plugin data.
68 68
 	 */
69 69
 	function check_update( $_transient_data ) {
70 70
 
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 //set_site_transient( 'update_plugins', null );
5 5
 
6 6
 // Exit if accessed directly
7
-if ( ! defined( 'ABSPATH' ) ) exit;
7
+if ( ! defined( 'ABSPATH' )) exit;
8 8
 
9 9
 /**
10 10
  * Allows plugins to use their own update API.
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 		$this->name        = plugin_basename( $_plugin_file );
41 41
 		$this->slug        = basename( $_plugin_file, '.php' );
42 42
 		$this->version     = $_api_data['version'];
43
-		$this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
43
+		$this->wp_override = isset($_api_data['wp_override']) ? (bool) $_api_data['wp_override'] : false;
44 44
 
45
-		$edd_plugin_data[ $this->slug ] = $this->api_data;
45
+		$edd_plugin_data[$this->slug] = $this->api_data;
46 46
 
47 47
 		// Set up hooks.
48 48
 		$this->init();
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 
61 61
 		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
62 62
 		add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
63
-		remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10, 2 );
64
-		add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
63
+		remove_action( 'after_plugin_row_'.$this->name, 'wp_plugin_update_row', 10, 2 );
64
+		add_action( 'after_plugin_row_'.$this->name, array( $this, 'show_update_notification' ), 10, 2 );
65 65
 		add_action( 'admin_init', array( $this, 'show_changelog' ) );
66 66
 
67 67
 	}
@@ -83,30 +83,30 @@  discard block
 block discarded – undo
83 83
 
84 84
 		global $pagenow;
85 85
 
86
-		if ( ! is_object( $_transient_data ) ) {
86
+		if ( ! is_object( $_transient_data )) {
87 87
 			$_transient_data = new stdClass;
88 88
 		}
89 89
 
90
-		if ( 'plugins.php' == $pagenow && is_multisite() ) {
90
+		if ('plugins.php' == $pagenow && is_multisite()) {
91 91
 			return $_transient_data;
92 92
 		}
93 93
 
94
-		if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
94
+		if ( ! empty($_transient_data->response) && ! empty($_transient_data->response[$this->name]) && false === $this->wp_override) {
95 95
 			return $_transient_data;
96 96
 		}
97 97
 
98 98
 		$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
99 99
 
100
-		if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
100
+		if (false !== $version_info && is_object( $version_info ) && isset($version_info->new_version)) {
101 101
 
102
-			if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
102
+			if (version_compare( $this->version, $version_info->new_version, '<' )) {
103 103
 
104
-				$_transient_data->response[ $this->name ] = $version_info;
104
+				$_transient_data->response[$this->name] = $version_info;
105 105
 
106 106
 			}
107 107
 
108 108
 			$_transient_data->last_checked           = time();
109
-			$_transient_data->checked[ $this->name ] = $this->version;
109
+			$_transient_data->checked[$this->name] = $this->version;
110 110
 
111 111
 		}
112 112
 
@@ -121,15 +121,15 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function show_update_notification( $file, $plugin ) {
123 123
 
124
-		if( ! current_user_can( 'update_plugins' ) ) {
124
+		if ( ! current_user_can( 'update_plugins' )) {
125 125
 			return;
126 126
 		}
127 127
 
128
-		if( ! is_multisite() ) {
128
+		if ( ! is_multisite()) {
129 129
 			return;
130 130
 		}
131 131
 
132
-		if ( $this->name != $file ) {
132
+		if ($this->name != $file) {
133 133
 			return;
134 134
 		}
135 135
 
@@ -140,55 +140,55 @@  discard block
 block discarded – undo
140 140
 
141 141
 		$update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
142 142
 
143
-		if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
143
+		if (empty($update_cache->response) || empty($update_cache->response[$this->name])) {
144 144
 
145
-			$cache_key    = md5( 'edd_plugin_' . sanitize_key( $this->name ) . '_version_info' );
145
+			$cache_key    = md5( 'edd_plugin_'.sanitize_key( $this->name ).'_version_info' );
146 146
 			$version_info = get_transient( $cache_key );
147 147
 
148
-			if( false === $version_info ) {
148
+			if (false === $version_info) {
149 149
 
150 150
 				$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
151 151
 
152 152
 				set_transient( $cache_key, $version_info, 3600 );
153 153
 			}
154 154
 
155
-			if( ! is_object( $version_info ) ) {
155
+			if ( ! is_object( $version_info )) {
156 156
 				return;
157 157
 			}
158 158
 
159
-			if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
159
+			if (version_compare( $this->version, $version_info->new_version, '<' )) {
160 160
 
161
-				$update_cache->response[ $this->name ] = $version_info;
161
+				$update_cache->response[$this->name] = $version_info;
162 162
 
163 163
 			}
164 164
 
165 165
 			$update_cache->last_checked = time();
166
-			$update_cache->checked[ $this->name ] = $this->version;
166
+			$update_cache->checked[$this->name] = $this->version;
167 167
 
168 168
 			set_site_transient( 'update_plugins', $update_cache );
169 169
 
170 170
 		} else {
171 171
 
172
-			$version_info = $update_cache->response[ $this->name ];
172
+			$version_info = $update_cache->response[$this->name];
173 173
 
174 174
 		}
175 175
 
176 176
 		// Restore our filter
177 177
 		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
178 178
 
179
-		if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
179
+		if ( ! empty($update_cache->response[$this->name]) && version_compare( $this->version, $version_info->new_version, '<' )) {
180 180
 
181 181
 			// build a plugin list row, with update notification
182 182
 			$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
183
-			echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
183
+			echo '<tr class="plugin-update-tr"><td colspan="'.$wp_list_table->get_column_count().'" class="plugin-update colspanchange"><div class="update-message">';
184 184
 
185
-			$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
185
+			$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin='.$this->name.'&slug='.$this->slug.'&TB_iframe=true&width=772&height=911' );
186 186
 
187
-			if ( empty( $version_info->download_link ) ) {
187
+			if (empty($version_info->download_link)) {
188 188
 				printf(
189 189
 					__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ),
190 190
 					esc_html( $version_info->name ),
191
-					'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
191
+					'<a target="_blank" class="thickbox" href="'.esc_url( $changelog_link ).'">',
192 192
 					esc_html( $version_info->new_version ),
193 193
 					'</a>'
194 194
 				);
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
 				printf(
197 197
 					__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads' ),
198 198
 					esc_html( $version_info->name ),
199
-					'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
199
+					'<a target="_blank" class="thickbox" href="'.esc_url( $changelog_link ).'">',
200 200
 					esc_html( $version_info->new_version ),
201 201
 					'</a>',
202
-					'<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
202
+					'<a href="'.esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ).$this->name, 'upgrade-plugin_'.$this->name ) ).'">',
203 203
 					'</a>'
204 204
 				);
205 205
 			}
@@ -224,13 +224,13 @@  discard block
 block discarded – undo
224 224
 	public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
225 225
 
226 226
 
227
-		if ( $_action != 'plugin_information' ) {
227
+		if ($_action != 'plugin_information') {
228 228
 
229 229
 			return $_data;
230 230
 
231 231
 		}
232 232
 
233
-		if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
233
+		if ( ! isset($_args->slug) || ($_args->slug != $this->slug)) {
234 234
 
235 235
 			return $_data;
236 236
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
 		$api_response = $this->api_request( 'plugin_information', $to_send );
249 249
 
250
-		if ( false !== $api_response ) {
250
+		if (false !== $api_response) {
251 251
 			$_data = $api_response;
252 252
 		}
253 253
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	 */
265 265
 	public function http_request_args( $args, $url ) {
266 266
 		// If it is an https request and we are performing a package download, disable ssl verification
267
-		if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
267
+		if (strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' )) {
268 268
 			$args['sslverify'] = false;
269 269
 		}
270 270
 		return $args;
@@ -287,19 +287,19 @@  discard block
 block discarded – undo
287 287
 
288 288
 		$data = array_merge( $this->api_data, $_data );
289 289
 
290
-		if ( $data['slug'] != $this->slug ) {
290
+		if ($data['slug'] != $this->slug) {
291 291
 			return;
292 292
 		}
293 293
 
294
-		if( $this->api_url == trailingslashit (home_url() ) ) {
294
+		if ($this->api_url == trailingslashit( home_url() )) {
295 295
 			return false; // Don't allow a plugin to ping itself
296 296
 		}
297 297
 
298 298
 		$api_params = array(
299 299
 			'edd_action' => 'get_version',
300
-			'license'    => ! empty( $data['license'] ) ? $data['license'] : '',
301
-			'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
302
-			'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
300
+			'license'    => ! empty($data['license']) ? $data['license'] : '',
301
+			'item_name'  => isset($data['item_name']) ? $data['item_name'] : false,
302
+			'item_id'    => isset($data['item_id']) ? $data['item_id'] : false,
303 303
 			'slug'       => $data['slug'],
304 304
 			'author'     => $data['author'],
305 305
 			'url'        => home_url()
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
 
308 308
 		$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
309 309
 
310
-		if ( ! is_wp_error( $request ) ) {
310
+		if ( ! is_wp_error( $request )) {
311 311
 			$request = json_decode( wp_remote_retrieve_body( $request ) );
312 312
 		}
313 313
 
314
-		if ( $request && isset( $request->sections ) ) {
314
+		if ($request && isset($request->sections)) {
315 315
 			$request->sections = maybe_unserialize( $request->sections );
316 316
 		} else {
317 317
 			$request = false;
@@ -324,32 +324,32 @@  discard block
 block discarded – undo
324 324
 
325 325
 		global $edd_plugin_data;
326 326
 
327
-		if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
327
+		if (empty($_REQUEST['edd_sl_action']) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action']) {
328 328
 			return;
329 329
 		}
330 330
 
331
-		if( empty( $_REQUEST['plugin'] ) ) {
331
+		if (empty($_REQUEST['plugin'])) {
332 332
 			return;
333 333
 		}
334 334
 
335
-		if( empty( $_REQUEST['slug'] ) ) {
335
+		if (empty($_REQUEST['slug'])) {
336 336
 			return;
337 337
 		}
338 338
 
339
-		if( ! current_user_can( 'update_plugins' ) ) {
339
+		if ( ! current_user_can( 'update_plugins' )) {
340 340
 			wp_die( __( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
341 341
 		}
342 342
 
343
-		$data         = $edd_plugin_data[ $_REQUEST['slug'] ];
344
-		$cache_key    = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_version_info' );
343
+		$data         = $edd_plugin_data[$_REQUEST['slug']];
344
+		$cache_key    = md5( 'edd_plugin_'.sanitize_key( $_REQUEST['plugin'] ).'_version_info' );
345 345
 		$version_info = get_transient( $cache_key );
346 346
 
347
-		if( false === $version_info ) {
347
+		if (false === $version_info) {
348 348
 
349 349
 			$api_params = array(
350 350
 				'edd_action' => 'get_version',
351
-				'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
352
-				'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
351
+				'item_name'  => isset($data['item_name']) ? $data['item_name'] : false,
352
+				'item_id'    => isset($data['item_id']) ? $data['item_id'] : false,
353 353
 				'slug'       => $_REQUEST['slug'],
354 354
 				'author'     => $data['author'],
355 355
 				'url'        => home_url()
@@ -357,11 +357,11 @@  discard block
 block discarded – undo
357 357
 
358 358
 			$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
359 359
 
360
-			if ( ! is_wp_error( $request ) ) {
360
+			if ( ! is_wp_error( $request )) {
361 361
 				$version_info = json_decode( wp_remote_retrieve_body( $request ) );
362 362
 			}
363 363
 
364
-			if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
364
+			if ( ! empty($version_info) && isset($version_info->sections)) {
365 365
 				$version_info->sections = maybe_unserialize( $version_info->sections );
366 366
 			} else {
367 367
 				$version_info = false;
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 
372 372
 		}
373 373
 
374
-		if( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) {
375
-			echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
374
+		if ( ! empty($version_info) && isset($version_info->sections['changelog'])) {
375
+			echo '<div style="background:#fff;padding:10px;">'.$version_info->sections['changelog'].'</div>';
376 376
 		}
377 377
 
378 378
 		exit;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,9 @@
 block discarded – undo
4 4
 //set_site_transient( 'update_plugins', null );
5 5
 
6 6
 // Exit if accessed directly
7
-if ( ! defined( 'ABSPATH' ) ) exit;
7
+if ( ! defined( 'ABSPATH' ) ) {
8
+	exit;
9
+}
8 10
 
9 11
 /**
10 12
  * Allows plugins to use their own update API.
Please login to merge, or discard this patch.
includes/general-functions.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 /**
9 9
  * Checks to see if a session is set and it's appropriate to start one, and starts it if necessary
10
- * @return void
10
+ * @return boolean
11 11
  */
12 12
 function ppp_maybe_start_session() {
13 13
 	$ret = false;
@@ -73,6 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 /**
75 75
  * Strips slashes and html_entities_decode for sending to the networks.
76
+ * @param string $string
76 77
  */
77 78
 function ppp_entities_and_slashes( $string ) {
78 79
 	return stripslashes( html_entity_decode( $string, ENT_COMPAT, 'UTF-8' ) );
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined( 'ABSPATH' )) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 function ppp_maybe_start_session() {
13 13
 	$ret = false;
14
-	if ( ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) && !isset( $_SESSION ) && !defined( 'DOING_AJAX' ) ) {
14
+	if ((is_admin() || (defined( 'DOING_CRON' ) && DOING_CRON)) && ! isset($_SESSION) && ! defined( 'DOING_AJAX' )) {
15 15
 		$ret = session_start();
16 16
 	}
17 17
 
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	global $ppp_share_settings;
27 27
 	$result = false;
28 28
 
29
-	if ( isset( $ppp_share_settings['analytics'] ) && $ppp_share_settings['analytics'] !== 'none' ) {
30
-		$result =  true;
29
+	if (isset($ppp_share_settings['analytics']) && $ppp_share_settings['analytics'] !== 'none') {
30
+		$result = true;
31 31
 	}
32 32
 
33 33
 	return apply_filters( 'ppp_is_link_tracking_enabled', $result );
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 function ppp_is_shortener_enabled() {
69 69
 	global $ppp_share_settings;
70 70
 
71
-	return ( isset( $ppp_share_settings['shortener'] ) && !empty( $ppp_share_settings['shortener'] ) && $ppp_share_settings != '-1' );
71
+	return (isset($ppp_share_settings['shortener']) && ! empty($ppp_share_settings['shortener']) && $ppp_share_settings != '-1');
72 72
 }
73 73
 
74 74
 /**
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 	$post_types = get_post_types( $post_type_args, NULL, 'and' );
102 102
 
103 103
 	$unsupported_post_types = array( 'wp_log', 'attachment' );
104
-	foreach ( $unsupported_post_types as $unsupported_post_type ) {
105
-		if ( array_key_exists( $unsupported_post_type, $post_types ) ) {
106
-			unset( $post_types[ $unsupported_post_type ] );
104
+	foreach ($unsupported_post_types as $unsupported_post_type) {
105
+		if (array_key_exists( $unsupported_post_type, $post_types )) {
106
+			unset($post_types[$unsupported_post_type]);
107 107
 		}
108 108
 	}
109 109
 
@@ -131,16 +131,16 @@  discard block
 block discarded – undo
131 131
 function ppp_should_save( $post_id, $post ) {
132 132
 	$ret = true;
133 133
 
134
-	if ( empty( $_POST ) ) {
134
+	if (empty($_POST)) {
135 135
 		$ret = false;
136 136
 	}
137 137
 
138
-	if ( wp_is_post_revision( $post_id ) ) {
138
+	if (wp_is_post_revision( $post_id )) {
139 139
 		$ret = false;
140 140
 	}
141 141
 
142 142
 	global $ppp_options;
143
-	if ( !isset( $ppp_options['post_types'] ) || !is_array( $ppp_options['post_types'] ) || !array_key_exists( $post->post_type, $ppp_options['post_types'] ) ) {
143
+	if ( ! isset($ppp_options['post_types']) || ! is_array( $ppp_options['post_types'] ) || ! array_key_exists( $post->post_type, $ppp_options['post_types'] )) {
144 144
 		$ret = false;
145 145
 	}
146 146
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 function ppp_set_uploads_dir() {
157 157
 	$upload_path = ppp_get_upload_path();
158 158
 
159
-	if ( false === get_transient( 'ppp_check_protection_files' ) ) {
159
+	if (false === get_transient( 'ppp_check_protection_files' )) {
160 160
 
161 161
 		// Make sure the /ppp folder is created
162 162
 		wp_mkdir_p( $upload_path );
@@ -165,22 +165,22 @@  discard block
 block discarded – undo
165 165
 		$rules  = "Options -Indexes\n";
166 166
 		$rules .= "deny from all\n";
167 167
 
168
-		$htaccess_exists = file_exists( $upload_path . '/.htaccess' );
168
+		$htaccess_exists = file_exists( $upload_path.'/.htaccess' );
169 169
 
170
-		if ( $htaccess_exists ) {
171
-			$contents = @file_get_contents( $upload_path . '/.htaccess' );
172
-			if ( $contents !== $rules || ! $contents ) {
170
+		if ($htaccess_exists) {
171
+			$contents = @file_get_contents( $upload_path.'/.htaccess' );
172
+			if ($contents !== $rules || ! $contents) {
173 173
 				// Update the .htaccess rules if they don't match
174
-				@file_put_contents( $upload_path . '/.htaccess', $rules );
174
+				@file_put_contents( $upload_path.'/.htaccess', $rules );
175 175
 			}
176
-		} elseif( wp_is_writable( $upload_path ) ) {
176
+		} elseif (wp_is_writable( $upload_path )) {
177 177
 			// Create the file if it doesn't exist
178
-			@file_put_contents( $upload_path . '/.htaccess', $rules );
178
+			@file_put_contents( $upload_path.'/.htaccess', $rules );
179 179
 		}
180 180
 
181 181
 		// Top level blank index.php
182
-		if ( ! file_exists( $upload_path . '/index.php' ) && wp_is_writable( $upload_path ) ) {
183
-			@file_put_contents( $upload_path . '/index.php', '<?php' . PHP_EOL . '// Silence is golden.' );
182
+		if ( ! file_exists( $upload_path.'/index.php' ) && wp_is_writable( $upload_path )) {
183
+			@file_put_contents( $upload_path.'/index.php', '<?php'.PHP_EOL.'// Silence is golden.' );
184 184
 		}
185 185
 
186 186
 		// Check for the files once per day
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
  */
198 198
 function ppp_get_upload_path() {
199 199
 	$wp_upload_dir = wp_upload_dir();
200
-	return $wp_upload_dir['basedir'] . '/ppp';
200
+	return $wp_upload_dir['basedir'].'/ppp';
201 201
 }
202 202
 
203 203
 /**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
 	$completed_upgrades = get_option( 'ppp_completed_upgrades' );
212 212
 
213
-	if ( false === $completed_upgrades ) {
213
+	if (false === $completed_upgrades) {
214 214
 		$completed_upgrades = array();
215 215
 	}
216 216
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
  */
228 228
 function ppp_has_upgrade_completed( $upgrade_action = '' ) {
229 229
 
230
-	if ( empty( $upgrade_action ) ) {
230
+	if (empty($upgrade_action)) {
231 231
 		return false;
232 232
 	}
233 233
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
  */
247 247
 function ppp_set_upgrade_complete( $upgrade_action = '' ) {
248 248
 
249
-	if ( empty( $upgrade_action ) ) {
249
+	if (empty($upgrade_action)) {
250 250
 		return false;
251 251
 	}
252 252
 
Please login to merge, or discard this patch.
includes/twitter-functions.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * Register Twitter as a servcie
24 24
  * @param  array $services The registered services
25
- * @return array           With Twitter added
25
+ * @return string[]           With Twitter added
26 26
  */
27 27
 function ppp_tw_register_service( $services = array() ) {
28 28
 	$services[] = 'tw';
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 /**
241 241
  * Register the Twitter connection area for the Social Media Accounts section
242 242
  * @param  array $content The existing content tokens
243
- * @return array          The content tokens with Twitter added
243
+ * @return string[]          The content tokens with Twitter added
244 244
  */
245 245
 function ppp_tw_register_admin_social_content( $content ) {
246 246
 	$content[] = 'tw';
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -370,9 +370,12 @@
 block discarded – undo
370 370
 
371 371
 									<?php endforeach; ?>
372 372
 
373
-								<?php else: ?>
373
+								<?php else {
374
+	: ?>
374 375
 
375
-									<?php ppp_render_tweet_row( 1, array( 'date' => '', 'time' => '', 'text' => '', 'image' => '', 'attachment_id' => '' ), $post->ID, 1 ); ?>
376
+									<?php ppp_render_tweet_row( 1, array( 'date' => '', 'time' => '', 'text' => '', 'image' => '', 'attachment_id' => '' ), $post->ID, 1 );
377
+}
378
+?>
376 379
 
377 380
 								<?php endif; ?>
378 381
 
Please login to merge, or discard this patch.
Spacing   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined( 'ABSPATH' )) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 function ppp_twitter_enabled() {
13 13
 	global $ppp_social_settings;
14 14
 
15
-	if ( isset( $ppp_social_settings['twitter'] ) && !empty( $ppp_social_settings['twitter'] ) ) {
15
+	if (isset($ppp_social_settings['twitter']) && ! empty($ppp_social_settings['twitter'])) {
16 16
 		return true;
17 17
 	}
18 18
 
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function ppp_tw_account_list_avatar( $string = '' ) {
52 52
 
53
-	if ( ppp_twitter_enabled() ) {
53
+	if (ppp_twitter_enabled()) {
54 54
 		global $ppp_social_settings;
55 55
 		$avatar_url = $ppp_social_settings['twitter']['user']->profile_image_url_https;
56
-		$string .= '<img class="ppp-social-icon" src="' . $avatar_url . '" />';
56
+		$string .= '<img class="ppp-social-icon" src="'.$avatar_url.'" />';
57 57
 	}
58 58
 
59 59
 	return $string;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function ppp_tw_account_list_name( $string = '' ) {
69 69
 
70
-	if ( ppp_twitter_enabled() ) {
70
+	if (ppp_twitter_enabled()) {
71 71
 		global $ppp_social_settings;
72 72
 		$string .= $ppp_social_settings['twitter']['user']->name;
73 73
 	}
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
  */
84 84
 function ppp_tw_account_list_actions( $string = '' ) {
85 85
 
86
-	if ( ! ppp_twitter_enabled() ) {
86
+	if ( ! ppp_twitter_enabled()) {
87 87
 		global $ppp_twitter_oauth, $ppp_social_settings;
88 88
 		$tw_auth = $ppp_twitter_oauth->ppp_verify_twitter_credentials();
89 89
 		$tw_authurl = $ppp_twitter_oauth->ppp_get_twitter_auth_url();
90 90
 
91
-		$string .= '<a href="' . $tw_authurl . '"><img src="' . PPP_URL . '/includes/images/sign-in-with-twitter-gray.png" /></a>';
91
+		$string .= '<a href="'.$tw_authurl.'"><img src="'.PPP_URL.'/includes/images/sign-in-with-twitter-gray.png" /></a>';
92 92
 	} else {
93
-		$string .= '<a class="button-primary" href="' . admin_url( 'admin.php?page=ppp-social-settings&ppp_social_disconnect=true&ppp_network=twitter' ) . '" >' . __( 'Disconnect from Twitter', 'ppp-txt' ) . '</a>&nbsp;';
94
-		$string .= '<a class="button-secondary" href="https://twitter.com/settings/applications" target="blank">' . __( 'Revoke Access via Twitter', 'ppp-txt' ) . '</a>';
93
+		$string .= '<a class="button-primary" href="'.admin_url( 'admin.php?page=ppp-social-settings&ppp_social_disconnect=true&ppp_network=twitter' ).'" >'.__( 'Disconnect from Twitter', 'ppp-txt' ).'</a>&nbsp;';
94
+		$string .= '<a class="button-secondary" href="https://twitter.com/settings/applications" target="blank">'.__( 'Revoke Access via Twitter', 'ppp-txt' ).'</a>';
95 95
 	}
96 96
 
97 97
 	return $string;
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
  * @return void
104 104
  */
105 105
 function ppp_capture_twitter_oauth() {
106
-	if ( isset( $_REQUEST['oauth_verifier'] ) && isset( $_REQUEST['oauth_token'] ) ) {
106
+	if (isset($_REQUEST['oauth_verifier']) && isset($_REQUEST['oauth_token'])) {
107 107
 		$current_screen = get_current_screen();
108
-		if ( 'user-edit' === $current_screen->base ) {
109
-			$user_id = ! empty( $_GET['user_id'] ) && is_numeric( $_GET['user_id'] ) ? $_GET['user_id'] : false;
108
+		if ('user-edit' === $current_screen->base) {
109
+			$user_id = ! empty($_GET['user_id']) && is_numeric( $_GET['user_id'] ) ? $_GET['user_id'] : false;
110 110
 			$twitter = new PPP_Twitter_User( $user_id );
111 111
 			$twitter->init();
112
-			$redirect = admin_url( 'user-edit.php?updated=1&user_id=' . $user_id );
112
+			$redirect = admin_url( 'user-edit.php?updated=1&user_id='.$user_id );
113 113
 		} else {
114 114
 			global $ppp_twitter_oauth;
115 115
 			$ppp_twitter_oauth->ppp_initialize_twitter();
@@ -127,17 +127,17 @@  discard block
 block discarded – undo
127 127
  * @return void
128 128
  */
129 129
 function ppp_disconnect_twitter() {
130
-	if ( ! empty( $_GET['user_id'] ) ) {
130
+	if ( ! empty($_GET['user_id'])) {
131 131
 		$user_id = (int) sanitize_text_field( $_GET['user_id'] );
132
-		if ( $user_id !== get_current_user_id() || ! current_user_can( 'manage_options' ) ) {
132
+		if ($user_id !== get_current_user_id() || ! current_user_can( 'manage_options' )) {
133 133
 			wp_die( __( 'Unable to disconnect Twitter account', 'ppp-txt' ) );
134 134
 		}
135 135
 		delete_user_meta( $user_id, '_ppp_twitter_data' );
136 136
 	} else {
137 137
 		global $ppp_social_settings;
138 138
 		$ppp_social_settings = get_option( 'ppp_social_settings' );
139
-		if ( isset( $ppp_social_settings['twitter'] ) ) {
140
-			unset( $ppp_social_settings['twitter'] );
139
+		if (isset($ppp_social_settings['twitter'])) {
140
+			unset($ppp_social_settings['twitter']);
141 141
 			update_option( 'ppp_social_settings', $ppp_social_settings );
142 142
 		}
143 143
 	}
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	global $ppp_options, $wp_logs, $wp_filter;
169 169
 
170 170
 	$post_meta     = get_post_meta( $post_id, '_ppp_tweets', true );
171
-	$this_share    = $post_meta[ $index ];
172
-	$attachment_id = isset( $this_share['attachment_id'] ) ? $this_share['attachment_id'] : false;
171
+	$this_share    = $post_meta[$index];
172
+	$attachment_id = isset($this_share['attachment_id']) ? $this_share['attachment_id'] : false;
173 173
 
174 174
 	$share_message = ppp_tw_build_share_message( $post_id, $name );
175 175
 
176
-	if ( empty( $attachment_id ) && ! empty( $this_share['image'] ) ) {
176
+	if (empty($attachment_id) && ! empty($this_share['image'])) {
177 177
 		$media = $this_share['image'];
178 178
 	} else {
179 179
 		$use_media = ppp_tw_use_media( $post_id, $index );
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 
200 200
 	update_post_meta( $log_entry, '_ppp_share_status', $status );
201 201
 
202
-	if ( ! empty( $status->id_str ) ) {
202
+	if ( ! empty($status->id_str)) {
203 203
 		$post      = get_post( $post_id );
204 204
 		$author_id = $post->post_author;
205 205
 		$author_rt = get_user_meta( $author_id, '_ppp_share_scheduled', true );
206 206
 
207
-		if ( $author_rt ) {
207
+		if ($author_rt) {
208 208
 			$twitter_user = new PPP_Twitter_User( $author_id );
209 209
 			$twitter_user->retweet( $status->id_str );
210 210
 		}
@@ -224,9 +224,9 @@  discard block
 block discarded – undo
224 224
 function ppp_tw_build_share_message( $post_id, $name, $scheduled = true, $include_link = true ) {
225 225
 	$share_content = ppp_tw_generate_share_content( $post_id, $name );
226 226
 
227
-	if ( $include_link ) {
227
+	if ($include_link) {
228 228
 		$share_link    = ppp_generate_link( $post_id, $name, $scheduled );
229
-		$share_content = $share_content . ' ' . $share_link;
229
+		$share_content = $share_content.' '.$share_link;
230 230
 	}
231 231
 
232 232
 	return apply_filters( 'ppp_tw_build_share_message', $share_content );
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
  */
241 241
 function ppp_tw_generate_share_content( $post_id, $name, $is_scheduled = true ) {
242 242
 	global $ppp_options;
243
-	$default_text = isset( $ppp_options['default_text'] ) ? $ppp_options['default_text'] : '';
243
+	$default_text = isset($ppp_options['default_text']) ? $ppp_options['default_text'] : '';
244 244
 	$ppp_tweets   = get_post_meta( $post_id, '_ppp_tweets', true );
245 245
 
246
-	if ( $is_scheduled && ! empty( $ppp_tweets ) ) {
246
+	if ($is_scheduled && ! empty($ppp_tweets)) {
247 247
 		$ppp_post_override_data = get_post_meta( $post_id, '_ppp_post_override_data', true );
248 248
 		$name_array    = explode( '_', $name );
249 249
 		$index         = $name_array[1];
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
 	}
252 252
 
253 253
 	// If an override was found, use it, otherwise try the default text content
254
-	$share_content = ( isset( $share_content ) && !empty( $share_content ) ) ? $share_content : $default_text;
254
+	$share_content = (isset($share_content) && ! empty($share_content)) ? $share_content : $default_text;
255 255
 
256 256
 	// If the content is still empty, just use the post title
257
-	$share_content = ( isset( $share_content ) && !empty( $share_content ) ) ? $share_content : get_the_title( $post_id );
257
+	$share_content = (isset($share_content) && ! empty($share_content)) ? $share_content : get_the_title( $post_id );
258 258
 
259 259
 	return apply_filters( 'ppp_share_content', $share_content, array( 'post_id' => $post_id ) );
260 260
 }
@@ -266,12 +266,12 @@  discard block
 block discarded – undo
266 266
  * @return bool         Whether or not this tweet should contain a media post
267 267
  */
268 268
 function ppp_tw_use_media( $post_id, $index ) {
269
-	if ( empty( $post_id ) || empty( $index ) ) {
269
+	if (empty($post_id) || empty($index)) {
270 270
 		return false;
271 271
 	}
272 272
 
273 273
 	$share_data = get_post_meta( $post_id, '_ppp_tweets', true );
274
-	$use_media  = ! empty( $share_data[$index]['attachment_id'] ) || ! empty( $share_data[$index]['image'] ) ? true : false;
274
+	$use_media  = ! empty($share_data[$index]['attachment_id']) || ! empty($share_data[$index]['image']) ? true : false;
275 275
 
276 276
 	return $use_media;
277 277
 }
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
  * @return void
283 283
  */
284 284
 function ppp_set_tw_token_constants( $social_tokens ) {
285
-	if ( !empty( $social_tokens ) && property_exists( $social_tokens, 'twitter' ) ) {
285
+	if ( ! empty($social_tokens) && property_exists( $social_tokens, 'twitter' )) {
286 286
 		define( 'PPP_TW_CONSUMER_KEY', $social_tokens->twitter->consumer_token );
287 287
 		define( 'PPP_TW_CONSUMER_SECRET', $social_tokens->twitter->consumer_secret );
288 288
 	}
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
  */
321 321
 function ppp_tw_add_meta_tab( $tabs ) {
322 322
 	global $ppp_social_settings;
323
-	if ( !isset( $ppp_social_settings['twitter'] ) ) {
323
+	if ( ! isset($ppp_social_settings['twitter'])) {
324 324
 		return $tabs;
325 325
 	}
326 326
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
  */
338 338
 function ppp_tw_register_metabox_content( $content ) {
339 339
 	global $ppp_social_settings;
340
-	if ( !isset( $ppp_social_settings['twitter'] ) ) {
340
+	if ( ! isset($ppp_social_settings['twitter'])) {
341 341
 		return $content;
342 342
 	}
343 343
 
@@ -396,16 +396,16 @@  discard block
 block discarded – undo
396 396
 							<tbody>
397 397
 								<?php ppp_render_tweet_share_on_publish_row(); ?>
398 398
 								<?php $tweets = get_post_meta( $post->ID, '_ppp_tweets', true ); ?>
399
-								<?php if ( ! empty( $tweets ) ) : ?>
399
+								<?php if ( ! empty($tweets)) : ?>
400 400
 
401
-									<?php foreach ( $tweets as $key => $value ) :
402
-										$date          = isset( $value['date'] )          ? $value['date']          : '';
403
-										$time          = isset( $value['time'] )          ? $value['time']          : '';
404
-										$text          = isset( $value['text'] )          ? $value['text']          : '';
405
-										$image         = isset( $value['image'] )         ? $value['image']         : '';
406
-										$attachment_id = isset( $value['attachment_id'] ) ? $value['attachment_id'] : '';
401
+									<?php foreach ($tweets as $key => $value) :
402
+										$date          = isset($value['date']) ? $value['date'] : '';
403
+										$time          = isset($value['time']) ? $value['time'] : '';
404
+										$text          = isset($value['text']) ? $value['text'] : '';
405
+										$image         = isset($value['image']) ? $value['image'] : '';
406
+										$attachment_id = isset($value['attachment_id']) ? $value['attachment_id'] : '';
407 407
 
408
-										$args = apply_filters( 'ppp_tweet_row_args', compact( 'date','time','text','image','attachment_id' ), $value );
408
+										$args = apply_filters( 'ppp_tweet_row_args', compact( 'date', 'time', 'text', 'image', 'attachment_id' ), $value );
409 409
 										?>
410 410
 
411 411
 										<?php ppp_render_tweet_row( $key, $args, $post->ID ); ?>
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 									<?php endforeach; ?>
415 415
 
416 416
 									<?php
417
-									if ( ! empty( $has_past_shares ) && count ( $tweets ) == $has_past_shares ) {
417
+									if ( ! empty($has_past_shares) && count( $tweets ) == $has_past_shares) {
418 418
 										$args = array(
419 419
 											'date'          => '',
420 420
 											'time'          => '',
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 								<tr>
438 438
 									<td class="submit" colspan="4" style="float: none; clear:both; background:#fff;">
439 439
 										<a class="button-secondary ppp-add-repeatable" style="margin: 6px 0;"><?php _e( 'Add New Tweet', 'ppp-txt' ); ?></a>
440
-										<?php if ( ! empty( $has_past_shares ) ) : ?>
440
+										<?php if ( ! empty($has_past_shares)) : ?>
441 441
 											<a class="button-secondary ppp-view-all" style="margin: 6px 0;"><?php _e( 'Toggle Past Tweets', 'ppp-txt' ); ?></a>
442 442
 										<?php endif; ?>
443 443
 									</td>
@@ -463,38 +463,38 @@  discard block
 block discarded – undo
463 463
  */
464 464
 function ppp_render_tweet_share_on_publish_row() {
465 465
 	global $post, $ppp_share_settings;
466
-	$default_text = !empty( $ppp_options['default_text'] ) ? $ppp_options['default_text'] : __( 'Social Text', 'ppp-txt' );
466
+	$default_text = ! empty($ppp_options['default_text']) ? $ppp_options['default_text'] : __( 'Social Text', 'ppp-txt' );
467 467
 
468 468
 	$ppp_post_exclude = get_post_meta( $post->ID, '_ppp_post_exclude', true );
469 469
 
470 470
 	$ppp_share_on_publish  = get_post_meta( $post->ID, '_ppp_share_on_publish', true );
471 471
 	$show_share_on_publish = false;
472 472
 
473
-	$share_by_default      = empty( $ppp_share_settings['twitter']['share_on_publish'] ) ? false : true;
473
+	$share_by_default      = empty($ppp_share_settings['twitter']['share_on_publish']) ? false : true;
474 474
 
475
-	if ( $ppp_share_on_publish == '1' || ( $ppp_share_on_publish == '' && $share_by_default ) ) {
475
+	if ($ppp_share_on_publish == '1' || ($ppp_share_on_publish == '' && $share_by_default)) {
476 476
 		$show_share_on_publish = true;
477 477
 	}
478 478
 
479 479
 	$ppp_share_on_publish_text          = get_post_meta( $post->ID, '_ppp_share_on_publish_text', true );
480 480
 	$ppp_share_on_publish_include_image = get_post_meta( $post->ID, '_ppp_share_on_publish_include_image', true );
481 481
 
482
-	$disabled = ( $post->post_status === 'publish' && time() > strtotime( $post->post_date ) ) ? true : false;
482
+	$disabled = ($post->post_status === 'publish' && time() > strtotime( $post->post_date )) ? true : false;
483 483
 	?>
484 484
 	<tr class="ppp-tweet-wrapper ppp-repeatable-row on-publish-row">
485 485
 		<td colspan="2" class="ppp-on-plublish-date-column">
486
-			<input <?php if ( $disabled ): ?>readonly<?php endif; ?> type="checkbox" name="_ppp_share_on_publish" id="ppp_share_on_publish" value="1" <?php checked( true, $show_share_on_publish, true ); ?> />
486
+			<input <?php if ($disabled): ?>readonly<?php endif; ?> type="checkbox" name="_ppp_share_on_publish" id="ppp_share_on_publish" value="1" <?php checked( true, $show_share_on_publish, true ); ?> />
487 487
 			&nbsp;<label for="ppp_share_on_publish"><?php _e( 'Tweet On Publish', 'ppp-txt' ); ?></label>
488 488
 		</td>
489 489
 
490 490
 		<td>
491
-			<input <?php if ( $disabled ): ?>readonly<?php endif; ?> class="ppp-tweet-text-repeatable" type="text" name="_ppp_share_on_publish_text" value="<?php echo esc_attr( $ppp_share_on_publish_text ); ?>" />
492
-			<?php $length = ! empty( $args['text'] ) ? strlen( $args['text'] ) : 0; ?>
491
+			<input <?php if ($disabled): ?>readonly<?php endif; ?> class="ppp-tweet-text-repeatable" type="text" name="_ppp_share_on_publish_text" value="<?php echo esc_attr( $ppp_share_on_publish_text ); ?>" />
492
+			<?php $length = ! empty($args['text']) ? strlen( $args['text'] ) : 0; ?>
493 493
 			&nbsp;<span class="ppp-text-length"><?php echo $length; ?></span>
494 494
 		</td>
495 495
 
496 496
 		<td style="width: 200px" colspan="2">
497
-			<input class="ppp-tw-featured-image-input" <?php if ( $disabled ): ?>readonly<?php endif; ?> id="ppp-share-on-publish-image" type="checkbox" name="_ppp_share_on_publish_include_image" value="1" <?php checked( '1', $ppp_share_on_publish_include_image, true ); ?>/>
497
+			<input class="ppp-tw-featured-image-input" <?php if ($disabled): ?>readonly<?php endif; ?> id="ppp-share-on-publish-image" type="checkbox" name="_ppp_share_on_publish_include_image" value="1" <?php checked( '1', $ppp_share_on_publish_include_image, true ); ?>/>
498 498
 			&nbsp;<label for="ppp-share-on-publish-image"><?php _e( 'Featured Image', 'ppp-txt' ); ?></label>
499 499
 		</td>
500 500
 
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 function ppp_render_tweet_row( $key, $args = array(), $post_id ) {
514 514
 	global $post, $has_past_shares;
515 515
 
516
-	if ( ! empty( $args['date'] ) && ! empty( $args['time'] ) ) {
516
+	if ( ! empty($args['date']) && ! empty($args['time'])) {
517 517
 		$share_time = ppp_generate_timestamp( $args['date'], $args['time'] );
518 518
 		$readonly   = ppp_generate_timestamp() > $share_time ? 'readonly="readonly" ' : false;
519 519
 	} else {
@@ -521,11 +521,11 @@  discard block
 block discarded – undo
521 521
 		$readonly   = false;
522 522
 	}
523 523
 
524
-	$no_date        = ! empty( $readonly ) ? ' hasDatepicker' : '';
525
-	$hide           = ! empty( $readonly ) ? 'display: none;' : '';
526
-	$shared         = ! empty( $readonly ) ? 'past-share' : '';
524
+	$no_date        = ! empty($readonly) ? ' hasDatepicker' : '';
525
+	$hide           = ! empty($readonly) ? 'display: none;' : '';
526
+	$shared         = ! empty($readonly) ? 'past-share' : '';
527 527
 
528
-	if ( ! empty( $readonly ) ) {
528
+	if ( ! empty($readonly)) {
529 529
 		$has_past_shares++;
530 530
 	}
531 531
 	?>
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 
541 541
 		<td>
542 542
 			<input <?php echo $readonly; ?>class="ppp-tweet-text-repeatable" type="text" name="_ppp_tweets[<?php echo $key; ?>][text]" value="<?php echo esc_attr( $args['text'] ); ?>" />
543
-			<?php $length = ! empty( $args['text'] ) ? strlen( $args['text'] ) : 0; ?>
543
+			<?php $length = ! empty($args['text']) ? strlen( $args['text'] ) : 0; ?>
544 544
 			&nbsp;<span class="ppp-text-length"><?php echo $length; ?></span>
545 545
 		</td>
546 546
 
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 		</td>
560 560
 
561 561
 		<td>
562
-			<a href="#" class="ppp-repeatable-row ppp-remove-repeatable" data-type="twitter" style="background: url(<?php echo admin_url('/images/xit.gif'); ?>) no-repeat;<?php echo $hide; ?>">&times;</a>
562
+			<a href="#" class="ppp-repeatable-row ppp-remove-repeatable" data-type="twitter" style="background: url(<?php echo admin_url( '/images/xit.gif' ); ?>) no-repeat;<?php echo $hide; ?>">&times;</a>
563 563
 		</td>
564 564
 
565 565
 	</tr>
@@ -574,24 +574,24 @@  discard block
 block discarded – undo
574 574
  */
575 575
 function ppp_tw_save_post_meta_boxes( $post_id, $post ) {
576 576
 
577
-	if ( ! ppp_should_save( $post_id, $post ) ) {
577
+	if ( ! ppp_should_save( $post_id, $post )) {
578 578
 		return;
579 579
 	}
580 580
 
581
-	$ppp_post_exclude = ( isset( $_REQUEST['_ppp_post_exclude'] ) ) ? $_REQUEST['_ppp_post_exclude'] : '0';
581
+	$ppp_post_exclude = (isset($_REQUEST['_ppp_post_exclude'])) ? $_REQUEST['_ppp_post_exclude'] : '0';
582 582
 
583
-	$ppp_share_on_publish = ( isset( $_REQUEST['_ppp_share_on_publish'] ) ) ? $_REQUEST['_ppp_share_on_publish'] : '0';
584
-	$ppp_share_on_publish_text = ( isset( $_REQUEST['_ppp_share_on_publish_text'] ) ) ? $_REQUEST['_ppp_share_on_publish_text'] : '';
585
-	$ppp_share_on_publish_include_image = ( isset( $_REQUEST['_ppp_share_on_publish_include_image'] ) ) ? $_REQUEST['_ppp_share_on_publish_include_image'] : '';
583
+	$ppp_share_on_publish = (isset($_REQUEST['_ppp_share_on_publish'])) ? $_REQUEST['_ppp_share_on_publish'] : '0';
584
+	$ppp_share_on_publish_text = (isset($_REQUEST['_ppp_share_on_publish_text'])) ? $_REQUEST['_ppp_share_on_publish_text'] : '';
585
+	$ppp_share_on_publish_include_image = (isset($_REQUEST['_ppp_share_on_publish_include_image'])) ? $_REQUEST['_ppp_share_on_publish_include_image'] : '';
586 586
 
587 587
 
588 588
 	update_post_meta( $post_id, '_ppp_share_on_publish', $ppp_share_on_publish );
589 589
 	update_post_meta( $post_id, '_ppp_share_on_publish_text', $ppp_share_on_publish_text );
590 590
 	update_post_meta( $post_id, '_ppp_share_on_publish_include_image', $ppp_share_on_publish_include_image );
591 591
 
592
-	$tweet_data = isset( $_REQUEST['_ppp_tweets'] ) ? $_REQUEST['_ppp_tweets'] : array();
593
-	foreach ( $tweet_data as $index => $tweet ) {
594
-		$tweet_data[ $index ]['text'] = sanitize_text_field( $tweet['text'] );
592
+	$tweet_data = isset($_REQUEST['_ppp_tweets']) ? $_REQUEST['_ppp_tweets'] : array();
593
+	foreach ($tweet_data as $index => $tweet) {
594
+		$tweet_data[$index]['text'] = sanitize_text_field( $tweet['text'] );
595 595
 	}
596 596
 	update_post_meta( $post_id, '_ppp_tweets', $tweet_data );
597 597
 
@@ -608,29 +608,29 @@  discard block
 block discarded – undo
608 608
 function ppp_tw_share_on_publish( $new_status, $old_status, $post ) {
609 609
 	global $ppp_options;
610 610
 
611
-	$from_meta = ! empty( $_POST['ppp_post_edit'] ) ? false : get_post_meta( $post->ID, '_ppp_share_on_publish', true );
612
-	$from_post = isset( $_POST['_ppp_share_on_publish'] );
611
+	$from_meta = ! empty($_POST['ppp_post_edit']) ? false : get_post_meta( $post->ID, '_ppp_share_on_publish', true );
612
+	$from_post = isset($_POST['_ppp_share_on_publish']);
613 613
 
614
-	if ( empty( $from_meta ) && empty( $from_post ) ) {
614
+	if (empty($from_meta) && empty($from_post)) {
615 615
 		return;
616 616
 	}
617 617
 
618 618
 	// Determine if we're seeing the share on publish in meta or $_POST
619
-	if ( $from_meta && !$from_post ) {
619
+	if ($from_meta && ! $from_post) {
620 620
 		$ppp_share_on_publish_text = get_post_meta( $post->ID, '_ppp_share_on_publish_text', true );
621 621
 		$use_media = get_post_meta( $post->ID, '_ppp_share_on_publish_include_image', true );
622 622
 	} else {
623
-		$ppp_share_on_publish_text = isset( $_POST['_ppp_share_on_publish_text'] ) ? $_POST['_ppp_share_on_publish_text'] : '';
624
-		$use_media = isset( $_POST['_ppp_share_on_publish_include_image'] ) ? $_POST['_ppp_share_on_publish_include_image'] : false;
623
+		$ppp_share_on_publish_text = isset($_POST['_ppp_share_on_publish_text']) ? $_POST['_ppp_share_on_publish_text'] : '';
624
+		$use_media = isset($_POST['_ppp_share_on_publish_include_image']) ? $_POST['_ppp_share_on_publish_include_image'] : false;
625 625
 	}
626 626
 
627
-	$share_content = ( !empty( $ppp_share_on_publish_text ) ) ? $ppp_share_on_publish_text : ppp_tw_generate_share_content( $post->ID, null, false );
627
+	$share_content = ( ! empty($ppp_share_on_publish_text)) ? $ppp_share_on_publish_text : ppp_tw_generate_share_content( $post->ID, null, false );
628 628
 	$share_content = apply_filters( 'ppp_share_content', $share_content, array( 'post_id' => $post->ID ) );
629
-	$name = 'sharedate_0_' . $post->ID;
629
+	$name = 'sharedate_0_'.$post->ID;
630 630
 	$media = ppp_post_has_media( $post->ID, 'tw', $use_media );
631 631
 	$share_link = ppp_generate_link( $post->ID, $name, true );
632 632
 
633
-	$status = ppp_send_tweet( $share_content . ' ' . $share_link, $post->ID, $media );
633
+	$status = ppp_send_tweet( $share_content.' '.$share_link, $post->ID, $media );
634 634
 
635 635
 	$log_title = ppp_tw_build_share_message( $post->ID, $name, false, false );
636 636
 
@@ -647,11 +647,11 @@  discard block
 block discarded – undo
647 647
 
648 648
 	$log_entry = WP_Logging::insert_log( $log_data, $log_meta );
649 649
 
650
-	if ( ! empty( $status->id_str ) ) {
650
+	if ( ! empty($status->id_str)) {
651 651
 		$author_id = $post->post_author;
652 652
 		$author_rt = get_user_meta( $author_id, '_ppp_share_on_publish', true );
653 653
 
654
-		if ( $author_rt ) {
654
+		if ($author_rt) {
655 655
 			$twitter_user = new PPP_Twitter_User( $author_id );
656 656
 			$twitter_user->retweet( $status->id_str );
657 657
 		}
@@ -671,20 +671,20 @@  discard block
 block discarded – undo
671 671
 function ppp_tw_generate_timestamps( $times, $post_id ) {
672 672
 	$ppp_tweets = get_post_meta( $post_id, '_ppp_tweets', true );
673 673
 
674
-	if ( empty( $ppp_tweets ) ) {
674
+	if (empty($ppp_tweets)) {
675 675
 		$ppp_tweets = array();
676 676
 	}
677 677
 
678
-	foreach ( $ppp_tweets as $key => $data ) {
679
-		if ( ! array_filter( $data ) ) {
678
+	foreach ($ppp_tweets as $key => $data) {
679
+		if ( ! array_filter( $data )) {
680 680
 			continue;
681 681
 		}
682 682
 
683 683
 		$timestamp = ppp_generate_timestamp( $data['date'], $data['time'] );
684 684
 
685
-		if ( $timestamp > current_time( 'timestamp', 1 ) ) { // Make sure the timestamp we're getting is in the future
686
-			$time_key           = strtotime( date_i18n( 'd-m-Y H:i:s', $timestamp , true ) ) . '_tw';
687
-			$times[ $time_key ] = 'sharedate_' . $key . '_' . $post_id . '_tw';
685
+		if ($timestamp > current_time( 'timestamp', 1 )) { // Make sure the timestamp we're getting is in the future
686
+			$time_key           = strtotime( date_i18n( 'd-m-Y H:i:s', $timestamp, true ) ).'_tw';
687
+			$times[$time_key] = 'sharedate_'.$key.'_'.$post_id.'_tw';
688 688
 		}
689 689
 
690 690
 	}
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 
705 705
 	$ret = false;
706 706
 
707
-	if ( ! empty( $ppp_share_settings['twitter']['cards_enabled'] ) ) {
707
+	if ( ! empty($ppp_share_settings['twitter']['cards_enabled'])) {
708 708
 		$ret = true;
709 709
 	}
710 710
 
@@ -719,13 +719,13 @@  discard block
 block discarded – undo
719 719
  */
720 720
 function ppp_tw_card_meta() {
721 721
 
722
-	if ( ! is_single() || ! ppp_twitter_enabled() || ! ppp_tw_cards_enabled() ) {
722
+	if ( ! is_single() || ! ppp_twitter_enabled() || ! ppp_tw_cards_enabled()) {
723 723
 		return;
724 724
 	}
725 725
 
726 726
 	global $post, $ppp_options;
727 727
 
728
-	if ( ! array_key_exists( $post->post_type, $ppp_options['post_types'] ) ) {
728
+	if ( ! array_key_exists( $post->post_type, $ppp_options['post_types'] )) {
729 729
 		return;
730 730
 	}
731 731
 
@@ -743,20 +743,20 @@  discard block
 block discarded – undo
743 743
 
744 744
 	$return = '';
745 745
 
746
-	if ( ! is_single() || ! ppp_tw_cards_enabled() ) {
746
+	if ( ! is_single() || ! ppp_tw_cards_enabled()) {
747 747
 		return $return;
748 748
 	}
749 749
 
750 750
 	global $post, $ppp_social_settings;
751 751
 
752 752
 
753
-	if ( empty( $post ) ) {
753
+	if (empty($post)) {
754 754
 		return;
755 755
 	}
756 756
 
757 757
 	$elements = ppp_tw_default_meta_elements();
758
-	foreach ( $elements as $name => $content ) {
759
-		$return .= '<meta name="' . $name . '" content="' . $content . '" />' . "\n";
758
+	foreach ($elements as $name => $content) {
759
+		$return .= '<meta name="'.$name.'" content="'.$content.'" />'."\n";
760 760
 	}
761 761
 
762 762
 	return apply_filters( 'ppp_tw_card_meta', $return );
@@ -776,22 +776,22 @@  discard block
 block discarded – undo
776 776
 	$elements = array();
777 777
 
778 778
 	$image_url = ppp_post_has_media( $post->ID, 'tw', true );
779
-	if ( $image_url ) {
779
+	if ($image_url) {
780 780
 		$elements['twitter:card']      = 'summary_large_image';
781 781
 		$elements['twitter:image:src'] = $image_url;
782 782
 	} else {
783 783
 		$elements['twitter:card'] = 'summary';
784 784
 	}
785 785
 
786
-	$elements['twitter:site']        = '@' . $ppp_social_settings['twitter']['user']->screen_name;
786
+	$elements['twitter:site']        = '@'.$ppp_social_settings['twitter']['user']->screen_name;
787 787
 	$elements['twitter:title']       = esc_attr( strip_tags( $post->post_title ) );
788 788
 	$elements['twitter:description'] = esc_attr( ppp_tw_get_card_description() );
789 789
 
790 790
 	$author_twitter_handle = get_user_meta( $post->post_author, 'twitter', true );
791
-	if ( ! empty( $author_twitter_handle ) ) {
791
+	if ( ! empty($author_twitter_handle)) {
792 792
 
793
-		if ( strpos( $author_twitter_handle, '@' ) === false ) {
794
-			$author_twitter_handle = '@' . $author_twitter_handle;
793
+		if (strpos( $author_twitter_handle, '@' ) === false) {
794
+			$author_twitter_handle = '@'.$author_twitter_handle;
795 795
 		}
796 796
 
797 797
 		$elements['twitter:creator'] = esc_attr( strip_tags( $author_twitter_handle ) );
@@ -810,13 +810,13 @@  discard block
 block discarded – undo
810 810
 function ppp_tw_get_card_description() {
811 811
 	global $post;
812 812
 
813
-	if ( ! is_single() || empty( $post ) ) {
813
+	if ( ! is_single() || empty($post)) {
814 814
 		return false;
815 815
 	}
816 816
 
817 817
 	$excerpt = $post->post_excerpt;
818 818
 
819
-	if ( empty( $excerpt ) ) {
819
+	if (empty($excerpt)) {
820 820
 		$excerpt = ppp_tw_format_card_description( $post->post_content );
821 821
 	}
822 822
 
@@ -834,10 +834,10 @@  discard block
 block discarded – undo
834 834
 	$max_len = apply_filters( 'ppp_tw_cart_desc_length', 200 );
835 835
 	$excerpt = strip_tags( $excerpt );
836 836
 
837
-	if ( strlen( $excerpt ) > $max_len ) {
837
+	if (strlen( $excerpt ) > $max_len) {
838 838
 		$excerpt_pre = substr( $excerpt, 0, $max_len );
839 839
 		$last_space  = strrpos( $excerpt_pre, ' ' );
840
-		$excerpt     = substr( $excerpt_pre, 0, $last_space ) . '...';
840
+		$excerpt     = substr( $excerpt_pre, 0, $last_space ).'...';
841 841
 	}
842 842
 
843 843
 	return $excerpt;
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
  */
853 853
 function ppp_tw_add_contact_method( $user_contactmethods ) {
854 854
 
855
-	if ( ! isset( $user_contactmethods['twitter'] ) ) {
855
+	if ( ! isset($user_contactmethods['twitter'])) {
856 856
 		$user_contactmethods['twitter'] = __( 'Twitter', 'ppp-txt' );
857 857
 	}
858 858
 	// Returns the contact methods
@@ -870,11 +870,11 @@  discard block
 block discarded – undo
870 870
  */
871 871
 function ppp_tw_profile_settings( $user ) {
872 872
 
873
-	if ( $user->ID == get_current_user_id() && ! current_user_can( 'edit_posts' ) ) {
873
+	if ($user->ID == get_current_user_id() && ! current_user_can( 'edit_posts' )) {
874 874
 		return;
875 875
 	}
876 876
 
877
-	if ( $user->ID !== get_current_user_id() && ! current_user_can( 'manage_options' ) ) {
877
+	if ($user->ID !== get_current_user_id() && ! current_user_can( 'manage_options' )) {
878 878
 		return;
879 879
 	}
880 880
 
@@ -888,16 +888,16 @@  discard block
 block discarded – undo
888 888
 			<?php
889 889
 			$twitter = new PPP_Twitter_User( get_current_user_id() );
890 890
 			$tw_user = get_user_meta( $user->ID, '_ppp_twitter_data', true );
891
-			if ( empty( $tw_user ) ) {
892
-				$tw_authurl = $twitter->get_auth_url( admin_url( 'user-edit.php?user_id=' . $user->ID ) );
891
+			if (empty($tw_user)) {
892
+				$tw_authurl = $twitter->get_auth_url( admin_url( 'user-edit.php?user_id='.$user->ID ) );
893 893
 
894
-				echo '<a href="' . $tw_authurl . '"><img src="' . PPP_URL . '/includes/images/sign-in-with-twitter-gray.png" /></a>';
894
+				echo '<a href="'.$tw_authurl.'"><img src="'.PPP_URL.'/includes/images/sign-in-with-twitter-gray.png" /></a>';
895 895
 			} else {
896 896
 				$connected = true;
897 897
 				?>
898 898
 				<p><strong><?php _e( 'Signed in as', 'ppp-txt' ); ?>: </strong><?php echo $tw_user['user']->screen_name; ?></p>
899 899
 				<p>
900
-					<a class="button-primary" href="<?php echo admin_url( 'user-edit.php?user_id=' . $user->ID . '&ppp_social_disconnect=true&ppp_network=twitter&user_id=' . $user->ID ); ?>" ><?php _e( 'Disconnect from Twitter', 'ppp-txt' ); ?></a>&nbsp;
900
+					<a class="button-primary" href="<?php echo admin_url( 'user-edit.php?user_id='.$user->ID.'&ppp_social_disconnect=true&ppp_network=twitter&user_id='.$user->ID ); ?>" ><?php _e( 'Disconnect from Twitter', 'ppp-txt' ); ?></a>&nbsp;
901 901
 					<a class="button-secondary" href="https://twitter.com/settings/applications" target="blank"><?php _e( 'Revoke Access via Twitter', 'ppp-txt' ); ?></a>
902 902
 				</p>
903 903
 				<?php
@@ -906,10 +906,10 @@  discard block
 block discarded – undo
906 906
 			</td>
907 907
 		</tr>
908 908
 
909
-		<?php if ( $connected ) : ?>
909
+		<?php if ($connected) : ?>
910 910
 		<?php
911 911
 			$share_on_publish = get_user_meta( $user->ID, '_ppp_share_on_publish', true );
912
-			$share_scheduled  = get_user_meta( $user->ID, '_ppp_share_scheduled' , true );
912
+			$share_scheduled  = get_user_meta( $user->ID, '_ppp_share_scheduled', true );
913 913
 		?>
914 914
 		<tr>
915 915
 			<th><?php _e( 'Sharing Options', 'ppp-txt' ); ?></th>
@@ -942,11 +942,11 @@  discard block
 block discarded – undo
942 942
  */
943 943
 function ppp_tw_save_profile( $user_id ) {
944 944
 
945
-	$share_on_publish = ! empty( $_POST['share_on_publish'] ) ? true : false;
946
-	$share_scheduled  = ! empty( $_POST['share_scheduled'] )  ? true : false;
945
+	$share_on_publish = ! empty($_POST['share_on_publish']) ? true : false;
946
+	$share_scheduled  = ! empty($_POST['share_scheduled']) ? true : false;
947 947
 
948 948
 	update_user_meta( $user_id, '_ppp_share_on_publish', $share_on_publish );
949
-	update_user_meta( $user_id, '_ppp_share_scheduled' , $share_scheduled  );
949
+	update_user_meta( $user_id, '_ppp_share_scheduled', $share_scheduled );
950 950
 
951 951
 }
952 952
 add_action( 'personal_options_update', 'ppp_tw_save_profile' );
@@ -955,14 +955,14 @@  discard block
 block discarded – undo
955 955
 function ppp_tw_calendar_on_publish_event( $events, $post_id ) {
956 956
 	$share_on_publish = get_post_meta( $post_id, '_ppp_share_on_publish', true );
957 957
 
958
-	if ( ! empty( $share_on_publish ) ) {
958
+	if ( ! empty($share_on_publish)) {
959 959
 		$share_text = get_post_meta( $post_id, '_ppp_share_on_publish_text', true );
960 960
 		$events[] = array(
961
-			'id' => $post_id . '-share-on-publish',
962
-			'title' => ( ! empty( $share_text ) ) ? $share_text : ppp_tw_generate_share_content( $post_id, null, false ),
963
-			'start'     => date_i18n( 'Y-m-d/TH:i:s', strtotime( get_the_date( null, $post_id ) . ' ' . get_the_time( null, $post_id ) ) + 1 ),
964
-			'end'       => date_i18n( 'Y-m-d/TH:i:s', strtotime( get_the_date( null, $post_id ) . ' ' . get_the_time( null, $post_id ) ) + 1 ),
965
-			'className' => 'ppp-calendar-item-tw cal-post-' . $post_id,
961
+			'id' => $post_id.'-share-on-publish',
962
+			'title' => ( ! empty($share_text)) ? $share_text : ppp_tw_generate_share_content( $post_id, null, false ),
963
+			'start'     => date_i18n( 'Y-m-d/TH:i:s', strtotime( get_the_date( null, $post_id ).' '.get_the_time( null, $post_id ) ) + 1 ),
964
+			'end'       => date_i18n( 'Y-m-d/TH:i:s', strtotime( get_the_date( null, $post_id ).' '.get_the_time( null, $post_id ) ) + 1 ),
965
+			'className' => 'ppp-calendar-item-tw cal-post-'.$post_id,
966 966
 			'belongsTo' => $post_id,
967 967
 		);
968 968
 	}
@@ -973,9 +973,9 @@  discard block
 block discarded – undo
973 973
 
974 974
 function ppp_tw_get_post_shares( $items, $post_id ) {
975 975
 	$tweets = get_post_meta( $post_id, '_ppp_tweets', true );
976
-	if ( empty( $tweets ) ) { return $items; }
976
+	if (empty($tweets)) { return $items; }
977 977
 
978
-	foreach ( $tweets as $key => $tweet ) {
978
+	foreach ($tweets as $key => $tweet) {
979 979
 		$items[] = array( 'id' => $key, 'service' => 'tw' );
980 980
 	}
981 981
 	return $items;
Please login to merge, or discard this patch.
includes/admin/actions.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined( 'ABSPATH' )) {
4 4
 	exit;
5 5
 }
6 6
 
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
  */
15 15
 function ppp_disconnect_social() {
16 16
 
17
-	if ( isset( $_GET['ppp_social_disconnect'] ) && isset( $_GET['ppp_network'] ) ) {
17
+	if (isset($_GET['ppp_social_disconnect']) && isset($_GET['ppp_network'])) {
18 18
 
19
-		if ( ! current_user_can( 'manage_options' ) ) {
19
+		if ( ! current_user_can( 'manage_options' )) {
20 20
 			wp_die( __( 'You do not have permission to view this page', 'ppp-txt' ) );
21 21
 		}
22 22
 
23 23
 		$network = $_GET['ppp_network'];
24
-		do_action( 'ppp_disconnect-' . $network );
24
+		do_action( 'ppp_disconnect-'.$network );
25 25
 	}
26 26
 }
27 27
 add_action( 'admin_init', 'ppp_disconnect_social', 10 );
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 
36 36
 	$tabs = apply_filters( 'ppp_metabox_tabs', array() );
37 37
 	$i = 0;
38
-	foreach ( $tabs as $key => $values ) {
39
-		if ( $i === 0 ) {
38
+	foreach ($tabs as $key => $values) {
39
+		if ($i === 0) {
40 40
 			$visibleKey = $key;
41 41
 			$class = 'tabs';
42 42
 		} else {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		}
45 45
 
46 46
 		?><li class="<?php echo $class; ?>"><a href="#<?php echo $key; ?>"><?php
47
-		if ( $values['class'] !== false ) {
47
+		if ($values['class'] !== false) {
48 48
 			?>
49 49
 			<span class="dashicons <?php echo $values['class']; ?>"></span>&nbsp;
50 50
 			<?php
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
 	$tabs = apply_filters( 'ppp_admin_tabs', array() );
66 66
 	$i = 0;
67 67
 	?><h2 id="ppp-social-connect-tabs" class="nav-tab-wrapper"><?php
68
-	foreach ( $tabs as $key => $values ) {
69
-		if ( $i === 0 ) {
68
+	foreach ($tabs as $key => $values) {
69
+		if ($i === 0) {
70 70
 			$visibleSettingTab = $key;
71 71
 			$class = ' nav-tab-active';
72 72
 		} else {
73 73
 			$class = '';
74 74
 		}
75 75
 		?><a class="nav-tab<?php echo $class; ?>" href='#<?php echo $key; ?>'><?php
76
-		if ( $values['class'] !== false ) {
76
+		if ($values['class'] !== false) {
77 77
 			?>
78 78
 			<span class="dashicons <?php echo $values['class']; ?>"></span>&nbsp;
79 79
 			<?php
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
 function ppp_generate_metabox_content( $post ) {
95 95
 	global $visibleKey;
96 96
 	$tab_content = apply_filters( 'ppp_metabox_content', array() );
97
-	if ( empty( $tab_content ) ) {
97
+	if (empty($tab_content)) {
98 98
 		printf( __( 'No social media accounts active. <a href="%s">Connect with your accounts now</a>.', 'ppp-txt' ), admin_url( 'admin.php?page=ppp-social-settings' ) );
99 99
 	} else {
100
-		foreach ( $tab_content as $service ) {
101
-			$hidden = ( $visibleKey == $service ) ? '' : ' hidden';
100
+		foreach ($tab_content as $service) {
101
+			$hidden = ($visibleKey == $service) ? '' : ' hidden';
102 102
 			?>
103 103
 			<div class="wp-tab-panel tabs-panel<?php echo $hidden; ?>" id="<?php echo $service; ?>">
104
-				<?php do_action( 'ppp_generate_metabox_content-' . $service, $post ); ?>
104
+				<?php do_action( 'ppp_generate_metabox_content-'.$service, $post ); ?>
105 105
 			</div>
106 106
 			<?php
107 107
 		}
@@ -116,14 +116,14 @@  discard block
 block discarded – undo
116 116
 function ppp_generate_social_account_content() {
117 117
 	global $visibleSettingTab;
118 118
 	$tab_content = apply_filters( 'ppp_admin_social_content', array() );
119
-	if ( empty( $tab_content ) ) {
119
+	if (empty($tab_content)) {
120 120
 		printf( __( 'No social media accounts active. <a href="%s">Connect with your accounts now</a>.', 'ppp-txt' ), admin_url( 'admin.php?page=ppp-social-settings' ) );
121 121
 	} else {
122
-		foreach ( $tab_content as $service ) {
123
-			$hidden = ( $visibleSettingTab == $service ) ? '' : ' hidden';
122
+		foreach ($tab_content as $service) {
123
+			$hidden = ($visibleSettingTab == $service) ? '' : ' hidden';
124 124
 			?>
125 125
 			<div class="ppp-social-connect<?php echo $hidden; ?>" id="<?php echo $service; ?>">
126
-				<?php do_action( 'ppp_connect_display-' . $service ); ?>
126
+				<?php do_action( 'ppp_connect_display-'.$service ); ?>
127 127
 			</div>
128 128
 			<?php
129 129
 		}
@@ -136,30 +136,30 @@  discard block
 block discarded – undo
136 136
  * @return void
137 137
  */
138 138
 function ppp_list_view_maybe_take_action() {
139
-	if ( ! isset( $_GET['page'] ) || $_GET['page'] !== 'ppp-schedule-info' ) {
139
+	if ( ! isset($_GET['page']) || $_GET['page'] !== 'ppp-schedule-info') {
140 140
 		return;
141 141
 	}
142 142
 
143
-	if ( ! isset( $_GET['action'] ) ) {
143
+	if ( ! isset($_GET['action'])) {
144 144
 		return;
145 145
 	}
146 146
 
147 147
 	// Get the necessary info for the actions
148
-	$post_id = isset( $_GET['post_id'] ) ? $_GET['post_id'] : 0;
149
-	$name    = isset( $_GET['name'] ) ? $_GET['name'] : '';
150
-	$index   = isset( $_GET['index'] ) ? $_GET['index'] : 0;
151
-	$delete  = isset( $_GET['delete_too'] ) ? true : false;
148
+	$post_id = isset($_GET['post_id']) ? $_GET['post_id'] : 0;
149
+	$name    = isset($_GET['name']) ? $_GET['name'] : '';
150
+	$index   = isset($_GET['index']) ? $_GET['index'] : 0;
151
+	$delete  = isset($_GET['delete_too']) ? true : false;
152 152
 
153
-	switch( $_GET['action'] ) {
153
+	switch ($_GET['action']) {
154 154
 		case 'delete_item':
155
-			if ( ! empty( $post_id ) && ! empty( $name ) || empty( $index ) ) {
156
-				ppp_remove_scheduled_share( array( (int)$post_id, $name ) ); // Remove the item in cron
155
+			if ( ! empty($post_id) && ! empty($name) || empty($index)) {
156
+				ppp_remove_scheduled_share( array( (int) $post_id, $name ) ); // Remove the item in cron
157 157
 
158 158
 				// Remove the item from postmeta if it exists.
159 159
 				$current_post_meta = get_post_meta( $post_id, '_ppp_tweets', true );
160 160
 
161
-				if ( isset( $current_post_meta[$index] ) ) {
162
-					unset( $current_post_meta[$index] );
161
+				if (isset($current_post_meta[$index])) {
162
+					unset($current_post_meta[$index]);
163 163
 					update_post_meta( $post_id, '_ppp_tweets', $current_post_meta );
164 164
 				}
165 165
 
@@ -168,17 +168,17 @@  discard block
 block discarded – undo
168 168
 			}
169 169
 			break;
170 170
 		case 'share_now':
171
-			if ( ! empty( $post_id ) && ! empty( $name ) ) {
171
+			if ( ! empty($post_id) && ! empty($name)) {
172 172
 				ppp_share_post( $post_id, $name );
173 173
 
174
-				if ( $delete && ! empty( $index ) ) {
175
-					ppp_remove_scheduled_share( array( (int)$post_id, $name ) ); // Remove the item in cron
174
+				if ($delete && ! empty($index)) {
175
+					ppp_remove_scheduled_share( array( (int) $post_id, $name ) ); // Remove the item in cron
176 176
 
177 177
 					// Remove the item from postmeta if it exists.
178 178
 					$current_post_meta = get_post_meta( $post_id, '_ppp_tweets', true );
179 179
 
180
-					if ( isset( $current_post_meta[$index] ) ) {
181
-						unset( $current_post_meta[$index] );
180
+					if (isset($current_post_meta[$index])) {
181
+						unset($current_post_meta[$index]);
182 182
 						update_post_meta( $post_id, '_ppp_tweets', $current_post_meta );
183 183
 					}
184 184
 
Please login to merge, or discard this patch.
includes/admin/admin-ajax.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined( 'ABSPATH' )) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 	$date = sanitize_text_field( $_POST['date'] );
11 11
 	$time = sanitize_text_field( $_POST['time'] );
12 12
 
13
-	$offset = (int) -( get_option( 'gmt_offset' ) ); // Make the timestamp in the users' timezone, b/c that makes more sense
13
+	$offset = (int) -(get_option( 'gmt_offset' )); // Make the timestamp in the users' timezone, b/c that makes more sense
14 14
 
15 15
 	$share_time = explode( ':', $time );
16 16
 
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 	$minutes = (int) substr( $share_time[1], 0, 2 );
19 19
 	$ampm = strtolower( substr( $share_time[1], -2 ) );
20 20
 
21
-	if ( $ampm == 'pm' && $hours != 12 ) {
21
+	if ($ampm == 'pm' && $hours != 12) {
22 22
 		$hours = $hours + 12;
23 23
 	}
24 24
 
25
-	if ( $ampm == 'am' && $hours == 12 ) {
25
+	if ($ampm == 'am' && $hours == 12) {
26 26
 		$hours = 00;
27 27
 	}
28 28
 
Please login to merge, or discard this patch.
includes/admin/admin-pages.php 2 patches
Braces   +13 added lines, -4 removed lines patch added patch discarded remove patch
@@ -176,8 +176,11 @@  discard block
 block discarded – undo
176 176
 							<?php $post = wp_get_recent_posts( array( 'numberposts' => 1 ) ); ?>
177 177
 							<?php if( count( $post ) > 0 ): ?>
178 178
 								<code><?php echo ppp_generate_link( $post[0]['ID'], 'sharedate_1_' . $post[0]['ID'], false ); ?></code></small>
179
-							<?php else: ?>
180
-								<em><?php _e( 'No posts available to generate link from.', 'ppp-txt' ); ?></em>
179
+							<?php else {
180
+	: ?>
181
+								<em><?php _e( 'No posts available to generate link from.', 'ppp-txt' );
182
+}
183
+?></em>
181 184
 							<?php endif; ?>
182 185
 						</p>
183 186
 					</td>
@@ -384,8 +387,14 @@  discard block
 block discarded – undo
384 387
 	Use Cookies:              <?php echo ini_get( 'session.use_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?>
385 388
 	Use Only Cookies:         <?php echo ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?>
386 389
 
387
-	UPLOAD_MAX_FILESIZE:      <?php if ( function_exists( 'phpversion' ) ) echo ini_get( 'upload_max_filesize' ); ?><?php echo "\n"; ?>
388
-	POST_MAX_SIZE:            <?php if ( function_exists( 'phpversion' ) ) echo ini_get( 'post_max_size' ); ?><?php echo "\n"; ?>
390
+	UPLOAD_MAX_FILESIZE:      <?php if ( function_exists( 'phpversion' ) ) {
391
+	echo ini_get( 'upload_max_filesize' );
392
+}
393
+?><?php echo "\n"; ?>
394
+	POST_MAX_SIZE:            <?php if ( function_exists( 'phpversion' ) ) {
395
+	echo ini_get( 'post_max_size' );
396
+}
397
+?><?php echo "\n"; ?>
389 398
 	WordPress Memory Limit:   <?php echo WP_MEMORY_LIMIT; ?><?php echo "\n"; ?>
390 399
 	DISPLAY ERRORS:           <?php echo ( ini_get( 'display_errors' ) ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A'; ?><?php echo "\n"; ?>
391 400
 	FSOCKOPEN:                <?php echo ( function_exists( 'fsockopen' ) ) ? __( 'Your server supports fsockopen.', 'ppp-txt' ) : __( 'Your server does not support fsockopen.', 'ppp-txt' ); ?><?php echo "\n"; ?>
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined( 'ABSPATH' )) {
5 5
 	exit;
6 6
 }
7 7
 
@@ -26,18 +26,18 @@  discard block
 block discarded – undo
26 26
 						<?php _e( 'License Key', 'ppp-txt' ); ?><br /><span style="font-size: x-small;"><?php _e( 'Enter your license key', 'ppp-txt' ); ?></span>
27 27
 					</th>
28 28
 					<td>
29
-						<input id="ppp_license_key" name="_ppp_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $license ); ?>" /><?php if( $status !== false && $status == 'valid' ) { ?>
29
+						<input id="ppp_license_key" name="_ppp_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $license ); ?>" /><?php if ($status !== false && $status == 'valid') { ?>
30 30
 						<span style="color:green;">&nbsp;<?php _e( 'active', 'ppp-txt' ); ?></span><?php } ?>
31 31
 					</td>
32 32
 				</tr>
33 33
 
34
-				<?php if( false !== $license ) { ?>
34
+				<?php if (false !== $license) { ?>
35 35
 					<tr valign="top">
36 36
 						<th scope="row" valign="top">
37 37
 							<?php _e( 'Activate License', 'ppp-txt' ); ?>
38 38
 						</th>
39 39
 						<td>
40
-							<?php if( $status !== false && $status == 'valid' ) { ?>
40
+							<?php if ($status !== false && $status == 'valid') { ?>
41 41
 								<?php wp_nonce_field( 'ppp_deactivate_nonce', 'ppp_deactivate_nonce' ); ?>
42 42
 								<input type="submit" class="button-secondary" name="ppp_license_deactivate" value="<?php _e( 'Deactivate License', 'ppp-txt' ); ?>"/>
43 43
 							<?php } else {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 						<span style="font-size: x-small;"><a href="#" onclick="jQuery('#ppp-text-helper').toggle(); return false;"><?php _e( 'Default Text Tips', 'ppp-txt' ); ?></a></span>
54 54
 					</th>
55 55
 					<td>
56
-						<?php $default_text = isset( $ppp_options['default_text'] ) ? $ppp_options['default_text'] : ''; ?>
56
+						<?php $default_text = isset($ppp_options['default_text']) ? $ppp_options['default_text'] : ''; ?>
57 57
 						<input type="text" class="regular-text" name="ppp_options[default_text]" value="<?php echo $default_text; ?>" placeholder="Post Title will be used if empty" size="50" />
58 58
 						<p id="ppp-text-helper" style="display: none">
59 59
 							<small>
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 							<br />
64 64
 							<?php _e( 'Possible Replacements:', 'ppp-txt' ); ?>
65 65
 							<br />
66
-							<?php foreach( ppp_get_text_tokens() as $token ): ?>
66
+							<?php foreach (ppp_get_text_tokens() as $token): ?>
67 67
 								<code>{<?php echo $token['token']; ?>}</code> - <?php echo $token['description']; ?><br />
68 68
 							<?php endforeach; ?>
69 69
 							</small>
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 					<th scope="row"><?php _e( 'Post Types', 'ppp-txt' ); ?><br /><span style="font-size: x-small;"><?php _e( 'What post types do you want to schedule for?', 'ppp-txt' ); ?></span></th>
76 76
 					<td>
77 77
 						<?php $post_types = ppp_supported_post_types(); ?>
78
-						<?php foreach ( $post_types as $post_type => $type_data ): ?>
79
-							<?php $value = ( isset( $ppp_options['post_types'] ) && isset( $ppp_options['post_types'][$post_type] ) ) ? true : false; ?>
78
+						<?php foreach ($post_types as $post_type => $type_data): ?>
79
+							<?php $value = (isset($ppp_options['post_types']) && isset($ppp_options['post_types'][$post_type])) ? true : false; ?>
80 80
 							<input type="checkbox" name="ppp_options[post_types][<?php echo $post_type; ?>]" value="1" id="<?php echo $post_type; ?>" <?php checked( true, $value, true ); ?> />&nbsp;
81 81
 							<label for="<?php echo $post_type; ?>"><?php echo $type_data->labels->name; ?></label></br />
82 82
 						<?php endforeach; ?>
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
 					<th scope="row"><?php _e( 'Advanced', 'ppp-txt' ); ?><br /><span style="font-size: x-small;"><?php _e( 'Tools for troubleshooting and advanced usage', 'ppp-txt' ); ?></span></th>
88 88
 					<td>
89 89
 						<p>
90
-						<?php $debug_enabled = isset( $ppp_options['enable_debug'] ) ? true : false; ?>
90
+						<?php $debug_enabled = isset($ppp_options['enable_debug']) ? true : false; ?>
91 91
 						<input type="checkbox" name="ppp_options[enable_debug]" <?php checked( true, $debug_enabled, true ); ?> value="1" /> <?php _e( 'Enable Debug', 'ppp-txt' ); ?>
92 92
 						</p>
93 93
 						<p>
94
-						<?php $delete_on_uninstall = isset( $ppp_options['delete_on_uninstall'] ) ? true : false; ?>
94
+						<?php $delete_on_uninstall = isset($ppp_options['delete_on_uninstall']) ? true : false; ?>
95 95
 						<input type="checkbox" name="ppp_options[delete_on_uninstall]" <?php checked( true, $delete_on_uninstall, true ); ?> value="1" /> <?php _e( 'Delete All Data On Uninstall', 'ppp-txt' ); ?>
96 96
 						</p>
97 97
 					</td>
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 			<?php wp_nonce_field( 'ppp-share-settings' ); ?>
127 127
 			<h3><?php _e( 'Social Media Accounts', 'ppp-txt' ); ?></h3>
128 128
 			<?php
129
-			require_once PPP_PATH . 'includes/admin/class-accounts-table.php';
129
+			require_once PPP_PATH.'includes/admin/class-accounts-table.php';
130 130
 
131 131
 			$accounts_table = new PPP_Accounts_Table();
132 132
 			$accounts_table->prepare_items();
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 			$accounts_table->display();
135 135
 			?>
136 136
 			<table class="form-table">
137
-				<?php $analytics_option = isset( $ppp_share_settings['analytics'] ) ? $ppp_share_settings['analytics'] : 0; ?>
137
+				<?php $analytics_option = isset($ppp_share_settings['analytics']) ? $ppp_share_settings['analytics'] : 0; ?>
138 138
 				<tr valign="top">
139 139
 					<th scope="row" valign="top">
140 140
 						<?php _e( 'Analytics', 'ppp-txt' ); ?></span>
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 						<hr />
174 174
 						<small><?php _e( 'Here is an example of what your link will look like', 'ppp-txt' ); ?>: <br />
175 175
 							<?php $post = wp_get_recent_posts( array( 'numberposts' => 1 ) ); ?>
176
-							<?php if( count( $post ) > 0 ): ?>
177
-								<code><?php echo ppp_generate_link( $post[0]['ID'], 'sharedate_1_' . $post[0]['ID'], false ); ?></code></small>
176
+							<?php if (count( $post ) > 0): ?>
177
+								<code><?php echo ppp_generate_link( $post[0]['ID'], 'sharedate_1_'.$post[0]['ID'], false ); ?></code></small>
178 178
 							<?php else: ?>
179 179
 								<em><?php _e( 'No posts available to generate link from.', 'ppp-txt' ); ?></em>
180 180
 							<?php endif; ?>
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
 				</tr>
184 184
 
185 185
 				<?php
186
-				$tw_sop = ! empty( $ppp_share_settings['twitter']['share_on_publish'] ) ? true : false;
187
-				$fb_sop = ! empty( $ppp_share_settings['facebook']['share_on_publish'] ) ? true : false;
188
-				$li_sop = ! empty( $ppp_share_settings['linkedin']['share_on_publish'] ) ? true : false;
186
+				$tw_sop = ! empty($ppp_share_settings['twitter']['share_on_publish']) ? true : false;
187
+				$fb_sop = ! empty($ppp_share_settings['facebook']['share_on_publish']) ? true : false;
188
+				$li_sop = ! empty($ppp_share_settings['linkedin']['share_on_publish']) ? true : false;
189 189
 				?>
190 190
 				<tr valign="top">
191 191
 					<th scope="row" valign="top">
@@ -193,21 +193,21 @@  discard block
 block discarded – undo
193 193
 						<small><em><?php _e( 'Enabled sharing on publish by default', 'ppp-txt' ); ?></em></small>
194 194
 					</th>
195 195
 					<td id="ppp-share-on-publish-wrapper">
196
-						<?php if ( ppp_twitter_enabled() ) : ?>
196
+						<?php if (ppp_twitter_enabled()) : ?>
197 197
 						<p>
198 198
 							<input type="checkbox" id="twitter-share-on-publish" value="1" <?php checked( true, $tw_sop, true ); ?> name="ppp_share_settings[twitter][share_on_publish]" />
199 199
 							<label for="twitter-share-on-publish"><?php _e( 'Twitter', 'ppp-txt' ); ?></label>
200 200
 						</p>
201 201
 						<?php endif; ?>
202 202
 
203
-						<?php if ( ppp_facebook_enabled() ) : ?>
203
+						<?php if (ppp_facebook_enabled()) : ?>
204 204
 						<p>
205 205
 							<input type="checkbox" id="facebook-share-on-publish" value="1" <?php checked( true, $fb_sop, true ); ?> name="ppp_share_settings[facebook][share_on_publish]" />
206 206
 							<label for="facebook-share-on-publish"><?php _e( 'Facebook', 'ppp-txt' ); ?></label>
207 207
 						</p>
208 208
 						<?php endif; ?>
209 209
 
210
-						<?php if ( ppp_linkedin_enabled() ) : ?>
210
+						<?php if (ppp_linkedin_enabled()) : ?>
211 211
 						<p>
212 212
 							<input type="checkbox" id="linkedin-share-on-publish" value="1" <?php checked( true, $li_sop, true ); ?> name="ppp_share_settings[linkedin][share_on_publish]" />
213 213
 							<label for="linkedin-share-on-publish"><?php _e( 'LinkedIn', 'ppp-txt' ); ?></label>
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 				</tr>
235 235
 
236 236
 				<?php
237
-				$shortener = isset( $ppp_share_settings['shortener'] ) ? $ppp_share_settings['shortener'] : false;
237
+				$shortener = isset($ppp_share_settings['shortener']) ? $ppp_share_settings['shortener'] : false;
238 238
 				?>
239 239
 				<tr valign="top">
240 240
 					<th scope="row" valign="top">
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
 								<?php do_action( 'ppp_url_shorteners', $shortener ); ?>
248 248
 							</select>
249 249
 						</p>
250
-						<?php if ( $shortener ) : ?>
251
-							<?php do_action( 'ppp_shortener_settings-' . $shortener ); ?>
250
+						<?php if ($shortener) : ?>
251
+							<?php do_action( 'ppp_shortener_settings-'.$shortener ); ?>
252 252
 						<?php endif; ?>
253 253
 					</td>
254 254
 				</tr>
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		.wp-list-table .column-content { width: 50%; }
282 282
 	</style>
283 283
 	<?php
284
-	require_once PPP_PATH . 'includes/admin/class-schedule-table.php';
284
+	require_once PPP_PATH.'includes/admin/class-schedule-table.php';
285 285
 	$schedule_table = new PPP_Schedule_Table();
286 286
 	$schedule_table->prepare_items();
287 287
 	?>
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		<div id="icon-options-general" class="icon32"></div><h1><?php _e( 'Post Promoter Pro - Scheduled Shares', 'ppp-txt' ); ?></h1>
290 290
 		<?php $schedule_table->display() ?>
291 291
 	</div>
292
-	<?php if ( ppp_is_shortener_enabled() ): ?>
292
+	<?php if (ppp_is_shortener_enabled()): ?>
293 293
 	<p>
294 294
 		<small><?php _e( 'NOTICE: Schedule view does not show shortened links, they will be shortened at the time of sharing', 'ppp-txt' ); ?></small>
295 295
 	</p>
@@ -307,24 +307,24 @@  discard block
 block discarded – undo
307 307
 	<div class="wrap">
308 308
 		<div id="icon-options-general" class="icon32"></div><h1><?php _e( 'Post Promoter Pro - System Info', 'ppp-txt' ); ?></h1>
309 309
 		<textarea style="font-family: Menlo, Monaco, monospace; white-space: pre" onclick="this.focus();this.select()" readonly cols="150" rows="35">
310
-	SITE_URL:                 <?php echo site_url() . "\n"; ?>
311
-	HOME_URL:                 <?php echo home_url() . "\n"; ?>
310
+	SITE_URL:                 <?php echo site_url()."\n"; ?>
311
+	HOME_URL:                 <?php echo home_url()."\n"; ?>
312 312
 
313
-	PPP Version:             <?php echo PPP_VERSION . "\n"; ?>
314
-	WordPress Version:        <?php echo get_bloginfo( 'version' ) . "\n"; ?>
313
+	PPP Version:             <?php echo PPP_VERSION."\n"; ?>
314
+	WordPress Version:        <?php echo get_bloginfo( 'version' )."\n"; ?>
315 315
 
316 316
 	PPP SETTINGS:
317 317
 	<?php
318
-	foreach ( $ppp_options as $name => $value ) {
319
-	if ( $value == false ) {
318
+	foreach ($ppp_options as $name => $value) {
319
+	if ($value == false) {
320 320
 		$value = 'false';
321 321
 	}
322 322
 
323
-	if ( $value == '1' ) {
323
+	if ($value == '1') {
324 324
 		$value = 'true';
325 325
 	}
326 326
 
327
-	echo $name . ': ' . maybe_serialize( $value ) . "\n\t";
327
+	echo $name.': '.maybe_serialize( $value )."\n\t";
328 328
 	}
329 329
 	?>
330 330
 
@@ -333,61 +333,61 @@  discard block
 block discarded – undo
333 333
 	$plugins = get_plugins();
334 334
 	$active_plugins = get_option( 'active_plugins', array() );
335 335
 
336
-	foreach ( $plugins as $plugin_path => $plugin ) {
336
+	foreach ($plugins as $plugin_path => $plugin) {
337 337
 		// If the plugin isn't active, don't show it.
338
-		if ( ! in_array( $plugin_path, $active_plugins ) ) {
338
+		if ( ! in_array( $plugin_path, $active_plugins )) {
339 339
 			continue;
340 340
 		}
341 341
 
342
-		echo $plugin['Name']; ?>: <?php echo $plugin['Version'] ."\n\t";
342
+		echo $plugin['Name']; ?>: <?php echo $plugin['Version']."\n\t";
343 343
 
344 344
 	}
345 345
 	?>
346 346
 
347 347
 	CURRENT THEME:
348 348
 	<?php
349
-	if ( get_bloginfo( 'version' ) < '3.4' ) {
350
-		$theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
351
-		echo $theme_data['Name'] . ': ' . $theme_data['Version'];
349
+	if (get_bloginfo( 'version' ) < '3.4') {
350
+		$theme_data = get_theme_data( get_stylesheet_directory().'/style.css' );
351
+		echo $theme_data['Name'].': '.$theme_data['Version'];
352 352
 	} else {
353 353
 		$theme_data = wp_get_theme();
354
-		echo $theme_data->Name . ': ' . $theme_data->Version;
354
+		echo $theme_data->Name.': '.$theme_data->Version;
355 355
 	}
356 356
 	?>
357 357
 
358 358
 
359
-	Multi-site:               <?php echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n" ?>
359
+	Multi-site:               <?php echo is_multisite() ? 'Yes'."\n" : 'No'."\n" ?>
360 360
 
361 361
 	ADVANCED INFO:
362
-	PHP Version:              <?php echo PHP_VERSION . "\n"; ?>
363
-	MySQL Version:            <?php echo $wpdb->db_version() . "\n"; ?>
364
-	Web Server Info:          <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
362
+	PHP Version:              <?php echo PHP_VERSION."\n"; ?>
363
+	MySQL Version:            <?php echo $wpdb->db_version()."\n"; ?>
364
+	Web Server Info:          <?php echo $_SERVER['SERVER_SOFTWARE']."\n"; ?>
365 365
 
366
-	PHP Memory Limit:         <?php echo ini_get( 'memory_limit' ) . "\n"; ?>
367
-	PHP Post Max Size:        <?php echo ini_get( 'post_max_size' ) . "\n"; ?>
368
-	PHP Time Limit:           <?php echo ini_get( 'max_execution_time' ) . "\n"; ?>
366
+	PHP Memory Limit:         <?php echo ini_get( 'memory_limit' )."\n"; ?>
367
+	PHP Post Max Size:        <?php echo ini_get( 'post_max_size' )."\n"; ?>
368
+	PHP Time Limit:           <?php echo ini_get( 'max_execution_time' )."\n"; ?>
369 369
 
370
-	WP_DEBUG:                 <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?>
371
-	SCRIPT_DEBUG:             <?php echo defined( 'SCRIPT_DEBUG' ) ? SCRIPT_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?>
370
+	WP_DEBUG:                 <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled'."\n" : 'Disabled'."\n" : 'Not set'."\n" ?>
371
+	SCRIPT_DEBUG:             <?php echo defined( 'SCRIPT_DEBUG' ) ? SCRIPT_DEBUG ? 'Enabled'."\n" : 'Disabled'."\n" : 'Not set'."\n" ?>
372 372
 
373
-	WP Table Prefix:          <?php echo "Length: ". strlen( $wpdb->prefix ); echo " Status:"; if ( strlen( $wpdb->prefix )>16 ) {echo " ERROR: Too Long";} else {echo " Acceptable";} echo "\n"; ?>
373
+	WP Table Prefix:          <?php echo "Length: ".strlen( $wpdb->prefix ); echo " Status:"; if (strlen( $wpdb->prefix ) > 16) {echo " ERROR: Too Long"; } else {echo " Acceptable"; } echo "\n"; ?>
374 374
 
375
-	Show On Front:            <?php echo get_option( 'show_on_front' ) . "\n" ?>
376
-	Page On Front:            <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ) . ' #' . $id . "\n" ?>
377
-	Page For Posts:           <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ) . ' #' . $id . "\n" ?>
375
+	Show On Front:            <?php echo get_option( 'show_on_front' )."\n" ?>
376
+	Page On Front:            <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ).' #'.$id."\n" ?>
377
+	Page For Posts:           <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ).' #'.$id."\n" ?>
378 378
 
379
-	Session:                  <?php echo isset( $_SESSION ) ? 'Enabled' : 'Disabled'; ?><?php echo "\n"; ?>
379
+	Session:                  <?php echo isset($_SESSION) ? 'Enabled' : 'Disabled'; ?><?php echo "\n"; ?>
380 380
 	Session Name:             <?php echo esc_html( ini_get( 'session.name' ) ); ?><?php echo "\n"; ?>
381 381
 	Cookie Path:              <?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?><?php echo "\n"; ?>
382 382
 	Save Path:                <?php echo esc_html( ini_get( 'session.save_path' ) ); ?><?php echo "\n"; ?>
383 383
 	Use Cookies:              <?php echo ini_get( 'session.use_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?>
384 384
 	Use Only Cookies:         <?php echo ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?>
385 385
 
386
-	UPLOAD_MAX_FILESIZE:      <?php if ( function_exists( 'phpversion' ) ) echo ini_get( 'upload_max_filesize' ); ?><?php echo "\n"; ?>
387
-	POST_MAX_SIZE:            <?php if ( function_exists( 'phpversion' ) ) echo ini_get( 'post_max_size' ); ?><?php echo "\n"; ?>
386
+	UPLOAD_MAX_FILESIZE:      <?php if (function_exists( 'phpversion' )) echo ini_get( 'upload_max_filesize' ); ?><?php echo "\n"; ?>
387
+	POST_MAX_SIZE:            <?php if (function_exists( 'phpversion' )) echo ini_get( 'post_max_size' ); ?><?php echo "\n"; ?>
388 388
 	WordPress Memory Limit:   <?php echo WP_MEMORY_LIMIT; ?><?php echo "\n"; ?>
389
-	DISPLAY ERRORS:           <?php echo ( ini_get( 'display_errors' ) ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A'; ?><?php echo "\n"; ?>
390
-	FSOCKOPEN:                <?php echo ( function_exists( 'fsockopen' ) ) ? __( 'Your server supports fsockopen.', 'ppp-txt' ) : __( 'Your server does not support fsockopen.', 'ppp-txt' ); ?><?php echo "\n"; ?>
389
+	DISPLAY ERRORS:           <?php echo (ini_get( 'display_errors' )) ? 'On ('.ini_get( 'display_errors' ).')' : 'N/A'; ?><?php echo "\n"; ?>
390
+	FSOCKOPEN:                <?php echo (function_exists( 'fsockopen' )) ? __( 'Your server supports fsockopen.', 'ppp-txt' ) : __( 'Your server does not support fsockopen.', 'ppp-txt' ); ?><?php echo "\n"; ?>
391 391
 		</textarea>
392 392
 	</div>
393 393
 	<?php
Please login to merge, or discard this patch.
includes/admin/class-accounts-table.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined( 'ABSPATH' )) {
5 5
 	exit;
6 6
 }
7 7
 
8
-if ( ! class_exists( 'WP_List_Table' ) ) {
9
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
8
+if ( ! class_exists( 'WP_List_Table' )) {
9
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
10 10
 }
11 11
 
12 12
 /**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @return string              The Content to display
43 43
 	 */
44 44
 	public function column_default( $item, $column_name ) {
45
-		return $item[ $column_name ];
45
+		return $item[$column_name];
46 46
 	}
47 47
 
48 48
 	/**
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 
75 75
 		$accounts = apply_filters( 'ppp_register_social_service', array() );
76 76
 
77
-		foreach ( $accounts as $account ) {
77
+		foreach ($accounts as $account) {
78 78
 			$data[$account] = array(
79
-				'icon'    => apply_filters( 'ppp_account_list_icon-' . $account, '' ),
80
-				'avatar'  => apply_filters( 'ppp_account_list_avatar-' . $account, '' ),
81
-				'name'    => apply_filters( 'ppp_account_list_name-' . $account, '' ),
82
-				'actions' => apply_filters( 'ppp_account_list_actions-' . $account, '' ),
83
-				'extras'  => apply_filters( 'ppp_account_list_extras-' . $account, '' ),
79
+				'icon'    => apply_filters( 'ppp_account_list_icon-'.$account, '' ),
80
+				'avatar'  => apply_filters( 'ppp_account_list_avatar-'.$account, '' ),
81
+				'name'    => apply_filters( 'ppp_account_list_name-'.$account, '' ),
82
+				'actions' => apply_filters( 'ppp_account_list_actions-'.$account, '' ),
83
+				'extras'  => apply_filters( 'ppp_account_list_extras-'.$account, '' ),
84 84
 			);
85 85
 		}
86 86
 
Please login to merge, or discard this patch.
includes/admin/class-schedule-table.php 2 patches
Switch Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -43,21 +43,21 @@
 block discarded – undo
43 43
 	 */
44 44
 	public function column_default( $item, $column_name ) {
45 45
 		switch ( $column_name ) {
46
-		case 'date':
47
-		case 'post_title':
48
-			return $item[ $column_name ];
49
-		case 'content':
50
-			$content = $item[ $column_name ];
51
-			return $content;
52
-		case 'image':
53
-			if ( ! empty( $item['image_url'] ) ) {
54
-				$content = '<img src="' . $item['image_url'] . '" />';
55
-			} else {
56
-				$content = __( 'None', 'ppp-txt' );
57
-			}
58
-			return $content;
59
-		default:
60
-			return;
46
+			case 'date':
47
+			case 'post_title':
48
+				return $item[ $column_name ];
49
+			case 'content':
50
+				$content = $item[ $column_name ];
51
+				return $content;
52
+			case 'image':
53
+				if ( ! empty( $item['image_url'] ) ) {
54
+					$content = '<img src="' . $item['image_url'] . '" />';
55
+				} else {
56
+					$content = __( 'None', 'ppp-txt' );
57
+				}
58
+				return $content;
59
+			default:
60
+				return;
61 61
 		}
62 62
 	}
63 63
 
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly
4
-if ( ! defined( 'ABSPATH' ) ) {
4
+if ( ! defined( 'ABSPATH' )) {
5 5
 	exit;
6 6
 }
7 7
 
8
-if ( ! class_exists( 'WP_List_Table' ) ) {
9
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
8
+if ( ! class_exists( 'WP_List_Table' )) {
9
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
10 10
 }
11 11
 
12 12
 /**
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 	 * @return string              The Content to display
43 43
 	 */
44 44
 	public function column_default( $item, $column_name ) {
45
-		switch ( $column_name ) {
45
+		switch ($column_name) {
46 46
 		case 'date':
47 47
 		case 'post_title':
48
-			return $item[ $column_name ];
48
+			return $item[$column_name];
49 49
 		case 'content':
50
-			$content = $item[ $column_name ];
50
+			$content = $item[$column_name];
51 51
 			return $content;
52 52
 		case 'image':
53
-			if ( ! empty( $item['image_url'] ) ) {
54
-				$content = '<img src="' . $item['image_url'] . '" />';
53
+			if ( ! empty($item['image_url'])) {
54
+				$content = '<img src="'.$item['image_url'].'" />';
55 55
 			} else {
56 56
 				$content = __( 'None', 'ppp-txt' );
57 57
 			}
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
 	 * @return string       The HTML to display for this column.
83 83
 	 */
84 84
 	public function column_post_title( $item ) {
85
-		$item_name = $item['name'] . '_' . $item['service'];
85
+		$item_name = $item['name'].'_'.$item['service'];
86 86
 		$actions   = array(
87
-			'edit'          => sprintf( __( '<a href="%s">Edit</a>', 'ppp-txt' ), admin_url( 'post.php?post=' . $item['post_id'] . '&action=edit#ppp_schedule_metabox' ) ),
88
-			'delete'        => sprintf( __( '<a href="%s">Delete</a>', 'ppp-txt' ), admin_url( 'admin.php?page=ppp-schedule-info&action=delete_item&post_id=' . $item['post_id'] . '&name=' . $item_name . '&index=' . $item['index'] ) ),
89
-			'share'         => sprintf( __( '<a href="%s">Share Now</a>', 'ppp-txt' ), admin_url( 'admin.php?page=ppp-schedule-info&action=share_now&post_id=' . $item['post_id'] . '&name=' . $item_name ) ),
90
-			'share_delete'  => sprintf( __( '<a href="%s">Share Now & Delete</a>', 'ppp-txt' ), admin_url( 'admin.php?page=ppp-schedule-info&action=share_now&post_id=' . $item['post_id'] . '&name=' . $item_name . '&index=' . $item['index'] . '&delete_too=true' ) ),
87
+			'edit'          => sprintf( __( '<a href="%s">Edit</a>', 'ppp-txt' ), admin_url( 'post.php?post='.$item['post_id'].'&action=edit#ppp_schedule_metabox' ) ),
88
+			'delete'        => sprintf( __( '<a href="%s">Delete</a>', 'ppp-txt' ), admin_url( 'admin.php?page=ppp-schedule-info&action=delete_item&post_id='.$item['post_id'].'&name='.$item_name.'&index='.$item['index'] ) ),
89
+			'share'         => sprintf( __( '<a href="%s">Share Now</a>', 'ppp-txt' ), admin_url( 'admin.php?page=ppp-schedule-info&action=share_now&post_id='.$item['post_id'].'&name='.$item_name ) ),
90
+			'share_delete'  => sprintf( __( '<a href="%s">Share Now & Delete</a>', 'ppp-txt' ), admin_url( 'admin.php?page=ppp-schedule-info&action=share_now&post_id='.$item['post_id'].'&name='.$item_name.'&index='.$item['index'].'&delete_too=true' ) ),
91 91
 		);
92 92
 
93
-		return sprintf( '<span class="dashicons icon-ppp-' . $item['service'] . '"></span>&nbsp;%1$s %2$s', $item['post_title'], $this->row_actions( $actions ) );
93
+		return sprintf( '<span class="dashicons icon-ppp-'.$item['service'].'"></span>&nbsp;%1$s %2$s', $item['post_title'], $this->row_actions( $actions ) );
94 94
 	}
95 95
 
96 96
 	/**
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 	 * @return string       The HTML to display the date
100 100
 	 */
101 101
 	public function column_date( $item ) {
102
-		$date = date_i18n( get_option('date_format') . ' @ ' . get_option('time_format'), $item['date'] );
103
-		if ( $item['conflict'] ) {
104
-			$date .= '<br /><small style="color: red">' . __( 'Warning: Multiple items scheduled at this time.', 'ppp-txt' ) . '</small>';
102
+		$date = date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), $item['date'] );
103
+		if ($item['conflict']) {
104
+			$date .= '<br /><small style="color: red">'.__( 'Warning: Multiple items scheduled at this time.', 'ppp-txt' ).'</small>';
105 105
 		}
106 106
 
107 107
 		return $date;
@@ -123,48 +123,48 @@  discard block
 block discarded – undo
123 123
 		$crons = ppp_get_shceduled_crons();
124 124
 
125 125
 		$cron_tally = array();
126
-		foreach ( $crons as $key => $cron ) {
126
+		foreach ($crons as $key => $cron) {
127 127
 			$ppp_data = $cron;
128 128
 			$timestamp = $ppp_data['timestamp'];
129 129
 
130
-			$cron_tally[$timestamp] = isset( $cron_tally[$timestamp] ) ? $cron_tally[$timestamp] + 1 : 1;
130
+			$cron_tally[$timestamp] = isset($cron_tally[$timestamp]) ? $cron_tally[$timestamp] + 1 : 1;
131 131
 
132 132
 			$name_parts = explode( '_', $ppp_data['args'][1] );
133 133
 			$post_id    = $ppp_data['args'][0];
134 134
 			$index      = $name_parts[1];
135
-			$service    = isset( $name_parts[3] ) ? $name_parts[3] : 'tw';
136
-			$builder    = 'ppp_' . $service . '_build_share_message';
137
-			$post_meta  = apply_filters( 'ppp_get_scheduled_items_' . $service, array(), $post_id );
135
+			$service    = isset($name_parts[3]) ? $name_parts[3] : 'tw';
136
+			$builder    = 'ppp_'.$service.'_build_share_message';
137
+			$post_meta  = apply_filters( 'ppp_get_scheduled_items_'.$service, array(), $post_id );
138 138
 			$image_url  = '';
139 139
 
140
-			if ( ! empty( $post_meta[$index]['attachment_id'] ) ) {
141
-				$image_url = ppp_post_has_media( $post_id, $service, true, $post_meta[ $index ]['attachment_id'] );
142
-			} elseif ( ! empty( $post_meta[ $index ]['image'] ) ) {
143
-				$image_url = $post_meta[ $index ]['image'];
140
+			if ( ! empty($post_meta[$index]['attachment_id'])) {
141
+				$image_url = ppp_post_has_media( $post_id, $service, true, $post_meta[$index]['attachment_id'] );
142
+			} elseif ( ! empty($post_meta[$index]['image'])) {
143
+				$image_url = $post_meta[$index]['image'];
144 144
 			}
145 145
 
146
-			$conflict   = $cron_tally[ $timestamp ] > 1 ? true : false;
146
+			$conflict   = $cron_tally[$timestamp] > 1 ? true : false;
147 147
 
148
-			$data[ $key ] = array(
148
+			$data[$key] = array(
149 149
 				'post_id'      => $post_id,
150 150
 				'post_title'   => get_the_title( $post_id ),
151 151
 				'service'      => $service,
152 152
 				'index'        => $index,
153
-				'date'         => $timestamp + ( get_option( 'gmt_offset' ) * 3600 ),
153
+				'date'         => $timestamp + (get_option( 'gmt_offset' ) * 3600),
154 154
 				'content'      => function_exists( $builder ) ? $builder( $post_id, $ppp_data['args'][1], false ) : '',
155
-				'name'         => 'sharedate_' . $index . '_' . $post_id,
155
+				'name'         => 'sharedate_'.$index.'_'.$post_id,
156 156
 				'conflict'     => $conflict,
157 157
 			);
158 158
 
159
-			if ( ! empty( $image_url ) ) {
160
-				$data[ $key ]['image_url'] = $image_url;
159
+			if ( ! empty($image_url)) {
160
+				$data[$key]['image_url'] = $image_url;
161 161
 			}
162 162
 
163
-			$description_function = 'ppp_' . $service . '_get_share_description';
164
-			if ( function_exists( $description_function ) ) {
163
+			$description_function = 'ppp_'.$service.'_get_share_description';
164
+			if (function_exists( $description_function )) {
165 165
 				$description = $description_function( $post_id, $index );
166
-				if ( ! empty( $description ) ) {
167
-					$data[ $key ]['content'] .= '<br />' . $description;
166
+				if ( ! empty($description)) {
167
+					$data[$key]['content'] .= '<br />'.$description;
168 168
 				}
169 169
 			}
170 170
 
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
 
173 173
 		$total_items = count( $data );
174 174
 
175
-		$offset = isset( $_GET['paged'] ) ? $_GET['paged'] : 1;
175
+		$offset = isset($_GET['paged']) ? $_GET['paged'] : 1;
176 176
 
177
-		$data = array_slice( $data, ( $offset - 1 ) * $per_page, $per_page, true );
177
+		$data = array_slice( $data, ($offset - 1) * $per_page, $per_page, true );
178 178
 		$this->items = $data;
179 179
 
180 180
 
Please login to merge, or discard this patch.
includes/admin/do-upgrades.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( !defined( 'ABSPATH' ) ) exit;
13
+if ( ! defined( 'ABSPATH' )) exit;
14 14
 
15 15
 /**
16 16
  * Render Upgrades Screen
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
  * @return void
20 20
 */
21 21
 function ppp_upgrades_screen() {
22
-	$action = isset( $_GET['ppp-upgrade'] ) ? sanitize_text_field( $_GET['ppp-upgrade'] ) : '';
23
-	$step   = isset( $_GET['step'] )        ? absint( $_GET['step'] )                     : 1;
24
-	$total  = isset( $_GET['total'] )       ? absint( $_GET['total'] )                    : false;
25
-	$custom = isset( $_GET['custom'] )      ? absint( $_GET['custom'] )                   : 0;
26
-	$number = isset( $_GET['number'] )      ? absint( $_GET['number'] )                   : 100;
27
-	$steps  = round( ( $total / $number ), 0 );
22
+	$action = isset($_GET['ppp-upgrade']) ? sanitize_text_field( $_GET['ppp-upgrade'] ) : '';
23
+	$step   = isset($_GET['step']) ? absint( $_GET['step'] ) : 1;
24
+	$total  = isset($_GET['total']) ? absint( $_GET['total'] ) : false;
25
+	$custom = isset($_GET['custom']) ? absint( $_GET['custom'] ) : 0;
26
+	$number = isset($_GET['number']) ? absint( $_GET['number'] ) : 100;
27
+	$steps  = round( ($total / $number), 0 );
28 28
 
29 29
 	$doing_upgrade_args = array(
30 30
 		'page'        => 'ppp-upgrades',
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	);
37 37
 
38 38
 	update_option( 'ppp_doing_upgrade', $doing_upgrade_args );
39
-	if ( $step > $steps ) {
39
+	if ($step > $steps) {
40 40
 		// Prevent a weird case where the estimate was off. Usually only a couple.
41 41
 		$steps = $step;
42 42
 	}
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	<div class="wrap">
45 45
 		<h1><?php _e( 'Post Promoter Pro - Upgrades', 'ppp-txt' ); ?></h1>
46 46
 
47
-		<?php if( ! empty( $action ) ) : ?>
47
+		<?php if ( ! empty($action)) : ?>
48 48
 
49 49
 			<div id="ppp-upgrade-status">
50 50
 				<p><?php _e( 'The upgrade process has started, please be patient. This could take several minutes. You will be automatically redirected when the upgrade is finished.', 'ppp-txt' ); ?></p>
51 51
 
52
-				<?php if( ! empty( $total ) ) : ?>
52
+				<?php if ( ! empty($total)) : ?>
53 53
 					<p><strong><?php printf( __( 'Step %d of approximately %d running', 'ppp-txt' ), $step, $steps ); ?></strong></p>
54 54
 				<?php endif; ?>
55 55
 			</div>
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( !defined( 'ABSPATH' ) ) exit;
13
+if ( !defined( 'ABSPATH' ) ) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * Render Upgrades Screen
@@ -57,11 +59,14 @@  discard block
 block discarded – undo
57 59
 				setTimeout(function() { document.location.href = "index.php?ppp_action=<?php echo $action; ?>&step=<?php echo $step; ?>&total=<?php echo $total; ?>&custom=<?php echo $custom; ?>"; }, 250);
58 60
 			</script>
59 61
 
60
-		<?php else : ?>
62
+		<?php else {
63
+	: ?>
61 64
 
62 65
 			<div id="ppp-upgrade-status">
63 66
 				<p>
64
-					<?php _e( 'The upgrade process has started, please be patient. This could take several minutes. You will be automatically redirected when the upgrade is finished.', 'ppp-txt' ); ?>
67
+					<?php _e( 'The upgrade process has started, please be patient. This could take several minutes. You will be automatically redirected when the upgrade is finished.', 'ppp-txt' );
68
+}
69
+?>
65 70
 				</p>
66 71
 			</div>
67 72
 			<script type="text/javascript">
Please login to merge, or discard this patch.