Completed
Push — staging ( 327815...66d862 )
by
unknown
02:05
created
includes/api/class-yikes-inc-easy-mailchimp-api-abstract-items.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 			}
80 80
 
81 81
 			// If the API gave an error or there are no more lists, break.
82
-			if ( isset( $response['error'] ) ) {
83
-				return new WP_Error( $response['title'], $response['detail'] );
82
+			if ( isset( $response[ 'error' ] ) ) {
83
+				return new WP_Error( $response[ 'title' ], $response[ 'detail' ] );
84 84
 			}
85 85
 
86 86
 			if ( empty( $response[ $item_key ] ) ) {
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 			// Update the total number of items if it's still zero.
91 91
 			if ( 0 === $total ) {
92
-				$total = intval( $response['total_items'] );
92
+				$total = intval( $response[ 'total_items' ] );
93 93
 			}
94 94
 
95 95
 			// Store each new list.
@@ -196,28 +196,28 @@  discard block
 block discarded – undo
196 196
 			return $response;
197 197
 		}
198 198
 
199
-		if ( isset( $response['error'] ) ) {
200
-			$title  = isset( $response['title'] )  ? $response['title']  : $response['name'];
201
-			$detail = isset( $response['detail'] ) ? $response['detail'] : $response['error'];
202
-			$data   = isset( $response['errors'] ) ? $response['errors'] : array();
199
+		if ( isset( $response[ 'error' ] ) ) {
200
+			$title  = isset( $response[ 'title' ] ) ? $response[ 'title' ] : $response[ 'name' ];
201
+			$detail = isset( $response[ 'detail' ] ) ? $response[ 'detail' ] : $response[ 'error' ];
202
+			$data   = isset( $response[ 'errors' ] ) ? $response[ 'errors' ] : array();
203 203
 
204 204
 			return new WP_Error(
205 205
 				$title,
206 206
 				$detail,
207 207
 				array(
208
-					'status' => (int) $response['status'],
208
+					'status' => (int) $response[ 'status' ],
209 209
 					'data'   => $data,
210 210
 				)
211 211
 			);
212 212
 		}
213 213
 
214
-		if ( isset( $response['status'] ) && 503 === (int) $response['status'] ) {
214
+		if ( isset( $response[ 'status' ] ) && 503 === (int) $response[ 'status' ] ) {
215 215
 			return new WP_Error(
216
-				isset( $response['title'] ) ? $response['title'] : __( '503: This is most likely an Akamai error.', 'yikes-inc-easy-mailchimp-extender' ),
217
-				isset( $response['ref_no'] ) ? $response['ref_no'] : '',
216
+				isset( $response[ 'title' ] ) ? $response[ 'title' ] : __( '503: This is most likely an Akamai error.', 'yikes-inc-easy-mailchimp-extender' ),
217
+				isset( $response[ 'ref_no' ] ) ? $response[ 'ref_no' ] : '',
218 218
 				array(
219
-					'status' => (int) $response['status'],
220
-					'data'   => isset( $response['ref_no'] ) ? $response['ref_no'] : '',
219
+					'status' => (int) $response[ 'status' ],
220
+					'data'   => isset( $response[ 'ref_no' ] ) ? $response[ 'ref_no' ] : '',
221 221
 				)
222 222
 			);
223 223
 		}
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
 		// Mailchimp uses the application/problem+json type for errors.
247 247
 		$headers = wp_remote_retrieve_headers( $response );
248 248
 
249
-		if ( isset( $headers['content-type'] ) ) {
250
-			if ( false !== strpos( $headers['content-type'], 'application/problem+json' ) ) {
251
-				$body['error'] = true;
249
+		if ( isset( $headers[ 'content-type' ] ) ) {
250
+			if ( false !== strpos( $headers[ 'content-type' ], 'application/problem+json' ) ) {
251
+				$body[ 'error' ] = true;
252 252
 			}
253 253
 		}
254 254
 
Please login to merge, or discard this patch.
admin/partials/menu/options-sections/general-settings.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	}
28 28
 } else {
29 29
  ?>
30
- <h3><span><?php _e( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span><?php echo $api_connection; ?></h3>
30
+ <h3><span><?php _e( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span><?php echo $api_connection; ?></h3>
31 31
  <?php 	
32 32
 }
33 33
 ?>
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 		<!-- Mailchimp API Input Field -->
44 44
 		<label for="yks-mailchimp-api-key">
45 45
 
46
-			<p><?php _e( 'Enter your API key in the field below to connect your site to your Mailchimp account.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
46
+			<p><?php _e( 'Enter your API key in the field below to connect your site to your Mailchimp account.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
47 47
 
48
-			<p><strong><?php _e( 'Mailchimp API Key' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
48
+			<p><strong><?php _e( 'Mailchimp API Key', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
49 49
 
50
-			<input autocomplete="off" <?php if ( $yikes_mc_api_constant ) { echo 'readonly="readonly"'; } if( strlen( yikes_get_mc_api_key() ) > 0 ) { ?> type="password" <?php } else { ?> type="text" <?php } ?> value="<?php echo esc_attr( yikes_get_mc_api_key() ); ?>" placeholder="<?php _e( 'Mailchimp API Key' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="yikes-mc-api-key" id="yikes-mc-api-key" class="settings-page-input" />
50
+			<input autocomplete="off" <?php if ( $yikes_mc_api_constant ) { echo 'readonly="readonly"'; } if ( strlen( yikes_get_mc_api_key() ) > 0 ) { ?> type="password" <?php } else { ?> type="text" <?php } ?> value="<?php echo esc_attr( yikes_get_mc_api_key() ); ?>" placeholder="<?php _e( 'Mailchimp API Key', 'yikes-inc-easy-mailchimp-extender' ); ?>" name="yikes-mc-api-key" id="yikes-mc-api-key" class="settings-page-input" />
51 51
 
52 52
 			<?php if ( $yikes_mc_api_constant ) { ?>
53 53
 				<p class="description"><?php printf( __( "Your Mailchimp API key has been defined using the %s constant, in a PHP file.", "yikes-inc-easy-mailchimp-extender" ), '<code>YIKES_MC_API_KEY</code>' ); ?></p>
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
 			<?php echo $api_error_response; ?>
57 57
 
58 58
 			<?php if ( ! $yikes_mc_api_constant ) { ?>
59
-				<p class="description"><small><a href="https://admin.mailchimp.com/account/api" target="_blank" title="<?php _e( 'Get your API key here' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Get your API key here' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
59
+				<p class="description"><small><a href="https://admin.mailchimp.com/account/api" target="_blank" title="<?php _e( 'Get your API key here', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Get your API key here', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
60 60
 			<?php } ?>
61 61
 
62 62
 			<p class="description"><?php esc_html_e( 'Warning: changing your API key may break your current forms.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
63 63
 		</label>
64 64
 
65 65
 		<!-- Use Nonce Validation Field -->		
66
-		<p><strong><?php _e( 'Enable nonce validation on this site?' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
66
+		<p><strong><?php _e( 'Enable nonce validation on this site?', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
67 67
 		<label for="yikes-mailchimp-use-nonce-yes">
68 68
 			Yes
69
-			<input type="radio" name="yikes-mailchimp-use-nonce" id="yikes-mailchimp-use-nonce-yes" class="settings-page-input" value="1" <?php checked( get_option( 'yikes-mailchimp-use-nonce', '1' ) , '1' ); ?> />
69
+			<input type="radio" name="yikes-mailchimp-use-nonce" id="yikes-mailchimp-use-nonce-yes" class="settings-page-input" value="1" <?php checked( get_option( 'yikes-mailchimp-use-nonce', '1' ), '1' ); ?> />
70 70
 		</label>
71 71
 		<label for="yikes-mailchimp-use-nonce-no">
72 72
 			No
73
-			<input type="radio" name="yikes-mailchimp-use-nonce" id="yikes-mailchimp-use-nonce-no" class="settings-page-input" value="0" <?php checked( get_option( 'yikes-mailchimp-use-nonce', '1' ) , '0' ); ?> />
73
+			<input type="radio" name="yikes-mailchimp-use-nonce" id="yikes-mailchimp-use-nonce-no" class="settings-page-input" value="0" <?php checked( get_option( 'yikes-mailchimp-use-nonce', '1' ), '0' ); ?> />
74 74
 		</label>
75 75
 
76 76
 	<?php submit_button(); ?>
Please login to merge, or discard this patch.
admin/partials/menu/options-sections/debug-settings.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 	- display installation stuff here
4 4
 	- php version, wp version, plugin version and debug log
5 5
 -->
6
-<h3><span><?php _e( 'Debug Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
6
+<h3><span><?php _e( 'Debug Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
7 7
 
8 8
 <div class="inside">
9 9
 
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 	
13 13
 		<?php settings_fields( 'yikes_inc_easy_mc_debug_settings_page' ); ?>
14 14
 	
15
-		<label for="yikes-mailchimp-debug-status"><strong><?php _e( 'Enable Debugging' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
16
-			<input type="checkbox" name="yikes-mailchimp-debug-status" id="yikes-mailchimp-debug-status" value="1" <?php checked( get_option( 'yikes-mailchimp-debug-status' , '' ) , '1' ); ?>>
15
+		<label for="yikes-mailchimp-debug-status"><strong><?php _e( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
16
+			<input type="checkbox" name="yikes-mailchimp-debug-status" id="yikes-mailchimp-debug-status" value="1" <?php checked( get_option( 'yikes-mailchimp-debug-status', '' ), '1' ); ?>>
17 17
 		</label>
18
-		<p class="description"><?php _e( "If you encounter an issue with Easy Forms for Mailchimp you can toggle on debugging to display advanced error messages and start logging errors." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
18
+		<p class="description"><?php _e( "If you encounter an issue with Easy Forms for Mailchimp you can toggle on debugging to display advanced error messages and start logging errors.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
19 19
 		
20 20
 		<?php submit_button(); ?>
21 21
 									
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 				)
35 35
 			);
36 36
 		?>
37
-		<h2><?php _e( "Debug Log" , 'yikes-inc-easy-mailchimp-extender' ); ?> &nbsp; <a href="<?php echo $url; ?>" class="button-secondary"><?php _e( 'Clear Log', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h2>
37
+		<h2><?php _e( "Debug Log", 'yikes-inc-easy-mailchimp-extender' ); ?> &nbsp; <a href="<?php echo $url; ?>" class="button-secondary"><?php _e( 'Clear Log', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h2>
38 38
 		
39 39
 		<table class="widefat" id="yikes-mailchimp-error-log">
40 40
 			<!-- table header -->
Please login to merge, or discard this patch.