Completed
Pull Request — master (#801)
by Viktor
28:51 queued 10:55
created
public/partials/shortcodes/yikes-mailchimp-subscriber-count.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 		return '';
27 27
 	}
28 28
 
29
-	$form    = ( ! empty( $attributes['form'] ) ) ? str_replace( '"', '', $attributes['form'] ) : false;
30
-	$list_id = ( ! empty( $attributes['list'] ) ) ? $attributes['list'] : false;
29
+	$form    = ( ! empty( $attributes[ 'form' ] ) ) ? str_replace( '"', '', $attributes[ 'form' ] ) : false;
30
+	$list_id = ( ! empty( $attributes[ 'list' ] ) ) ? $attributes[ 'list' ] : false;
31 31
 
32 32
 	/* If no list ID was passed into the shortcode - bail */
33 33
 	if ( ! $list_id && ! $form ) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			return '';
53 53
 		}
54 54
 
55
-		$list_id = sanitize_key( $form_data['list_id'] ); // associated list id (users who fill out the form will be subscribed to this list)
55
+		$list_id = sanitize_key( $form_data[ 'list_id' ] ); // associated list id (users who fill out the form will be subscribed to this list)
56 56
 	}
57 57
 
58 58
 	// object buffer
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	}
72 72
 
73 73
 	/* type cast the returned value as an integer */
74
-	echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $list_data['stats']['member_count'] );
74
+	echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $list_data[ 'stats' ][ 'member_count' ] );
75 75
 
76 76
 	return ob_get_clean();
77 77
 
Please login to merge, or discard this patch.
admin/partials/menu/options.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@  discard block
 block discarded – undo
5 5
 */
6 6
 
7 7
 	/* Get and Store Option Values */
8
-	if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) === 'valid_api_key' ) {
9
-		$api_connection = '<span id="connection-container" class="api-connected" title="' . __( "Your site is currently connected to the MailChimp API" , "yikes-inc-easy-mailchimp-extender" ) . '"><span class="dashicons dashicons-yes yikes-mc-api-connected"></span> ' . __( "Connected" , 'yikes-inc-easy-mailchimp-extender' ) . '</span>';
8
+	if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) === 'valid_api_key' ) {
9
+		$api_connection = '<span id="connection-container" class="api-connected" title="' . __( "Your site is currently connected to the MailChimp API", "yikes-inc-easy-mailchimp-extender" ) . '"><span class="dashicons dashicons-yes yikes-mc-api-connected"></span> ' . __( "Connected", 'yikes-inc-easy-mailchimp-extender' ) . '</span>';
10 10
 		$api_error_response = '';
11 11
 	} else {
12
-		$api_connection = '<span id="connection-container" class="api-not-connected"><span class="dashicons dashicons-no-alt yikes-mc-api-not-connected"></span>  ' . __( "Not Connected" , 'yikes-inc-easy-mailchimp-extender' ) . '</span>';
13
-		if( get_option( 'yikes-mc-api-invalid-key-response' , '' ) != '' ) {
14
-			$api_error_response = '<p><small><i class="dashicons dashicons-no-alt"></i> ' . get_option( 'yikes-mc-api-invalid-key-response' , '' ) . '</small></p>';
12
+		$api_connection = '<span id="connection-container" class="api-not-connected"><span class="dashicons dashicons-no-alt yikes-mc-api-not-connected"></span>  ' . __( "Not Connected", 'yikes-inc-easy-mailchimp-extender' ) . '</span>';
13
+		if ( get_option( 'yikes-mc-api-invalid-key-response', '' ) != '' ) {
14
+			$api_error_response = '<p><small><i class="dashicons dashicons-no-alt"></i> ' . get_option( 'yikes-mc-api-invalid-key-response', '' ) . '</small></p>';
15 15
 		} else {
16 16
 			$api_error_response = '';
17 17
 		}
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 	* @since 6.2.2
24 24
 	*
25 25
 	*/
26
-	if ( isset( $_REQUEST['section'] ) ) {
27
-		$_REQUEST['section'] = preg_replace('/[^\w-]/', '', strip_tags ( $_REQUEST['section'] ) );
26
+	if ( isset( $_REQUEST[ 'section' ] ) ) {
27
+		$_REQUEST[ 'section' ] = preg_replace( '/[^\w-]/', '', strip_tags( $_REQUEST[ 'section' ] ) );
28 28
 	}
29 29
 ?>
30 30
 	<!-- Actual Settings Form
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
 	<div class="wrap">
33 33
 
34 34
 		<!-- Freddie Logo -->
35
-		<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
35
+		<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
36 36
 
37
-		<h1>Easy Forms for MailChimp | <?php if ( isset( $_REQUEST['section'] ) ) { echo ucwords( str_replace( '-', ' ', $_REQUEST['section'] ) ); } else { echo __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ); } ?></h1>
37
+		<h1>Easy Forms for MailChimp | <?php if ( isset( $_REQUEST[ 'section' ] ) ) { echo ucwords( str_replace( '-', ' ', $_REQUEST[ 'section' ] ) ); } else { echo __( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); } ?></h1>
38 38
 
39 39
 		<!-- Settings Page Description -->
40
-		<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Manage the overall settings for Easy forms for MailChimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
40
+		<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Manage the overall settings for Easy forms for MailChimp.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
41 41
 		<?php
42 42
 			/* Success Messages on Options Updated */
43
-			if( isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated'] == 'true' ) {
43
+			if ( isset( $_REQUEST[ 'settings-updated' ] ) && $_REQUEST[ 'settings-updated' ] == 'true' ) {
44 44
 				?>
45 45
 				<div class="updated manage-form-admin-notice">
46 46
 					<p><?php _e( 'Settings successfully updated.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 				<?php
49 49
 			}
50 50
 			/* MailChimp API Cleared Successfully message */
51
-			if( isset( $_REQUEST['transient-cleared'] ) && $_REQUEST['transient-cleared'] == 'true' ) {
51
+			if ( isset( $_REQUEST[ 'transient-cleared' ] ) && $_REQUEST[ 'transient-cleared' ] == 'true' ) {
52 52
 				?>
53 53
 				<div class="updated manage-form-admin-notice">
54 54
 					<p><?php _e( 'MailChimp API Cache successfully cleared.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			}
58 58
 			/* Error Log Clear Messages */
59 59
 				/* Success Messages on Options Updated */
60
-				if( isset( $_REQUEST['error-log-cleared'] ) && $_REQUEST['error-log-cleared'] == 'true' ) {
60
+				if ( isset( $_REQUEST[ 'error-log-cleared' ] ) && $_REQUEST[ 'error-log-cleared' ] == 'true' ) {
61 61
 					?>
62 62
 					<div class="updated manage-form-admin-notice">
63 63
 						<p><?php _e( 'Error log successfully cleared.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 					<?php
66 66
 				}
67 67
 				/* MailChimp API Cleared Successfully message */
68
-				if( isset( $_REQUEST['error-log-cleared'] ) && $_REQUEST['error-log-cleared'] == 'false' ) {
68
+				if ( isset( $_REQUEST[ 'error-log-cleared' ] ) && $_REQUEST[ 'error-log-cleared' ] == 'false' ) {
69 69
 					?>
70 70
 					<div class="error manage-form-admin-notice">
71 71
 						<p><?php _e( "Whoops! We've encountered an error while trying to clear the error log. Please refresh the page and try again. If the error persists please get in touch with the YIKES Inc. support team.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -74,28 +74,28 @@  discard block
 block discarded – undo
74 74
 				}
75 75
 
76 76
 				/* Display a success message if our error log was sucessfully created, or display an error if not */
77
-				if( isset( $_GET['error_log_created'] ) && $_GET['error_log_created'] == 'true' ) {
77
+				if ( isset( $_GET[ 'error_log_created' ] ) && $_GET[ 'error_log_created' ] == 'true' ) {
78 78
 					?>
79 79
 					<div class="updated">
80 80
 						<p><?php _e( 'Error log successfully created. You may now start logging errors.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
81 81
 					</div>
82 82
 					<?php
83
-				} else if( isset( $_GET['error_log_created'] ) && $_GET['error_log_created'] == 'false' ) {
83
+				} else if ( isset( $_GET[ 'error_log_created' ] ) && $_GET[ 'error_log_created' ] == 'false' ) {
84 84
 					?>
85 85
 					<div class="error">
86
-						<p><?php echo esc_attr( urldecode( $_GET['error_message'] ) , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
86
+						<p><?php echo esc_attr( urldecode( $_GET[ 'error_message' ] ), 'yikes-inc-easy-mailchimp-extender' ); ?></p>
87 87
 					</div>
88 88
 					<?php
89 89
 				}
90 90
 
91 91
 				/* Display a success message if the user successfully imported some forms */
92
-				if( isset( $_GET['section'] ) && $_GET['section'] == 'import-export-forms' && isset( $_GET['import-forms'] ) && $_GET['import-forms'] == 'true' ) {
92
+				if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'import-export-forms' && isset( $_GET[ 'import-forms' ] ) && $_GET[ 'import-forms' ] == 'true' ) {
93 93
 					?>
94 94
 					<div class="updated">
95 95
 						<p><?php printf( __( 'Opt-in forms successfully imported. <a href="%s" title="View Forms">View Forms</a>', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?></p>
96 96
 					</div>
97 97
 					<?php
98
-				} elseif( isset( $_GET['section'] ) && $_GET['section'] == 'import-export-forms' && isset( $_GET['import-settings'] ) && $_GET['import-settings'] == 'true' ) {
98
+				} elseif ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'import-export-forms' && isset( $_GET[ 'import-settings' ] ) && $_GET[ 'import-settings' ] == 'true' ) {
99 99
 					?>
100 100
 					<div class="updated">
101 101
 						<p><?php printf( __( 'YIKES Easy Forms for MailChimp settings successfully imported.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?></p>
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 
117 117
 						<div class="postbox yikes-easy-mc-postbox">
118 118
 
119
-							<?php if( !isset( $_REQUEST['section'] ) || $_REQUEST['section'] == '' ) {
119
+							<?php if ( ! isset( $_REQUEST[ 'section' ] ) || $_REQUEST[ 'section' ] == '' ) {
120 120
 								include YIKES_MC_PATH . 'admin/partials/menu/options-sections/general-settings.php';
121 121
 							} else {
122
-								if( isset( $_REQUEST['addon'] ) && $_REQUEST['addon'] == 'true' ) {
123
-									include apply_filters( 'yikes-mailchimp-'.$_REQUEST['section'].'-options-path' , '' );
122
+								if ( isset( $_REQUEST[ 'addon' ] ) && $_REQUEST[ 'addon' ] == 'true' ) {
123
+									include apply_filters( 'yikes-mailchimp-' . $_REQUEST[ 'section' ] . '-options-path', '' );
124 124
 								} else {
125 125
 									// White list a set of files that are allowed to be included here
126 126
 									$file_base = 'admin/partials/menu/options-sections/';
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 										$file_base . 'recaptcha-settings.php',
134 134
 									);
135 135
 									// Ensure the included file is allowed and whitelisted above, before including it
136
-									if ( 0 === validate_file( 'admin/partials/menu/options-sections/' . $_REQUEST['section'] . '.php', $acceptable_files ) ) {
137
-										include YIKES_MC_PATH . 'admin/partials/menu/options-sections/' . $_REQUEST['section'] . '.php';
136
+									if ( 0 === validate_file( 'admin/partials/menu/options-sections/' . $_REQUEST[ 'section' ] . '.php', $acceptable_files ) ) {
137
+										include YIKES_MC_PATH . 'admin/partials/menu/options-sections/' . $_REQUEST[ 'section' ] . '.php';
138 138
 									} else {
139 139
 										wp_die( esc_attr__( 'Invalid file. If this error persists, please contact support.', 'yikes-inc-easy-mailchimp' ) );
140 140
 									}
Please login to merge, or discard this patch.
admin/partials/menu/add-ons.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@
 block discarded – undo
7 7
 <div class="wrap">
8 8
 
9 9
 	<!-- Freddie Logo -->
10
-	<img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
10
+	<img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
11 11
 
12
-	<h1>Easy Forms for MailChimp | <?php echo esc_attr__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> &nbsp; <a href="https://yikesplugins.com/plugins/?plugins=MailChimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1>
12
+	<h1>Easy Forms for MailChimp | <?php echo esc_attr__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?> &nbsp; <a href="https://yikesplugins.com/plugins/?plugins=MailChimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1>
13 13
 
14 14
 	<!-- Addons Page Description -->
15
-	<p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find all free and paid add-ons available for Easy Forms for MailChimp. Each add-on extends the functionality of the free plugin." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
15
+	<p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find all free and paid add-ons available for Easy Forms for MailChimp. Each add-on extends the functionality of the free plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
16 16
 
17 17
 	<!-- Add-On Container -->
18 18
 	<section id="add-ons">
Please login to merge, or discard this patch.
includes/api/class-yikes-inc-easy-mailchimp-api-abstract-items.php 1 patch
Spacing   +11 added lines, -11 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,16 +196,16 @@  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
 			);
@@ -234,9 +234,9 @@  discard block
 block discarded – undo
234 234
 
235 235
 		// MailChimp uses the application/problem+json type for errors
236 236
 		$headers = wp_remote_retrieve_headers( $response );
237
-		if ( isset( $headers['content-type'] ) ) {
238
-			if ( false !== strpos( $headers['content-type'], 'application/problem+json' ) ) {
239
-				$body['error'] = true;
237
+		if ( isset( $headers[ 'content-type' ] ) ) {
238
+			if ( false !== strpos( $headers[ 'content-type' ], 'application/problem+json' ) ) {
239
+				$body[ 'error' ] = true;
240 240
 			}
241 241
 		}
242 242
 
Please login to merge, or discard this patch.
includes/api/class-yikes-inc-easy-mailchimp-api.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 * @return array|WP_Error
104 104
 	 */
105 105
 	public function patch( $path = '', $headers = array(), $params = array() ) {
106
-		if ( ! isset( $params['body'] ) ) {
106
+		if ( ! isset( $params[ 'body' ] ) ) {
107 107
 			return new WP_Error(
108 108
 				'yikesinc_eme_missing_body',
109 109
 				sprintf(
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @return array|WP_Error
131 131
 	 */
132 132
 	public function post( $path = '', $headers = array(), $params = array() ) {
133
-		if ( ! isset( $params['body'] ) ) {
133
+		if ( ! isset( $params[ 'body' ] ) ) {
134 134
 			return new WP_Error(
135 135
 				'yikesinc_eme_missing_body',
136 136
 				sprintf(
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @return array|WP_Error
158 158
 	 */
159 159
 	public function put( $path = '', $headers = array(), $params = array() ) {
160
-		if ( ! isset( $params['body'] ) ) {
160
+		if ( ! isset( $params[ 'body' ] ) ) {
161 161
 			return new WP_Error(
162 162
 				'yikesinc_eme_missing_body',
163 163
 				sprintf(
@@ -288,13 +288,13 @@  discard block
 block discarded – undo
288 288
 		$authorized_args = $this->get_authorized_args();
289 289
 
290 290
 		// If we have body data, maybe convert it to JSON.
291
-		if ( isset( $params['body'] ) && ( is_array( $params['body'] ) || is_object( $params['body'] ) ) ) {
292
-			$params['body']          = json_encode( wp_parse_args( $authorized_args['body'], $params['body'] ) );
293
-			$headers['Content-Type'] = 'application/json';
291
+		if ( isset( $params[ 'body' ] ) && ( is_array( $params[ 'body' ] ) || is_object( $params[ 'body' ] ) ) ) {
292
+			$params[ 'body' ]          = json_encode( wp_parse_args( $authorized_args[ 'body' ], $params[ 'body' ] ) );
293
+			$headers[ 'Content-Type' ] = 'application/json';
294 294
 		}
295 295
 
296 296
 		// Combine the given headers and auth headers
297
-		$headers = wp_parse_args( $authorized_args['headers'], $headers );
297
+		$headers = wp_parse_args( $authorized_args[ 'headers' ], $headers );
298 298
 		/**
299 299
 		 * Filter the headers used for a request to the MailChimp API.
300 300
 		 *
@@ -358,12 +358,12 @@  discard block
 block discarded – undo
358 358
 
359 359
 		// Version 2.0 uses body authorization
360 360
 		if ( version_compare( '3.0', $this->api_version, '>' ) ) {
361
-			$args['body'] = $this->get_auth_body();
361
+			$args[ 'body' ] = $this->get_auth_body();
362 362
 		}
363 363
 
364 364
 		// Version 3.0 uses authorization headers.
365 365
 		if ( version_compare( '3.0', $this->api_version, '<=' ) ) {
366
-			$args['headers'] = $this->get_auth_headers();
366
+			$args[ 'headers' ] = $this->get_auth_headers();
367 367
 		}
368 368
 
369 369
 		return $args;
Please login to merge, or discard this patch.
includes/class-yikes-inc-easy-mailchimp-extender-activator.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 			if ( $network_wide ) {
35 35
 				$old_blog = $wpdb->blogid;
36 36
 				// Get all blog ids
37
-				$blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
37
+				$blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
38 38
 				foreach ( $blogids as $blog_id ) {
39 39
 					switch_to_blog( $blog_id );
40 40
 					self::_activate_yikes_easy_mailchimp( $wpdb );
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 		custom_fields TEXT NOT NULL,
91 91
 		UNIQUE KEY id (id)
92 92
 		) $charset_collate;";
93
-		require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
94
-		dbDelta($sql);
93
+		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
94
+		dbDelta( $sql );
95 95
 
96 96
 		// create an option for the date that the user initially activated the plugin
97 97
 		// used to display a two week notice, asking for a review or to upgrade
Please login to merge, or discard this patch.
Braces   +10 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
19 19
  * @author     YIKES Inc. <[email protected]>
20 20
  */
21
-class Yikes_Inc_Easy_Mailchimp_Extender_Activator {
21
+class Yikes_Inc_Easy_Mailchimp_Extender_Activator {
22 22
 	/**
23 23
 	 * Short Description. Activation hook.
24 24
 	 *
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @since    6.0.0
28 28
 	 */
29
-	public static function activate( $network_wide ) {
29
+	public static function activate( $network_wide ) {
30 30
 		global $wpdb;
31 31
 
32
-		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
32
+		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
33 33
 			// check if it is a network activation - if so, run the activation function for each blog id
34
-			if ( $network_wide ) {
34
+			if ( $network_wide ) {
35 35
 				$old_blog = $wpdb->blogid;
36 36
 				// Get all blog ids
37 37
 				$blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
38
-				foreach ( $blogids as $blog_id ) {
38
+				foreach ( $blogids as $blog_id ) {
39 39
 					switch_to_blog( $blog_id );
40 40
 					self::_activate_yikes_easy_mailchimp( $wpdb );
41 41
 					restore_current_blog();
@@ -44,7 +44,8 @@  discard block
 block discarded – undo
44 44
 				return;
45 45
 			}
46 46
 			self::_activate_yikes_easy_mailchimp( $wpdb );
47
-		} else { /* end network activate */
47
+		} else {
48
+/* end network activate */
48 49
 			self::_activate_yikes_easy_mailchimp( $wpdb );
49 50
 		}
50 51
 	}
@@ -56,7 +57,7 @@  discard block
 block discarded – undo
56 57
 	 *
57 58
 	 * @since    6.0.0
58 59
 	 */
59
-	static function _activate_yikes_easy_mailchimp( $wpdb ) {
60
+	static function _activate_yikes_easy_mailchimp( $wpdb ) {
60 61
 
61 62
 		// single site
62 63
 		$custom_table_name = $wpdb->prefix . 'yikes_easy_mc_forms';
@@ -95,12 +96,12 @@  discard block
 block discarded – undo
95 96
 
96 97
 		// create an option for the date that the user initially activated the plugin
97 98
 		// used to display a two week notice, asking for a review or to upgrade
98
-		if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) || get_option( 'yikes_easy_mailchimp_activation_date' ) == '' ) {
99
+		if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) || get_option( 'yikes_easy_mailchimp_activation_date' ) == '' ) {
99 100
 			update_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) );
100 101
 		}
101 102
 
102 103
 		// Create an option for the forms.
103
-		if ( class_exists( 'Yikes_Inc_Easy_MailChimp_Extender_Option_Forms' ) ) {
104
+		if ( class_exists( 'Yikes_Inc_Easy_MailChimp_Extender_Option_Forms' ) ) {
104 105
 			$option_class = new Yikes_Inc_Easy_MailChimp_Extender_Option_Forms();
105 106
 			$option_class->create_option();
106 107
 		}
Please login to merge, or discard this patch.
includes/class-yikes-inc-easy-mailchimp-extender.php 1 patch
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
26 26
  * @author     YIKES Inc. <[email protected]>
27 27
  */
28
-class Yikes_Inc_Easy_Mailchimp_Extender {
28
+class Yikes_Inc_Easy_Mailchimp_Extender {
29 29
 	/**
30 30
 	 * The loader that's responsible for maintaining and registering all hooks that power
31 31
 	 * the plugin.
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @param Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface
72 72
 	 */
73
-	public function __construct( Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface ) {
73
+	public function __construct( Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface ) {
74 74
 		$this->version = YIKES_MC_VERSION;
75 75
 		$this->form_interface = $form_interface;
76 76
 		$this->load_dependencies();
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @since    1.0.0
94 94
 	 * @access   private
95 95
 	 */
96
-	private function load_dependencies() {
96
+	private function load_dependencies() {
97 97
 		/**
98 98
 		 * The class responsible for orchestrating the actions and filters of the
99 99
 		 * core plugin.
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @since    1.0.0
118 118
 	 * @access   private
119 119
 	 */
120
-	private function define_admin_hooks() {
120
+	private function define_admin_hooks() {
121 121
 		$plugin_admin = new Yikes_Inc_Easy_Mailchimp_Forms_Admin( $this->get_yikes_inc_easy_mailchimp_extender(), $this->get_version(), $this->form_interface );
122 122
 		$plugin_admin->hooks();
123 123
 		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @since    1.0.0
131 131
 	 * @access   private
132 132
 	 */
133
-	private function define_public_hooks() {
133
+	private function define_public_hooks() {
134 134
 		$plugin_public = new Yikes_Inc_Easy_Mailchimp_Extender_Public( $this->get_yikes_inc_easy_mailchimp_extender(), $this->get_version() );
135 135
 	}
136 136
 	/**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 *
139 139
 	 * @since    1.0.0
140 140
 	 */
141
-	public function run() {
141
+	public function run() {
142 142
 		$this->loader->run();
143 143
 	}
144 144
 	/**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * @since     1.0.0
149 149
 	 * @return    string    The name of the plugin.
150 150
 	 */
151
-	public function get_yikes_inc_easy_mailchimp_extender() {
151
+	public function get_yikes_inc_easy_mailchimp_extender() {
152 152
 		return $this->yikes_inc_easy_mailchimp_extender;
153 153
 	}
154 154
 	/**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @since     1.0.0
158 158
 	 * @return    Yikes_Inc_Easy_Mailchimp_Extender_Loader    Orchestrates the hooks of the plugin.
159 159
 	 */
160
-	public function get_loader() {
160
+	public function get_loader() {
161 161
 		return $this->loader;
162 162
 	}
163 163
 	/**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 * @since     1.0.0
167 167
 	 * @return    string    The version number of the plugin.
168 168
 	 */
169
-	public function get_version() {
169
+	public function get_version() {
170 170
 		return $this->version;
171 171
 	}
172 172
 }
Please login to merge, or discard this patch.
includes/third-party-integrations/visual-composer/visual-composer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 		if ( ! empty( $all_forms ) ) {
107 107
 			// build an array to pass to our javascript
108 108
 			foreach ( $all_forms as $id => $form ) {
109
-				$lists[ $form['form_name'] ] = $id;
109
+				$lists[ $form[ 'form_name' ] ] = $id;
110 110
 			}
111 111
 		} else {
112 112
 			$lists[ __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ) ] = '-';
Please login to merge, or discard this patch.
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,18 +5,18 @@  discard block
 block discarded – undo
5 5
 *	@since 6.0.3
6 6
 */
7 7
 
8
-class YIKES_MailChimp_Visual_Composer_Extension {
8
+class YIKES_MailChimp_Visual_Composer_Extension {
9 9
 
10 10
 	/**
11 11
 	 * Constructor
12 12
 	 *
13 13
 	 * @since 6.0.3
14 14
 	 */
15
-	function __construct() {
15
+	function __construct() {
16 16
 		
17 17
 		add_action( 'admin_init', array( $this, 'extend_visual_composer' ) );
18 18
 
19
-		if ( function_exists( 'vc_add_shortcode_param' ) ) {
19
+		if ( function_exists( 'vc_add_shortcode_param' ) ) {
20 20
 			vc_add_shortcode_param( 'yikes_mailchimp_logo', array( $this, 'yikes_mailchimp_logo_vc_section' ) );
21 21
 		}
22 22
 	}
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @since 6.0.3
28 28
 	 */
29
-	public function extend_visual_composer() {
29
+	public function extend_visual_composer() {
30 30
 
31
-		if ( ! function_exists( 'vc_map' ) ) {
31
+		if ( ! function_exists( 'vc_map' ) ) {
32 32
 			return;
33 33
 		}
34 34
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 *
99 99
 	 * @since 6.0.3
100 100
 	 */
101
-	public function yikes_mailchimp_logo_vc_section() {
101
+	public function yikes_mailchimp_logo_vc_section() {
102 102
 		return '<img style="width:250px;display:block;margin:0 auto;" src="' . YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png" title="' . __( 'Easy Forms for MailChimp', 'yikes-inc-easy-mailchimp-extender' ) . '" />';
103 103
 	}
104 104
 
@@ -107,17 +107,17 @@  discard block
 block discarded – undo
107 107
 	 *
108 108
 	 * @since 6.0.3
109 109
 	 */
110
-	public function yikes_mailchimp_retreive_user_created_forms() {
110
+	public function yikes_mailchimp_retreive_user_created_forms() {
111 111
 		$interface = yikes_easy_mailchimp_extender_get_form_interface();
112 112
 		$all_forms = $interface->get_all_forms();
113 113
 
114 114
 		$lists = array();
115
-		if ( ! empty( $all_forms ) ) {
115
+		if ( ! empty( $all_forms ) ) {
116 116
 			// build an array to pass to our javascript
117
-			foreach ( $all_forms as $id => $form ) {
117
+			foreach ( $all_forms as $id => $form ) {
118 118
 				$lists[ $form['form_name'] ] = $id;
119 119
 			}
120
-		} else {
120
+		} else {
121 121
 			$lists[ __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ) ] = '-';
122 122
 		}
123 123
 
Please login to merge, or discard this patch.
includes/class-yikes-inc-easy-mailchimp-extender-loader.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * @return   type                                   The collection of actions and filters registered with WordPress.
87 87
 	 */
88 88
 	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
89
-		$hooks[] = array(
89
+		$hooks[ ] = array(
90 90
 			'hook'          => $hook,
91 91
 			'component'     => $component,
92 92
 			'callback'      => $callback,
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function run() {
104 104
 		foreach ( $this->filters as $hook ) {
105
-			add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
105
+			add_filter( $hook[ 'hook' ], array( $hook[ 'component' ], $hook[ 'callback' ] ), $hook[ 'priority' ], $hook[ 'accepted_args' ] );
106 106
 		}
107 107
 		foreach ( $this->actions as $hook ) {
108
-			add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
108
+			add_action( $hook[ 'hook' ], array( $hook[ 'component' ], $hook[ 'callback' ] ), $hook[ 'priority' ], $hook[ 'accepted_args' ] );
109 109
 		}
110 110
 	}
111 111
 }
112 112
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
20 20
  * @author     YIKES Inc. <[email protected]>
21 21
  */
22
-class Yikes_Inc_Easy_Mailchimp_Extender_Loader {
22
+class Yikes_Inc_Easy_Mailchimp_Extender_Loader {
23 23
 	/**
24 24
 	 * The array of actions registered with WordPress.
25 25
 	 *
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @since    6.0.0
43 43
 	 */
44
-	public function __construct() {
44
+	public function __construct() {
45 45
 		$this->actions = array();
46 46
 		$this->filters = array();
47 47
 	}
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * @param      int      Optional    $priority         The priority at which the function should be fired.
56 56
 	 * @param      int      Optional    $accepted_args    The number of arguments that should be passed to the $callback.
57 57
 	 */
58
-	public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
58
+	public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
59 59
 		$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
60 60
 	}
61 61
 	/**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @param      int      Optional    $priority         The priority at which the function should be fired.
69 69
 	 * @param      int      Optional    $accepted_args    The number of arguments that should be passed to the $callback.
70 70
 	 */
71
-	public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
71
+	public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
72 72
 		$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
73 73
 	}
74 74
 	/**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @param      int      Optional    $accepted_args    The number of arguments that should be passed to the $callback.
86 86
 	 * @return   type                                   The collection of actions and filters registered with WordPress.
87 87
 	 */
88
-	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
88
+	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
89 89
 		$hooks[] = array(
90 90
 			'hook'          => $hook,
91 91
 			'component'     => $component,
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @since    6.0.0
102 102
 	 */
103
-	public function run() {
104
-		foreach ( $this->filters as $hook ) {
103
+	public function run() {
104
+		foreach ( $this->filters as $hook ) {
105 105
 			add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
106 106
 		}
107
-		foreach ( $this->actions as $hook ) {
107
+		foreach ( $this->actions as $hook ) {
108 108
 			add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
109 109
 		}
110 110
 	}
Please login to merge, or discard this patch.