Passed
Push — master ( e64af5...ad1bda )
by Chris
03:25
created
includes/admin/licensing/updater.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         //add_filter( 'mwp_premium_perform_update', array( $this, 'premium_update' ) );
141 141
 
142 142
 	    // Add additional info if the license is expired.
143
-	    add_action( 'in_plugin_update_message-'. $this->plugin_path, array( $this, 'maybe_show_license_expired_message' ), 10, 2 );
143
+	    add_action( 'in_plugin_update_message-' . $this->plugin_path, array( $this, 'maybe_show_license_expired_message' ), 10, 2 );
144 144
     }
145 145
 
146 146
 	public function maybe_show_license_expired_message( $plugin_data, $response ) {
@@ -257,18 +257,18 @@  discard block
 block discarded – undo
257 257
 
258 258
         // Create a new stdClass object and populate it with our plugin information.
259 259
         $api                        = new stdClass;
260
-        $api->name                  = isset( $this->info->name )           ? $this->info->name           : '';
261
-        $api->slug                  = isset( $this->info->slug )           ? $this->info->slug           : '';
262
-        $api->version               = isset( $this->info->version )        ? $this->info->version        : '';
263
-        $api->author                = isset( $this->info->author )         ? $this->info->author         : '';
260
+        $api->name                  = isset( $this->info->name ) ? $this->info->name : '';
261
+        $api->slug                  = isset( $this->info->slug ) ? $this->info->slug : '';
262
+        $api->version               = isset( $this->info->version ) ? $this->info->version : '';
263
+        $api->author                = isset( $this->info->author ) ? $this->info->author : '';
264 264
         $api->author_profile        = isset( $this->info->author_profile ) ? $this->info->author_profile : '';
265
-        $api->requires              = isset( $this->info->requires )       ? $this->info->requires       : '';
266
-        $api->tested                = isset( $this->info->tested )         ? $this->info->tested         : '';
267
-        $api->last_updated          = isset( $this->info->last_updated )   ? $this->info->last_updated   : '';
268
-        $api->homepage              = isset( $this->info->homepage )       ? $this->info->homepage       : '';
265
+        $api->requires              = isset( $this->info->requires ) ? $this->info->requires : '';
266
+        $api->tested                = isset( $this->info->tested ) ? $this->info->tested : '';
267
+        $api->last_updated          = isset( $this->info->last_updated ) ? $this->info->last_updated : '';
268
+        $api->homepage              = isset( $this->info->homepage ) ? $this->info->homepage : '';
269 269
 
270
-        $changelog                  = isset( $this->info->changelog )      ? $this->info->changelog       : '';
271
-        $description                = isset( $this->info->description )    ? $this->info->description     : '';
270
+        $changelog                  = isset( $this->info->changelog ) ? $this->info->changelog : '';
271
+        $description                = isset( $this->info->description ) ? $this->info->description : '';
272 272
 
273 273
         if ( ! empty( $changelog ) ) {
274 274
              if ( ! empty( $description ) ) {
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
             $api->sections = array();
284 284
         }
285 285
 
286
-        $api->download_link         = isset( $this->info->download_link )  ? $this->info->download_link  : '';
286
+        $api->download_link = isset( $this->info->download_link ) ? $this->info->download_link : '';
287 287
 
288 288
         // Return the new API object with our custom data.
289 289
         return $api;
Please login to merge, or discard this patch.
includes/admin/pages/network-settings.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
                      */
49 49
                     do_action( 'monsterinsights_network_settings_general_tab_notice' );
50 50
                     ?>
51
-                    <h1><?php esc_html_e( 'Network Settings', 'google-analytics-for-wordpress'); ?></h1>
52
-                    <p><?php esc_html_e( 'Activate your MonsterInsights license key on this panel to hide the license key settings and addon pages for subsites.', 'google-analytics-for-wordpress'); ?></p>
51
+                    <h1><?php esc_html_e( 'Network Settings', 'google-analytics-for-wordpress' ); ?></h1>
52
+                    <p><?php esc_html_e( 'Activate your MonsterInsights license key on this panel to hide the license key settings and addon pages for subsites.', 'google-analytics-for-wordpress' ); ?></p>
53 53
                     <form id="monsterinsights-network-general-tab" method="post">
54 54
 
55 55
                     <table class="form-table">
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                                     <form id="monsterinsights-google-authenticate" method="post">
115 115
                                         <?php if ( MonsterInsights()->auth->get_network_viewname() && MonsterInsights()->auth->get_network_ua() ) { ?>
116 116
                                             <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_network_licensed() ) { ?>
117
-                                                <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p>
117
+                                                <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p>
118 118
                                             <?php } else { ?>
119 119
                                                 <p><?php echo esc_html__( 'Profile Active: ', 'google-analytics-for-wordpress' ) . MonsterInsights()->auth->get_network_viewname(); ?></p>
120 120
                                                 <p><?php wp_nonce_field( 'monsterinsights-google-authenticated-nonce', 'monsterinsights-google-authenticated-nonce' ); ?>
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                                             <?php } ?>
125 125
                                         <?php } else { ?>
126 126
                                             <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_network_licensed() ) { ?>
127
-                                                <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p>
127
+                                                <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p>
128 128
                                             <?php } else { ?>
129 129
                                                 <?php wp_nonce_field( 'monsterinsights-google-authenticate-nonce', 'monsterinsights-google-authenticate-nonce' ); ?>
130 130
                                                 <?php submit_button( esc_html__( 'Authenticate with your Google account', 'google-analytics-for-wordpress' ), 'button-action', 'monsterinsights-google-authenticate-submit', false ); ?>
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                             <?php if ( ! MonsterInsights()->auth->get_network_viewname() ) {
139 139
                                 $network_ua = MonsterInsights()->auth->get_network_manual_ua();
140 140
                             ?>
141
-                            <tr id="monsterinsights-google-ua-box" <?php echo (empty( $network_ua ) ? 'class="monsterinsights-hideme"' : ''); ?> >
141
+                            <tr id="monsterinsights-google-ua-box" <?php echo ( empty( $network_ua ) ? 'class="monsterinsights-hideme"' : '' ); ?> >
142 142
                                 <th scope="row">
143 143
                                         <label for="monsterinsights-google-ua"><?php esc_html_e( 'Network UA code', 'google-analytics-for-wordpress' ); ?></label>
144 144
                                     </th>
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
                                 </th>
157 157
                                 <td>
158 158
                                     <p>
159
-                                        <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="'. monsterinsights_get_url( 'network-settings-page', 'go-lite-pro-link', "https://www.monsterinsights.com/docs/go-lite-pro" ) .'">', '</a>' ); ?>
159
+                                        <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="' . monsterinsights_get_url( 'network-settings-page', 'go-lite-pro-link', "https://www.monsterinsights.com/docs/go-lite-pro" ) . '">', '</a>' ); ?>
160 160
                                     </p>
161 161
                                     <p>
162
-                                        <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="'. monsterinsights_get_upgrade_link( 'network-settings-page', 'upgrade-to-pro-link' ) .'">', '</a>' ); ?>
162
+                                        <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="' . monsterinsights_get_upgrade_link( 'network-settings-page', 'upgrade-to-pro-link' ) . '">', '</a>' ); ?>
163 163
                                     </p>
164 164
                                 </td>
165 165
                             </tr>
Please login to merge, or discard this patch.
includes/api-request.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -155,25 +155,25 @@  discard block
 block discarded – undo
155 155
 		$this->network   = is_network_admin() || ! empty( $args['network'] );
156 156
 
157 157
 		$default_token   = $this->network ? MonsterInsights()->auth->get_network_token() : MonsterInsights()->auth->get_token();
158
-		$default_key     = $this->network ? MonsterInsights()->auth->get_network_key()   : MonsterInsights()->auth->get_key();
158
+		$default_key     = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key();
159 159
 
160
-		$this->token     = ! empty( $args['token'] )     ? $args['token']  : $default_token;
161
-		$this->key       = ! empty( $args['key'] ) 	     ? $args['key']    : $default_key;
162
-		$this->tt        = ! empty( $args['tt'] ) 		 ? $args['tt']     : '';
163
-		$this->return    = ! empty( $args['return'] )    ? $args['return'] : '';
164
-		$this->start     = ! empty( $args['start'] )	 ? $args['start']  : '';
165
-		$this->end       = ! empty( $args['end'] )  	 ? $args['end']    : '';
160
+		$this->token     = ! empty( $args['token'] ) ? $args['token'] : $default_token;
161
+		$this->key       = ! empty( $args['key'] ) ? $args['key'] : $default_key;
162
+		$this->tt        = ! empty( $args['tt'] ) ? $args['tt'] : '';
163
+		$this->return    = ! empty( $args['return'] ) ? $args['return'] : '';
164
+		$this->start     = ! empty( $args['start'] ) ? $args['start'] : '';
165
+		$this->end       = ! empty( $args['end'] ) ? $args['end'] : '';
166 166
 
167 167
 		// We need to do this hack so that the network panel + the site_url of the main site are distinct
168 168
 		$this->site_url  = is_network_admin() ? network_admin_url() : site_url();
169 169
 
170 170
 		if ( monsterinsights_is_pro_version() ) {
171
-			$this->license   = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key();
171
+			$this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key();
172 172
 		}
173 173
 		$this->plugin    = MonsterInsights()->plugin_slug;
174 174
 		$this->miversion = MONSTERINSIGHTS_VERSION;
175
-		$this->sitei     = ! empty( $args['sitei'] )   ? $args['sitei'] : '';
176
-		$this->testurl   = ! empty( $args['testurl'] ) ? $args['testurl']    : '';
175
+		$this->sitei     = ! empty( $args['sitei'] ) ? $args['sitei'] : '';
176
+		$this->testurl   = ! empty( $args['testurl'] ) ? $args['testurl'] : '';
177 177
 	}
178 178
 
179 179
 	/**
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	public function request() {
187 187
 		// Make sure we're not blocked
188 188
 		$blocked = $this->is_blocked( $this->url );
189
-		if ( $blocked || is_wp_error( $blocked )  ) {
189
+		if ( $blocked || is_wp_error( $blocked ) ) {
190 190
 			if ( is_wp_error( $blocked ) ) {
191 191
 				return new WP_Error( 'api-error', sprintf( __( 'The firewall of your server is blocking outbound calls. Please contact your hosting provider to fix this issue. %s', 'google-analytics-for-wordpress' ), $blocked->get_error_message() ) );
192 192
 			} else {
@@ -243,14 +243,14 @@  discard block
 block discarded – undo
243 243
 		}
244 244
 
245 245
 		if ( 'GET' == $this->method ) {
246
-			$body['time']   = time(); // just to avoid caching
246
+			$body['time'] = time(); // just to avoid caching
247 247
 		}
248 248
 
249
-		$body['timezone'] = date('e');
249
+		$body['timezone'] = date( 'e' );
250 250
 
251 251
 		$body['network']  = $this->network ? 'network' : 'site';
252 252
 
253
-		$body['ip']   = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '';
253
+		$body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '';
254 254
 
255 255
 		// This filter will be removed in the future.
256 256
 		$body   = apply_filters( 'monsterinsights_api_request_body', $body );
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		);
282 282
 
283 283
 		// Perform the query and retrieve the response.
284
-		$response      = 'GET' == $this->method ? wp_remote_get( esc_url_raw( $this->url ) . '?' . $string, $data ) : wp_remote_post( esc_url_raw( $this->url ), $data );
284
+		$response = 'GET' == $this->method ? wp_remote_get( esc_url_raw( $this->url ) . '?' . $string, $data ) : wp_remote_post( esc_url_raw( $this->url ), $data );
285 285
 		//return new WP_Error( 'debug', '<pre>' . var_export( $response, true ) . '</pre>' );
286 286
 
287 287
 		if ( is_wp_error( $response ) ) {
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
 		// If not a 200 status header, send back error.
301 301
 		if ( 200 != $response_code ) {
302
-			$type  = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error';
302
+			$type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error';
303 303
 
304 304
 			if ( empty( $response_code ) ) {
305 305
 				return new WP_Error( $type, __( 'The API was unreachable.', 'google-analytics-for-wordpress' ) );
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 		// and for image linking purposes in Google Images. We use it to test outbound connections since it is run on google.com
390 390
 		// and is only a few bytes large. Plus on Google's main CDN so it loads in most places in 0.07 seconds or less. Perfect for our
391 391
 		// use case of quickly testing outbound connections. 
392
-		$testurl = ! empty( $this->testurl ) ? $this->testurl :'http://www.google.com/blank.html';
392
+		$testurl = ! empty( $this->testurl ) ? $this->testurl : 'http://www.google.com/blank.html';
393 393
 		if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
394 394
 			if ( defined( 'WP_ACCESSIBLE_HOSTS' ) ) {
395 395
 				$wp_http      = new WP_Http();
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 						'body'          => ''
405 405
 					);
406 406
 					$response = wp_remote_get( $testurl, $params );
407
-					if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
407
+					if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
408 408
 						return false;
409 409
 					} else {
410 410
 						if ( is_wp_error( $response ) ) {
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 			);
427 427
 			$response = wp_remote_get( $testurl, $params );
428 428
 
429
-			if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
429
+			if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
430 430
 				return false;
431 431
 			} else {
432 432
 				if ( is_wp_error( $response ) ) {
Please login to merge, or discard this patch.