Completed
Pull Request — develop (#690)
by
unknown
01:43
created
class-tgm-plugin-activation.php 1 patch
Braces   +17 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1081,7 +1081,8 @@  discard block
 block discarded – undo
1081 1081
 					if ( ! $automatic ) {
1082 1082
 						// Make sure message doesn't display again if bulk activation is performed
1083 1083
 						// immediately after a single activation.
1084
-						if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1084
+						if ( ! isset( $_POST['action'] ) ) {
1085
+// WPCS: CSRF OK.
1085 1086
 							echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
1086 1087
 						}
1087 1088
 					} else {
@@ -1102,7 +1103,8 @@  discard block
 block discarded – undo
1102 1103
 				if ( ! $automatic ) {
1103 1104
 					// Make sure message doesn't display again if bulk activation is performed
1104 1105
 					// immediately after a single activation.
1105
-					if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1106
+					if ( ! isset( $_POST['action'] ) ) {
1107
+// WPCS: CSRF OK.
1106 1108
 						echo '<div id="message" class="error"><p>',
1107 1109
 							sprintf(
1108 1110
 								esc_html( $this->strings['plugin_needs_higher_version'] ),
@@ -1762,10 +1764,12 @@  discard block
 block discarded – undo
1762 1764
 			if ( 'update-core' === $screen->base ) {
1763 1765
 				// Core update screen.
1764 1766
 				return true;
1765
-			} elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
1767
+			} elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) {
1768
+// WPCS: CSRF ok.
1766 1769
 				// Plugins bulk update screen.
1767 1770
 				return true;
1768
-			} elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
1771
+			} elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) {
1772
+// WPCS: CSRF ok.
1769 1773
 				// Individual updates (ajax call).
1770 1774
 				return true;
1771 1775
 			}
@@ -2211,8 +2215,9 @@  discard block
 block discarded – undo
2211 2215
 	 * @return array
2212 2216
 	 */
2213 2217
 	function tgmpa_wpfavs_plugins( $token ) {
2214
-		if( empty( $token ) )
2215
-			return array();
2218
+		if( empty( $token ) ) {
2219
+					return array();
2220
+		}
2216 2221
 
2217 2222
 		$cache = json_decode( get_transient( 'tgmpa_wpfavs_plugins' ), true );
2218 2223
 
@@ -2221,15 +2226,17 @@  discard block
 block discarded – undo
2221 2226
 			$response = wp_remote_get( 'https://wpfavs.com/api/v1/wpfav/' . $token );
2222 2227
 
2223 2228
 			// Make sure there are no errors
2224
-			if ( is_wp_error( $response ) )
2225
-				return array();
2229
+			if ( is_wp_error( $response ) ) {
2230
+							return array();
2231
+			}
2226 2232
 
2227 2233
 			// Decode response
2228 2234
 			$response = apply_filters( 'tgmpa_wpfav_api_response', json_decode( wp_remote_retrieve_body( $response ), TRUE ) );
2229 2235
 
2230 2236
 			//check for api errors
2231
-			if( isset( $response['error'] ) )
2232
-				return array();
2237
+			if( isset( $response['error'] ) ) {
2238
+							return array();
2239
+			}
2233 2240
 
2234 2241
 			$plugins = array();
2235 2242
 			// create our plugins array
Please login to merge, or discard this patch.