Completed
Pull Request — master (#808)
by
unknown
07:45 queued 05:21
created
public/partials/shortcodes/process_form_shortcode.php 3 patches
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 	}
155 155
 
156 156
 	/**
157
-	*	If login is required, abort
158
-	*	@since 6.0.3.8
159
-	*/
157
+	 *	If login is required, abort
158
+	 *	@since 6.0.3.8
159
+	 */
160 160
 	if( $form_login_required ) {
161 161
 		if( apply_filters( 'yikes-mailchimp-required-login-requirement', ! is_user_logged_in() ) ) {
162 162
 			ob_start();
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 	}
172 172
 
173 173
 	/**
174
-	*	Check if schedule is set for this form
175
-	*	@since 6.0.3.8
176
-	*/
174
+	 *	Check if schedule is set for this form
175
+	 *	@since 6.0.3.8
176
+	 */
177 177
 	if( $form_schedule_state ) {
178 178
 		// store current date
179 179
 		$current_date = strtotime( current_time( 'm/d/Y g:iA' ) );
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 	}
227 227
 
228 228
 	/**
229
-	*	Check for form inline parameter
230
-	*/
229
+	 *	Check for form inline parameter
230
+	 */
231 231
 	$form_inline = ( $atts['inline'] == 1 || $atts['inline'] == 'true' || get_theme_mod( 'form-inline-' . $form_id, '' ) === true ); // form-inline-{$form_id} comes from customizer extension
232 232
 	// recheck from our form options
233 233
 	if ( ! $form_inline ) {
@@ -291,21 +291,21 @@  discard block
 block discarded – undo
291 291
 	/**** Set up any filter'able content (that needs to be filtered before the rest of the logic kicks off) ****/
292 292
 
293 293
 	/**
294
-	*	yikes-mailchimp-countries-with-zip
295
-	*
296
-	*	Filter which countries show the zip field
297
-	*
298
-	*	@param array | An array of country codes that the zip field will appear for - default: US, GB, CA
299
-	*				   Note: please return the array with the country code as the KEY! This allows for optimal searching. 
300
-	*	@param int   | $form_id
301
-	*/
294
+	 *	yikes-mailchimp-countries-with-zip
295
+	 *
296
+	 *	Filter which countries show the zip field
297
+	 *
298
+	 *	@param array | An array of country codes that the zip field will appear for - default: US, GB, CA
299
+	 *				   Note: please return the array with the country code as the KEY! This allows for optimal searching. 
300
+	 *	@param int   | $form_id
301
+	 */
302 302
 	$countries_with_zip_code_field = apply_filters( 'yikes-mailchimp-countries-with-zip', 
303 303
 										array( 'US' => 'US', 'GB' => 'GB', 'CA' => 'CA', 
304
-											   'IE' => 'IE', 'CN' => 'CN', 'IN' => 'IN', 
305
-											   'AU' => 'AU', 'BR' => 'BR', 'MX' => 'MX',
306
-											   'IT' => 'IT', 'NZ' => 'NZ', 'JP' => 'JP',
307
-											   'FR' => 'FR', 'GR' => 'GR', 'DE' => 'DE',
308
-											   'NL' => 'NL', 'PT' => 'PT', 'ES' => 'ES'
304
+												'IE' => 'IE', 'CN' => 'CN', 'IN' => 'IN', 
305
+												'AU' => 'AU', 'BR' => 'BR', 'MX' => 'MX',
306
+												'IT' => 'IT', 'NZ' => 'NZ', 'JP' => 'JP',
307
+												'FR' => 'FR', 'GR' => 'GR', 'DE' => 'DE',
308
+												'NL' => 'NL', 'PT' => 'PT', 'ES' => 'ES'
309 309
 										), $form_id
310 310
 									);
311 311
 
@@ -532,14 +532,14 @@  discard block
 block discarded – undo
532 532
 							$description .= '</p>';
533 533
 
534 534
 							/**
535
-							*	'yikes-mailchimp-' . $field['merge'] . '-description-html' (e.g. yikes-mailchimp-FNAME-description-html)
536
-							*
537
-							* 	Filter the description HTML block
538
-							*	
539
-							*	@param string | $description 			| The full HTML description block
540
-							*	@param string | $field['description']	| The field's description text
541
-							*	@param int	  | $form_id
542
-							*/
535
+							 *	'yikes-mailchimp-' . $field['merge'] . '-description-html' (e.g. yikes-mailchimp-FNAME-description-html)
536
+							 *
537
+							 * 	Filter the description HTML block
538
+							 *	
539
+							 *	@param string | $description 			| The full HTML description block
540
+							 *	@param string | $field['description']	| The field's description text
541
+							 *	@param int	  | $form_id
542
+							 */
543 543
 							$description = apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description-html', $description, esc_attr( stripslashes( $field['description'] ) ), $form_id );
544 544
 						}
545 545
 
@@ -684,13 +684,13 @@  discard block
 block discarded – undo
684 684
 								$required_fields = array( 'addr1' => 'address' , 'addr2' => 'address 2', 'city' => 'city', 'state' =>'state', 'zip' =>'zip' , 'country' => 'country' );
685 685
 
686 686
 								/**
687
-								* Filter to control the default country (the option pre-selected in the country dropdown).
688
-								*
689
-								*	'yikes-mailchimp-default-country-value'
690
-								*
691
-								* @param string | $country_slug | The slug of the desired default country. Default: 'US'
692
-								* @param int	| $form_id		| ID of the form
693
-								*/
687
+								 * Filter to control the default country (the option pre-selected in the country dropdown).
688
+								 *
689
+								 *	'yikes-mailchimp-default-country-value'
690
+								 *
691
+								 * @param string | $country_slug | The slug of the desired default country. Default: 'US'
692
+								 * @param int	| $form_id		| ID of the form
693
+								 */
694 694
 								$default_country = apply_filters( 'yikes-mailchimp-default-country-value', 'US', $form_id );
695 695
 
696 696
 								// <!-- Description Above -->
@@ -756,15 +756,15 @@  discard block
 block discarded – undo
756 756
 														<?php
757 757
 															$state_and_province_list = file_get_contents( YIKES_MC_PATH . 'public/partials/shortcodes/templates/state-and-province-dropdown.php' ); 
758 758
 															/**
759
-															*	'yikes-mailchimp-state-province-list'
760
-															*
761
-															*	Filter the HTML options for the states dropdown
762
-															*
763
-															* 	@param string  | $state_and_province_list | HTML string of state/province options
764
-															*	@param int	   | $form_id				  | The form ID
765
-															*
766
-															*	@return string | $state_and_province_list | Filtered HTML string of state/province options
767
-															*/
759
+															 *	'yikes-mailchimp-state-province-list'
760
+															 *
761
+															 *	Filter the HTML options for the states dropdown
762
+															 *
763
+															 * 	@param string  | $state_and_province_list | HTML string of state/province options
764
+															 *	@param int	   | $form_id				  | The form ID
765
+															 *
766
+															 *	@return string | $state_and_province_list | Filtered HTML string of state/province options
767
+															 */
768 768
 															echo apply_filters( 'yikes-mailchimp-state-province-list', $state_and_province_list, $form_id );
769 769
 															
770 770
 														?>
@@ -797,17 +797,17 @@  discard block
 block discarded – undo
797 797
 													} else { 
798 798
 
799 799
 														/**
800
-														* A filter to set the default zip code value.
801
-														*
802
-														* U.S. users may want to default their subscribers. 
803
-														* However, this filter is more for non-U.S. users, where the zip field is hidden. 
804
-														* MailChimp requires a zip code (for all submissions/countries), so this filter allows users users to set a default value.
805
-														*
806
-														*	'yikes-mailchimp-default-zip-code'
807
-														*
808
-														* @param string | $zip		| A value to pre-populate the zip code with.
809
-														* @param int	| $form_id	| ID of the form
810
-														*/
800
+														 * A filter to set the default zip code value.
801
+														 *
802
+														 * U.S. users may want to default their subscribers. 
803
+														 * However, this filter is more for non-U.S. users, where the zip field is hidden. 
804
+														 * MailChimp requires a zip code (for all submissions/countries), so this filter allows users users to set a default value.
805
+														 *
806
+														 *	'yikes-mailchimp-default-zip-code'
807
+														 *
808
+														 * @param string | $zip		| A value to pre-populate the zip code with.
809
+														 * @param int	| $form_id	| ID of the form
810
+														 */
811 811
 														$zip_value = apply_filters( 'yikes-mailchimp-default-zip-code', '', $form_id );
812 812
 													}
813 813
 												?>
@@ -1038,14 +1038,14 @@  discard block
 block discarded – undo
1038 1038
 							$description .= '</p>';
1039 1039
 
1040 1040
 							/**
1041
-							*	'yikes-mailchimp-' . $field['group_id'] . '-description-html' (e.g. yikes-mailchimp-0ab8f8c84b-description-html)
1042
-							*
1043
-							* 	Filter the description HTML block
1044
-							*	
1045
-							*	@param string | $description 			| The full HTML description block
1046
-							*	@param string | $field['description']	| The field's description text
1047
-							*	@param int	  | $form_id
1048
-							*/
1041
+							 *	'yikes-mailchimp-' . $field['group_id'] . '-description-html' (e.g. yikes-mailchimp-0ab8f8c84b-description-html)
1042
+							 *
1043
+							 * 	Filter the description HTML block
1044
+							 *	
1045
+							 *	@param string | $description 			| The full HTML description block
1046
+							 *	@param string | $field['description']	| The field's description text
1047
+							 *	@param int	  | $form_id
1048
+							 */
1049 1049
 							$description = apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-description-html', $description, esc_attr( stripslashes( $field['description'] ) ), $form_id );
1050 1050
 						}
1051 1051
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -474,7 +474,9 @@  discard block
 block discarded – undo
474 474
 						$field_array['required'] = isset( $field['require'] ) ? 'required="required"' : '';
475 475
 						$label_array['visible'] = isset( $field['hide'] ) ? 'style="display:none;"' : '';
476 476
 						$label_class_array[] = ( $tag === 'merge' ) ? $field['merge'] . '-label' : $field['group_id'] . '-label';
477
-						if ( isset( $field['require'] ) ) $label_class_array[] = 'yikes-mailchimp-field-required';
477
+						if ( isset( $field['require'] ) ) {
478
+							$label_class_array[] = 'yikes-mailchimp-field-required';
479
+						}
478 480
 					}
479 481
 
480 482
 					// if both hide label and hide field are checked, we gotta hide the field!
@@ -761,7 +763,7 @@  discard block
 block discarded – undo
761 763
 														} else {
762 764
 															$zip_value = $_POST[$field['merge']]; 
763 765
 														}
764
-													} else { 
766
+													} else {
765 767
 
766 768
 														/**
767 769
 														* A filter to set the default zip code value.
@@ -1125,7 +1127,7 @@  discard block
 block discarded – undo
1125 1127
 												echo $no_default === true ? '<option value="">' . $no_default_name . '</option>' : '';
1126 1128
 
1127 1129
 												$i = 0;
1128
-												foreach( $groups as $group_id => $name ) { 
1130
+												foreach( $groups as $group_id => $name ) {
1129 1131
 
1130 1132
 													// If the form was submitted and failed, set the submitted/chosen values as the default
1131 1133
 													if( isset( $_POST[ 'group-' . $field['group_id'] ] ) && $form_submitted === 0 ) {
@@ -1174,7 +1176,7 @@  discard block
 block discarded – undo
1174 1176
 										// Turn $default_choice into an array if it isn't already
1175 1177
 										$default_choice = ( isset( $default_choice ) && is_array( $default_choice ) ) ? $default_choice : array( $default_choice );
1176 1178
 
1177
-										foreach( $groups as $group_id => $name ) { 
1179
+										foreach( $groups as $group_id => $name ) {
1178 1180
 											?>
1179 1181
 											<label for="<?php echo esc_attr( $field['group_id'] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if ( $x === $count ) { echo ' last-selection'; } ?>" style="display:none;">
1180 1182
 												<input 
Please login to merge, or discard this patch.
Spacing   +284 added lines, -284 removed lines patch added patch discarded remove patch
@@ -30,39 +30,39 @@  discard block
 block discarded – undo
30 30
 	$form_submitted = isset( $form_submitted ) ? $form_submitted : 0;
31 31
 
32 32
 	/* If the user hasn't authenticated yet, lets kill off */
33
-	if ( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
34
-		return '<div class="invalid-api-key-error"><p>' . __( "Whoops, you're not connected to MailChimp. You need to enter a valid MailChimp API key." , 'yikes-inc-easy-mailchimp-extender' ) . '</p></div>';
33
+	if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) {
34
+		return '<div class="invalid-api-key-error"><p>' . __( "Whoops, you're not connected to MailChimp. You need to enter a valid MailChimp API key.", 'yikes-inc-easy-mailchimp-extender' ) . '</p></div>';
35 35
 	}
36 36
 
37 37
 	// if the user forgot to specify a form ID, lets kill of and warn them.
38
-	if( ! $atts['form'] ) {
38
+	if ( ! $atts[ 'form' ] ) {
39 39
 		return __( 'Whoops, it looks like you forgot to specify a form to display.', 'yikes-inc-easy-mailchimp-extender' );
40 40
 	}
41 41
 
42 42
 	// store our variables
43
-	$form_id   = (int) $atts['form']; // form id (the id of the form in the database)
43
+	$form_id   = (int) $atts[ 'form' ]; // form id (the id of the form in the database)
44 44
 	$interface = yikes_easy_mailchimp_extender_get_form_interface();
45 45
 	$form_data = $interface->get_form( $form_id );
46 46
 
47 47
 	// confirm we have some results, or return an error
48 48
 	if ( empty( $form_data ) ) {
49
-		return __( "Oh no...This form doesn't exist. Head back to the manage forms page and select a different form." , 'yikes-inc-easy-mailchimp-extender' );
49
+		return __( "Oh no...This form doesn't exist. Head back to the manage forms page and select a different form.", 'yikes-inc-easy-mailchimp-extender' );
50 50
 	}
51 51
 
52 52
 	/*
53 53
 	*	Check if the user wants to use reCAPTCHA Spam Prevention
54 54
 	*/
55
-	if ( get_option( 'yikes-mc-recaptcha-status' , '' ) == '1' ) {
55
+	if ( get_option( 'yikes-mc-recaptcha-status', '' ) == '1' ) {
56 56
 
57 57
 		// Allow users to manually set recaptcha (instead of globally - recaptcha="1"/recaptcha="0" - but still needs to be globally enabled on the settings page).
58
-		if ( $atts['recaptcha'] != '0' ) {
58
+		if ( $atts[ 'recaptcha' ] != '0' ) {
59 59
 
60 60
 			// If either of the Private the Secret key is left blank, we should display an error back to the user.
61
-			if ( get_option( 'yikes-mc-recaptcha-site-key' , '' ) == '' ) {
62
-				return __( "Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!" , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>';
61
+			if ( get_option( 'yikes-mc-recaptcha-site-key', '' ) == '' ) {
62
+				return __( "Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!", 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>';
63 63
 			}
64
-			if ( get_option( 'yikes-mc-recaptcha-secret-key' , '' ) == '' ) {
65
-				return __( "Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA secret key!" , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>';
64
+			if ( get_option( 'yikes-mc-recaptcha-secret-key', '' ) == '' ) {
65
+				return __( "Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA secret key!", 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>';
66 66
 			}
67 67
 
68 68
 			$has_recaptcha = true;
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
 			$locale_split = explode( '_', $locale );
73 73
 
74 74
 			// Setup reCAPTCHA parameters.
75
-			$lang       = ! empty( $locale_split ) ? $locale_split[0] : $locale;
76
-			$lang       = ! empty( $atts['recaptcha_lang'] ) ? $atts['recaptcha_lang'] : $lang;
77
-			$type       = ! empty( $atts['recaptcha_type'] ) ? strtolower( $atts['recaptcha_type'] ) : 'image'; // setup recaptcha type
78
-			$theme      = ! empty( $atts['recaptcha_theme'] ) ? strtolower( $atts['recaptcha_theme'] ) : 'light'; // setup recaptcha theme
79
-			$size       = ! empty( $atts['recaptcha_size'] ) ? strtolower( $atts['recaptcha_size'] ) : 'normal'; // setup recaptcha size
80
-			$data_cb    = ! empty( $atts['recaptcha_data_callback'] ) ? $atts['recaptcha_data_callback'] : false; // setup recaptcha size
81
-			$expired_cb = ! empty( $atts['recaptcha_expired_callback'] ) ? $atts['recaptcha_expired_callback'] : false; // setup recaptcha size
75
+			$lang       = ! empty( $locale_split ) ? $locale_split[ 0 ] : $locale;
76
+			$lang       = ! empty( $atts[ 'recaptcha_lang' ] ) ? $atts[ 'recaptcha_lang' ] : $lang;
77
+			$type       = ! empty( $atts[ 'recaptcha_type' ] ) ? strtolower( $atts[ 'recaptcha_type' ] ) : 'image'; // setup recaptcha type
78
+			$theme      = ! empty( $atts[ 'recaptcha_theme' ] ) ? strtolower( $atts[ 'recaptcha_theme' ] ) : 'light'; // setup recaptcha theme
79
+			$size       = ! empty( $atts[ 'recaptcha_size' ] ) ? strtolower( $atts[ 'recaptcha_size' ] ) : 'normal'; // setup recaptcha size
80
+			$data_cb    = ! empty( $atts[ 'recaptcha_data_callback' ] ) ? $atts[ 'recaptcha_data_callback' ] : false; // setup recaptcha size
81
+			$expired_cb = ! empty( $atts[ 'recaptcha_expired_callback' ] ) ? $atts[ 'recaptcha_expired_callback' ] : false; // setup recaptcha size
82 82
 
83 83
 			// Pass the shortcode parameters through a filter.
84 84
 			$recaptcha_shortcode_params = apply_filters( 'yikes-mailchimp-recaptcha-parameters', array(
@@ -88,49 +88,49 @@  discard block
 block discarded – undo
88 88
 				'size'             => $size,
89 89
 				'success_callback' => $data_cb,
90 90
 				'expired_callback' => $expired_cb,
91
-			), $atts['form'] );
91
+			), $atts[ 'form' ] );
92 92
 
93 93
 			// Enqueue Google recaptcha JS.
94
-			wp_register_script( 'google-recaptcha-js' , 'https://www.google.com/recaptcha/api.js?hl=' . $recaptcha_shortcode_params['language'] . '&onload=renderReCaptchaCallback&render=explicit', array( 'jquery', 'form-submission-helpers' ) , 'all' );
94
+			wp_register_script( 'google-recaptcha-js', 'https://www.google.com/recaptcha/api.js?hl=' . $recaptcha_shortcode_params[ 'language' ] . '&onload=renderReCaptchaCallback&render=explicit', array( 'jquery', 'form-submission-helpers' ), 'all' );
95 95
 			wp_enqueue_script( 'google-recaptcha-js' );
96 96
 
97
-			$recaptcha_site_key = get_option( 'yikes-mc-recaptcha-site-key' , '' );
98
-			$recaptcha_box      = '<div class="g-recaptcha" data-sitekey="' . esc_attr( $recaptcha_site_key ) . '" data-theme="' . esc_attr( $recaptcha_shortcode_params['theme'] ) . '" data-type="' . esc_attr( $recaptcha_shortcode_params['type'] ) . '" data-size="' . esc_attr( $recaptcha_shortcode_params['size'] ) . '" data-callback="' . esc_attr( $recaptcha_shortcode_params['success_callback'] ) . '" data-expired-callback="' . esc_attr( $recaptcha_shortcode_params['expired_callback'] ) . '"></div>';
97
+			$recaptcha_site_key = get_option( 'yikes-mc-recaptcha-site-key', '' );
98
+			$recaptcha_box      = '<div class="g-recaptcha" data-sitekey="' . esc_attr( $recaptcha_site_key ) . '" data-theme="' . esc_attr( $recaptcha_shortcode_params[ 'theme' ] ) . '" data-type="' . esc_attr( $recaptcha_shortcode_params[ 'type' ] ) . '" data-size="' . esc_attr( $recaptcha_shortcode_params[ 'size' ] ) . '" data-callback="' . esc_attr( $recaptcha_shortcode_params[ 'success_callback' ] ) . '" data-expired-callback="' . esc_attr( $recaptcha_shortcode_params[ 'expired_callback' ] ) . '"></div>';
99 99
 		}
100 100
 	}
101 101
 
102 102
 	// place our results into a separate variable for easy looping
103
-	$additional_form_settings = ( isset( $form_data['form_settings'] ) ) ? $form_data['form_settings'] : false;
103
+	$additional_form_settings = ( isset( $form_data[ 'form_settings' ] ) ) ? $form_data[ 'form_settings' ] : false;
104 104
 	
105 105
 	// store our options from the additional form settings array
106
-	$form_classes = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-class-names'] : '';
107
-	$inline_form = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-inline-form'] : '';
108
-	$submit_button_type = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-submit-button-type'] : 'text';
109
-	$submit_button_text = ( $additional_form_settings && $additional_form_settings['yikes-easy-mc-submit-button-text'] != '' ) ? esc_attr( $additional_form_settings['yikes-easy-mc-submit-button-text'] ) : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
110
-	$submit_button_image = ( $additional_form_settings ) ? esc_url( $additional_form_settings['yikes-easy-mc-submit-button-image'] ) : '';
111
-	$submit_button_classes = ( $additional_form_settings ) ? ' ' . esc_attr( $additional_form_settings['yikes-easy-mc-submit-button-classes'] ) : '';
106
+	$form_classes = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-class-names' ] : '';
107
+	$inline_form = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-inline-form' ] : '';
108
+	$submit_button_type = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-submit-button-type' ] : 'text';
109
+	$submit_button_text = ( $additional_form_settings && $additional_form_settings[ 'yikes-easy-mc-submit-button-text' ] != '' ) ? esc_attr( $additional_form_settings[ 'yikes-easy-mc-submit-button-text' ] ) : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
110
+	$submit_button_image = ( $additional_form_settings ) ? esc_url( $additional_form_settings[ 'yikes-easy-mc-submit-button-image' ] ) : '';
111
+	$submit_button_classes = ( $additional_form_settings ) ? ' ' . esc_attr( $additional_form_settings[ 'yikes-easy-mc-submit-button-classes' ] ) : '';
112 112
 
113 113
 	// scheuldes
114
-	$form_schedule_state = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-schedule'] : false;
115
-	$form_schedule_start = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-start'] : '';;
116
-	$form_schedule_end = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-end'] : '';
117
-	$form_pending_message = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-pending-message'] : '';
118
-	$form_expired_message = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-expired-message'] : '';
114
+	$form_schedule_state = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-schedule' ] : false;
115
+	$form_schedule_start = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-start' ] : ''; ;
116
+	$form_schedule_end = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-end' ] : '';
117
+	$form_pending_message = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-pending-message' ] : '';
118
+	$form_expired_message = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-expired-message' ] : '';
119 119
 
120 120
 	// register required
121
-	$form_login_required = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-login-required'] : false;
122
-	$form_login_message = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-login-message'] : '';
121
+	$form_login_required = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-login-required' ] : false;
122
+	$form_login_message = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-login-message' ] : '';
123 123
 
124 124
 	// store number of fields
125
-	$field_count = (int) count( $form_data['fields'] );
125
+	$field_count = (int) count( $form_data[ 'fields' ] );
126 126
 
127 127
 	// confirm we actually have fields, before looping
128
-	if ( isset( $form_data['fields'] ) && ! empty( $form_data['fields'] ) ) {
128
+	if ( isset( $form_data[ 'fields' ] ) && ! empty( $form_data[ 'fields' ] ) ) {
129 129
 		// loop over each field, if it's set to hidden -- subtract it from the field count
130 130
 		// this throws off the layout for inline forms setup below
131
-		foreach ( $form_data['fields'] as $form_field ) {
132
-			if ( isset( $form_field['hide'] ) && (string) $form_field['hide'] === '1' ) {
133
-				$field_count --;
131
+		foreach ( $form_data[ 'fields' ] as $form_field ) {
132
+			if ( isset( $form_field[ 'hide' ] ) && (string) $form_field[ 'hide' ] === '1' ) {
133
+				$field_count--;
134 134
 			}
135 135
 		}
136 136
 	}
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 	*	If login is required, abort
140 140
 	*	@since 6.0.3.8
141 141
 	*/
142
-	if( $form_login_required ) {
143
-		if( apply_filters( 'yikes-mailchimp-required-login-requirement', ! is_user_logged_in() ) ) {
142
+	if ( $form_login_required ) {
143
+		if ( apply_filters( 'yikes-mailchimp-required-login-requirement', ! is_user_logged_in() ) ) {
144 144
 			ob_start();
145 145
 				?>
146 146
 					<div class="yikes-mailchimp-login-required yikes-mailchimp-form-<?php echo $form_id; ?>-login-required">
@@ -156,19 +156,19 @@  discard block
 block discarded – undo
156 156
 	*	Check if schedule is set for this form
157 157
 	*	@since 6.0.3.8
158 158
 	*/
159
-	if( $form_schedule_state ) {
159
+	if ( $form_schedule_state ) {
160 160
 		// store current date
161 161
 		$current_date = strtotime( current_time( 'm/d/Y g:iA' ) );
162 162
 
163 163
 		// the the current date is less than the form scheduled start date
164
-		if( $current_date < $form_schedule_start ) {
164
+		if ( $current_date < $form_schedule_start ) {
165 165
 			echo apply_filters( 'yikes-mailchimp-frontend-content', $form_pending_message, $form_id, $form_schedule_start );
166 166
 			return;
167 167
 			// abort
168 168
 		}
169 169
 
170 170
 		// The current date is past or equal to the end date, aka form has now expired
171
-		if( $current_date >= $form_schedule_end ) {
171
+		if ( $current_date >= $form_schedule_end ) {
172 172
 			echo apply_filters( 'yikes-mailchimp-frontend-content', $form_expired_message, $form_id, $form_schedule_end );
173 173
 			return;
174 174
 			// abort
@@ -177,14 +177,14 @@  discard block
 block discarded – undo
177 177
 
178 178
 	// setup the submit button text
179 179
 	// shortcode parameter takes precedence over option
180
-	$submit = ( ! empty( $atts['submit'] ) ) ? $atts['submit'] : $submit_button_text;
180
+	$submit = ( ! empty( $atts[ 'submit' ] ) ) ? $atts[ 'submit' ] : $submit_button_text;
181 181
 
182 182
 	/*
183 183
 	*	Check for the constant to prevent styles from loading
184 184
 	*	to exclude styles from loading, add `define( 'YIKES_MAILCHIMP_EXCLUDE_STYLES', true );` to functions.php
185 185
 	*	@since 6.0.3.8
186 186
 	*/
187
-	if( ! defined( 'YIKES_MAILCHIMP_EXCLUDE_STYLES' ) ) {
187
+	if ( ! defined( 'YIKES_MAILCHIMP_EXCLUDE_STYLES' ) ) {
188 188
 		// enqueue the form styles
189 189
 		wp_enqueue_style( 'yikes-inc-easy-mailchimp-public-styles', YIKES_MC_URL . 'public/css/yikes-inc-easy-mailchimp-extender-public.min.css' );
190 190
 	}
@@ -192,19 +192,19 @@  discard block
 block discarded – undo
192 192
 	/**
193 193
 	*	Check for form inline parameter
194 194
 	*/
195
-	$form_inline = ( $atts['inline'] == 1 || $atts['inline'] == 'true' || get_theme_mod( 'form-inline-' . $form_id, '' ) === true ); // form-inline-{$form_id} comes from customizer extension
195
+	$form_inline = ( $atts[ 'inline' ] == 1 || $atts[ 'inline' ] == 'true' || get_theme_mod( 'form-inline-' . $form_id, '' ) === true ); // form-inline-{$form_id} comes from customizer extension
196 196
 	// recheck from our form options
197 197
 	if ( ! $form_inline ) {
198
-		$form_inline = (bool) $additional_form_settings['yikes-easy-mc-inline-form'];
198
+		$form_inline = (bool) $additional_form_settings[ 'yikes-easy-mc-inline-form' ];
199 199
 	}
200 200
 
201 201
 	/* If the current user is logged in, and an admin...lets display our 'Edit Form' link */
202
-	if( is_user_logged_in() ) {
203
-		if( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
202
+	if ( is_user_logged_in() ) {
203
+		if ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
204 204
 			$edit_form_link = '<span class="edit-link">';
205
-			$edit_form_link .= '<a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $atts['form'] ) ) . '" title="' . __( 'Edit' , 'yikes-inc-easy-mailchimp-extender' ) . ' ' . ucwords( $form_data['form_name'] ) . '">' . __( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
205
+			$edit_form_link .= '<a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $atts[ 'form' ] ) ) . '" title="' . __( 'Edit', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . ucwords( $form_data[ 'form_name' ] ) . '">' . __( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
206 206
 			$edit_form_link .= '</span>';
207
-			$edit_form_link = apply_filters( 'yikes-mailchimp-front-end-form-action-links', $edit_form_link, $atts['form'], ucwords( $form_data['form_name'] ) );
207
+			$edit_form_link = apply_filters( 'yikes-mailchimp-front-end-form-action-links', $edit_form_link, $atts[ 'form' ], ucwords( $form_data[ 'form_name' ] ) );
208 208
 		} else {
209 209
 			$edit_form_link = '';
210 210
 		}
@@ -214,16 +214,16 @@  discard block
 block discarded – undo
214 214
 	// or else MailChimp throws errors at you
215 215
 	// extract our array keys
216 216
 	// @todo Remove array_keys() and in_array() usage here.
217
-	if( isset( $form_data['fields'] ) && ! empty( $form_data['fields'] ) ) {
218
-		$array_keys = array_keys( $form_data['fields'] );
217
+	if ( isset( $form_data[ 'fields' ] ) && ! empty( $form_data[ 'fields' ] ) ) {
218
+		$array_keys = array_keys( $form_data[ 'fields' ] );
219 219
 		// check for EMAIL in that array
220
-		if( !in_array( 'EMAIL', $array_keys ) && !in_array( 'email', $array_keys ) ) {
221
-			return '<p>' . __( "An email field is required for all MailChimp forms. Please add an email field to this form." , 'yikes-inc-easy-mailchimp-extender' ) . '</p><p>' . $edit_form_link . '</p>';
220
+		if ( ! in_array( 'EMAIL', $array_keys ) && ! in_array( 'email', $array_keys ) ) {
221
+			return '<p>' . __( "An email field is required for all MailChimp forms. Please add an email field to this form.", 'yikes-inc-easy-mailchimp-extender' ) . '</p><p>' . $edit_form_link . '</p>';
222 222
 		}
223 223
 	} else {
224
-		$error = '<p>' . __( "Whoops, it looks like you forgot to assign fields to this form." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
225
-		if( is_user_logged_in() ) {
226
-			if( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
224
+		$error = '<p>' . __( "Whoops, it looks like you forgot to assign fields to this form.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
225
+		if ( is_user_logged_in() ) {
226
+			if ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
227 227
 				return $error . $edit_form_link;
228 228
 			}
229 229
 		} else {
@@ -325,17 +325,17 @@  discard block
 block discarded – undo
325 325
 		*	Set a custom title using custom_title="lorem ipsum" parameter in the shortcode
326 326
 		*	- This takes precedence over the title set
327 327
 		*/
328
-		if ( $atts['title'] ) {
329
-			if ( ! empty( $atts['custom_title'] ) ) {
328
+		if ( $atts[ 'title' ] ) {
329
+			if ( ! empty( $atts[ 'custom_title' ] ) ) {
330 330
 				/**
331 331
 				 * Filter the title that is displayed through the shortcode.
332 332
 				 *
333 333
 				 * @param string $title   The title to display.
334 334
 				 * @param int    $form_id The form ID.
335 335
 				 */
336
-				$title = apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $atts['custom_title'] ), $form_id );
336
+				$title = apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $atts[ 'custom_title' ] ), $form_id );
337 337
 			} else {
338
-				$title = apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $form_data['form_name'] ), $form_id );
338
+				$title = apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $form_data[ 'form_name' ] ), $form_id );
339 339
 			}
340 340
 
341 341
 			echo sprintf( '<h3 class="yikes-mailchimp-form-title yikes-mailchimp-form-title-%1$s">%2$s</h3>', $form_id, $title );
@@ -345,17 +345,17 @@  discard block
 block discarded – undo
345 345
 		*	Allow users to specify a custom description for this form, no html support
346 346
 		*	@since 6.0.3.8
347 347
 		*/
348
-		if ( $atts['description'] ) {
349
-			if ( ! empty( $atts['custom_description'] ) ) {
348
+		if ( $atts[ 'description' ] ) {
349
+			if ( ! empty( $atts[ 'custom_description' ] ) ) {
350 350
 				/**
351 351
 				 * Filter the description that is displayed through the shortcode.
352 352
 				 *
353 353
 				 * @param string $title   The title to display.
354 354
 				 * @param int    $form_id The form ID.
355 355
 				 */
356
-				$description = apply_filters( 'yikes-mailchimp-form-description', $atts['custom_description'], $form_id );
356
+				$description = apply_filters( 'yikes-mailchimp-form-description', $atts[ 'custom_description' ], $form_id );
357 357
 			} else {
358
-				$description = apply_filters( 'yikes-mailchimp-form-description', $form_data['form_description'], $form_id );
358
+				$description = apply_filters( 'yikes-mailchimp-form-description', $form_data[ 'form_description' ], $form_id );
359 359
 			}
360 360
 
361 361
 			echo sprintf( '<section class="yikes-mailchimp-form-description yikes-mailchimp-form-description-%1$s">%2$s</section>', $form_id, $description );
@@ -370,10 +370,10 @@  discard block
 block discarded – undo
370 370
 		$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
371 371
 
372 372
 		// Check for AJAX
373
-		if( ( ! empty( $atts['ajax'] ) && $atts['ajax'] == 1 ) || $form_data['submission_settings']['ajax'] == 1 ) {
373
+		if ( ( ! empty( $atts[ 'ajax' ] ) && $atts[ 'ajax' ] == 1 ) || $form_data[ 'submission_settings' ][ 'ajax' ] == 1 ) {
374 374
 
375 375
 			// Enqueue our ajax script
376
-			wp_enqueue_script( 'yikes-easy-mc-ajax' , YIKES_MC_URL . "public/js/yikes-mc-ajax-forms{$min}.js" , array( 'jquery' ), YIKES_MC_VERSION, false );
376
+			wp_enqueue_script( 'yikes-easy-mc-ajax', YIKES_MC_URL . "public/js/yikes-mc-ajax-forms{$min}.js", array( 'jquery' ), YIKES_MC_VERSION, false );
377 377
 			wp_localize_script( 'yikes-easy-mc-ajax', 'yikes_mailchimp_ajax', array(
378 378
 				'ajax_url'                      => esc_url( admin_url( 'admin-ajax.php' ) ),
379 379
 				'page_data'                     => $page_data,
@@ -404,67 +404,67 @@  discard block
 block discarded – undo
404 404
 
405 405
 		// render the form!
406 406
 		?>
407
-			<form id="<?php echo sanitize_title( $form_data['form_name'] ); ?>-<?php echo $form_id; ?>" class="yikes-easy-mc-form yikes-easy-mc-form-<?php echo $form_id . ' '; if ( $form_inline )  { echo 'yikes-mailchimp-form-inline '; } echo ' ' . apply_filters( 'yikes-mailchimp-form-class', $form_classes, $form_id ); if( !empty( $_POST ) && $form_submitted == 1 && $form_data['submission_settings']['hide_form_post_signup'] == 1 ) { echo ' yikes-easy-mc-display-none'; } ?>" method="POST" data-attr-form-id="<?php echo esc_attr( $form_id ); ?>">
407
+			<form id="<?php echo sanitize_title( $form_data[ 'form_name' ] ); ?>-<?php echo $form_id; ?>" class="yikes-easy-mc-form yikes-easy-mc-form-<?php echo $form_id . ' '; if ( $form_inline ) { echo 'yikes-mailchimp-form-inline '; } echo ' ' . apply_filters( 'yikes-mailchimp-form-class', $form_classes, $form_id ); if ( ! empty( $_POST ) && $form_submitted == 1 && $form_data[ 'submission_settings' ][ 'hide_form_post_signup' ] == 1 ) { echo ' yikes-easy-mc-display-none'; } ?>" method="POST" data-attr-form-id="<?php echo esc_attr( $form_id ); ?>">
408 408
 
409 409
 				<?php
410 410
 				// Set a default constant for hidden fields
411 411
 				$hidden_label_count = 0;
412 412
 
413 413
 				// Loop over our form fields
414
-				foreach( $form_data['fields'] as $field ) {
414
+				foreach ( $form_data[ 'fields' ] as $field ) {
415 415
 						// input array
416 416
 						$field_array = array();
417 417
 						// label array
418 418
 						$label_array = array();
419 419
 						// label classes array
420 420
 						$label_class_array = array();
421
-						if( $field['additional-classes'] != '' ) {
421
+						if ( $field[ 'additional-classes' ] != '' ) {
422 422
 							// split custom classes at spaces
423
-							$custom_classes = explode( ' ' , $field['additional-classes'] );
423
+							$custom_classes = explode( ' ', $field[ 'additional-classes' ] );
424 424
 							// check our custom class array for field-left/field-right
425 425
 							// if it's set we need to assign it to our label and remove it from the field classes
426 426
 							 // input half left
427
-							if( in_array( 'field-left-half' , $custom_classes ) ) {
427
+							if ( in_array( 'field-left-half', $custom_classes ) ) {
428 428
 								// $label_array['class'] = 'class="field-left-half"';
429
-								$label_class_array[] = 'field-left-half';
430
-								$key = array_search( 'field-left-half' , $custom_classes );
431
-								unset( $custom_classes[$key] );
429
+								$label_class_array[ ] = 'field-left-half';
430
+								$key = array_search( 'field-left-half', $custom_classes );
431
+								unset( $custom_classes[ $key ] );
432 432
 							} // input half right
433
-							if( in_array( 'field-right-half' , $custom_classes ) ) {
433
+							if ( in_array( 'field-right-half', $custom_classes ) ) {
434 434
 								// $label_array['class'] = 'class="field-right-half"';
435
-								$label_class_array[] = 'field-right-half';
436
-								$key = array_search( 'field-right-half' , $custom_classes );
437
-								unset( $custom_classes[$key] );
435
+								$label_class_array[ ] = 'field-right-half';
436
+								$key = array_search( 'field-right-half', $custom_classes );
437
+								unset( $custom_classes[ $key ] );
438 438
 							} // input thirds (1/3 width, floated left)
439
-							if( in_array( 'field-third' , $custom_classes ) ) {
439
+							if ( in_array( 'field-third', $custom_classes ) ) {
440 440
 								// $label_array['class'] = 'class="field-third"';
441
-								$label_class_array[] = 'field-third';
442
-								$key = array_search( 'field-third' , $custom_classes );
443
-								unset( $custom_classes[$key] );
441
+								$label_class_array[ ] = 'field-third';
442
+								$key = array_search( 'field-third', $custom_classes );
443
+								unset( $custom_classes[ $key ] );
444 444
 							} // 2 column radio
445
-							if( in_array( 'option-2-col' , $custom_classes ) ) {
445
+							if ( in_array( 'option-2-col', $custom_classes ) ) {
446 446
 								// $label_array['class'] = 'class="option-2-col"';
447
-								$label_class_array[] = 'option-2-col';
448
-								$key = array_search( 'option-2-col' , $custom_classes );
449
-								unset( $custom_classes[$key] );
447
+								$label_class_array[ ] = 'option-2-col';
448
+								$key = array_search( 'option-2-col', $custom_classes );
449
+								unset( $custom_classes[ $key ] );
450 450
 							} // 3 column radio
451
-							if( in_array( 'option-3-col' , $custom_classes ) ) {
451
+							if ( in_array( 'option-3-col', $custom_classes ) ) {
452 452
 								// $label_array['class'] = 'class="option-3-col"';
453
-								$label_class_array[] = 'option-3-col';
454
-								$key = array_search( 'option-3-col' , $custom_classes );
455
-								unset( $custom_classes[$key] );
453
+								$label_class_array[ ] = 'option-3-col';
454
+								$key = array_search( 'option-3-col', $custom_classes );
455
+								unset( $custom_classes[ $key ] );
456 456
 							} // 4 column radio
457
-							if( in_array( 'option-4-col' , $custom_classes ) ) {
457
+							if ( in_array( 'option-4-col', $custom_classes ) ) {
458 458
 								// $label_array['class'] = 'class="option-4-col"';
459
-								$label_class_array[] = 'option-4-col';
460
-								$key = array_search( 'option-4-col' , $custom_classes );
461
-								unset( $custom_classes[$key] );
459
+								$label_class_array[ ] = 'option-4-col';
460
+								$key = array_search( 'option-4-col', $custom_classes );
461
+								unset( $custom_classes[ $key ] );
462 462
 							} // inline radio & checkboxes etc
463
-							if( in_array( 'option-inline' , $custom_classes ) ) {
463
+							if ( in_array( 'option-inline', $custom_classes ) ) {
464 464
 								// $label_array['class'] = 'class="option-inline"';
465
-								$label_class_array[] = 'option-inline';
466
-								$key = array_search( 'option-inline' , $custom_classes );
467
-								unset( $custom_classes[$key] );
465
+								$label_class_array[ ] = 'option-inline';
466
+								$key = array_search( 'option-inline', $custom_classes );
467
+								unset( $custom_classes[ $key ] );
468 468
 							}
469 469
 						} else {
470 470
 							$custom_classes = array();
@@ -472,19 +472,19 @@  discard block
 block discarded – undo
472 472
 
473 473
 						// if the form is set to inline, add the inline class to our labels
474 474
 						// since @6.0.3.8
475
-						if( $form_inline ) {
476
-							$label_class_array[] = 'label-inline';
475
+						if ( $form_inline ) {
476
+							$label_class_array[ ] = 'label-inline';
477 477
 						}
478 478
 
479
-						if( isset( $field['hide-label'] ) ) {
480
-							if( absint( $field['hide-label'] ) === 1 ) {
479
+						if ( isset( $field[ 'hide-label' ] ) ) {
480
+							if ( absint( $field[ 'hide-label' ] ) === 1 ) {
481 481
 								$hidden_label_count++;
482
-								$custom_classes[] = 'field-no-label';
482
+								$custom_classes[ ] = 'field-no-label';
483 483
 							}
484 484
 						}
485 485
 
486 486
 					/* Store tag variable based on field type */
487
-					if( isset( $field['merge'] ) ) {
487
+					if ( isset( $field[ 'merge' ] ) ) {
488 488
 						$group = '';
489 489
 						$tag = 'merge';
490 490
 					} else {
@@ -494,28 +494,28 @@  discard block
 block discarded – undo
494 494
 
495 495
 					// build up our array
496 496
 					$field_id_string   = 'yikes-easy-mc-form-' . $form_id . '-' . $field[ $tag ];
497
-					$field_array['id'] = 'id="' . esc_attr( $field_id_string ) . '" ';
498
-					$field_array['name'] = 'name="' . $group . esc_attr( $field[ $tag ] ) . '" ';
499
-					$field_array['placeholder'] = isset( $field['placeholder'] ) ? 'placeholder="' . esc_attr( stripslashes( $field['placeholder'] ) ) . '" ' : '';
500
-					$field_array['classes'] = 'class="yikes-easy-mc-'.$field['type'] . ' ' .  esc_attr( trim( implode( ' ' , $custom_classes ) ) ) . '" ';
497
+					$field_array[ 'id' ] = 'id="' . esc_attr( $field_id_string ) . '" ';
498
+					$field_array[ 'name' ] = 'name="' . $group . esc_attr( $field[ $tag ] ) . '" ';
499
+					$field_array[ 'placeholder' ] = isset( $field[ 'placeholder' ] ) ? 'placeholder="' . esc_attr( stripslashes( $field[ 'placeholder' ] ) ) . '" ' : '';
500
+					$field_array[ 'classes' ] = 'class="yikes-easy-mc-' . $field[ 'type' ] . ' ' . esc_attr( trim( implode( ' ', $custom_classes ) ) ) . '" ';
501 501
 
502 502
 					// email must always be required and visible
503
-					if( $field['type'] == 'email' ) {
504
-						$field_array['required'] = 'required="required"';
505
-						$label_array['visible'] = '';
506
-						$label_class_array[] = $field['merge'] . '-label';
507
-						$label_class_array[] = 'yikes-mailchimp-field-required';
503
+					if ( $field[ 'type' ] == 'email' ) {
504
+						$field_array[ 'required' ] = 'required="required"';
505
+						$label_array[ 'visible' ] = '';
506
+						$label_class_array[ ] = $field[ 'merge' ] . '-label';
507
+						$label_class_array[ ] = 'yikes-mailchimp-field-required';
508 508
 					} else {
509
-						$field_array['required'] = isset( $field['require'] ) ? 'required="required"' : '';
510
-						$label_array['visible'] = isset( $field['hide'] ) ? 'style="display:none;"' : '';
511
-						$label_class_array[] = ( $tag === 'merge' ) ? $field['merge'] . '-label' : $field['group_id'] . '-label';
512
-						if ( isset( $field['require'] ) ) $label_class_array[] = 'yikes-mailchimp-field-required';
509
+						$field_array[ 'required' ] = isset( $field[ 'require' ] ) ? 'required="required"' : '';
510
+						$label_array[ 'visible' ] = isset( $field[ 'hide' ] ) ? 'style="display:none;"' : '';
511
+						$label_class_array[ ] = ( $tag === 'merge' ) ? $field[ 'merge' ] . '-label' : $field[ 'group_id' ] . '-label';
512
+						if ( isset( $field[ 'require' ] ) ) $label_class_array[ ] = 'yikes-mailchimp-field-required';
513 513
 					}
514 514
 
515 515
 					// if both hide label and hide field are checked, we gotta hide the field!
516
-					if( isset( $field['hide' ] ) && $field['hide'] == 1 ) {
517
-						if( isset( $field['hide-label' ] ) && $field['hide-label'] == 1 ) {
518
-							$field_array['visible'] = 'style="display:none;"';
516
+					if ( isset( $field[ 'hide' ] ) && $field[ 'hide' ] == 1 ) {
517
+						if ( isset( $field[ 'hide-label' ] ) && $field[ 'hide-label' ] == 1 ) {
518
+							$field_array[ 'visible' ] = 'style="display:none;"';
519 519
 						}
520 520
 					}
521 521
 
@@ -523,20 +523,20 @@  discard block
 block discarded – undo
523 523
 					$label_class_array = function_exists( 'sanitize_html_class' ) ? array_map( 'sanitize_html_class', $label_class_array ) : $label_class_array;
524 524
 
525 525
 					// Turn the clases into a string
526
-					$label_array['classes'] = 'class="' . implode( ' ', $label_class_array ) . ' "';
526
+					$label_array[ 'classes' ] = 'class="' . implode( ' ', $label_class_array ) . ' "';
527 527
 
528 528
 					// Filter the field array data
529 529
 					$field_array = apply_filters( 'yikes-mailchimp-field-data', $field_array, $field, $form_id );
530 530
 
531 531
 					/* Loop Over Standard Fields (aka merge variables) */
532
-					if( isset( $field['merge'] ) ) {
532
+					if ( isset( $field[ 'merge' ] ) ) {
533 533
 
534 534
 						// Handle the Description logic in one spot, here:
535
-						$show_description = isset( $field['description'] ) && trim( $field['description'] ) !== '' ? true : false;
536
-						$description_above = isset( $field['description_above'] ) && $field['description_above'] === '1' ? true : false;
535
+						$show_description = isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) !== '' ? true : false;
536
+						$description_above = isset( $field[ 'description_above' ] ) && $field[ 'description_above' ] === '1' ? true : false;
537 537
 						if ( $show_description === true ) {
538
-							$description = '<p class="form-field-description" id="form-field-description-' . $field['merge'] . '">';
539
-							$description .= apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', esc_attr( stripslashes( $field['description'] ) ), $form_id );
538
+							$description = '<p class="form-field-description" id="form-field-description-' . $field[ 'merge' ] . '">';
539
+							$description .= apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', esc_attr( stripslashes( $field[ 'description' ] ) ), $form_id );
540 540
 							$description .= '</p>';
541 541
 
542 542
 							/**
@@ -548,11 +548,11 @@  discard block
 block discarded – undo
548 548
 							*	@param string | $field['description']	| The field's description text
549 549
 							*	@param int	  | $form_id
550 550
 							*/
551
-							$description = apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description-html', $description, esc_attr( stripslashes( $field['description'] ) ), $form_id );
551
+							$description = apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description-html', $description, esc_attr( stripslashes( $field[ 'description' ] ) ), $form_id );
552 552
 						}
553 553
 
554 554
 						// loop over our fields by Type
555
-						switch ( $field['type'] ) {
555
+						switch ( $field[ 'type' ] ) {
556 556
 
557 557
 							default:
558 558
 							case 'email':
@@ -560,24 +560,24 @@  discard block
 block discarded – undo
560 560
 							case 'number':
561 561
 
562 562
 								// pass our default value through our filter to parse dynamic data by tag (used solely for 'text' type)
563
-								$default_value = ( isset( $field['default'] ) ? esc_attr( $field['default'] ) : '' );
563
+								$default_value = ( isset( $field[ 'default' ] ) ? esc_attr( $field[ 'default' ] ) : '' );
564 564
 								$default_value = apply_filters( 'yikes-mailchimp-process-default-tag', $default_value );
565
-								$default_value = apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-default-value', $default_value, $field, $form_id );
565
+								$default_value = apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-default-value', $default_value, $field, $form_id );
566 566
 
567 567
 									?>
568
-									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
568
+									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ', $label_array ); ?>>
569 569
 
570 570
 										<!-- dictate label visibility -->
571
-										<?php if( !isset( $field['hide-label'] ) ) { ?>
572
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
573
-												<?php if( ! isset( $field['hide-label'] ) ) { echo apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label' , esc_attr( stripslashes( $field['label'] ) ), $form_id ); } ?>
571
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
572
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
573
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ), $form_id ); } ?>
574 574
 											</span>
575 575
 										<?php } ?>
576 576
 
577 577
 										<!-- Description Above -->
578 578
 										<?php if ( $show_description === true && $description_above === true ) { echo $description; } ?>
579 579
 
580
-										<input <?php echo implode( ' ' , $field_array ); if( $field['type'] != 'email' && $field['type'] != 'number' ) { ?> type="text" <?php } else if( $field['type'] == 'email' ) { ?> type="email" <?php } else { ?> type="number" <?php } ?> value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[$field['merge']] ); } else { echo esc_attr( $default_value ); } ?>">
580
+										<input <?php echo implode( ' ', $field_array ); if ( $field[ 'type' ] != 'email' && $field[ 'type' ] != 'number' ) { ?> type="text" <?php } else if ( $field[ 'type' ] == 'email' ) { ?> type="email" <?php } else { ?> type="number" <?php } ?> value="<?php if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[ $field[ 'merge' ] ] ); } else { echo esc_attr( $default_value ); } ?>">
581 581
 
582 582
 										<!-- Description Below -->
583 583
 										<?php if ( $show_description === true && $description_above === false ) { echo $description; } ?>
@@ -589,23 +589,23 @@  discard block
 block discarded – undo
589 589
 
590 590
 							case 'url':
591 591
 							case 'imageurl':
592
-								$default_value = ( isset( $field['default'] ) ) ? $field['default'] : '';
593
-								$default_value = apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-default-value', $default_value, $field, $form_id );
592
+								$default_value = ( isset( $field[ 'default' ] ) ) ? $field[ 'default' ] : '';
593
+								$default_value = apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-default-value', $default_value, $field, $form_id );
594 594
 									?>
595 595
 
596
-									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
596
+									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ', $label_array ); ?>>
597 597
 
598 598
 										<!-- dictate label visibility -->
599
-										<?php if( !isset( $field['hide-label'] ) ) { ?>
600
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
601
-												<?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
599
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
600
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
601
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
602 602
 											</span>
603 603
 										<?php } ?>
604 604
 
605 605
 										<!-- Description Above -->
606 606
 										<?php if ( $show_description === true && $description_above === true ) { echo $description; } ?>
607 607
 
608
-										<input <?php echo implode( ' ' , $field_array ); ?> type="url" <?php if( $field['type'] == 'url' ) { ?> title="<?php _e( 'Please enter a valid URL to the website.' , 'yikes-inc-easy-mailchimp-extender' ); ?>" <?php } else { ?> title="<?php _e( 'Please enter a valid URL to the image.' , 'yikes-inc-easy-mailchimp-extender' ); ?>" <?php } ?> value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[$field['merge']] ); } else { echo esc_attr( $default_value ); } ?>" >
608
+										<input <?php echo implode( ' ', $field_array ); ?> type="url" <?php if ( $field[ 'type' ] == 'url' ) { ?> title="<?php _e( 'Please enter a valid URL to the website.', 'yikes-inc-easy-mailchimp-extender' ); ?>" <?php } else { ?> title="<?php _e( 'Please enter a valid URL to the image.', 'yikes-inc-easy-mailchimp-extender' ); ?>" <?php } ?> value="<?php if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[ $field[ 'merge' ] ] ); } else { echo esc_attr( $default_value ); } ?>" >
609 609
 
610 610
 										<!-- Description Below -->
611 611
 										<?php if ( $show_description === true && $description_above === false ) { echo $description; } ?>
@@ -616,24 +616,24 @@  discard block
 block discarded – undo
616 616
 							break;
617 617
 
618 618
 							case 'phone':
619
-								$default_value = ( isset( $field['default'] ) ? esc_attr( $field['default'] ) : '' );
620
-								$default_value = apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-default-value', $default_value, $field, $form_id );
621
-								$phone_format = $field['phone_format'];
619
+								$default_value = ( isset( $field[ 'default' ] ) ? esc_attr( $field[ 'default' ] ) : '' );
620
+								$default_value = apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-default-value', $default_value, $field, $form_id );
621
+								$phone_format = $field[ 'phone_format' ];
622 622
 								?>
623 623
 
624
-									<label for="<?php echo esc_attr( $field_id_string ) ?>" <?php echo implode( ' ' , $label_array ); ?>>
624
+									<label for="<?php echo esc_attr( $field_id_string ) ?>" <?php echo implode( ' ', $label_array ); ?>>
625 625
 
626 626
 										<!-- dictate label visibility -->
627
-										<?php if( !isset( $field['hide-label'] ) ) { ?>
628
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
629
-												<?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
627
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
628
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
629
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
630 630
 											</span>
631 631
 										<?php } ?>
632 632
 
633 633
 										<!-- Description Above -->
634 634
 										<?php if ( $show_description === true && $description_above === true ) { echo $description; } ?>
635 635
 
636
-										<input <?php echo implode( ' ' , $field_array ); ?> type="text" <?php if( $phone_format != 'US' ) { ?> data-phone-type="international" title="<?php _e( 'International Phone Number' , 'yikes-inc-easy-mailchimp-extender' ); ?>" pattern="<?php echo apply_filters( 'yikes-mailchimp-international-phone-pattern' , '[0-9,-,+]{1,}' ); ?>" <?php } else { ?> title="<?php _e( 'US Phone Number (###) ### - ####' , 'yikes-inc-easy-mailchimp-extender' ); ?>" data-phone-type="us" pattern="<?php echo apply_filters( 'yikes-mailchimp-us-phone-pattern' , '^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$' ); ?>" <?php } ?> value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[$field['merge']] ); } else { echo esc_attr( $default_value ); } ?>">
636
+										<input <?php echo implode( ' ', $field_array ); ?> type="text" <?php if ( $phone_format != 'US' ) { ?> data-phone-type="international" title="<?php _e( 'International Phone Number', 'yikes-inc-easy-mailchimp-extender' ); ?>" pattern="<?php echo apply_filters( 'yikes-mailchimp-international-phone-pattern', '[0-9,-,+]{1,}' ); ?>" <?php } else { ?> title="<?php _e( 'US Phone Number (###) ### - ####', 'yikes-inc-easy-mailchimp-extender' ); ?>" data-phone-type="us" pattern="<?php echo apply_filters( 'yikes-mailchimp-us-phone-pattern', '^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$' ); ?>" <?php } ?> value="<?php if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[ $field[ 'merge' ] ] ); } else { echo esc_attr( $default_value ); } ?>">
637 637
 
638 638
 										<!-- Description Below -->
639 639
 										<?php if ( $show_description === true && $description_above === false ) { echo $description; } ?>
@@ -643,23 +643,23 @@  discard block
 block discarded – undo
643 643
 							break;
644 644
 
645 645
 							case 'zip':
646
-								$default_value = ( isset( $field['default'] ) ? esc_attr( $field['default'] ) : '' );
647
-								$default_value = apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-default-value', $default_value, $field, $form_id );
646
+								$default_value = ( isset( $field[ 'default' ] ) ? esc_attr( $field[ 'default' ] ) : '' );
647
+								$default_value = apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-default-value', $default_value, $field, $form_id );
648 648
 
649 649
 									?>
650
-									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
650
+									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ', $label_array ); ?>>
651 651
 
652 652
 									<!-- dictate label visibility -->
653
-									<?php if( ! isset( $field['hide-label'] ) ) { ?>
654
-										<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
655
-											<?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
653
+									<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
654
+										<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
655
+											<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
656 656
 										</span>
657 657
 									<?php } ?>
658 658
 
659 659
 									<!-- Description Above -->
660 660
 									<?php if ( $show_description === true && $description_above === true ) { echo $description; } ?>
661 661
 
662
-									<input <?php echo implode( ' ' , $field_array ); ?> type="text" pattern="\d{5,5}(-\d{4,4})?" title="<?php _e( '5 digit zip code, numbers only' , 'yikes-inc-easy-mailchimp-extender' ); ?>" value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[$field['merge']] ); } else { echo esc_attr( $default_value ); } ?>">
662
+									<input <?php echo implode( ' ', $field_array ); ?> type="text" pattern="\d{5,5}(-\d{4,4})?" title="<?php _e( '5 digit zip code, numbers only', 'yikes-inc-easy-mailchimp-extender' ); ?>" value="<?php if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[ $field[ 'merge' ] ] ); } else { echo esc_attr( $default_value ); } ?>">
663 663
 
664 664
 									<!-- Description Below -->
665 665
 									<?php if ( $show_description === true && $description_above === false ) { echo $description; } ?>
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 							case 'address':
673 673
 
674 674
 								// required fields
675
-								$required_fields = array( 'addr1' => 'address' , 'addr2' => 'address 2', 'city' => 'city', 'state' =>'state', 'zip' =>'zip' , 'country' => 'country' );
675
+								$required_fields = array( 'addr1' => 'address', 'addr2' => 'address 2', 'city' => 'city', 'state' =>'state', 'zip' =>'zip', 'country' => 'country' );
676 676
 
677 677
 								/**
678 678
 								* Filter to control the default country (the option pre-selected in the country dropdown).
@@ -688,55 +688,55 @@  discard block
 block discarded – undo
688 688
 								if ( $show_description === true && $description_above === true ) { echo $description; }
689 689
 
690 690
 								// Placeholder logic
691
-								if ( ! empty( $field_array['placeholder'] ) ) {
691
+								if ( ! empty( $field_array[ 'placeholder' ] ) ) {
692 692
 									
693 693
 									$use_address_placeholder = true;
694 694
 
695 695
 									// Don't use the address field's array placeholder - use the custom placeholder
696
-									unset( $field_array['placeholder'] );
696
+									unset( $field_array[ 'placeholder' ] );
697 697
 								}
698 698
 
699 699
 								// store number for looping
700 700
 								$x = 1;
701
-								foreach( $required_fields as $type => $label ) {
701
+								foreach ( $required_fields as $type => $label ) {
702 702
 
703 703
 									// set the field names for the address fields
704
-									$field_array['name'] = 'name="' . $field[$tag] . '[' . $type . ']' . '"';
704
+									$field_array[ 'name' ] = 'name="' . $field[ $tag ] . '[' . $type . ']' . '"';
705 705
 
706 706
 									// Set the placeholder value if we need to
707 707
 									$placeholder = isset( $use_address_placeholder ) ? apply_filters( 'yikes-mailchimp-address-' . $type . '-placeholder', ucwords( $label ) ) : '';
708 708
 
709 709
 									// reset the label classes for left-half/right-half for addresses
710
-									if( isset( $label_array['class'] ) ) {
710
+									if ( isset( $label_array[ 'class' ] ) ) {
711 711
 										if ( $x % 2 == 0 ) {
712
-											$label_array['class'] = str_replace( 'field-left-half', 'field-right-half', $label_array['class'] );
712
+											$label_array[ 'class' ] = str_replace( 'field-left-half', 'field-right-half', $label_array[ 'class' ] );
713 713
 										} else {
714
-											$label_array['class'] = str_replace( 'field-right-half', 'field-left-half', $label_array['class'] );
714
+											$label_array[ 'class' ] = str_replace( 'field-right-half', 'field-left-half', $label_array[ 'class' ] );
715 715
 										}
716 716
 									}
717 717
 
718 718
 									// Never force addr2 to be required
719 719
 									if ( $type === 'addr2' ) {
720
-										$field_array['required'] = apply_filters( 'yikes-mailchimp-address-2-required', '', $form_id );
720
+										$field_array[ 'required' ] = apply_filters( 'yikes-mailchimp-address-2-required', '', $form_id );
721 721
 									}
722 722
 
723
-									switch( $type ) {
723
+									switch ( $type ) {
724 724
 
725 725
 										default:
726 726
 										case 'addr1':
727 727
 										case 'addr2':
728 728
 										case 'city':
729 729
 											?>
730
-											<label for="<?php echo esc_attr( $field['merge'] ); ?>" data-attr-name="<?php echo esc_attr( $type ); ?>-field" <?php echo implode( ' ' , $label_array ); ?>>
730
+											<label for="<?php echo esc_attr( $field[ 'merge' ] ); ?>" data-attr-name="<?php echo esc_attr( $type ); ?>-field" <?php echo implode( ' ', $label_array ); ?>>
731 731
 
732 732
 												<!-- dictate label visibility -->
733
-												<?php if( ! isset( $field['hide-label'] ) ) { ?>
734
-													<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
735
-														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label' , esc_attr( $label ), $form_id ) ); ?>
733
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
734
+													<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
735
+														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label', esc_attr( $label ), $form_id ) ); ?>
736 736
 													</span>
737 737
 												<?php } ?>
738 738
 												
739
-												<input <?php echo implode( ' ' , $field_array ); ?> placeholder="<?php echo $placeholder; ?>" type="text" value="<?php if( isset( $_POST[$field['merge']][$type] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[$field['merge']][$type] ); } ?>">
739
+												<input <?php echo implode( ' ', $field_array ); ?> placeholder="<?php echo $placeholder; ?>" type="text" value="<?php if ( isset( $_POST[ $field[ 'merge' ] ][ $type ] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[ $field[ 'merge' ] ][ $type ] ); } ?>">
740 740
 
741 741
 											</label>
742 742
 											<?php
@@ -745,16 +745,16 @@  discard block
 block discarded – undo
745 745
 
746 746
 										case 'state':
747 747
 											?>
748
-											<label for="<?php echo esc_attr( $field['merge'] ); ?>" <?php echo implode( ' ' , $label_array ); ?> data-attr-name="state-dropdown">
748
+											<label for="<?php echo esc_attr( $field[ 'merge' ] ); ?>" <?php echo implode( ' ', $label_array ); ?> data-attr-name="state-dropdown">
749 749
 
750 750
 												<!-- dictate label visibility -->
751
-												<?php if( ! isset( $field['hide-label'] ) ) { ?>
752
-													<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
753
-														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label' , esc_attr( $label ), $form_id ) ); ?>
751
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
752
+													<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
753
+														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label', esc_attr( $label ), $form_id ) ); ?>
754 754
 													</span>
755 755
 												<?php } ?>
756 756
 
757
-													<select <?php echo implode( ' ' , $field_array ); ?>>
757
+													<select <?php echo implode( ' ', $field_array ); ?>>
758 758
 														<?php
759 759
 															$state_and_province_list = file_get_contents( YIKES_MC_PATH . 'public/partials/shortcodes/templates/state-and-province-dropdown.php' ); 
760 760
 															/**
@@ -780,21 +780,21 @@  discard block
 block discarded – undo
780 780
 										case 'zip':
781 781
 
782 782
 											?>
783
-											<label for="<?php echo esc_attr( $field['merge'] ); ?>"  placeholder="<?php echo $placeholder; ?>" <?php echo implode( ' ' , $label_array ); ?> data-attr-name="zip-input"<?php if ( ! isset( $countries_with_zip_code_field[ $default_country ] ) ) { ?> style="display: none;"<?php } ?>>
783
+											<label for="<?php echo esc_attr( $field[ 'merge' ] ); ?>"  placeholder="<?php echo $placeholder; ?>" <?php echo implode( ' ', $label_array ); ?> data-attr-name="zip-input"<?php if ( ! isset( $countries_with_zip_code_field[ $default_country ] ) ) { ?> style="display: none;"<?php } ?>>
784 784
 
785
-												<?php if( ! isset( $field['hide-label'] ) ) { ?>
786
-													<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
787
-														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label' , esc_attr( $label ), $form_id ) ); ?>
785
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
786
+													<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
787
+														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label', esc_attr( $label ), $form_id ) ); ?>
788 788
 													</span>
789 789
 												<?php } ?>
790 790
 
791 791
 												<?php 
792 792
 													// If zip lookup plugin is installed, the ZIP field comes back as an array and we need to handle it differently...
793
-													if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) {
794
-														if ( is_array( $_POST[$field['merge']] ) && isset( $_POST[$field['merge']]['zip'] ) ) {
795
-															$zip_value = $_POST[$field['merge']]['zip'];
793
+													if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) {
794
+														if ( is_array( $_POST[ $field[ 'merge' ] ] ) && isset( $_POST[ $field[ 'merge' ] ][ 'zip' ] ) ) {
795
+															$zip_value = $_POST[ $field[ 'merge' ] ][ 'zip' ];
796 796
 														} else {
797
-															$zip_value = $_POST[$field['merge']]; 
797
+															$zip_value = $_POST[ $field[ 'merge' ] ]; 
798 798
 														}
799 799
 													} else { 
800 800
 
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 													}
815 815
 												?>
816 816
 
817
-												<input <?php echo implode( ' ' , $field_array ); ?>  placeholder="<?php echo $placeholder; ?>" type="text" pattern="<?php echo apply_filters( 'yikes-mailchimp-zip-pattern', '\d{5,5}(-\d{4,4})?', $form_id ); ?>" title="<?php _e( '5 digit zip code, numbers only' , 'yikes-inc-easy-mailchimp-extender' ); ?>" value="<?php echo esc_attr( $zip_value ); ?>">
817
+												<input <?php echo implode( ' ', $field_array ); ?>  placeholder="<?php echo $placeholder; ?>" type="text" pattern="<?php echo apply_filters( 'yikes-mailchimp-zip-pattern', '\d{5,5}(-\d{4,4})?', $form_id ); ?>" title="<?php _e( '5 digit zip code, numbers only', 'yikes-inc-easy-mailchimp-extender' ); ?>" value="<?php echo esc_attr( $zip_value ); ?>">
818 818
 
819 819
 											</label>
820 820
 											<?php
@@ -824,16 +824,16 @@  discard block
 block discarded – undo
824 824
 										case 'country':
825 825
 											?>
826 826
 
827
-											<label for="<?php echo esc_attr( $field['merge'] ); ?>" data-attr-name="<?php echo esc_attr( $type ); ?>-field" <?php echo implode( ' ' , $label_array ); ?>>
827
+											<label for="<?php echo esc_attr( $field[ 'merge' ] ); ?>" data-attr-name="<?php echo esc_attr( $type ); ?>-field" <?php echo implode( ' ', $label_array ); ?>>
828 828
 
829 829
 												<!-- dictate label visibility -->
830
-												<?php if( !isset( $field['hide-label'] ) ) { ?>
831
-													<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
832
-														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label' , esc_attr( $label ), $form_id ) ); ?>
830
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
831
+													<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
832
+														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label', esc_attr( $label ), $form_id ) ); ?>
833 833
 													</span>
834 834
 												<?php } ?>
835 835
 
836
-												<select <?php echo implode( ' ' , $field_array ); ?> data-country="true">
836
+												<select <?php echo implode( ' ', $field_array ); ?> data-country="true">
837 837
 													<?php include( YIKES_MC_PATH . 'public/partials/shortcodes/templates/country-dropdown.php' ); ?>
838 838
 												</select>
839 839
 											</label>
@@ -879,40 +879,40 @@  discard block
 block discarded – undo
879 879
 								wp_register_script( 'yikes-datepicker-scripts', YIKES_MC_URL . "public/js/yikes-datepicker-scripts{$min}.js", array( 'jquery-ui-datepicker' ), YIKES_MC_VERSION, false );
880 880
 								wp_localize_script( 'yikes-datepicker-scripts', 'datepicker_settings', $datepicker_options );
881 881
 								wp_enqueue_script( 'yikes-datepicker-scripts' );
882
-								wp_enqueue_style( 'jquery-datepicker-styles' , YIKES_MC_URL . 'public/css/jquery-ui.min.css' );
883
-								wp_enqueue_style( 'yikes-datepicker-styles' , YIKES_MC_URL . 'public/css/yikes-datepicker-styles.min.css' );
882
+								wp_enqueue_style( 'jquery-datepicker-styles', YIKES_MC_URL . 'public/css/jquery-ui.min.css' );
883
+								wp_enqueue_style( 'yikes-datepicker-styles', YIKES_MC_URL . 'public/css/yikes-datepicker-styles.min.css' );
884 884
 
885
-								switch ( $field['type'] ) {
885
+								switch ( $field[ 'type' ] ) {
886 886
 									default:
887 887
 									case 'date':
888
-										$date_format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'mm/dd/yyyy';
888
+										$date_format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'mm/dd/yyyy';
889 889
 										break;
890 890
 
891 891
 									case 'birthday':
892
-										$date_format = ( isset( $field['date_format'] ) ) ? strtolower( $field['date_format'] ) : 'mm/dd';
892
+										$date_format = ( isset( $field[ 'date_format' ] ) ) ? strtolower( $field[ 'date_format' ] ) : 'mm/dd';
893 893
 										break;
894 894
 								}
895 895
 
896
-								$default_value = ( isset( $field['default'] ) ? esc_attr( $field['default'] ) : '' );
897
-								$default_value = apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-default-value', $default_value, $field, $form_id );
896
+								$default_value = ( isset( $field[ 'default' ] ) ? esc_attr( $field[ 'default' ] ) : '' );
897
+								$default_value = apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-default-value', $default_value, $field, $form_id );
898 898
 								
899 899
 								// store empty number for looping
900 900
 								$x = 0;
901 901
 
902 902
 								?>
903
-									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
903
+									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ', $label_array ); ?>>
904 904
 
905 905
 										<!-- dictate label visibility -->
906
-										<?php if( !isset( $field['hide-label'] ) ) { ?>
907
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
908
-												<?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
906
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
907
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
908
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
909 909
 											</span>
910 910
 										<?php } ?>
911 911
 
912 912
 										<!-- Description Above -->
913 913
 										<?php if ( $show_description === true && $description_above === true ) { echo $description; } ?>
914 914
 
915
-										<input <?php echo implode( ' ' , $field_array ); ?> type="text" <?php if( $field['type'] == 'date' ) { ?> data-attr-type="date" <?php } else { ?> data-attr-type="birthday" <?php } ?> value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[$field['merge']] ); } else { echo esc_attr( $default_value ); } ?>" data-date-format="<?php echo esc_attr( strtolower( $date_format ) ); ?>">
915
+										<input <?php echo implode( ' ', $field_array ); ?> type="text" <?php if ( $field[ 'type' ] == 'date' ) { ?> data-attr-type="date" <?php } else { ?> data-attr-type="birthday" <?php } ?> value="<?php if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) { echo esc_attr( $_POST[ $field[ 'merge' ] ] ); } else { echo esc_attr( $default_value ); } ?>" data-date-format="<?php echo esc_attr( strtolower( $date_format ) ); ?>">
916 916
 
917 917
 										<!-- Description Below -->
918 918
 										<?php if ( $show_description === true && $description_above === false ) { echo $description; } ?>
@@ -923,26 +923,26 @@  discard block
 block discarded – undo
923 923
 							break;
924 924
 
925 925
 							case 'dropdown':
926
-								$no_default     = $field['default_choice'] === 'no-default' || isset( $field['default_choice'][0] ) && $field['default_choice'][0] === 'no-default';
927
-								$default_choice = is_array( $field['default_choice'] ) ? $field['default_choice'] : array( $field['default_choice'] );
926
+								$no_default     = $field[ 'default_choice' ] === 'no-default' || isset( $field[ 'default_choice' ][ 0 ] ) && $field[ 'default_choice' ][ 0 ] === 'no-default';
927
+								$default_choice = is_array( $field[ 'default_choice' ] ) ? $field[ 'default_choice' ] : array( $field[ 'default_choice' ] );
928 928
 
929 929
 								// store empty number for looping
930 930
 								$x = 0;
931 931
 									?>
932
-									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
932
+									<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ', $label_array ); ?>>
933 933
 										<!-- dictate label visibility -->
934
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
935
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
936
-												<?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
934
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
935
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
936
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
937 937
 											</span>
938 938
 										<?php }
939 939
 
940 940
 											// decode for looping
941
-											$choices = json_decode( $field['choices'], true );
941
+											$choices = json_decode( $field[ 'choices' ], true );
942 942
 
943 943
 											// If the form was submitted, but failed, let's default to the chosen option
944
-											if( isset( $_POST[ $field['merge'] ] ) && $form_submitted === 0 ) {
945
-												$default_choice = is_array( $_POST[ $field['merge'] ] ) ? $_POST[ $field['merge'] ] : array( $_POST[ $field['merge'] ] );
944
+											if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted === 0 ) {
945
+												$default_choice = is_array( $_POST[ $field[ 'merge' ] ] ) ? $_POST[ $field[ 'merge' ] ] : array( $_POST[ $field[ 'merge' ] ] );
946 946
 											}
947 947
 
948 948
 										?>
@@ -950,11 +950,11 @@  discard block
 block discarded – undo
950 950
 										<!-- Description Above -->
951 951
 										<?php if ( $show_description === true && $description_above === true ) { echo $description; } ?>
952 952
 
953
-										<select <?php echo implode( ' ' , $field_array ); ?>>
953
+										<select <?php echo implode( ' ', $field_array ); ?>>
954 954
 											<?php
955 955
 												$no_default_name = apply_filters( 'yikes-mailchimp-dropdown-field-no-default-option-name', __( 'Select...', 'yikes-inc-easy-mailchimp-extender' ), $form_id );
956 956
 												echo $no_default === true ? '<option value="">' . $no_default_name . '</option>' : '';
957
-												foreach( $choices as $choice ) { ?>
957
+												foreach ( $choices as $choice ) { ?>
958 958
 													<option 
959 959
 														value="<?php echo esc_attr( $choice ); ?>"
960 960
 														<?php if ( $no_default !== true && in_array( $x, $default_choice ) || in_array( $choice, $default_choice, true ) ) { echo 'selected="selected"'; } ?>>
@@ -977,17 +977,17 @@  discard block
 block discarded – undo
977 977
 							case 'radio':
978 978
 							case 'checkbox':
979 979
 								// remove the ID (as to not assign the same ID to every radio button)
980
-								unset( $field_array['id'] );
981
-								$choices = json_decode( $field['choices'], true );
980
+								unset( $field_array[ 'id' ] );
981
+								$choices = json_decode( $field[ 'choices' ], true );
982 982
 
983 983
 								// assign a default choice
984
-								$no_default     = $field['default_choice'] === 'no-default' || isset( $field['default_choice'][0] ) && $field['default_choice'][0] === 'no-default';
985
-								$default_choice = ( isset( $field['default_choice'] ) && ! empty( $field['default_choice'] ) ) ? $field['default_choice'] : $choices[0];
984
+								$no_default     = $field[ 'default_choice' ] === 'no-default' || isset( $field[ 'default_choice' ][ 0 ] ) && $field[ 'default_choice' ][ 0 ] === 'no-default';
985
+								$default_choice = ( isset( $field[ 'default_choice' ] ) && ! empty( $field[ 'default_choice' ] ) ) ? $field[ 'default_choice' ] : $choices[ 0 ];
986 986
 								$default_choice = ( is_array( $default_choice ) ) ? $default_choice : array( $default_choice );
987 987
 
988 988
 								// If the form was submitted, but failed, let's default to the chosen option
989
-								if( isset( $_POST[ $field['merge'] ] ) && $form_submitted === 0 ) {
990
-									$default_choice = is_array( $_POST[ $field['merge'] ] ) ? $_POST[ $field['merge'] ] : array( $_POST[ $field['merge'] ] );
989
+								if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted === 0 ) {
990
+									$default_choice = is_array( $_POST[ $field[ 'merge' ] ] ) ? $_POST[ $field[ 'merge' ] ] : array( $_POST[ $field[ 'merge' ] ] );
991 991
 								}
992 992
 
993 993
 								$count = count( $choices );
@@ -995,29 +995,29 @@  discard block
 block discarded – undo
995 995
 								$x = 0;
996 996
 
997 997
 								?>
998
-								<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
998
+								<label for="<?php echo esc_attr( $field_id_string ); ?>" <?php echo implode( ' ', $label_array ); ?>>
999 999
 
1000 1000
 									<!-- dictate label visibility -->
1001
-									<?php if( ! isset( $field['hide-label'] ) ) { ?>
1002
-										<span class="<?php echo esc_attr( $field['merge'] ). '-label'; ?> checkbox-parent-label">
1003
-											<?php echo esc_attr( apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label', stripslashes( $field['label'] ) ) ); ?>
1001
+									<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
1002
+										<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?> checkbox-parent-label">
1003
+											<?php echo esc_attr( apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', stripslashes( $field[ 'label' ] ) ) ); ?>
1004 1004
 										</span>
1005 1005
 									<?php }
1006 1006
 
1007 1007
 									// <!-- Description Above -->
1008 1008
 									if ( $show_description === true && $description_above === true ) { echo $description; }
1009 1009
 
1010
-									foreach( $choices as $choice ) {
1010
+									foreach ( $choices as $choice ) {
1011 1011
 										?>
1012
-										<label for="<?php echo esc_attr( $field['merge'] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if( $i === $count ) { ?> last-selection<?php } ?>">
1012
+										<label for="<?php echo esc_attr( $field[ 'merge' ] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ', $custom_classes ); if ( $i === $count ) { ?> last-selection<?php } ?>">
1013 1013
 											<input 
1014
-												type="<?php echo esc_attr( $field['type'] ); ?>" 
1015
-												name="<?php echo esc_attr( $field['merge'] ); ?>" 
1016
-												id="<?php echo esc_attr( $field['merge'] . '-' . $i ); ?>" 
1014
+												type="<?php echo esc_attr( $field[ 'type' ] ); ?>" 
1015
+												name="<?php echo esc_attr( $field[ 'merge' ] ); ?>" 
1016
+												id="<?php echo esc_attr( $field[ 'merge' ] . '-' . $i ); ?>" 
1017 1017
 												<?php if ( $no_default !== true && in_array( $x, $default_choice ) || in_array( $choice, $default_choice, true ) ) { echo 'checked="checked"'; } ?>
1018
-												<?php echo $field_array['required']; ?>
1018
+												<?php echo $field_array[ 'required' ]; ?>
1019 1019
 												value="<?php echo esc_attr( $choice ); ?>">
1020
-											<span class="<?php echo esc_attr( $field['merge'] ). '-label'; ?>"><?php echo stripslashes( $choice ); ?></span>
1020
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>"><?php echo stripslashes( $choice ); ?></span>
1021 1021
 										</label>
1022 1022
 										<?php
1023 1023
 										$i++;
@@ -1038,11 +1038,11 @@  discard block
 block discarded – undo
1038 1038
 						/**** Interest Groups ****/
1039 1039
 
1040 1040
 						// Handle the Description logic in one spot, here:
1041
-						$show_description = isset( $field['description'] ) && trim( $field['description'] ) !== '' ? true : false;
1042
-						$description_above = isset( $field['description_above'] ) && $field['description_above'] === '1' ? true : false;
1041
+						$show_description = isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) !== '' ? true : false;
1042
+						$description_above = isset( $field[ 'description_above' ] ) && $field[ 'description_above' ] === '1' ? true : false;
1043 1043
 						if ( $show_description === true ) {
1044
-							$description = '<p class="form-field-description" id="form-field-description-' . $field['group_id'] . '">';
1045
-							$description .= apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-description', esc_attr( stripslashes( $field['description'] ) ), $form_id );
1044
+							$description = '<p class="form-field-description" id="form-field-description-' . $field[ 'group_id' ] . '">';
1045
+							$description .= apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-description', esc_attr( stripslashes( $field[ 'description' ] ) ), $form_id );
1046 1046
 							$description .= '</p>';
1047 1047
 
1048 1048
 							/**
@@ -1054,27 +1054,27 @@  discard block
 block discarded – undo
1054 1054
 							*	@param string | $field['description']	| The field's description text
1055 1055
 							*	@param int	  | $form_id
1056 1056
 							*/
1057
-							$description = apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-description-html', $description, esc_attr( stripslashes( $field['description'] ) ), $form_id );
1057
+							$description = apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-description-html', $description, esc_attr( stripslashes( $field[ 'description' ] ) ), $form_id );
1058 1058
 						}
1059 1059
 
1060 1060
 						// Get our groups
1061
-						$groups = isset( $field['groups'] ) && ! empty( $field['groups'] ) ? json_decode( $field['groups'], true ) : array();
1061
+						$groups = isset( $field[ 'groups' ] ) && ! empty( $field[ 'groups' ] ) ? json_decode( $field[ 'groups' ], true ) : array();
1062 1062
 
1063 1063
 						// Get the default choice(s) from the field settings and turn them into an array if not already
1064
-						$default_choice = isset( $field['default_choice'] ) ? $field['default_choice'] : '';
1064
+						$default_choice = isset( $field[ 'default_choice' ] ) ? $field[ 'default_choice' ] : '';
1065 1065
 						$default_choice = is_array( $default_choice ) ? $default_choice : array( $default_choice );
1066
-						$default_choice = apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-default', $default_choice, $groups, $field, $form_id );
1066
+						$default_choice = apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-default', $default_choice, $groups, $field, $form_id );
1067 1067
 
1068 1068
 						$count = count( $groups );
1069 1069
 
1070
-						if( $field['type'] === 'checkboxes' ) {
1070
+						if ( $field[ 'type' ] === 'checkboxes' ) {
1071 1071
 							$type = 'checkbox';
1072
-						} else if( $field['type'] === 'radio' ) {
1072
+						} else if ( $field[ 'type' ] === 'radio' ) {
1073 1073
 							$type = 'radio';
1074 1074
 						}
1075 1075
 
1076 1076
 						// loop over the interest group field types
1077
-						switch ( $field['type'] ) {
1077
+						switch ( $field[ 'type' ] ) {
1078 1078
 
1079 1079
 							case 'checkboxes':
1080 1080
 							case 'radio':
@@ -1082,11 +1082,11 @@  discard block
 block discarded – undo
1082 1082
 								$x = 1; // used to find the last item of our array
1083 1083
 
1084 1084
 									?>
1085
-									<label for="<?php echo esc_attr( $field['group_id'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
1086
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
1085
+									<label for="<?php echo esc_attr( $field[ 'group_id' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
1086
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
1087 1087
 											<!-- dictate label visibility -->
1088
-											<span class="<?php echo esc_attr( $field['group_id'] ) . '-label'; ?> checkbox-parent-label">
1089
-												<?php echo apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
1088
+											<span class="<?php echo esc_attr( $field[ 'group_id' ] ) . '-label'; ?> checkbox-parent-label">
1089
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
1090 1090
 											</span>
1091 1091
 									<?php
1092 1092
 										}
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 
1097 1097
 										// Display Submission Errors
1098 1098
 										if ( ! empty( $missing_required_checkbox_interest_groups ) ) {
1099
-											if( in_array( $field['group_id'], $missing_required_checkbox_interest_groups ) ) {
1099
+											if ( in_array( $field[ 'group_id' ], $missing_required_checkbox_interest_groups ) ) {
1100 1100
 												?>
1101 1101
 													<p class="yikes-mailchimp-required-interest-group-error">
1102 1102
 														<?php echo apply_filters( 'yikes-mailchimp-interest-group-checkbox-error', __( 'This field is required.', 'yikes-inc-easy-mailchimp-extender' ), $form_id ); ?>
@@ -1108,20 +1108,20 @@  discard block
 block discarded – undo
1108 1108
 										foreach ( $groups as $group_id => $name ) {
1109 1109
 
1110 1110
 											// If the form was submitted and failed, set the submitted/chosen values as the default
1111
-											if ( isset( $_POST[ 'group-' . $field['group_id'] ] ) && $form_submitted === 0 ) {
1111
+											if ( isset( $_POST[ 'group-' . $field[ 'group_id' ] ] ) && $form_submitted === 0 ) {
1112 1112
 
1113 1113
 												// Format default choice as array
1114
-												$default_choice = ( is_array( $_POST[ 'group-' . $field['group_id'] ] ) ) ? $_POST[ 'group-' . $field['group_id'] ] : array( $_POST[ 'group-' . $field['group_id'] ] );
1114
+												$default_choice = ( is_array( $_POST[ 'group-' . $field[ 'group_id' ] ] ) ) ? $_POST[ 'group-' . $field[ 'group_id' ] ] : array( $_POST[ 'group-' . $field[ 'group_id' ] ] );
1115 1115
 											}
1116 1116
 
1117 1117
 											?>
1118
-											<label for="<?php echo esc_attr( $field['group_id'] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if( $x === $count ) { ?> last-selection<?php } ?>">
1118
+											<label for="<?php echo esc_attr( $field[ 'group_id' ] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ', $custom_classes ); if ( $x === $count ) { ?> last-selection<?php } ?>">
1119 1119
 												<input 
1120
-													<?php if( isset( $field['require'] ) && $field['require'] == 1 ) { if ( $field['type'] !== 'checkboxes' ) { ?> required="required" <?php } ?> 
1120
+													<?php if ( isset( $field[ 'require' ] ) && $field[ 'require' ] == 1 ) { if ( $field[ 'type' ] !== 'checkboxes' ) { ?> required="required" <?php } ?> 
1121 1121
 													class="yikes-interest-group-required" <?php } ?> 
1122 1122
 													type="<?php echo esc_attr( $type ); ?>"
1123
-													name="group-<?php echo esc_attr( $field['group_id'] ); ?>[]" 
1124
-													id="<?php echo esc_attr( $field['group_id'] . '-' . $i ); ?>"
1123
+													name="group-<?php echo esc_attr( $field[ 'group_id' ] ); ?>[]" 
1124
+													id="<?php echo esc_attr( $field[ 'group_id' ] . '-' . $i ); ?>"
1125 1125
 													<?php if ( in_array( $group_id, $default_choice ) ) { echo 'checked="checked"'; } ?> 
1126 1126
 													value="<?php echo esc_attr( $group_id ); ?>">
1127 1127
 													<?php echo esc_attr( $name ); ?>
@@ -1143,32 +1143,32 @@  discard block
 block discarded – undo
1143 1143
 
1144 1144
 									?>
1145 1145
 
1146
-									<label for="<?php echo esc_attr( $field['group_id'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
1146
+									<label for="<?php echo esc_attr( $field[ 'group_id' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
1147 1147
 										<!-- dictate label visibility -->
1148
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
1149
-											<span class="<?php echo esc_attr( $field['group_id'] ) . '-label'; ?>">
1150
-												<?php echo apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
1148
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
1149
+											<span class="<?php echo esc_attr( $field[ 'group_id' ] ) . '-label'; ?>">
1150
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
1151 1151
 											</span>
1152 1152
 										<?php } ?>
1153 1153
 
1154 1154
 										<!-- Description Above -->
1155 1155
 										<?php if ( $show_description === true && $description_above === true ) { echo $description; } ?>
1156 1156
 
1157
-										<select <?php echo implode( ' ' , $field_array ); ?>>
1157
+										<select <?php echo implode( ' ', $field_array ); ?>>
1158 1158
 
1159 1159
 											<?php
1160
-												$no_default      = $field['default_choice'] === 'no-default' || isset( $field['default_choice'][0] ) && $field['default_choice'][0] === 'no-default';
1160
+												$no_default      = $field[ 'default_choice' ] === 'no-default' || isset( $field[ 'default_choice' ][ 0 ] ) && $field[ 'default_choice' ][ 0 ] === 'no-default';
1161 1161
 												$no_default_name = apply_filters( 'yikes-mailchimp-dropdown-ig-no-default-option-name', __( 'Select...', 'yikes-inc-easy-mailchimp-extender' ), $form_id );
1162 1162
 												echo $no_default === true ? '<option value="">' . $no_default_name . '</option>' : '';
1163 1163
 
1164 1164
 												$i = 0;
1165
-												foreach( $groups as $group_id => $name ) { 
1165
+												foreach ( $groups as $group_id => $name ) { 
1166 1166
 
1167 1167
 													// If the form was submitted and failed, set the submitted/chosen values as the default
1168
-													if( isset( $_POST[ 'group-' . $field['group_id'] ] ) && $form_submitted === 0 ) {
1168
+													if ( isset( $_POST[ 'group-' . $field[ 'group_id' ] ] ) && $form_submitted === 0 ) {
1169 1169
 
1170 1170
 														// Format default choice as array
1171
-														$default_choice = ( is_array( $_POST[ 'group-' . $field['group_id'] ] ) ) ? $_POST[ 'group-' . $field['group_id'] ] : array( $_POST[ 'group-' . $field['group_id'] ] );
1171
+														$default_choice = ( is_array( $_POST[ 'group-' . $field[ 'group_id' ] ] ) ) ? $_POST[ 'group-' . $field[ 'group_id' ] ] : array( $_POST[ 'group-' . $field[ 'group_id' ] ] );
1172 1172
 													}
1173 1173
 											?>
1174 1174
 													<option 
@@ -1196,12 +1196,12 @@  discard block
 block discarded – undo
1196 1196
 
1197 1197
 									?>
1198 1198
 
1199
-									<label for="<?php echo esc_attr( $field['group_id'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
1199
+									<label for="<?php echo esc_attr( $field[ 'group_id' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
1200 1200
 
1201 1201
 										<!-- dictate label visibility -->
1202
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
1203
-											<span class="<?php echo esc_attr( $field['group_id'] ) . '-label'; ?> checkbox-parent-label" style="display:none;">
1204
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['group_id'].'-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
1202
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
1203
+											<span class="<?php echo esc_attr( $field[ 'group_id' ] ) . '-label'; ?> checkbox-parent-label" style="display:none;">
1204
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
1205 1205
 											</span>
1206 1206
 										<?php }
1207 1207
 
@@ -1211,17 +1211,17 @@  discard block
 block discarded – undo
1211 1211
 										// Turn $default_choice into an array if it isn't already
1212 1212
 										$default_choice = ( isset( $default_choice ) && is_array( $default_choice ) ) ? $default_choice : array( $default_choice );
1213 1213
 
1214
-										foreach( $groups as $group_id => $name ) { 
1214
+										foreach ( $groups as $group_id => $name ) { 
1215 1215
 											?>
1216
-											<label for="<?php echo esc_attr( $field['group_id'] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if ( $x === $count ) { echo ' last-selection'; } ?>" style="display:none;">
1216
+											<label for="<?php echo esc_attr( $field[ 'group_id' ] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ', $custom_classes ); if ( $x === $count ) { echo ' last-selection'; } ?>" style="display:none;">
1217 1217
 												<input 
1218 1218
 													type="checkbox" 
1219
-													name="group-<?php echo esc_attr( $field['group_id'] ); ?>[]" 
1220
-													id="<?php echo esc_attr( $field['group_id'] ) . '-' . $i; ?>"
1219
+													name="group-<?php echo esc_attr( $field[ 'group_id' ] ); ?>[]" 
1220
+													id="<?php echo esc_attr( $field[ 'group_id' ] ) . '-' . $i; ?>"
1221 1221
 													value="<?php echo esc_attr( $group_id ) ?>"
1222 1222
 													<?php if ( in_array( $group_id, $default_choice ) ) { echo 'checked="checked"'; } ?>
1223 1223
 												>
1224
-												<?php echo esc_attr( stripslashes( str_replace( '' , '\'', $name ) ) ); ?>
1224
+												<?php echo esc_attr( stripslashes( str_replace( '', '\'', $name ) ) ); ?>
1225 1225
 											</label>
1226 1226
 											<?php
1227 1227
 											$i++;
@@ -1246,14 +1246,14 @@  discard block
 block discarded – undo
1246 1246
 					echo $recaptcha_box;
1247 1247
 				}
1248 1248
 
1249
-				$admin_class = is_user_logged_in() && current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ? ' admin-logged-in' : '';
1249
+				$admin_class = is_user_logged_in() && current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ? ' admin-logged-in' : '';
1250 1250
 				?>
1251 1251
 
1252 1252
 				<!-- Honeypot Trap -->
1253 1253
 				<input type="hidden" name="yikes-mailchimp-honeypot" id="yikes-mailchimp-honeypot-<?php echo esc_attr( $form_id ); ?>" value="">
1254 1254
 
1255 1255
 				<!-- List ID -->
1256
-				<input type="hidden" name="yikes-mailchimp-associated-list-id" id="yikes-mailchimp-associated-list-id-<?php echo esc_attr( $form_id ); ?>" value="<?php echo esc_attr( $form_data['list_id'] ); ?>">
1256
+				<input type="hidden" name="yikes-mailchimp-associated-list-id" id="yikes-mailchimp-associated-list-id-<?php echo esc_attr( $form_id ); ?>" value="<?php echo esc_attr( $form_data[ 'list_id' ] ); ?>">
1257 1257
 
1258 1258
 				<!-- The form that is being submitted! Used to display error/success messages above the correct form -->
1259 1259
 				<input type="hidden" name="yikes-mailchimp-submitted-form" id="yikes-mailchimp-submitted-form-<?php echo esc_attr( $form_id ); ?>" value="<?php echo esc_attr( $form_id ); ?>">
@@ -1267,15 +1267,15 @@  discard block
 block discarded – undo
1267 1267
 						// If the number of fields, is equal to the hidden label count, add our class
1268 1268
 						// eg: All field labels are set to hidden.
1269 1269
 						if ( absint( $field_count ) === absint( $hidden_label_count ) ) {
1270
-							$submit_button_label_classes[] = 'labels-hidden';
1270
+							$submit_button_label_classes[ ] = 'labels-hidden';
1271 1271
 						}
1272 1272
 						echo '<label class="empty-form-inline-label submit-button-inline-label"><span class="' . implode( ' ', $submit_button_label_classes ) . '">&nbsp;</span>';
1273 1273
 					}
1274 1274
 					// Display the image or text based button.
1275 1275
 					if ( $submit_button_type === 'text' ) {
1276
-						echo apply_filters( 'yikes-mailchimp-form-submit-button', '<button type="submit" class="' . apply_filters( 'yikes-mailchimp-form-submit-button-classes', 'yikes-easy-mc-submit-button yikes-easy-mc-submit-button-' . esc_attr( $form_data['id'] ) . ' btn btn-primary' . $submit_button_classes . $admin_class, $form_data['id'] ) . '"> <span class="yikes-mailchimp-submit-button-span-text">' .  apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data['id'] ) . '</span></button>', $form_data['id'] );
1276
+						echo apply_filters( 'yikes-mailchimp-form-submit-button', '<button type="submit" class="' . apply_filters( 'yikes-mailchimp-form-submit-button-classes', 'yikes-easy-mc-submit-button yikes-easy-mc-submit-button-' . esc_attr( $form_data[ 'id' ] ) . ' btn btn-primary' . $submit_button_classes . $admin_class, $form_data[ 'id' ] ) . '"> <span class="yikes-mailchimp-submit-button-span-text">' . apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data[ 'id' ] ) . '</span></button>', $form_data[ 'id' ] );
1277 1277
 					} else {
1278
-						echo apply_filters( 'yikes-mailchimp-form-submit-button', '<input type="image" alt="' . apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data['id'] ) . '" src="' . $submit_button_image . '" class="' . apply_filters( 'yikes-mailchimp-form-submit-button-classes', 'yikes-easy-mc-submit-button yikes-easy-mc-submit-button-image yikes-easy-mc-submit-button-' . esc_attr( $form_data['id'] ) . ' btn btn-primary' . $submit_button_classes . $admin_class, $form_data['id'] ) . '">', $form_data['id'] );
1278
+						echo apply_filters( 'yikes-mailchimp-form-submit-button', '<input type="image" alt="' . apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data[ 'id' ] ) . '" src="' . $submit_button_image . '" class="' . apply_filters( 'yikes-mailchimp-form-submit-button-classes', 'yikes-easy-mc-submit-button yikes-easy-mc-submit-button-image yikes-easy-mc-submit-button-' . esc_attr( $form_data[ 'id' ] ) . ' btn btn-primary' . $submit_button_classes . $admin_class, $form_data[ 'id' ] ) . '">', $form_data[ 'id' ] );
1279 1279
 					}
1280 1280
 					if ( $form_inline && ! $inline_form_override ) {
1281 1281
 						echo '</label>';
@@ -1290,8 +1290,8 @@  discard block
 block discarded – undo
1290 1290
 
1291 1291
 		<?php
1292 1292
 			/* If the current user is logged in, and an admin...lets display our 'Edit Form' link */
1293
-			if( is_user_logged_in() ) {
1294
-				if( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
1293
+			if ( is_user_logged_in() ) {
1294
+				if ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
1295 1295
 					echo $edit_form_link;
1296 1296
 				}
1297 1297
 			}
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 		*	for non-admins
1308 1308
 		*/
1309 1309
 		if ( ! current_user_can( 'manage_options' ) ) {
1310
-			$impressions = $form_data['impressions'] + 1;
1310
+			$impressions = $form_data[ 'impressions' ] + 1;
1311 1311
 			$interface->update_form_field( $form_id, 'impressions', $impressions );
1312 1312
 		}
1313 1313
 
Please login to merge, or discard this patch.
admin/class-yikes-inc-easy-mailchimp-extender-admin.php 4 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -489,6 +489,9 @@  discard block
 block discarded – undo
489 489
 			$response_body = json_decode( wp_remote_retrieve_body( $response ) );
490 490
 		}
491 491
 
492
+		/**
493
+		 * @return string
494
+		 */
492 495
 		public function get_premium_license( $plugin_slug ) {
493 496
 
494 497
 			switch( $plugin_slug ) {
@@ -823,6 +826,7 @@  discard block
 block discarded – undo
823 826
 
824 827
 	/**
825 828
 	 * Convert the php date format string to a js date format
829
+	 * @param string $type
826 830
 	 */
827 831
 	public function yikes_jQuery_datepicker_date_format_php_to_js( $sFormat, $type ) {
828 832
 		switch ( $type ) {
@@ -1318,8 +1322,6 @@  discard block
 block discarded – undo
1318 1322
 	 * the correct WordPress options API (old plugin stored options wierdly)
1319 1323
 	 *
1320 1324
 	 * @since    1.0.0
1321
-	 * @param      string    $yikes_inc_easy_mailchimp_extender       The name of this plugin.
1322
-	 * @param      string    $version    The version of this plugin.
1323 1325
 	 */
1324 1326
 	public function check_for_old_yks_mc_options() {
1325 1327
 		$old_plugin_options = get_option( 'ykseme_storage' );
@@ -1354,8 +1356,6 @@  discard block
 block discarded – undo
1354 1356
 		 * the correct WordPress options API (old plugin stored options wierdly)
1355 1357
 		 *
1356 1358
 		 * @since    1.0.0
1357
-		 * @param      string    $yikes_inc_easy_mailchimp_extender       The name of this plugin.
1358
-		 * @param      string    $version    The version of this plugin.
1359 1359
 		 */
1360 1360
 		public function display_options_migrate_notice() {
1361 1361
 
Please login to merge, or discard this patch.
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -510,10 +510,10 @@  discard block
 block discarded – undo
510 510
 		}
511 511
 
512 512
 		/**
513
-		*	Dismiss the migrate options notice (incase the user wants to do things manually)
514
-		*
515
-		*	@since 6.0.0
516
-		**/
513
+		 *	Dismiss the migrate options notice (incase the user wants to do things manually)
514
+		 *
515
+		 *	@since 6.0.0
516
+		 **/
517 517
 		public function yikes_easy_mailchimp_dismiss_option_migrate() {
518 518
 			// delete the options and allow the user to manually update things.
519 519
 
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 			yikes_easy_mailchimp_stop_bugging_me()
619 619
 			Remove the Review us notification when user clicks 'Dismiss'
620 620
 			@since v3.1.1
621
-		*/
621
+		 */
622 622
 		public function yikes_easy_mailchimp_stop_bugging_me() {
623 623
 			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) && (int) filter_var( $_GET['yikes_easy_mc_icons_nobug'], FILTER_SANITIZE_NUMBER_INT ) === 1 ) {
624 624
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', true );
@@ -885,9 +885,9 @@  discard block
 block discarded – undo
885 885
 	}
886 886
 
887 887
 	/**
888
-	*	Register our admin pages
889
-	*	used to display data back to the user
890
-	**/
888
+	 *	Register our admin pages
889
+	 *	used to display data back to the user
890
+	 **/
891 891
 	public function register_admin_pages() {
892 892
 
893 893
 		/* Top Level Menu 'Easy MailChimp' */
@@ -1016,28 +1016,28 @@  discard block
 block discarded – undo
1016 1016
 	}
1017 1017
 
1018 1018
 	/**
1019
-	* Generate Us Easy MailChimp Manage Forms Page
1020
-	*
1021
-	* @since    1.0.0
1022
-	*/
1019
+	 * Generate Us Easy MailChimp Manage Forms Page
1020
+	 *
1021
+	 * @since    1.0.0
1022
+	 */
1023 1023
 	function generateManageFormsPage() {
1024 1024
 		require_once YIKES_MC_PATH . 'admin/partials/menu/manage-forms.php'; // include our manage forms page
1025 1025
 	}
1026 1026
 
1027 1027
 	/**
1028
-	* Generate Us Easy MailChimp Manage Lists Page
1029
-	*
1030
-	* @since    1.0.0
1031
-	*/
1028
+	 * Generate Us Easy MailChimp Manage Lists Page
1029
+	 *
1030
+	 * @since    1.0.0
1031
+	 */
1032 1032
 	function generateManageListsPage() {
1033 1033
 		require_once YIKES_MC_PATH . 'admin/partials/menu/manage-lists.php'; // include our lists page
1034 1034
 	}
1035 1035
 
1036 1036
 	/**
1037
-	* Generate Us Easy MailChimp Support Page
1038
-	*
1039
-	* @since    1.0.0
1040
-	*/
1037
+	 * Generate Us Easy MailChimp Support Page
1038
+	 *
1039
+	 * @since    1.0.0
1040
+	 */
1041 1041
 	function generateSupportPage() {
1042 1042
 
1043 1043
 		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-support-scripts', plugin_dir_url( __FILE__ ) . 'js/support.js', array( 'jquery' ), $this->version, false );	
@@ -1045,37 +1045,37 @@  discard block
 block discarded – undo
1045 1045
 	}
1046 1046
 
1047 1047
 	/**
1048
-	* Generate Us Easy MailChimp Edit Form Page
1049
-	*
1050
-	* @since    1.0.0
1051
-	*/
1048
+	 * Generate Us Easy MailChimp Edit Form Page
1049
+	 *
1050
+	 * @since    1.0.0
1051
+	 */
1052 1052
 	function generateEditFormPage() {
1053 1053
 		require_once YIKES_MC_PATH . 'admin/partials/edit-form.php'; // include our options page
1054 1054
 	}
1055 1055
 
1056 1056
 	/**
1057
-	* Generate Us Easy MailChimp View List Page
1058
-	*
1059
-	* @since    1.0.0
1060
-	*/
1057
+	 * Generate Us Easy MailChimp View List Page
1058
+	 *
1059
+	 * @since    1.0.0
1060
+	 */
1061 1061
 	function generateViewListPage() {
1062 1062
 		require_once YIKES_MC_PATH . 'admin/partials/view-list.php'; // include our options page
1063 1063
 	}
1064 1064
 
1065 1065
 	/**
1066
-	* Generate Us Easy MailChimp View User Page
1067
-	*
1068
-	* @since    1.0.0
1069
-	*/
1066
+	 * Generate Us Easy MailChimp View User Page
1067
+	 *
1068
+	 * @since    1.0.0
1069
+	 */
1070 1070
 	function generateViewUserPage() {
1071 1071
 		require_once YIKES_MC_PATH . 'admin/partials/view-user.php'; // include our options page
1072 1072
 	}
1073 1073
 
1074 1074
 	/**
1075
-	*	Register our plugin settings, and display them on our settings page
1076
-	*
1077
-	* @since v.5.4
1078
-	**/
1075
+	 *	Register our plugin settings, and display them on our settings page
1076
+	 *
1077
+	 * @since v.5.4
1078
+	 **/
1079 1079
 	function yikes_easy_mc_settings_init() {
1080 1080
 
1081 1081
 		/* Register General Settings Section */
@@ -1193,9 +1193,9 @@  discard block
 block discarded – undo
1193 1193
 	}
1194 1194
 
1195 1195
 	/**
1196
-	*	Options Sanitization & Validation
1197
-	*	@since complete re-write
1198
-	**/
1196
+	 *	Options Sanitization & Validation
1197
+	 *	@since complete re-write
1198
+	 **/
1199 1199
 	function yikes_mc_validate_api_key( $input ) {
1200 1200
 		if ( $input === '' ) {
1201 1201
 			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
@@ -1227,20 +1227,20 @@  discard block
 block discarded – undo
1227 1227
 	}
1228 1228
 
1229 1229
 	/**
1230
-	* Generate Us Easy Forms for MailChimp Options Page
1231
-	*
1232
-	* @since    1.0.0
1233
-	*/
1230
+	 * Generate Us Easy Forms for MailChimp Options Page
1231
+	 *
1232
+	 * @since    1.0.0
1233
+	 */
1234 1234
 	function generatePageOptions() {
1235 1235
 		require_once YIKES_MC_PATH . 'admin/partials/menu/options.php'; // include our options page
1236 1236
 	}
1237 1237
 
1238 1238
 	/**
1239
-	*	Check if users API key is valid, if not
1240
-	*	this function will apply a disabled attribute
1241
-	*	to form fields. (input, dropdowns, buttons etc.)
1242
-	* 	@since v5.5 re-write
1243
-	**/
1239
+	 *	Check if users API key is valid, if not
1240
+	 *	this function will apply a disabled attribute
1241
+	 *	to form fields. (input, dropdowns, buttons etc.)
1242
+	 * 	@since v5.5 re-write
1243
+	 **/
1244 1244
 	public function is_user_mc_api_valid_form( $echo = true ) {
1245 1245
 		if ( $echo == true ) {
1246 1246
 			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
 	 * Migrate our old options , to the new options API
1281 1281
 	 * moving from 5.5 and beyond..
1282 1282
 	 * @since
1283
-	*/
1283
+	 */
1284 1284
 	public function migrate_old_yks_mc_options() {
1285 1285
 		// include our migrate options helper file
1286 1286
 		include_once YIKES_MC_PATH . 'admin/partials/upgrade-helpers/upgrade-migrate-options.php';
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 	/**
1290 1290
 		Admin Notices
1291 1291
 		- Notifications displayed at the top of admin pages, back to the user
1292
-	**/
1292
+	 **/
1293 1293
 
1294 1294
 		/**
1295 1295
 		 * Check for existing plugin options
@@ -1348,12 +1348,12 @@  discard block
 block discarded – undo
1348 1348
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1349 1349
 		*/
1350 1350
 		function findMCListID($id, $array) {
1351
-		   foreach ($array as $key => $val) {
1352
-			   if ($val['id'] === $id) {
1353
-				   return $key;
1354
-			   }
1355
-		   }
1356
-		   return null;
1351
+			foreach ($array as $key => $val) {
1352
+				if ($val['id'] === $id) {
1353
+					return $key;
1354
+				}
1355
+			}
1356
+			return null;
1357 1357
 		} // end
1358 1358
 
1359 1359
 		/* Ajax Migrate Options */
@@ -1591,13 +1591,13 @@  discard block
 block discarded – undo
1591 1591
 				<?php
1592 1592
 
1593 1593
 					/**
1594
-					*	yikes-mailchimp-excluded-redirect-post-types
1595
-					*
1596
-					*	Filter the post types that will not show on the redirect list dropdown.
1597
-					*
1598
-					* 	@param array | $excluded_post_types | The array of default excluded post types
1599
-					*	@return array| $excluded_post_types | The array of user-defined excluded post types
1600
-					*/
1594
+					 *	yikes-mailchimp-excluded-redirect-post-types
1595
+					 *
1596
+					 *	Filter the post types that will not show on the redirect list dropdown.
1597
+					 *
1598
+					 * 	@param array | $excluded_post_types | The array of default excluded post types
1599
+					 *	@return array| $excluded_post_types | The array of user-defined excluded post types
1600
+					 */
1601 1601
 					$excluded_post_types = array( 'attachment', 'revision', 'nav_menu_item', 'shop_order', 'shop_order_refund', 'custom_css', 'customize_changeset', 'forum', 'topic', 'reply' );
1602 1602
 					$excluded_post_types = apply_filters( 'yikes-mailchimp-excluded-redirect-post-types', $excluded_post_types );
1603 1603
 
@@ -1733,9 +1733,9 @@  discard block
 block discarded – undo
1733 1733
 			}
1734 1734
 
1735 1735
 			/**
1736
-			*	Custom action hook for our extensions to hook into
1737
-			*	@parameter	get_current_screen()	current screen information
1738
-			*/
1736
+			 *	Custom action hook for our extensions to hook into
1737
+			 *	@parameter	get_current_screen()	current screen information
1738
+			 */
1739 1739
 			do_action( 'yikes-mailchimp-admin-sidebar', get_current_screen() );
1740 1740
 
1741 1741
 		}
@@ -2646,13 +2646,13 @@  discard block
 block discarded – undo
2646 2646
 			$result = $this->form_interface->create_form( $form_data );
2647 2647
 
2648 2648
 			/**
2649
-			* `yikes-mailchimp-after-duplicating-form`
2650
-			*
2651
-			* @param $post_id_to_clone | int   | ID of the original form
2652
-			* @param $result           | mixed | ID of the new form OR false if the operation failed
2653
-			* @param $form_data        | array | Array of the form data 
2654
-			*
2655
-			*/
2649
+			 * `yikes-mailchimp-after-duplicating-form`
2650
+			 *
2651
+			 * @param $post_id_to_clone | int   | ID of the original form
2652
+			 * @param $result           | mixed | ID of the new form OR false if the operation failed
2653
+			 * @param $form_data        | array | Array of the form data 
2654
+			 *
2655
+			 */
2656 2656
 			do_action( 'yikes-mailchimp-after-duplicating-form', $post_id_to_clone, $result, $form_data );
2657 2657
 
2658 2658
 			if ( false === $result ) {
Please login to merge, or discard this patch.
Braces   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @subpackage Yikes_Inc_Easy_Mailchimp_Forms/admin
10 10
  * @author     YIKES, Inc. <[email protected]>
11 11
  */
12
-class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
12
+class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
13 13
 
14 14
 	/**
15 15
 	 * The ID of this plugin.
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$yikes_inc_easy_mailchimp_extender,
50 50
 		$version,
51 51
 		Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface
52
-	) {
52
+	) {
53 53
 		$this->yikes_inc_easy_mailchimp_extender = $yikes_inc_easy_mailchimp_extender;
54 54
 		$this->version                           = $version;
55 55
 		$this->form_interface                    = $form_interface;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @author Jeremy Pry
62 62
 	 */
63
-	public function hooks() {
63
+	public function hooks() {
64 64
 
65 65
 		// check for old plugin options and migrate if exist.
66 66
 		add_action( 'admin_menu', array( $this, 'register_admin_pages' ), 11 );
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		/***********************/
102 102
 		/** Create A Form **/
103 103
 		/**********************/
104
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) {
104
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) {
105 105
 
106 106
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
107 107
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		/***********************/
111 111
 		/** Delete A Form **/
112 112
 		/**********************/
113
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) {
113
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) {
114 114
 
115 115
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
116 116
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		/**********************************/
120 120
 		/** Duplicate/Clone A Form    **/
121 121
 		/********************************/
122
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) {
122
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) {
123 123
 
124 124
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
125 125
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		/*************************************/
129 129
 		/**  Reset Form Impression Stats **/
130 130
 		/***********************************/
131
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) {
131
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) {
132 132
 
133 133
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
134 134
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		/**********************************/
138 138
 		/**         Update A Form        **/
139 139
 		/********************************/
140
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) {
140
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) {
141 141
 
142 142
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
143 143
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		/**************************************************/
147 147
 		/**     Clear Store MailChimp Transient Data   **/
148 148
 		/*************************************************/
149
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) {
149
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) {
150 150
 
151 151
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
152 152
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		/*******************************************/
156 156
 		/** Remove a user from a mailing list     **/
157 157
 		/*****************************************/
158
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) {
158
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) {
159 159
 
160 160
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
161 161
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		/*******************************************/
165 165
 		/**    Create misisng error log file  **/
166 166
 		/*****************************************/
167
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) {
167
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) {
168 168
 
169 169
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
170 170
 
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
 		add_action( 'admin_head', array( $this, 'add_tinyMCE_buttons' ) );
177 177
 
178 178
 		// pass our lists data to tinyMCE button for use.
179
-		foreach ( array( 'post.php', 'post-new.php' ) as $hook ) {
179
+		foreach ( array( 'post.php', 'post-new.php' ) as $hook ) {
180 180
 
181 181
 			add_action( 'admin_enqueue_scripts', array( $this, 'tinymce_yikes_easy_mc' ) );
182 182
 
183 183
 		}
184 184
 
185 185
 		// display an admin notice for users on PHP < 5.3.
186
-		if ( phpversion() < '5.3' ) {
186
+		if ( phpversion() < '5.3' ) {
187 187
 			add_action( "admin_notices", array( $this, 'display_php_warning' ), 999 );
188 188
 		}
189 189
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		/**************************************************/
197 197
 		/**        Clear MailChimp Error Log Data        **/
198 198
 		/*************************************************/
199
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) {
199
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) {
200 200
 
201 201
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
202 202
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		/*********************************************/
206 206
 		/**        Export MailChimp Opt-in Forms   **/
207 207
 		/*******************************************/
208
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) {
208
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) {
209 209
 
210 210
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
211 211
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		/*********************************************/
215 215
 		/**                Export Plugin Settings           **/
216 216
 		/*******************************************/
217
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) {
217
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) {
218 218
 
219 219
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
220 220
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		/*******************************************/
224 224
 		/**        Import Class Inclusion       **/
225 225
 		/*****************************************/
226
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) {
226
+		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) {
227 227
 
228 228
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
229 229
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		/*******************************************/
233 233
 		/**    Premium Support Request     **/
234 234
 		/*****************************************/
235
-		if ( isset( $_POST['submit-premium-support-request'] ) ) {
235
+		if ( isset( $_POST['submit-premium-support-request'] ) ) {
236 236
 
237 237
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
238 238
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		/****************************************/
242 242
 		/**    Dismiss Options Migrations        **/
243 243
 		/****************************************/
244
-		if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
244
+		if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
245 245
 
246 246
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
247 247
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		 * @ param  array  $links  Pre-existing plugin action links
277 277
 		 * @ return array  $links  New array of plugin actions
278 278
 		 */
279
-		public function easy_forms_plugin_action_links( $links ) {
279
+		public function easy_forms_plugin_action_links( $links ) {
280 280
 			$links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
281 281
 			$links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES, Inc.', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
282 282
 			return $links;
@@ -292,13 +292,13 @@  discard block
 block discarded – undo
292 292
 		 *
293 293
 		 * @return string
294 294
 		 */
295
-		public function yikes_easy_forms_admin_disclaimer( $footer_text ) {
295
+		public function yikes_easy_forms_admin_disclaimer( $footer_text ) {
296 296
 			$page = get_current_screen();
297 297
 			$base = $page->base;
298
-			if ( strpos( $base, 'yikes-inc-easy-mailchimp' ) !== false || strpos( $base, 'yikes-mailchimp' ) !== false ) {
298
+			if ( strpos( $base, 'yikes-inc-easy-mailchimp' ) !== false || strpos( $base, 'yikes-mailchimp' ) !== false ) {
299 299
 				$disclaimer_text = sprintf( '<em>' . __( 'Disclaimer: <strong>Easy Forms for MailChimp</strong> is in no way endorsed, affiliated or backed by MailChimp, or its parent company Rocket Science Group.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" data-rated="' . __( 'Thanks :)', 'yikes-inc-easy-mailchimp-extender' ) . '">', '</a></em>' );
300 300
 				return $disclaimer_text;
301
-			} else {
301
+			} else {
302 302
 				return $footer_text;
303 303
 			}
304 304
 		}
@@ -310,32 +310,32 @@  discard block
 block discarded – undo
310 310
 		*	@since 6.0.0
311 311
 		*	@return	parsed tag content
312 312
 		*/
313
-		public function parse_mailchimp_default_tag( $default_tag ) {
314
-			if ( ! $default_tag || $default_tag == '' ) {
313
+		public function parse_mailchimp_default_tag( $default_tag ) {
314
+			if ( ! $default_tag || $default_tag == '' ) {
315 315
 				return $default_tag;
316 316
 			}
317 317
 			global $post;
318 318
 			// page title.
319
-			if ( $default_tag == '{page_title}' ) {
319
+			if ( $default_tag == '{page_title}' ) {
320 320
 				$default_tag = get_the_title( $post->ID );
321 321
 			}
322 322
 			// page id.
323
-			if ( $default_tag == '{page_id}' ) {
323
+			if ( $default_tag == '{page_id}' ) {
324 324
 				$default_tag = $post->ID;
325 325
 			}
326 326
 			// page url.
327
-			if ( $default_tag == '{page_url}' ) {
327
+			if ( $default_tag == '{page_url}' ) {
328 328
 				$default_tag = get_permalink( $post->ID );
329 329
 			}
330 330
 			// blog name.
331
-			if ( $default_tag == '{blog_name}' ) {
331
+			if ( $default_tag == '{blog_name}' ) {
332 332
 				$default_tag = get_bloginfo( 'name' );
333 333
 			}
334 334
 			// is user logged in.
335
-			if ( $default_tag == '{user_logged_in}' ) {
336
-				if ( is_user_logged_in() ) {
335
+			if ( $default_tag == '{user_logged_in}' ) {
336
+				if ( is_user_logged_in() ) {
337 337
 					$default_tag = 'Registered User';
338
-				} else {
338
+				} else {
339 339
 					$default_tag = 'Guest User';
340 340
 				}
341 341
 			}
@@ -349,21 +349,21 @@  discard block
 block discarded – undo
349 349
 		*	When a user clicks 'Clear Log' on the debug settings page, this funciton
350 350
 		*	is used to clear the data out of our php file.
351 351
 		*/
352
-		public function yikes_easy_mailchimp_clear_error_log() {
352
+		public function yikes_easy_mailchimp_clear_error_log() {
353 353
 
354 354
 			// Get our error log class.
355 355
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
356 356
 
357 357
 			// file put contents $returned error + other data.
358
-			if ( file_exists( $error_logging->error_log_file_path ) ) {
358
+			if ( file_exists( $error_logging->error_log_file_path ) ) {
359 359
 
360 360
 				$clear_log = file_put_contents( $error_logging->error_log_file_path, '' );
361 361
 
362
-				if ( $clear_log === false ) {
362
+				if ( $clear_log === false ) {
363 363
 
364 364
 					// redirect the user to the manage forms page, display error message.
365 365
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error-log-cleared=false' ) ) );
366
-				} else {
366
+				} else {
367 367
 
368 368
 					// redirect the user to the manage forms page, display confirmation.
369 369
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error-log-cleared=true' ) ) );
@@ -377,13 +377,13 @@  discard block
 block discarded – undo
377 377
 		*	@since 		6.0.0
378 378
 		*	@return 	CSV export file
379 379
 		*/
380
-		public function yikes_easy_mailchimp_export_forms() {
380
+		public function yikes_easy_mailchimp_export_forms() {
381 381
 			// grab our nonce.
382 382
 			$nonce = $_REQUEST['nonce'];
383 383
 			// grab the forms.
384 384
 			$forms = isset( $_REQUEST['yikes_export_forms'] ) ? $_REQUEST['yikes_export_forms'] : array();
385 385
 			// validate nonce.
386
-			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
386
+			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
387 387
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
388 388
 			}
389 389
 
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 		*	@since 		6.0.0
402 402
 		*	@return 	CSV export file
403 403
 		*/
404
-		public function yikes_easy_mailchimp_export_plugin_settings() {
404
+		public function yikes_easy_mailchimp_export_plugin_settings() {
405 405
 			// grab our nonce
406 406
 			$nonce = $_REQUEST['nonce'];
407 407
 			// validate nonce.
408
-			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
408
+			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
409 409
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
410 410
 			}
411 411
 
@@ -421,15 +421,15 @@  discard block
 block discarded – undo
421 421
 		*	Custom import function to import all or specific forms
422 422
 		*	@since 6.0.0
423 423
 		*/
424
-		public function yikes_easy_mailchimp_import_forms() {
424
+		public function yikes_easy_mailchimp_import_forms() {
425 425
 			// grab our nonce.
426 426
 			$nonce = $_REQUEST['nonce'];
427 427
 			// validate nonce.
428
-			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
428
+			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
429 429
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
430 430
 			}
431 431
 			// include the export class.
432
-			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
432
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
433 433
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-import.class.php' );
434 434
 			}
435 435
 			// run the import function.
@@ -445,9 +445,9 @@  discard block
 block discarded – undo
445 445
 		*	Premium Support Request
446 446
 		*	@since 6.0.0
447 447
 		*/
448
-		public function yikes_easy_mailchimp_premium_support_request() {
448
+		public function yikes_easy_mailchimp_premium_support_request() {
449 449
 
450
-			if ( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
450
+			if ( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
451 451
 				return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' );
452 452
 			}
453 453
 
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 			) );
484 484
 
485 485
 			// Catch the error.
486
-			if ( is_wp_error( $response ) ) {
486
+			if ( is_wp_error( $response ) ) {
487 487
 				wp_send_json_error( $response->getMessage() );
488 488
 			}
489 489
 
@@ -491,9 +491,9 @@  discard block
 block discarded – undo
491 491
 			$response_body = json_decode( wp_remote_retrieve_body( $response ) );
492 492
 		}
493 493
 
494
-		public function get_premium_license( $plugin_slug ) {
494
+		public function get_premium_license( $plugin_slug ) {
495 495
 
496
-			switch( $plugin_slug ) {
496
+			switch( $plugin_slug ) {
497 497
 
498 498
 				case 'form-customizer':
499 499
 					return defined( 'YIKES_CUSTOMIZER_EDD_ITEM_ID' ) ? YIKES_CUSTOMIZER_EDD_ITEM_ID : '';
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 		*
515 515
 		*	@since 6.0.0
516 516
 		**/
517
-		public function yikes_easy_mailchimp_dismiss_option_migrate() {
517
+		public function yikes_easy_mailchimp_dismiss_option_migrate() {
518 518
 			// delete the options and allow the user to manually update things.
519 519
 
520 520
 			// Verify the NONCE is valid.
@@ -532,8 +532,8 @@  discard block
 block discarded – undo
532 532
 		 *
533 533
 		 * @since 6.0.0
534 534
 		 */
535
-		public function load_error_logging_class() {
536
-			if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
535
+		public function load_error_logging_class() {
536
+			if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
537 537
 				// if error logging is enabled we should include our error logging class
538 538
 				/* Generate oure error logging table */
539 539
 				require_once YIKES_MC_PATH . '/includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
@@ -548,21 +548,21 @@  discard block
 block discarded – undo
548 548
 		 *
549 549
 		 * @since v6.0.0
550 550
 		 */
551
-		public function yikes_easy_mailchimp_check_installation_date() {
551
+		public function yikes_easy_mailchimp_check_installation_date() {
552 552
 
553 553
 			// add a new option to store the plugin activation date/time.
554 554
 			// @since v6.0.0.
555 555
 			// this is used to notify the user that they should review after 2 weeks.
556
-			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
556
+			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
557 557
 				add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) );
558 558
 			}
559 559
 
560 560
 			$stop_bugging_me = get_option( 'yikes_easy_mailchimp_review_stop_bugging_me' );
561 561
 
562
-			if ( ! $stop_bugging_me ) {
562
+			if ( ! $stop_bugging_me ) {
563 563
 				$install_date = get_option( 'yikes_easy_mailchimp_activation_date' );
564 564
 				$past_date = strtotime( '-14 days' );
565
-				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
565
+				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
566 566
 					add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) );
567 567
 				}
568 568
 			}
@@ -574,9 +574,9 @@  discard block
 block discarded – undo
574 574
 			asking for a review, and for user feedback
575 575
 			@since v6.0.0
576 576
 		*/
577
-		public function yikes_easy_mailchimp_display_review_us_notice() {
577
+		public function yikes_easy_mailchimp_display_review_us_notice() {
578 578
 			/* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
579
-			if ( in_array( get_current_screen()->base , array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
579
+			if ( in_array( get_current_screen()->base , array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
580 580
 
581 581
 				// The URL of the page the user is currently on 
582 582
 				$current_uri  	  = isset( $_SERVER['REQUEST_URI'] ) && ! empty( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : false;
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
 			Remove the Review us notification when user clicks 'Dismiss'
620 620
 			@since v3.1.1
621 621
 		*/
622
-		public function yikes_easy_mailchimp_stop_bugging_me() {
623
-			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) && (int) filter_var( $_GET['yikes_easy_mc_icons_nobug'], FILTER_SANITIZE_NUMBER_INT ) === 1 ) {
622
+		public function yikes_easy_mailchimp_stop_bugging_me() {
623
+			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) && (int) filter_var( $_GET['yikes_easy_mc_icons_nobug'], FILTER_SANITIZE_NUMBER_INT ) === 1 ) {
624 624
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', true );
625 625
 			}
626 626
 		}
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 	/* End Two Week Notification */
629 629
 
630 630
 		/* Display a warning users who are using PHP < 5.3 */
631
-		public function display_php_warning() {
631
+		public function display_php_warning() {
632 632
 			$message = __( 'Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Please reach out to your host provider for assistance.', 'yikes-inc-easy-mailchimp-extender' );
633 633
 			echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>";
634 634
 		}
@@ -638,10 +638,10 @@  discard block
 block discarded – undo
638 638
 	 * TinyMCE Functions
639 639
 	 */
640 640
 	// load our button and pass in the JS form data variable.
641
-	public function add_tinyMCE_buttons() {
641
+	public function add_tinyMCE_buttons() {
642 642
 		global $typenow;
643 643
 		// only on Post Type: post and page.
644
-		if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
644
+		if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
645 645
 			return;
646 646
 		}
647 647
 		add_filter( 'mce_buttons', array( $this, 'yks_mc_add_tinymce_button' ) );
@@ -649,14 +649,14 @@  discard block
 block discarded – undo
649 649
 	}
650 650
 
651 651
 	// Add the button key for address via JS.
652
-	public function yks_mc_add_tinymce_button( $buttons ) {
652
+	public function yks_mc_add_tinymce_button( $buttons ) {
653 653
 		array_push( $buttons, 'yks_mc_tinymce_button_key' );
654 654
 		// Print all buttons.
655 655
 		return $buttons;
656 656
 	}
657 657
 
658 658
 	// inlcude the js for tinymce.
659
-	public function yks_mc_add_tinymce_plugin( $plugin_array ) {
659
+	public function yks_mc_add_tinymce_plugin( $plugin_array ) {
660 660
 
661 661
 		$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
662 662
 
@@ -668,23 +668,23 @@  discard block
 block discarded – undo
668 668
 		 * Pass our imported list data, to the JS file
669 669
 		 * to build the drop down list in the modal
670 670
 		 */
671
-	public function tinymce_yikes_easy_mc() {
671
+	public function tinymce_yikes_easy_mc() {
672 672
 		// check capabilities.
673
-		if ( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
673
+		if ( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
674 674
 			return;
675 675
 		}
676 676
 
677 677
 		$list_data = $this->form_interface->get_all_forms();
678 678
 		$lists     = array();
679
-		if ( ! empty( $list_data ) ) {
679
+		if ( ! empty( $list_data ) ) {
680 680
 			// build an array to pass to our javascript.
681
-			foreach ( $list_data as $id => $form ) {
681
+			foreach ( $list_data as $id => $form ) {
682 682
 				$lists[] = array(
683 683
 					'text'  => urlencode( $form['form_name'] ),
684 684
 					'value' => $id,
685 685
 				);
686 686
 			}
687
-		} else {
687
+		} else {
688 688
 			$lists[0] = array(
689 689
 				'text'  => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ),
690 690
 				'value' => '-',
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 	/**
710 710
 	 *  Fix the MailChimp icon spacing in the admin menu.
711 711
 	 */
712
-	public function fix_menu_icon_spacing() {
712
+	public function fix_menu_icon_spacing() {
713 713
 		?>
714 714
 			<style>
715 715
 			a[href="admin.php?page=yikes-inc-easy-mailchimp"] .wp-menu-image img {
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 	 *
725 725
 	 * @since    6.0.0
726 726
 	 */
727
-	public function enqueue_styles() {
727
+	public function enqueue_styles() {
728 728
 		/**
729 729
 		 *	Enqueue our global dashboard styles.
730 730
 		 */
@@ -733,14 +733,14 @@  discard block
 block discarded – undo
733 733
 		/*
734 734
 		*	Enqueue Add-ons styles.
735 735
 		*/
736
-		if ( get_current_screen()->base == 'easy-forms_page_yikes-inc-easy-mailchimp-addons' ) {
736
+		if ( get_current_screen()->base == 'easy-forms_page_yikes-inc-easy-mailchimp-addons' ) {
737 737
 			wp_enqueue_style( 'yikes-inc-easy-mailchimp-extender-addons-styles', plugin_dir_url( __FILE__ ) . 'css/yikes-inc-easy-mailchimp-extender-addons.min.css', array(), $this->version, 'all' );
738 738
 		}
739 739
 
740 740
 		/*
741 741
 		*	Enqueue Subscriber Profile Flags.
742 742
 		*/
743
-		if ( get_current_screen()->base == 'admin_page_yikes-mailchimp-view-user' ) {
743
+		if ( get_current_screen()->base == 'admin_page_yikes-mailchimp-view-user' ) {
744 744
 			wp_enqueue_style( 'yikes-inc-easy-mailchimp-extender-subscriber-flags', plugin_dir_url( __FILE__ ) . 'css/flag-icon.min.css', array(), $this->version, 'all' );
745 745
 		}
746 746
 	}
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 	 *
750 750
 	 * @since    6.0.0
751 751
 	 */
752
-	public function enqueue_scripts() {
752
+	public function enqueue_scripts() {
753 753
 		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery', 'jquery-ui-sortable' ), $this->version, false );
754 754
 
755 755
 		$localized_data = array(
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 
765 765
 		// Enqueue required scripts for the form editor
766 766
 		$screen = get_current_screen();
767
-		if ( ! isset( $screen->base ) || 'admin_page_yikes-mailchimp-edit-form' !== $screen->base ) {
767
+		if ( ! isset( $screen->base ) || 'admin_page_yikes-mailchimp-edit-form' !== $screen->base ) {
768 768
 			return;
769 769
 		}
770 770
 
@@ -810,12 +810,12 @@  discard block
 block discarded – undo
810 810
 	/**
811 811
 	 * Convert the php date format string to a js date format
812 812
 	 */
813
-	public function yikes_jQuery_datepicker_date_format_php_to_js( $sFormat, $type ) {
814
-		switch ( $type ) {
813
+	public function yikes_jQuery_datepicker_date_format_php_to_js( $sFormat, $type ) {
814
+		switch ( $type ) {
815 815
 			default:
816 816
 			case 'date':
817 817
 				// Standard Date Fields
818
-				switch ( $sFormat ) {
818
+				switch ( $sFormat ) {
819 819
 					//Predefined WP date formats
820 820
 					case 'F j, Y':
821 821
 					case 'j F Y':
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 				break;
839 839
 			// Birthday Fields
840 840
 			case 'birthday':
841
-				switch ( $sFormat ) {
841
+				switch ( $sFormat ) {
842 842
 					//Predefined WP date formats
843 843
 					case 'F j, Y':
844 844
 					case 'j F Y':
@@ -867,8 +867,8 @@  discard block
 block discarded – undo
867 867
 	/**
868 868
 	 * Convert the php date format string to a js date format
869 869
 	 */
870
-	public function yikes_jQuery_datepicker_date_format( $site_option ) {
871
-		switch( $site_option ) {
870
+	public function yikes_jQuery_datepicker_date_format( $site_option ) {
871
+		switch( $site_option ) {
872 872
 			//Predefined WP date formats
873 873
 			default:
874 874
 			case 'F j, Y':
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 	*	Register our admin pages
889 889
 	*	used to display data back to the user
890 890
 	**/
891
-	public function register_admin_pages() {
891
+	public function register_admin_pages() {
892 892
 
893 893
 		/* Top Level Menu 'Easy MailChimp' */
894 894
 		add_menu_page(
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
 	*	when they click 'Go Pro' in the admin menu
1012 1012
 	*	to do: populate with sales URL
1013 1013
 	*/
1014
-	public function generateAddOnsPage() {
1014
+	public function generateAddOnsPage() {
1015 1015
 		require_once YIKES_MC_PATH . 'admin/partials/menu/add-ons.php'; // include our add-ons page
1016 1016
 	}
1017 1017
 
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 	*
1021 1021
 	* @since    1.0.0
1022 1022
 	*/
1023
-	function generateManageFormsPage() {
1023
+	function generateManageFormsPage() {
1024 1024
 		require_once YIKES_MC_PATH . 'admin/partials/menu/manage-forms.php'; // include our manage forms page
1025 1025
 	}
1026 1026
 
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
 	*
1030 1030
 	* @since    1.0.0
1031 1031
 	*/
1032
-	function generateManageListsPage() {
1032
+	function generateManageListsPage() {
1033 1033
 		require_once YIKES_MC_PATH . 'admin/partials/menu/manage-lists.php'; // include our lists page
1034 1034
 	}
1035 1035
 
@@ -1038,7 +1038,7 @@  discard block
 block discarded – undo
1038 1038
 	*
1039 1039
 	* @since    1.0.0
1040 1040
 	*/
1041
-	function generateSupportPage() {
1041
+	function generateSupportPage() {
1042 1042
 
1043 1043
 		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-support-scripts', plugin_dir_url( __FILE__ ) . 'js/support.js', array( 'jquery' ), $this->version, false );	
1044 1044
 		require_once YIKES_MC_PATH . 'admin/partials/menu/support.php';
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
 	*
1050 1050
 	* @since    1.0.0
1051 1051
 	*/
1052
-	function generateEditFormPage() {
1052
+	function generateEditFormPage() {
1053 1053
 		require_once YIKES_MC_PATH . 'admin/partials/edit-form.php'; // include our options page
1054 1054
 	}
1055 1055
 
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 	*
1059 1059
 	* @since    1.0.0
1060 1060
 	*/
1061
-	function generateViewListPage() {
1061
+	function generateViewListPage() {
1062 1062
 		require_once YIKES_MC_PATH . 'admin/partials/view-list.php'; // include our options page
1063 1063
 	}
1064 1064
 
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
 	*
1068 1068
 	* @since    1.0.0
1069 1069
 	*/
1070
-	function generateViewUserPage() {
1070
+	function generateViewUserPage() {
1071 1071
 		require_once YIKES_MC_PATH . 'admin/partials/view-user.php'; // include our options page
1072 1072
 	}
1073 1073
 
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 	*
1077 1077
 	* @since v.5.4
1078 1078
 	**/
1079
-	function yikes_easy_mc_settings_init() {
1079
+	function yikes_easy_mc_settings_init() {
1080 1080
 
1081 1081
 		/* Register General Settings Section */
1082 1082
 
@@ -1196,27 +1196,27 @@  discard block
 block discarded – undo
1196 1196
 	*	Options Sanitization & Validation
1197 1197
 	*	@since complete re-write
1198 1198
 	**/
1199
-	function yikes_mc_validate_api_key( $input ) {
1200
-		if ( $input === '' ) {
1199
+	function yikes_mc_validate_api_key( $input ) {
1200
+		if ( $input === '' ) {
1201 1201
 			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1202 1202
 			return '';
1203 1203
 		}
1204 1204
 		$api_key = strip_tags ( trim( $input ) );
1205 1205
 		$dash_position = strpos( trim( $input ), '-' );
1206
-		if ( $dash_position !== false ) {
1206
+		if ( $dash_position !== false ) {
1207 1207
 			$manager = new Yikes_Inc_Easy_MailChimp_API_Manager( $api_key );
1208
-		} else {
1208
+		} else {
1209 1209
 			update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) );
1210 1210
 			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1211 1211
 			return $api_key;
1212 1212
 		}
1213 1213
 
1214 1214
 		$response = $manager->get_account_handler()->get_account( false );
1215
-		if ( ! is_wp_error( $response ) ) {
1215
+		if ( ! is_wp_error( $response ) ) {
1216 1216
 			update_option( 'yikes-mc-api-validation', 'valid_api_key' );
1217 1217
 				// Clear the API key transient data
1218 1218
 			$this->delete_yikes_mailchimp_transients();
1219
-		}  else {
1219
+		} else {
1220 1220
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1221 1221
 			$error_logging->yikes_easy_mailchimp_write_to_error_log( $response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) );
1222 1222
 			update_option( 'yikes-mc-api-invalid-key-response', $response->get_error_message() );
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
 	*
1232 1232
 	* @since    1.0.0
1233 1233
 	*/
1234
-	function generatePageOptions() {
1234
+	function generatePageOptions() {
1235 1235
 		require_once YIKES_MC_PATH . 'admin/partials/menu/options.php'; // include our options page
1236 1236
 	}
1237 1237
 
@@ -1241,15 +1241,15 @@  discard block
 block discarded – undo
1241 1241
 	*	to form fields. (input, dropdowns, buttons etc.)
1242 1242
 	* 	@since v5.5 re-write
1243 1243
 	**/
1244
-	public function is_user_mc_api_valid_form( $echo = true ) {
1245
-		if ( $echo == true ) {
1246
-			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1244
+	public function is_user_mc_api_valid_form( $echo = true ) {
1245
+		if ( $echo == true ) {
1246
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1247 1247
 				echo 'disabled="disabled"';
1248 1248
 			}
1249
-		} else {
1250
-			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1249
+		} else {
1250
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1251 1251
 				return false;
1252
-			} else {
1252
+			} else {
1253 1253
 				return true;
1254 1254
 			}
1255 1255
 		}
@@ -1264,11 +1264,11 @@  discard block
 block discarded – undo
1264 1264
 	 * @param      string    $yikes_inc_easy_mailchimp_extender       The name of this plugin.
1265 1265
 	 * @param      string    $version    The version of this plugin.
1266 1266
 	 */
1267
-	public function check_for_old_yks_mc_options() {
1267
+	public function check_for_old_yks_mc_options() {
1268 1268
 		$old_plugin_options = get_option( 'ykseme_storage' );
1269 1269
 		// only perform options migrations if the site is not a multi-site setup
1270
-		if ( !is_multisite() ) {
1271
-			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1270
+		if ( !is_multisite() ) {
1271
+			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1272 1272
 				// display a notice to the user that they should 'migrate'
1273 1273
 				// from the old plugin settings to the new ones
1274 1274
 				add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 );
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
 	 * moving from 5.5 and beyond..
1282 1282
 	 * @since
1283 1283
 	*/
1284
-	public function migrate_old_yks_mc_options() {
1284
+	public function migrate_old_yks_mc_options() {
1285 1285
 		// include our migrate options helper file
1286 1286
 		include_once YIKES_MC_PATH . 'admin/partials/upgrade-helpers/upgrade-migrate-options.php';
1287 1287
 	}
@@ -1300,15 +1300,15 @@  discard block
 block discarded – undo
1300 1300
 		 * @param      string    $yikes_inc_easy_mailchimp_extender       The name of this plugin.
1301 1301
 		 * @param      string    $version    The version of this plugin.
1302 1302
 		 */
1303
-		public function display_options_migrate_notice() {
1303
+		public function display_options_migrate_notice() {
1304 1304
 
1305 1305
 			// Confirm that the necessary forms table in the database exists, else bail
1306 1306
 			global $wpdb;
1307
-			if ( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1307
+			if ( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1308 1308
 				return;
1309 1309
 			}
1310 1310
 
1311
-			if ( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1311
+			if ( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1312 1312
 					// Delete the options, start a-new! (this will disable the migration notice altogether)
1313 1313
 					delete_option( 'widget_yikes_mc_widget' );
1314 1314
 					delete_option( 'api_validation' );
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
 						<p><?php printf( __( "The previously stored options for %s have been cleared from the database. You should update the plugin options on the <a href='%s' title='Settings Page'>settings page</a> before continuing. You should also update the shortcodes used to generate your forms, and any widgets you may have previously set-up.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>', admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ); ?></p>
1320 1320
 					</div>
1321 1321
 				<?php
1322
-			} else {
1322
+			} else {
1323 1323
 			?>
1324 1324
 				<div class="yikes-easy-mc-updated migrate-options-notice">
1325 1325
 					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list." , 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?></p>
@@ -1347,9 +1347,9 @@  discard block
 block discarded – undo
1347 1347
 		*	and return the index ( used to find the list name assigned to a form )
1348 1348
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1349 1349
 		*/
1350
-		function findMCListID($id, $array) {
1351
-		   foreach ($array as $key => $val) {
1352
-			   if ($val['id'] === $id) {
1350
+		function findMCListID($id, $array) {
1351
+		   foreach ($array as $key => $val) {
1352
+			   if ($val['id'] === $id) {
1353 1353
 				   return $key;
1354 1354
 			   }
1355 1355
 		   }
@@ -1357,14 +1357,14 @@  discard block
 block discarded – undo
1357 1357
 		} // end
1358 1358
 
1359 1359
 		/* Ajax Migrate Options */
1360
-		function migrate_archived_options() {
1360
+		function migrate_archived_options() {
1361 1361
 			// all options prefixed with 'yikes-mc-'
1362 1362
 			$option_name = 'yikes-mc-'.$_POST['option_name'];
1363 1363
 			$option_value = $_POST['option_value'];
1364
-			if ( json_decode( $option_value ) ) {
1364
+			if ( json_decode( $option_value ) ) {
1365 1365
 				// decode our lists() array, and store it
1366 1366
 				$opt_value = json_decode( $option_value, true );
1367
-			} else {
1367
+			} else {
1368 1368
 				$opt_value = $option_value;
1369 1369
 			}
1370 1370
 			update_option( $option_name, $opt_value );
@@ -1373,12 +1373,12 @@  discard block
 block discarded – undo
1373 1373
 		}
1374 1374
 
1375 1375
 		/* Ajax Migrate Forms */
1376
-		function migrate_previously_setup_forms() {
1376
+		function migrate_previously_setup_forms() {
1377 1377
 			$option_name = $_POST['option_name'];
1378 1378
 			$done = $_POST['done_import'];
1379 1379
 			// Create some starter forms for the user
1380 1380
 			// based on previously imported lists (to our old version)
1381
-			if ( $option_name == 'yikes-mc-lists' ) {
1381
+			if ( $option_name == 'yikes-mc-lists' ) {
1382 1382
 				$option_value = $_POST['option_value'];
1383 1383
 				$new_options = json_decode( stripslashes_deep( $option_value ) , true );
1384 1384
 
@@ -1410,9 +1410,9 @@  discard block
 block discarded – undo
1410 1410
 					'custom_fields'           => '',
1411 1411
 				) );
1412 1412
 			}
1413
-			if ( $done == 'done' ) {
1413
+			if ( $done == 'done' ) {
1414 1414
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => true ) );
1415
-			} else {
1415
+			} else {
1416 1416
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => false ) );
1417 1417
 			}
1418 1418
 			wp_die();
@@ -1424,8 +1424,8 @@  discard block
 block discarded – undo
1424 1424
 		*	Render our sidebar menu on all of the setings pages (general, form, checkbox, recaptcha, popup, debug etc. )
1425 1425
 		*	@since v5.6 - complete re-write
1426 1426
 		*/
1427
-		public function generate_options_pages_sidebar_menu() {
1428
-			if ( isset( $_REQUEST['section'] ) ) {
1427
+		public function generate_options_pages_sidebar_menu() {
1428
+			if ( isset( $_REQUEST['section'] ) ) {
1429 1429
 				$selected = $_REQUEST['section'];
1430 1430
 			}
1431 1431
 			$installed_addons = get_option( 'yikes-easy-mc-active-addons', array() );
@@ -1452,13 +1452,13 @@  discard block
 block discarded – undo
1452 1452
 					</ul>
1453 1453
 					<?php
1454 1454
 						// create our add-on settings pages
1455
-						if ( !empty( $installed_addons ) ) {
1455
+						if ( !empty( $installed_addons ) ) {
1456 1456
 							?>
1457 1457
 							<hr class="add-on-settings-divider" />
1458 1458
 							<strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1459 1459
 							<ul id="addon-settings-nav">
1460 1460
 							<?php
1461
-							foreach( $installed_addons as $addon_name ) {
1461
+							foreach( $installed_addons as $addon_name ) {
1462 1462
 								?>
1463 1463
 									<li>
1464 1464
 										<?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] ==  $addon_name ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => $addon_name, 'addon' => 'true' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section='.$addon_name ) ) ); ?>"><?php echo ucwords( str_replace( '-', ' ', $addon_name ) ); ?></a></li>
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
 		*	Render our sidebar menu on all of the setings pages (general, form, checkbox, recaptcha, popup, debug etc. )
1479 1479
 		*	@since v5.6 - complete re-write
1480 1480
 		*/
1481
-		public function generate_manage_forms_sidebar( $lists ) {
1481
+		public function generate_manage_forms_sidebar( $lists ) {
1482 1482
 			// create a custom URL to allow for creating fields
1483 1483
 			$url = esc_url_raw(
1484 1484
 				add_query_arg(
@@ -1509,18 +1509,18 @@  discard block
 block discarded – undo
1509 1509
 					<label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1510 1510
 						<select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); disabled( true, empty( $lists ) ); ?>>
1511 1511
 							<?php
1512
-							if ( ! empty( $lists ) ) {
1513
-								foreach( $lists as $mailing_list ) {
1512
+							if ( ! empty( $lists ) ) {
1513
+								foreach( $lists as $mailing_list ) {
1514 1514
 									?>
1515 1515
 									<option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1516 1516
 									<?php
1517 1517
 								}
1518
-							} else {
1519
-								if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1518
+							} else {
1519
+								if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1520 1520
 									?>
1521 1521
 									<option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1522 1522
 									<?php
1523
-								} else {
1523
+								} else {
1524 1524
 									?>
1525 1525
 									<option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1526 1526
 									<?php
@@ -1531,8 +1531,8 @@  discard block
 block discarded – undo
1531 1531
 						</select>
1532 1532
 
1533 1533
 						<?php
1534
-						if ( isset( $_GET['transient-cleared'] ) ) {
1535
-							if ( 'true' === $_GET['transient-cleared'] ) {
1534
+						if ( isset( $_GET['transient-cleared'] ) ) {
1535
+							if ( 'true' === $_GET['transient-cleared'] ) {
1536 1536
 								?>
1537 1537
 								<div class="yikes-list-refreshed-notice">
1538 1538
 									<p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -1541,8 +1541,8 @@  discard block
 block discarded – undo
1541 1541
 							}
1542 1542
 						}
1543 1543
 
1544
-						if ( isset( $lists ) && empty( $lists ) ) {
1545
-							if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1544
+						if ( isset( $lists ) && empty( $lists ) ) {
1545
+							if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1546 1546
 								?>
1547 1547
 									<p class="description">
1548 1548
 										<?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ) , __( 'Create a list', 'yikes-inc-easy-mailchimp-extender' ) ); ?>
@@ -1553,9 +1553,9 @@  discard block
 block discarded – undo
1553 1553
 						?>
1554 1554
 					</label>
1555 1555
 					<?php
1556
-						if ( $this->is_user_mc_api_valid_form( false ) ) {
1556
+						if ( $this->is_user_mc_api_valid_form( false ) ) {
1557 1557
 							echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary', '', false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1558
-						} else {
1558
+						} else {
1559 1559
 							echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1560 1560
 							?>
1561 1561
 								<a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&settings-updated=true' ) ); ?>"><?php _e( 'general settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
@@ -1566,7 +1566,7 @@  discard block
 block discarded – undo
1566 1566
 
1567 1567
 				<!-- Clear API CACHE -->
1568 1568
 				<?php
1569
-				if ( isset( $lists ) && ! empty( $lists ) ) {
1569
+				if ( isset( $lists ) && ! empty( $lists ) ) {
1570 1570
 					if ( false !== get_transient( 'yikes-easy-mailchimp-list-data' ) ) { ?>
1571 1571
 						<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data', 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post">
1572 1572
 							<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists', 'yikes-inc-easy-mailchimp-extender' ); ?>" />
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
 		*	Generate a dropdown of post and pages
1583 1583
 		*	so the user can send the user to on form submission
1584 1584
 		*/
1585
-		public function generate_page_redirect_dropdown( $redirect, $redirect_page, $custom_redirect_url ) {
1585
+		public function generate_page_redirect_dropdown( $redirect, $redirect_page, $custom_redirect_url ) {
1586 1586
 				$post_types = get_post_types();
1587 1587
 				?>
1588 1588
 				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
@@ -1602,10 +1602,10 @@  discard block
 block discarded – undo
1602 1602
 					$excluded_post_types = apply_filters( 'yikes-mailchimp-excluded-redirect-post-types', $excluded_post_types );
1603 1603
 
1604 1604
 						// loop over registered post types, and query!
1605
-						foreach( $post_types as $registered_post_type ) {
1605
+						foreach( $post_types as $registered_post_type ) {
1606 1606
 
1607 1607
 							// exclude a few built in custom post types and any defined by the filter
1608
-							if ( ! in_array( $registered_post_type, $excluded_post_types ) ) {
1608
+							if ( ! in_array( $registered_post_type, $excluded_post_types ) ) {
1609 1609
 
1610 1610
 								// Grab only the post IDs - in the past we've created timeout issues on some servers with lots of posts
1611 1611
 								$wp_query_args = array(
@@ -1620,11 +1620,11 @@  discard block
 block discarded – undo
1620 1620
 
1621 1621
 								$post_ids = ! empty( $wp_query_result->posts ) ? $wp_query_result->posts : array();
1622 1622
 
1623
-								if ( ! empty ( $post_ids ) ) {
1623
+								if ( ! empty ( $post_ids ) ) {
1624 1624
 									?>
1625 1625
 										<optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>">
1626 1626
 									<?php
1627
-											foreach( $post_ids as $post_id ) {
1627
+											foreach( $post_ids as $post_id ) {
1628 1628
 												?><option <?php selected( $redirect_page , $post_id ); ?> value="<?php echo $post_id; ?>"><?php echo get_the_title( $post_id ) ?></option><?php
1629 1629
 											}
1630 1630
 									?>
@@ -1655,15 +1655,15 @@  discard block
 block discarded – undo
1655 1655
 		*
1656 1656
 		* 	Displayed in sidebars
1657 1657
 		*/
1658
-		public function generate_show_some_love_container() {
1658
+		public function generate_show_some_love_container() {
1659 1659
 			// if no active add-ons are installed,
1660 1660
 			// lets display our branding and add-on sidebar
1661 1661
 			$options = get_option( 'yikes-easy-mc-active-addons', array() );
1662
-			if ( empty( $options ) ) {
1662
+			if ( empty( $options ) ) {
1663 1663
 
1664 1664
 				/* On Edit Forms Page Display Upsell to Customizer */
1665 1665
 				$screen = get_current_screen();
1666
-				if ( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1666
+				if ( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1667 1667
 				?>
1668 1668
 
1669 1669
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
@@ -1741,18 +1741,18 @@  discard block
 block discarded – undo
1741 1741
 		*	-
1742 1742
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
1743 1743
 		*/
1744
-		public function generate_form_editor( $form_fields, $list_id, $merge_variables, $interest_groups ) {
1744
+		public function generate_form_editor( $form_fields, $list_id, $merge_variables, $interest_groups ) {
1745 1745
 
1746 1746
 			// if no list id, die!
1747
-			if ( ! $list_id ) {
1747
+			if ( ! $list_id ) {
1748 1748
 				wp_die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) );
1749 1749
 			}
1750 1750
 
1751
-			if ( ! $merge_variables ) {
1751
+			if ( ! $merge_variables ) {
1752 1752
 				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support." , 'yikes-inc-easy-mailchimp-extender' ) );
1753 1753
 			}
1754 1754
 
1755
-			if ( ! empty( $form_fields ) ) {
1755
+			if ( ! empty( $form_fields ) ) {
1756 1756
 
1757 1757
 				// find any fields that are assigned to this form, that don't exist in MailChimp
1758 1758
 				// or else were going to run into issues when we submit the form
@@ -1764,18 +1764,18 @@  discard block
 block discarded – undo
1764 1764
 				$mailchimp_merge_field_ids	= array();
1765 1765
 
1766 1766
 				// loop over merge variables
1767
-				if ( ! empty( $merge_variables['merge_fields'] ) ) {
1767
+				if ( ! empty( $merge_variables['merge_fields'] ) ) {
1768 1768
 					$available_merge_variables = wp_list_pluck( $merge_variables['merge_fields'], 'tag' );
1769 1769
 					$mailchimp_merge_field_ids = wp_list_pluck( $merge_variables['merge_fields'], 'merge_id' );
1770 1770
 					
1771 1771
 					// Array will look like $merge_tag => $merge_id
1772
-					foreach( $available_merge_variables as $index => $merge_tag ) { 
1772
+					foreach( $available_merge_variables as $index => $merge_tag ) {
1773 1773
 						$merge_field_ids[$merge_tag] = $mailchimp_merge_field_ids[$index];
1774 1774
 					}
1775 1775
 				}
1776 1776
 
1777 1777
 				// loop over interest groups
1778
-				if ( ! empty( $interest_groups ) ) {
1778
+				if ( ! empty( $interest_groups ) ) {
1779 1779
 					$available_interest_groups = array_keys( $interest_groups );
1780 1780
 				}
1781 1781
 
@@ -1785,9 +1785,9 @@  discard block
 block discarded – undo
1785 1785
 				$excluded_fields = array_diff( $assigned_fields, $merged_fields );
1786 1786
 
1787 1787
 				$i = 1;
1788
-				foreach( $form_fields as $field ) {
1788
+				foreach( $form_fields as $field ) {
1789 1789
 
1790
-					if ( isset( $field['merge'] ) ) {
1790
+					if ( isset( $field['merge'] ) ) {
1791 1791
 						// @todo: don't use in_array()
1792 1792
 						$excluded_field = in_array( $field['merge'], $excluded_fields, true );
1793 1793
 						?>
@@ -1821,7 +1821,7 @@  discard block
 block discarded – undo
1821 1821
 									<input type="hidden" class="yikes-mc-merge-field-id" name="field[<?php echo $field['merge']; ?>][id]" value="<?php echo $merge_field_ids[ $field['merge'] ] ?>" />  
1822 1822
 								<?php } ?>
1823 1823
 
1824
-								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1824
+								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1825 1825
 									$choices = json_decode( $field['choices'], true );
1826 1826
 								?>
1827 1827
 									<input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
@@ -1845,7 +1845,7 @@  discard block
 block discarded – undo
1845 1845
 										</tr>
1846 1846
 
1847 1847
 										<!-- Placeholder Value -->
1848
-										<?php switch( $field['type'] ) {
1848
+										<?php switch( $field['type'] ) {
1849 1849
 
1850 1850
 											case 'text':
1851 1851
 											case 'email':
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
 										?>
1893 1893
 
1894 1894
 										<!-- Default Value -->
1895
-										<?php switch( $field['type'] ) {
1895
+										<?php switch( $field['type'] ) {
1896 1896
 											default:
1897 1897
 											case 'text':
1898 1898
 											case 'number':
@@ -1908,7 +1908,7 @@  discard block
 block discarded – undo
1908 1908
 													<input id="default_value_<?php echo esc_attr( $field['merge'] ); ?>" <?php if ( $field['type'] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field['merge']; ?>][default]" <?php if ( $field['type'] != 'url' ) { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( $field['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field['default'] ) ) ) : ''; ?>" <?php } ?> />
1909 1909
 													<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1910 1910
 													<?php
1911
-													switch( $field['type'] ) {
1911
+													switch( $field['type'] ) {
1912 1912
 														case 'text':
1913 1913
 															?>
1914 1914
 																<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" onclick="storeGlobalClicked( jQuery( this ) );" class="thickbox"><?php _e( 'View Pre-Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
@@ -2065,7 +2065,7 @@  discard block
 block discarded – undo
2065 2065
 										<!-- Display Phone/Date Formats back to the user -->
2066 2066
 										<!-- Phone Format Initial Load -->
2067 2067
 										<?php
2068
-											switch( $field['type'] ) {
2068
+											switch( $field['type'] ) {
2069 2069
 												/* Store the phone format, for properly regex pattern */
2070 2070
 												case 'phone':
2071 2071
 												case 'birthday':
@@ -2075,7 +2075,7 @@  discard block
 block discarded – undo
2075 2075
 															<td scope="row">
2076 2076
 																<label for="placeholder">
2077 2077
 																	<?php
2078
-																		switch( $field['type'] ) {
2078
+																		switch( $field['type'] ) {
2079 2079
 																			default:
2080 2080
 																			case 'birthday':
2081 2081
 																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
@@ -2136,7 +2136,7 @@  discard block
 block discarded – undo
2136 2136
 
2137 2137
 
2138 2138
 
2139
-					} else {
2139
+					} else {
2140 2140
 
2141 2141
 						/**** Interest Group ****/
2142 2142
 
@@ -2169,7 +2169,7 @@  discard block
 block discarded – undo
2169 2169
 
2170 2170
 									<table class="form-table form-field-container">
2171 2171
 										<!-- Default Value -->
2172
-										<?php switch( $field['type'] ) {
2172
+										<?php switch( $field['type'] ) {
2173 2173
 											default:
2174 2174
 											case 'radio':
2175 2175
 											case 'checkboxes':
@@ -2186,7 +2186,7 @@  discard block
 block discarded – undo
2186 2186
 
2187 2187
 														$default_shown = false;
2188 2188
 
2189
-														foreach ( json_decode( $field['groups'], true ) as $id => $group ) {
2189
+														foreach ( json_decode( $field['groups'], true ) as $id => $group ) {
2190 2190
 															$field_id   = "{$field['group_id']}-{$id}";
2191 2191
 															$field_type = 'hidden' == $field['type'] ? 'checkbox' : $field['type'];
2192 2192
 															$field_type = 'checkboxes' == $field_type ? 'checkbox' : $field_type;
@@ -2195,7 +2195,7 @@  discard block
 block discarded – undo
2195 2195
 
2196 2196
 															// Determine if the current group is checked.
2197 2197
 															$checked = '';
2198
-															switch ( $field_type ) {
2198
+															switch ( $field_type ) {
2199 2199
 																case 'radio':
2200 2200
 																default:
2201 2201
 																	$default = is_array( $field['default_choice'] ) ? current( $field['default_choice'] ) : $field['default_choice'];
@@ -2204,14 +2204,14 @@  discard block
 block discarded – undo
2204 2204
 
2205 2205
 																case 'checkbox':
2206 2206
 																case 'hidden':
2207
-																	if ( is_array( $field['default_choice'] ) && in_array( $id, $field['default_choice'] ) ) {
2207
+																	if ( is_array( $field['default_choice'] ) && in_array( $id, $field['default_choice'] ) ) {
2208 2208
 																		$checked = checked( true, true, false );
2209 2209
 																	}
2210 2210
 																break;
2211 2211
 															}
2212 2212
 
2213 2213
 															// Allow users to not set a default choice for radio buttons.
2214
-															if ( $field_type === 'radio' && $default_shown === false ) {
2214
+															if ( $field_type === 'radio' && $default_shown === false ) {
2215 2215
 																$default_shown = true;
2216 2216
 																?>
2217 2217
 																<label for="<?php echo $field_id . 'no-default'; ?>">
@@ -2364,7 +2364,7 @@  discard block
 block discarded – undo
2364 2364
 						<?php
2365 2365
 					}
2366 2366
 				}
2367
-			} else {
2367
+			} else {
2368 2368
 				?>
2369 2369
 					<h4 class="no-fields-assigned-notice non-draggable-yikes"><em><?php _e( 'No fields are assigned to this form. Select fields from the right hand column to add to this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></h4>
2370 2370
 				<?php
@@ -2451,19 +2451,19 @@  discard block
 block discarded – undo
2451 2451
 		*	-
2452 2452
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2453 2453
 		*/
2454
-		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2454
+		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2455 2455
 			$fields_assigned_to_form = array();
2456
-			foreach ( $form_fields as $field ) {
2457
-				if ( isset( $field['merge'] ) ) {
2456
+			foreach ( $form_fields as $field ) {
2457
+				if ( isset( $field['merge'] ) ) {
2458 2458
 					$fields_assigned_to_form[ $field['merge'] ] = true;
2459 2459
 				}
2460 2460
 			}
2461 2461
 
2462
-			if ( ! empty( $available_merge_variables['merge_fields'] ) ) {
2462
+			if ( ! empty( $available_merge_variables['merge_fields'] ) ) {
2463 2463
 				?>
2464 2464
 				<ul id="available-fields"><?php
2465
-				foreach ( $available_merge_variables['merge_fields'] as $merge_var ) {
2466
-					if ( isset( $fields_assigned_to_form[ $merge_var['tag'] ] ) ) {
2465
+				foreach ( $available_merge_variables['merge_fields'] as $merge_var ) {
2466
+					if ( isset( $fields_assigned_to_form[ $merge_var['tag'] ] ) ) {
2467 2467
 						?>
2468 2468
 						<li class="available-form-field not-available"
2469 2469
 						    alt="<?php echo $merge_var['tag']; ?>"
@@ -2473,13 +2473,13 @@  discard block
 block discarded – undo
2473 2473
 						    title="<?php esc_attr_e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>"
2474 2474
 						    disabled="disabled">
2475 2475
 							<?php echo stripslashes( $merge_var['name'] );
2476
-							if ( $merge_var['required'] ) {
2476
+							if ( $merge_var['required'] ) {
2477 2477
 								echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>';
2478 2478
 							} ?>
2479 2479
 							<small class="field-type-text"><?php echo $merge_var['type']; ?></small>
2480 2480
 						</li>
2481 2481
 						<?php
2482
-					} else {
2482
+					} else {
2483 2483
 						?>
2484 2484
 						<li class="available-form-field"
2485 2485
 						    alt="<?php echo $merge_var['tag']; ?>"
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
 						    data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>"
2488 2488
 						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>">
2489 2489
 							<?php echo stripslashes( $merge_var['name'] );
2490
-							if ( $merge_var['required'] ) {
2490
+							if ( $merge_var['required'] ) {
2491 2491
 								echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>';
2492 2492
 							} ?>
2493 2493
 							<small class="field-type-text"><?php echo $merge_var['type']; ?></small>
@@ -2512,21 +2512,21 @@  discard block
 block discarded – undo
2512 2512
 		*	-
2513 2513
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2514 2514
 		*/
2515
-		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2515
+		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2516 2516
 			$fields_assigned_to_form = array();
2517
-			if ( ! empty( $form_fields ) ) {
2518
-				foreach ( $form_fields as $field ) {
2519
-					if ( isset( $field['group_id'] ) ) {
2517
+			if ( ! empty( $form_fields ) ) {
2518
+				foreach ( $form_fields as $field ) {
2519
+					if ( isset( $field['group_id'] ) ) {
2520 2520
 						$fields_assigned_to_form[ $field['group_id'] ] = true;
2521 2521
 					}
2522 2522
 				}
2523 2523
 			}
2524 2524
 
2525
-			if ( ! empty( $available_interest_groups ) ) {
2525
+			if ( ! empty( $available_interest_groups ) ) {
2526 2526
 				?>
2527 2527
 				<ul id="available-interest-groups"><?php
2528
-				foreach ( $available_interest_groups as $interest_group ) {
2529
-					if ( isset( $fields_assigned_to_form[ $interest_group['id'] ] ) ) {
2528
+				foreach ( $available_interest_groups as $interest_group ) {
2529
+					if ( isset( $fields_assigned_to_form[ $interest_group['id'] ] ) ) {
2530 2530
 						?>
2531 2531
 						<li class="available-interest-group not-available" 
2532 2532
 							alt="<?php echo $interest_group['id']; ?>" 
@@ -2539,7 +2539,7 @@  discard block
 block discarded – undo
2539 2539
 							<small class="field-type-text"><?php echo $interest_group['type']; ?></small>
2540 2540
 						</li>
2541 2541
 						<?php
2542
-					} else {
2542
+					} else {
2543 2543
 						?>
2544 2544
 						<li class="available-interest-group" 
2545 2545
 							alt="<?php echo $interest_group['id']; ?>" 
@@ -2569,9 +2569,9 @@  discard block
 block discarded – undo
2569 2569
 		*	and include it here for easy maintenance
2570 2570
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2571 2571
 		*/
2572
-		public function yikes_easy_mailchimp_create_form() {
2572
+		public function yikes_easy_mailchimp_create_form() {
2573 2573
 			$nonce = $_REQUEST['nonce'];
2574
-			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2574
+			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2575 2575
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) );
2576 2576
 			}
2577 2577
 
@@ -2582,13 +2582,13 @@  discard block
 block discarded – undo
2582 2582
 			) );
2583 2583
 
2584 2584
 			// if an error occurs during the form creation process
2585
-			if ( false == $result ) {
2585
+			if ( false == $result ) {
2586 2586
 				// write it to the error log
2587 2587
 				// if the form was not created successfully
2588 2588
 				$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2589 2589
 				$error_logging->maybe_write_to_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender') , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2590 2590
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ) ) ) ) );
2591
-			} else {
2591
+			} else {
2592 2592
 				// redirect the user to the new form edit page
2593 2593
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result) ) );
2594 2594
 			}
@@ -2601,12 +2601,12 @@  discard block
 block discarded – undo
2601 2601
 		*	and include it here for easy maintenance
2602 2602
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2603 2603
 		*/
2604
-		public function yikes_easy_mailchimp_delete_form() {
2604
+		public function yikes_easy_mailchimp_delete_form() {
2605 2605
 			// grab & store our variables ( associated list & form name )
2606 2606
 			$nonce = $_REQUEST['nonce'];
2607 2607
 			$post_id_to_delete = $_REQUEST['mailchimp-form'];
2608 2608
 			// verify our nonce
2609
-			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2609
+			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2610 2610
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2611 2611
 			}
2612 2612
 
@@ -2621,12 +2621,12 @@  discard block
 block discarded – undo
2621 2621
 		*	Duplicate an entire form !
2622 2622
 		*	Probably Move these to its own file,
2623 2623
 		*/
2624
-		public function yikes_easy_mailchimp_duplicate_form() {
2624
+		public function yikes_easy_mailchimp_duplicate_form() {
2625 2625
 			// grab & store our variables ( associated list & form name )
2626 2626
 			$nonce = $_REQUEST['nonce'];
2627 2627
 			$post_id_to_clone = $_REQUEST['mailchimp-form'];
2628 2628
 			// verify our nonce
2629
-			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2629
+			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2630 2630
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2631 2631
 			}
2632 2632
 
@@ -2650,10 +2650,10 @@  discard block
 block discarded – undo
2650 2650
 			*/
2651 2651
 			do_action( 'yikes-mailchimp-after-duplicating-form', $post_id_to_clone, $result, $form_data );
2652 2652
 
2653
-			if ( false === $result ) {
2653
+			if ( false === $result ) {
2654 2654
 				// redirect the user to the manage forms page, display error
2655 2655
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp&duplicated-form=false' ) ) );
2656
-			} else {
2656
+			} else {
2657 2657
 				// redirect the user to the manage forms page, display confirmation
2658 2658
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp&duplicated-form=true' ) ) );
2659 2659
 			}
@@ -2664,12 +2664,12 @@  discard block
 block discarded – undo
2664 2664
 		/*
2665 2665
 		*	Reset a forms impression stats
2666 2666
 		*/
2667
-		public function yikes_easy_mailchimp_reset_impression_stats() {
2667
+		public function yikes_easy_mailchimp_reset_impression_stats() {
2668 2668
 			// grab & store our variables ( associated list & form name )
2669 2669
 			$nonce = $_REQUEST['nonce'];
2670 2670
 			$form_id_to_reset = $_REQUEST['mailchimp-form'];
2671 2671
 			// verify our nonce
2672
-			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2672
+			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2673 2673
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2674 2674
 			}
2675 2675
 
@@ -2681,10 +2681,10 @@  discard block
 block discarded – undo
2681 2681
 				)
2682 2682
 			);
2683 2683
 
2684
-			if ( false === $result ) {
2684
+			if ( false === $result ) {
2685 2685
 				// redirect the user to the manage forms page, display error
2686 2686
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp&reset-stats=false' ) ) );
2687
-			} else {
2687
+			} else {
2688 2688
 				// redirect the user to the manage forms page, display confirmation
2689 2689
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp&reset-stats=true' ) ) );
2690 2690
 			}
@@ -2696,13 +2696,13 @@  discard block
 block discarded – undo
2696 2696
 		*	Update an entire form !
2697 2697
 		*	Probably Move these to its own file,
2698 2698
 		*/
2699
-		public function yikes_easy_mailchimp_update_form() {
2699
+		public function yikes_easy_mailchimp_update_form() {
2700 2700
 
2701 2701
 			$nonce   = $_REQUEST['nonce'];
2702 2702
 			$form_id = $_REQUEST['id'];
2703 2703
 
2704 2704
 			// verify our nonce
2705
-			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
2705
+			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
2706 2706
 				wp_die(
2707 2707
 					__( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ),
2708 2708
 					__( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ),
@@ -2775,11 +2775,11 @@  discard block
 block discarded – undo
2775 2775
 
2776 2776
 			// additional custom fields (extensions / user defined fields)
2777 2777
 			$custom_fields = array();
2778
-			if ( isset( $_POST['custom-field'] ) ) {
2779
-				foreach ( $_POST['custom-field'] as $custom_field => $custom_value ) {
2780
-					if ( is_array( $custom_value ) ) {
2778
+			if ( isset( $_POST['custom-field'] ) ) {
2779
+				foreach ( $_POST['custom-field'] as $custom_field => $custom_value ) {
2780
+					if ( is_array( $custom_value ) ) {
2781 2781
 						$custom_fields[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2782
-					} else {
2782
+					} else {
2783 2783
 						$custom_fields[ $custom_field ] = stripslashes( $custom_value );
2784 2784
 					}
2785 2785
 				}
@@ -2815,7 +2815,7 @@  discard block
 block discarded – undo
2815 2815
 			exit();
2816 2816
 		}
2817 2817
 
2818
-		public static function generate_default_email_body() {
2818
+		public static function generate_default_email_body() {
2819 2819
 			$email_body  = '<p>' . __( 'Greetings,', 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; 
2820 2820
 
2821 2821
 			$email_body .= '<p>';
@@ -2838,18 +2838,18 @@  discard block
 block discarded – undo
2838 2838
 		}
2839 2839
 
2840 2840
 		/* Unsubscribe a given user from our list */
2841
-		public function yikes_easy_mailchimp_unsubscribe_user() {
2841
+		public function yikes_easy_mailchimp_unsubscribe_user() {
2842 2842
 			$nonce    = $_REQUEST['nonce'];
2843 2843
 			$list_id  = $_REQUEST['mailchimp-list'];
2844 2844
 			$email_id = $_REQUEST['email_id'];
2845 2845
 
2846 2846
 			// verify our nonce
2847
-			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2847
+			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2848 2848
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2849 2849
 			}
2850 2850
 
2851 2851
 			$response = yikes_get_mc_api_manager()->get_list_handler()->member_unsubscribe( $list_id, $email_id );
2852
-			if ( is_wp_error( $response ) ) {
2852
+			if ( is_wp_error( $response ) ) {
2853 2853
 				$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2854 2854
 				$error_logging->maybe_write_to_log(
2855 2855
 					$response->get_error_code(),
@@ -2862,22 +2862,22 @@  discard block
 block discarded – undo
2862 2862
 			exit;
2863 2863
 		}
2864 2864
 
2865
-		public function yikes_easy_mailchimp_create_missing_error_log() {
2865
+		public function yikes_easy_mailchimp_create_missing_error_log() {
2866 2866
 			// grab our nonnce
2867 2867
 			$nonce = $_REQUEST['nonce'];
2868 2868
 			// validate nonce
2869
-			if ( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2869
+			if ( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2870 2870
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2871 2871
 			}
2872 2872
 			// setup the path to the error log
2873 2873
 			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' );
2874
-			try {
2874
+			try {
2875 2875
 				// create the file
2876 2876
 				fwrite( $error_log , '' );
2877 2877
 				// close out
2878 2878
 				fclose( $error_log );
2879 2879
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=true' ) ) );
2880
-			} catch ( Exception $e ) {
2880
+			} catch ( Exception $e ) {
2881 2881
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=false&error_message='.urlencode( $e->getMessage() ) ) ) );
2882 2882
 			}
2883 2883
 		}
@@ -2886,11 +2886,11 @@  discard block
 block discarded – undo
2886 2886
 		*	Clear Transient Data !
2887 2887
 		*	Probably Move these to its own file,
2888 2888
 		*/
2889
-		public function yikes_easy_mailchimp_clear_transient_data() {
2889
+		public function yikes_easy_mailchimp_clear_transient_data() {
2890 2890
 
2891 2891
 			// verify our nonce
2892 2892
 			$nonce = $_REQUEST['nonce'];
2893
-			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2893
+			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2894 2894
 				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2895 2895
 			}
2896 2896
 
@@ -2898,14 +2898,14 @@  discard block
 block discarded – undo
2898 2898
 
2899 2899
 			// if the request came from the settings page, redirect to the settings page.
2900 2900
 			$referer = wp_get_referer();
2901
-			if ( $referer && ( strpos( $referer, 'yikes-inc-easy-mailchimp-settings' ) > 0 ) ) {
2901
+			if ( $referer && ( strpos( $referer, 'yikes-inc-easy-mailchimp-settings' ) > 0 ) ) {
2902 2902
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings&transient-cleared=true' ) ) );
2903
-			} elseif ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] === 'yikes-mailchimp-edit-form' && isset( $_REQUEST['id'] ) && ! empty( $_REQUEST['id'] ) ) {
2903
+			} elseif ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] === 'yikes-mailchimp-edit-form' && isset( $_REQUEST['id'] ) && ! empty( $_REQUEST['id'] ) ) {
2904 2904
 
2905 2905
 				// else check if we were editing a form.
2906 2906
 				$id = filter_var( $_REQUEST['id'], FILTER_SANITIZE_NUMBER_INT );
2907 2907
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $id ) ) );
2908
-			} else {
2908
+			} else {
2909 2909
 				// else redirect to the manage forms page.
2910 2910
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp&transient-cleared=true' ) ) );
2911 2911
 			}
@@ -2921,17 +2921,17 @@  discard block
 block discarded – undo
2921 2921
 		 * @since 6.0.2
2922 2922
 		 * @return $list_id_array - array of list id's to loop over
2923 2923
 		 */
2924
-		public function get_mailchimp_list_ids_on_account() {
2924
+		public function get_mailchimp_list_ids_on_account() {
2925 2925
 			$api_key = yikes_get_mc_api_key();
2926
-			if ( ! $api_key ) {
2926
+			if ( ! $api_key ) {
2927 2927
 				// if no api key is set/site is not connected, return an empty array.
2928 2928
 				return array();
2929 2929
 			}
2930 2930
 
2931 2931
 			$lists = get_transient( 'yikesinc_eme_list_ids' );
2932
-			if ( false === $lists ) {
2932
+			if ( false === $lists ) {
2933 2933
 				$lists = yikes_get_mc_api_manager()->get_list_handler()->get_list_ids();
2934
-				if ( is_wp_error( $lists ) ) {
2934
+				if ( is_wp_error( $lists ) ) {
2935 2935
 					return array();
2936 2936
 				}
2937 2937
 				set_transient( 'yikesinc_eme_list_ids', $lists, HOUR_IN_SECONDS );
@@ -2945,9 +2945,9 @@  discard block
 block discarded – undo
2945 2945
 		 *
2946 2946
 		 *	@since 6.0
2947 2947
 		 */
2948
-		public function yikes_mailchimp_load_helper_class() {
2948
+		public function yikes_mailchimp_load_helper_class() {
2949 2949
 			// check to see if it's already loaded up.
2950
-			if ( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2950
+			if ( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2951 2951
 				// Include our main helper class file
2952 2952
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' );
2953 2953
 			}
@@ -2960,11 +2960,11 @@  discard block
 block discarded – undo
2960 2960
 		 * @order requires that yikes-inc-easy-mailchimp-extender-admin.min.css be enqueued, so we can override the defaults (handle: yikes-inc-easy-mailchimp-extender-admin)
2961 2961
 		 * @return print out custom styles to the admin header to alter the default blue color
2962 2962
 		 */
2963
-		public function alter_yikes_easy_mc_color_scheme() {
2963
+		public function alter_yikes_easy_mc_color_scheme() {
2964 2964
 			// get the current set color scheme for the logged in user
2965 2965
 			$current_color_scheme = get_user_option( 'admin_color' );
2966 2966
 			// switch over each color scheme, and set our variable
2967
-			switch ( $current_color_scheme ) {
2967
+			switch ( $current_color_scheme ) {
2968 2968
 				default:
2969 2969
 				case 'fresh': // default blue (defined by this plugin)
2970 2970
 					$main_color = '#00a0d2';
@@ -3012,16 +3012,16 @@  discard block
 block discarded – undo
3012 3012
 		/**
3013 3013
 		 *	Display premium support page if any add-ons are installed, otherwise display free support page
3014 3014
 		 */
3015
-		public function display_support_page_content() {
3015
+		public function display_support_page_content() {
3016 3016
 
3017 3017
 			$addons = get_option( 'yikes-easy-mc-active-addons', array() );
3018 3018
 
3019 3019
 			// If we have premium add-ons...
3020
-			if ( ! empty( $addons ) ) { 
3020
+			if ( ! empty( $addons ) ) {
3021 3021
 
3022 3022
 				// Add our premium support partial.
3023 3023
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/premium-support.php' );
3024
-			} else {
3024
+			} else {
3025 3025
 
3026 3026
 				// Otherwise add our free support partial.
3027 3027
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/free-support.php' );
@@ -3033,8 +3033,8 @@  discard block
 block discarded – undo
3033 3033
 		 *
3034 3034
 		 * @since 6.0.4
3035 3035
 		 */
3036
-		public function check_yikes_mc_table_version() {
3037
-			if ( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
3036
+		public function check_yikes_mc_table_version() {
3037
+			if ( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
3038 3038
 				require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php';
3039 3039
 				global $wpdb;
3040 3040
 				Yikes_Inc_Easy_Mailchimp_Extender_Activator::_activate_yikes_easy_mailchimp( $wpdb );
@@ -3048,7 +3048,7 @@  discard block
 block discarded – undo
3048 3048
 		 *
3049 3049
 		 * @since 6.0.4.4
3050 3050
 		 */
3051
-		public function process_subscriber_count_shortcode_in_form_descriptions( $form_description, $form_id ) {
3051
+		public function process_subscriber_count_shortcode_in_form_descriptions( $form_description, $form_id ) {
3052 3052
 			$form_description = str_replace( '[yikes-mailchimp-subscriber-count]', do_shortcode( '[yikes-mailchimp-subscriber-count form="' . $form_id . '"]' ), $form_description );
3053 3053
 			return $form_description;
3054 3054
 		}
@@ -3058,9 +3058,9 @@  discard block
 block discarded – undo
3058 3058
 		 *
3059 3059
 		 * @since 6.0.3
3060 3060
 		 */
3061
-		public function generate_edit_forms_upsell_ad() {
3061
+		public function generate_edit_forms_upsell_ad() {
3062 3062
 		$upsell_ads = glob( YIKES_MC_PATH . 'includes/upsells/*.php' );
3063
-		if ( $upsell_ads && ! empty( $upsell_ads ) ) {
3063
+		if ( $upsell_ads && ! empty( $upsell_ads ) ) {
3064 3064
 			$ad_count = absint( count( $upsell_ads ) - 1 );
3065 3065
 			$ad       = $upsell_ads[ mt_rand( 0, $ad_count ) ];
3066 3066
 			ob_start();
@@ -3077,11 +3077,11 @@  discard block
 block discarded – undo
3077 3077
 		 * Mainly used when the API key is altered, changed or removed.
3078 3078
 		 * @since 6.1.3
3079 3079
 		 */
3080
-		public function delete_yikes_mailchimp_transients() {
3080
+		public function delete_yikes_mailchimp_transients() {
3081 3081
 
3082 3082
 		// delete all of the list_id transients.
3083 3083
 		$list_ids = $this->get_mailchimp_list_ids_on_account();
3084
-		foreach ( $list_ids as $id ) {
3084
+		foreach ( $list_ids as $id ) {
3085 3085
 			delete_transient( "yikes_eme_list_{$id}" );
3086 3086
 			delete_transient( "yikes_eme_merge_variables_{$id}" );
3087 3087
 			delete_transient( "yikes_eme_interest_categories_{$id}" );
@@ -3101,13 +3101,13 @@  discard block
 block discarded – undo
3101 3101
 	 *
3102 3102
 	 * @author Jeremy Pry
3103 3103
 	 */
3104
-	public function check_db_version() {
3104
+	public function check_db_version() {
3105 3105
 		$option = get_option( 'yikes_easy_mailchimp_extender_version', '0.0.0' );
3106
-		if ( version_compare( $option, '6.2.0', '<' ) ) {
3106
+		if ( version_compare( $option, '6.2.0', '<' ) ) {
3107 3107
 			$this->convert_db_to_option();
3108 3108
 		}
3109 3109
 
3110
-		if ( version_compare( $option, YIKES_MC_VERSION, '<' ) ) {
3110
+		if ( version_compare( $option, YIKES_MC_VERSION, '<' ) ) {
3111 3111
 			update_option( 'yikes_easy_mailchimp_extender_version', YIKES_MC_VERSION );
3112 3112
 		}
3113 3113
 	}
@@ -3117,7 +3117,7 @@  discard block
 block discarded – undo
3117 3117
 	 *
3118 3118
 	 * @author Jeremy Pry
3119 3119
 	 */
3120
-	public function convert_db_to_option() {
3120
+	public function convert_db_to_option() {
3121 3121
 		/** @var wpdb */
3122 3122
 		global $wpdb;
3123 3123
 
@@ -3126,11 +3126,11 @@  discard block
 block discarded – undo
3126 3126
 		$form_option      = array();
3127 3127
 		$form_ids         = $db_interface->get_form_ids();
3128 3128
 
3129
-		if ( empty( $form_ids ) ) {
3129
+		if ( empty( $form_ids ) ) {
3130 3130
 			return;
3131 3131
 		}
3132 3132
 
3133
-		foreach ( $form_ids as $form_id ) {
3133
+		foreach ( $form_ids as $form_id ) {
3134 3134
 			$form_option[ $form_id ] = $db_interface->get_form( $form_id );
3135 3135
 		}
3136 3136
 
@@ -3142,7 +3142,7 @@  discard block
 block discarded – undo
3142 3142
 	 *
3143 3143
 	 * @author Jeremy Pry
3144 3144
 	 */
3145
-	public function register_optin_widget() {
3145
+	public function register_optin_widget() {
3146 3146
 		register_widget( 'Yikes_Inc_Easy_Mailchimp_Extender_Widget' );
3147 3147
 	}
3148 3148
 }
Please login to merge, or discard this patch.
Spacing   +362 added lines, -362 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		/***********************/
102 102
 		/** Create A Form **/
103 103
 		/**********************/
104
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) {
104
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-form' ) {
105 105
 
106 106
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
107 107
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		/***********************/
111 111
 		/** Delete A Form **/
112 112
 		/**********************/
113
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) {
113
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-delete-form' ) {
114 114
 
115 115
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
116 116
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		/**********************************/
120 120
 		/** Duplicate/Clone A Form    **/
121 121
 		/********************************/
122
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) {
122
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-duplicate-form' ) {
123 123
 
124 124
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
125 125
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		/*************************************/
129 129
 		/**  Reset Form Impression Stats **/
130 130
 		/***********************************/
131
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) {
131
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-reset-stats' ) {
132 132
 
133 133
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
134 134
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		/**********************************/
138 138
 		/**         Update A Form        **/
139 139
 		/********************************/
140
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) {
140
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-update-form' ) {
141 141
 
142 142
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
143 143
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		/**************************************************/
147 147
 		/**     Clear Store MailChimp Transient Data   **/
148 148
 		/*************************************************/
149
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) {
149
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-transient-data' ) {
150 150
 
151 151
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
152 152
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		/*******************************************/
156 156
 		/** Remove a user from a mailing list     **/
157 157
 		/*****************************************/
158
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) {
158
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-unsubscribe-user' ) {
159 159
 
160 160
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
161 161
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		/*******************************************/
165 165
 		/**    Create misisng error log file  **/
166 166
 		/*****************************************/
167
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) {
167
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-error-log' ) {
168 168
 
169 169
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
170 170
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		/**************************************************/
197 197
 		/**        Clear MailChimp Error Log Data        **/
198 198
 		/*************************************************/
199
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) {
199
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-error-log' ) {
200 200
 
201 201
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
202 202
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		/*********************************************/
206 206
 		/**        Export MailChimp Opt-in Forms   **/
207 207
 		/*******************************************/
208
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) {
208
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-forms' ) {
209 209
 
210 210
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
211 211
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		/*********************************************/
215 215
 		/**                Export Plugin Settings           **/
216 216
 		/*******************************************/
217
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) {
217
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-settings' ) {
218 218
 
219 219
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
220 220
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		/*******************************************/
224 224
 		/**        Import Class Inclusion       **/
225 225
 		/*****************************************/
226
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) {
226
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) {
227 227
 
228 228
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
229 229
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		/*******************************************/
233 233
 		/**    Premium Support Request     **/
234 234
 		/*****************************************/
235
-		if ( isset( $_POST['submit-premium-support-request'] ) ) {
235
+		if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) {
236 236
 
237 237
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
238 238
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		/****************************************/
242 242
 		/**    Dismiss Options Migrations        **/
243 243
 		/****************************************/
244
-		if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
244
+		if ( isset( $_REQUEST[ 'dismiss_migration_nonce' ] ) ) {
245 245
 
246 246
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
247 247
 
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
 		 * @ return array  $links  New array of plugin actions
278 278
 		 */
279 279
 		public function easy_forms_plugin_action_links( $links ) {
280
-			$links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
281
-			$links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES, Inc.', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
280
+			$links[ ] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) . '">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
281
+			$links[ ] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES, Inc.', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
282 282
 			return $links;
283 283
 		}
284 284
 
@@ -379,17 +379,17 @@  discard block
 block discarded – undo
379 379
 		*/
380 380
 		public function yikes_easy_mailchimp_export_forms() {
381 381
 			// grab our nonce.
382
-			$nonce = $_REQUEST['nonce'];
382
+			$nonce = $_REQUEST[ 'nonce' ];
383 383
 			// grab the forms.
384
-			$forms = isset( $_REQUEST['yikes_export_forms'] ) ? $_REQUEST['yikes_export_forms'] : array();
384
+			$forms = isset( $_REQUEST[ 'yikes_export_forms' ] ) ? $_REQUEST[ 'yikes_export_forms' ] : array();
385 385
 			// validate nonce.
386 386
 			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
387
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
387
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
388 388
 			}
389 389
 
390 390
 			// run the export function.
391 391
 			// parameters: ( $table_name, $form_ids, $file_name ).
392
-			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export('Yikes-Inc-Easy-MailChimp-Forms-Export', $forms );
392
+			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'Yikes-Inc-Easy-MailChimp-Forms-Export', $forms );
393 393
 			// re-direct the user back to the page.
394 394
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) );
395 395
 			die();
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 		*/
404 404
 		public function yikes_easy_mailchimp_export_plugin_settings() {
405 405
 			// grab our nonce
406
-			$nonce = $_REQUEST['nonce'];
406
+			$nonce = $_REQUEST[ 'nonce' ];
407 407
 			// validate nonce.
408 408
 			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
409
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
409
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
410 410
 			}
411 411
 
412 412
 			// run the export function.
@@ -423,10 +423,10 @@  discard block
 block discarded – undo
423 423
 		*/
424 424
 		public function yikes_easy_mailchimp_import_forms() {
425 425
 			// grab our nonce.
426
-			$nonce = $_REQUEST['nonce'];
426
+			$nonce = $_REQUEST[ 'nonce' ];
427 427
 			// validate nonce.
428 428
 			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
429
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
429
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
430 430
 			}
431 431
 			// include the export class.
432 432
 			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
@@ -447,18 +447,18 @@  discard block
 block discarded – undo
447 447
 		*/
448 448
 		public function yikes_easy_mailchimp_premium_support_request() {
449 449
 
450
-			if ( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
450
+			if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] != 'yikes-support-request' ) {
451 451
 				return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' );
452 452
 			}
453 453
 
454
-			$email       = isset( $_POST['user-email'] ) ? $_POST['user-email'] : '';
455
-			$topic       = isset( $_POST['support-topic'] ) ? $_POST['support-topic'] : '';
456
-			$issue       = isset( $_POST['support-content'] ) ? $_POST['support-content'] : '';
457
-			$priority    = isset( $_POST['support-priority'] ) ? $_POST['support-priority'] : 1;
458
-			$license     = isset( $_POST['license_key'] ) ? $_POST['license_key'] : '';
459
-			$plugin_name = isset( $_POST['plugin-name'] ) ? $_POST['plugin-name'] : '';
460
-			$plugin_slug = isset( $_POST['plugin-slug'] ) ? $_POST['plugin-slug'] : '';
461
-			$name        = isset( $_POST['user-name'] ) ? $_POST['user-name'] : 'MailChimp Support';
454
+			$email       = isset( $_POST[ 'user-email' ] ) ? $_POST[ 'user-email' ] : '';
455
+			$topic       = isset( $_POST[ 'support-topic' ] ) ? $_POST[ 'support-topic' ] : '';
456
+			$issue       = isset( $_POST[ 'support-content' ] ) ? $_POST[ 'support-content' ] : '';
457
+			$priority    = isset( $_POST[ 'support-priority' ] ) ? $_POST[ 'support-priority' ] : 1;
458
+			$license     = isset( $_POST[ 'license_key' ] ) ? $_POST[ 'license_key' ] : '';
459
+			$plugin_name = isset( $_POST[ 'plugin-name' ] ) ? $_POST[ 'plugin-name' ] : '';
460
+			$plugin_slug = isset( $_POST[ 'plugin-slug' ] ) ? $_POST[ 'plugin-slug' ] : '';
461
+			$name        = isset( $_POST[ 'user-name' ] ) ? $_POST[ 'user-name' ] : 'MailChimp Support';
462 462
 
463 463
 			$edd_item_id = $this->get_premium_license( $plugin_slug );
464 464
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 
494 494
 		public function get_premium_license( $plugin_slug ) {
495 495
 
496
-			switch( $plugin_slug ) {
496
+			switch ( $plugin_slug ) {
497 497
 
498 498
 				case 'form-customizer':
499 499
 					return defined( 'YIKES_CUSTOMIZER_EDD_ITEM_ID' ) ? YIKES_CUSTOMIZER_EDD_ITEM_ID : '';
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 			// add a new option to store the plugin activation date/time.
554 554
 			// @since v6.0.0.
555 555
 			// this is used to notify the user that they should review after 2 weeks.
556
-			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
556
+			if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
557 557
 				add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) );
558 558
 			}
559 559
 
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 				$install_date = get_option( 'yikes_easy_mailchimp_activation_date' );
564 564
 				$past_date = strtotime( '-14 days' );
565 565
 				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
566
-					add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) );
566
+					add_action( 'admin_notices', array( $this, 'yikes_easy_mailchimp_display_review_us_notice' ) );
567 567
 				}
568 568
 			}
569 569
 
@@ -576,13 +576,13 @@  discard block
 block discarded – undo
576 576
 		*/
577 577
 		public function yikes_easy_mailchimp_display_review_us_notice() {
578 578
 			/* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
579
-			if ( in_array( get_current_screen()->base , array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
579
+			if ( in_array( get_current_screen()->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base, 'yikes-inc-easy-mailchimp' ) !== false ) {
580 580
 
581 581
 				// The URL of the page the user is currently on 
582
-				$current_uri  	  = isset( $_SERVER['REQUEST_URI'] ) && ! empty( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : false;
583
-				$current_host	  = isset( $_SERVER['HTTP_HOST'] ) && ! empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : false;
582
+				$current_uri = isset( $_SERVER[ 'REQUEST_URI' ] ) && ! empty( $_SERVER[ 'REQUEST_URI' ] ) ? $_SERVER[ 'REQUEST_URI' ] : false;
583
+				$current_host = isset( $_SERVER[ 'HTTP_HOST' ] ) && ! empty( $_SERVER[ 'HTTP_HOST' ] ) ? $_SERVER[ 'HTTP_HOST' ] : false;
584 584
 				$current_protocol = is_ssl() === true ? 'https://' : 'http://';
585
-				$current_url	  = ( $current_uri !== false && $current_host !== false ) ? $current_protocol . $current_host . $current_uri : admin_url();
585
+				$current_url = ( $current_uri !== false && $current_host !== false ) ? $current_protocol . $current_host . $current_uri : admin_url();
586 586
 
587 587
 				$plugin_name = '<strong>Easy Forms for MailChimp</strong>';
588 588
 				// Review URL - Change to the URL of your plugin on WordPress.org.
@@ -593,17 +593,17 @@  discard block
 block discarded – undo
593 593
 				// Make sure all of our variables have values.
594 594
 				$reviewurl  = ( ! empty( $reviewurl ) ) ? $reviewurl : '';
595 595
 				$addons_url = ( ! empty( $addons_url ) ) ? $addons_url : '';
596
-				$nobugurl	= ( ! empty( $nobugurl ) ) ? $nobugurl : '';
596
+				$nobugurl = ( ! empty( $nobugurl ) ) ? $nobugurl : '';
597 597
 
598 598
 				$review_message = '<div id="yikes-mailchimp-logo"></div>';
599 599
 				$review_message .= sprintf( 
600 600
 					__( 'It looks like you\'ve been using %1$s for 2 weeks now. We hope you\'re enjoying the features included with the free version. If so, please consider leaving us a review. Reviews only help to catch other users attention as well as provide us with feedback to grow and improve upon. If you\'re really enjoying the plugin, consider buying an add-on or developer license for some really awesome features and premium support.', 'yikes-inc-easy-mailchimp-extender' ) 
601 601
 					. '<span class="button-container"> <a href="%2$s" target="_blank" class="button-secondary"><span class="dashicons dashicons-star-filled"></span>'
602
-						. __( "Leave A Review" , 'yikes-inc-easy-mailchimp-extender' ) 
602
+						. __( "Leave A Review", 'yikes-inc-easy-mailchimp-extender' ) 
603 603
 					. '</a> <a href="%3$s" class="button-secondary"><span class="dashicons dashicons-upload"></span>'
604
-						. __( "View Addons" , 'yikes-inc-easy-mailchimp-extender' ) 
604
+						. __( "View Addons", 'yikes-inc-easy-mailchimp-extender' ) 
605 605
 					. '</a> <a href="%4$s" class="button-secondary"><span class="dashicons dashicons-no-alt"></span>'
606
-						. __( "Dismiss" , 'yikes-inc-easy-mailchimp-extender' ) 
606
+						. __( "Dismiss", 'yikes-inc-easy-mailchimp-extender' ) 
607 607
 					. "</a> </span>", 
608 608
 				$plugin_name, $reviewurl, $addons_url, $nobugurl );
609 609
 				?>
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 			@since v3.1.1
621 621
 		*/
622 622
 		public function yikes_easy_mailchimp_stop_bugging_me() {
623
-			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) && (int) filter_var( $_GET['yikes_easy_mc_icons_nobug'], FILTER_SANITIZE_NUMBER_INT ) === 1 ) {
623
+			if ( isset( $_GET[ 'yikes_easy_mc_icons_nobug' ] ) && (int) filter_var( $_GET[ 'yikes_easy_mc_icons_nobug' ], FILTER_SANITIZE_NUMBER_INT ) === 1 ) {
624 624
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', true );
625 625
 			}
626 626
 		}
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 	// inlcude the js for tinymce.
659 659
 	public function yks_mc_add_tinymce_plugin( $plugin_array ) {
660 660
 
661
-		$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
661
+		$plugin_array[ 'yks_mc_tinymce_button' ] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
662 662
 
663 663
 		return $plugin_array;
664 664
 	}
@@ -679,13 +679,13 @@  discard block
 block discarded – undo
679 679
 		if ( ! empty( $list_data ) ) {
680 680
 			// build an array to pass to our javascript.
681 681
 			foreach ( $list_data as $id => $form ) {
682
-				$lists[] = array(
683
-					'text'  => urlencode( $form['form_name'] ),
682
+				$lists[ ] = array(
683
+					'text'  => urlencode( $form[ 'form_name' ] ),
684 684
 					'value' => $id,
685 685
 				);
686 686
 			}
687 687
 		} else {
688
-			$lists[0] = array(
688
+			$lists[ 0 ] = array(
689 689
 				'text'  => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ),
690 690
 				'value' => '-',
691 691
 			);
@@ -773,8 +773,8 @@  discard block
 block discarded – undo
773 773
 
774 774
 		wp_enqueue_style( 'wp-color-picker' );
775 775
 		wp_enqueue_script( 'wp-color-picker' );
776
-		wp_enqueue_script( 'jquery.timepicker.js',YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ) , $this->version, false );
777
-		wp_enqueue_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ) , $this->version, false );
776
+		wp_enqueue_script( 'jquery.timepicker.js', YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ), $this->version, false );
777
+		wp_enqueue_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ), $this->version, false );
778 778
 
779 779
 		$localized_data = array(
780 780
 			'ajax_url'                          => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 	 * Convert the php date format string to a js date format
869 869
 	 */
870 870
 	public function yikes_jQuery_datepicker_date_format( $site_option ) {
871
-		switch( $site_option ) {
871
+		switch ( $site_option ) {
872 872
 			//Predefined WP date formats
873 873
 			default:
874 874
 			case 'F j, Y':
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
 
1081 1081
 		/* Register General Settings Section */
1082 1082
 
1083
-		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this , 'yikes_mc_validate_api_key' ) );
1083
+		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this, 'yikes_mc_validate_api_key' ) );
1084 1084
 
1085 1085
 		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mailchimp-use-nonce' );
1086 1086
 
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 		add_settings_field(
1126 1126
 			'optin-checkbox-init',
1127 1127
 			__( 'Select Checkboxes to Generate', 'yikes-inc-easy-mailchimp-extender' ),
1128
-			'',  // callback + validation inside of admin/partials/menu/options.php
1128
+			'', // callback + validation inside of admin/partials/menu/options.php
1129 1129
 			'yikes_inc_easy_mc_checkbox_settings'
1130 1130
 		);
1131 1131
 		/* End Checkbox Settings */
@@ -1147,21 +1147,21 @@  discard block
 block discarded – undo
1147 1147
 			add_settings_field(
1148 1148
 				'yikes-mc-recaptcha-site-key',
1149 1149
 				__( 'Enter reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ),
1150
-				'',  // callback + validation inside of admin/partials/menu/options.php
1150
+				'', // callback + validation inside of admin/partials/menu/options.php
1151 1151
 				'yikes_easy_mc_settings_recpatcha_section'
1152 1152
 			);
1153 1153
 
1154 1154
 			add_settings_field(
1155 1155
 				'yikes-mc-recaptcha-secret-key',
1156 1156
 				__( 'Enter reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ),
1157
-				'',  // callback + validation inside of admin/partials/menu/options.php
1157
+				'', // callback + validation inside of admin/partials/menu/options.php
1158 1158
 				'yikes_easy_mc_settings_recpatcha_section'
1159 1159
 			);
1160 1160
 
1161 1161
 			add_settings_field(
1162 1162
 				'yikes-mc-recaptcha-status',
1163 1163
 				__( 'Enable ReCaptcha', 'yikes-inc-easy-mailchimp-extender' ),
1164
-				'',  // callback + validation inside of admin/partials/menu/options.php
1164
+				'', // callback + validation inside of admin/partials/menu/options.php
1165 1165
 				'yikes_easy_mc_settings_recpatcha_section'
1166 1166
 			);
1167 1167
 
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
 			add_settings_field(
1182 1182
 				'yikes-mailchimp-debug-status',
1183 1183
 				__( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ),
1184
-				'',  // callback + validation inside of admin/partials/menu/options.php
1184
+				'', // callback + validation inside of admin/partials/menu/options.php
1185 1185
 				'yikes_easy_mc_settings_debug_section'
1186 1186
 			);
1187 1187
 
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1202 1202
 			return '';
1203 1203
 		}
1204
-		$api_key = strip_tags ( trim( $input ) );
1204
+		$api_key = strip_tags( trim( $input ) );
1205 1205
 		$dash_position = strpos( trim( $input ), '-' );
1206 1206
 		if ( $dash_position !== false ) {
1207 1207
 			$manager = new Yikes_Inc_Easy_MailChimp_API_Manager( $api_key );
@@ -1216,9 +1216,9 @@  discard block
 block discarded – undo
1216 1216
 			update_option( 'yikes-mc-api-validation', 'valid_api_key' );
1217 1217
 				// Clear the API key transient data
1218 1218
 			$this->delete_yikes_mailchimp_transients();
1219
-		}  else {
1219
+		} else {
1220 1220
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1221
-			$error_logging->yikes_easy_mailchimp_write_to_error_log( $response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) );
1221
+			$error_logging->yikes_easy_mailchimp_write_to_error_log( $response->get_error_message(), __( "Connecting to MailChimp", 'yikes-inc-easy-mailchimp-extender' ), __( "Settings Page/General Settings", 'yikes-inc-easy-mailchimp-extender' ) );
1222 1222
 			update_option( 'yikes-mc-api-invalid-key-response', $response->get_error_message() );
1223 1223
 			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1224 1224
 		}
@@ -1267,11 +1267,11 @@  discard block
 block discarded – undo
1267 1267
 	public function check_for_old_yks_mc_options() {
1268 1268
 		$old_plugin_options = get_option( 'ykseme_storage' );
1269 1269
 		// only perform options migrations if the site is not a multi-site setup
1270
-		if ( !is_multisite() ) {
1270
+		if ( ! is_multisite() ) {
1271 1271
 			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1272 1272
 				// display a notice to the user that they should 'migrate'
1273 1273
 				// from the old plugin settings to the new ones
1274
-				add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 );
1274
+				add_action( 'admin_notices', array( $this, 'display_options_migrate_notice' ), 11 );
1275 1275
 			}
1276 1276
 		}
1277 1277
 	}
@@ -1304,11 +1304,11 @@  discard block
 block discarded – undo
1304 1304
 
1305 1305
 			// Confirm that the necessary forms table in the database exists, else bail
1306 1306
 			global $wpdb;
1307
-			if ( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1307
+			if ( $wpdb->get_var( "show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'" ) != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1308 1308
 				return;
1309 1309
 			}
1310 1310
 
1311
-			if ( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1311
+			if ( isset( $_GET[ 'yikes-mc-options-migration-dismissed' ] ) && $_GET[ 'yikes-mc-options-migration-dismissed' ] == 'true' ) {
1312 1312
 					// Delete the options, start a-new! (this will disable the migration notice altogether)
1313 1313
 					delete_option( 'widget_yikes_mc_widget' );
1314 1314
 					delete_option( 'api_validation' );
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
 			} else {
1323 1323
 			?>
1324 1324
 				<div class="yikes-easy-mc-updated migrate-options-notice">
1325
-					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list." , 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?></p>
1325
+					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?></p>
1326 1326
 					<p><?php _e( "Before you continue, it's strongly recommended you the perform the migration to ensure the plugin continues to function properly.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1327 1327
 					<p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1328 1328
 					<section id="migration-buttons">
@@ -1347,9 +1347,9 @@  discard block
 block discarded – undo
1347 1347
 		*	and return the index ( used to find the list name assigned to a form )
1348 1348
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1349 1349
 		*/
1350
-		function findMCListID($id, $array) {
1351
-		   foreach ($array as $key => $val) {
1352
-			   if ($val['id'] === $id) {
1350
+		function findMCListID( $id, $array ) {
1351
+		   foreach ( $array as $key => $val ) {
1352
+			   if ( $val[ 'id' ] === $id ) {
1353 1353
 				   return $key;
1354 1354
 			   }
1355 1355
 		   }
@@ -1359,8 +1359,8 @@  discard block
 block discarded – undo
1359 1359
 		/* Ajax Migrate Options */
1360 1360
 		function migrate_archived_options() {
1361 1361
 			// all options prefixed with 'yikes-mc-'
1362
-			$option_name = 'yikes-mc-'.$_POST['option_name'];
1363
-			$option_value = $_POST['option_value'];
1362
+			$option_name = 'yikes-mc-' . $_POST[ 'option_name' ];
1363
+			$option_value = $_POST[ 'option_value' ];
1364 1364
 			if ( json_decode( $option_value ) ) {
1365 1365
 				// decode our lists() array, and store it
1366 1366
 				$opt_value = json_decode( $option_value, true );
@@ -1374,22 +1374,22 @@  discard block
 block discarded – undo
1374 1374
 
1375 1375
 		/* Ajax Migrate Forms */
1376 1376
 		function migrate_previously_setup_forms() {
1377
-			$option_name = $_POST['option_name'];
1378
-			$done = $_POST['done_import'];
1377
+			$option_name = $_POST[ 'option_name' ];
1378
+			$done = $_POST[ 'done_import' ];
1379 1379
 			// Create some starter forms for the user
1380 1380
 			// based on previously imported lists (to our old version)
1381 1381
 			if ( $option_name == 'yikes-mc-lists' ) {
1382
-				$option_value = $_POST['option_value'];
1383
-				$new_options = json_decode( stripslashes_deep( $option_value ) , true );
1382
+				$option_value = $_POST[ 'option_value' ];
1383
+				$new_options = json_decode( stripslashes_deep( $option_value ), true );
1384 1384
 
1385
-				$list_id = $new_options['id'];
1386
-				$form_name = $new_options['name'];
1387
-				$fields = $new_options['fields']; // our fields array
1385
+				$list_id = $new_options[ 'id' ];
1386
+				$form_name = $new_options[ 'name' ];
1387
+				$fields = $new_options[ 'fields' ]; // our fields array
1388 1388
 
1389
-				$custom_styles = isset( $new_options['custom_styles'] ) ? $new_options['custom_styles']: '0'; // store as an array with all of our styles
1390
-				$custom_template = isset( $new_options['custom_template'] ) ? $new_options['custom_template'] : '0'; // store template data as an array ( active , template used )
1391
-				$redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1392
-				$redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1389
+				$custom_styles = isset( $new_options[ 'custom_styles' ] ) ? $new_options[ 'custom_styles' ] : '0'; // store as an array with all of our styles
1390
+				$custom_template = isset( $new_options[ 'custom_template' ] ) ? $new_options[ 'custom_template' ] : '0'; // store template data as an array ( active , template used )
1391
+				$redirect_user_on_submit = isset( $new_options[ 'yks_mailchimp_redirect_' . $list_id ] ) ? '1' : '0';
1392
+				$redirect_page = isset( $new_options[ 'page_id_' . $list_id ] ) ? $new_options[ 'page_id_' . $list_id ] : '';
1393 1393
 
1394 1394
 				/* Insert Forms Function  */
1395 1395
 				$this->form_interface->create_form( array(
@@ -1425,8 +1425,8 @@  discard block
 block discarded – undo
1425 1425
 		*	@since v5.6 - complete re-write
1426 1426
 		*/
1427 1427
 		public function generate_options_pages_sidebar_menu() {
1428
-			if ( isset( $_REQUEST['section'] ) ) {
1429
-				$selected = $_REQUEST['section'];
1428
+			if ( isset( $_REQUEST[ 'section' ] ) ) {
1429
+				$selected = $_REQUEST[ 'section' ];
1430 1430
 			}
1431 1431
 			$installed_addons = get_option( 'yikes-easy-mc-active-addons', array() );
1432 1432
 
@@ -1443,25 +1443,25 @@  discard block
 block discarded – undo
1443 1443
 				<h3><span><?php _e( 'Additional Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1444 1444
 				<div class="inside">
1445 1445
 					<ul id="settings-nav">
1446
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'general-settings' || !isset( $_REQUEST['section'] ) ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'general-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) ); ?>"><?php _e( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1447
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'integration-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'integration-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=integration-settings' ) ) ); ?>"><?php _e( 'Integration Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1448
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'recaptcha-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'recaptcha-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) ); ?>"><?php _e( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1449
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'api-cache-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'api-cache-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings' ) ) ); ?>"><?php _e( 'API Cache Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1450
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] ==  'debug-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'debug-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings' ) ) ); ?>"><?php _e( 'Debug Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1451
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] ==  'import-export-forms' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'import-export-forms' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) ); ?>"><?php _e( 'Import/Export', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1446
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'general-settings' || ! isset( $_REQUEST[ 'section' ] ) ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'general-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) ); ?>"><?php _e( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1447
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'integration-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'integration-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=integration-settings' ) ) ); ?>"><?php _e( 'Integration Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1448
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'recaptcha-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'recaptcha-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) ); ?>"><?php _e( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1449
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'api-cache-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'api-cache-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings' ) ) ); ?>"><?php _e( 'API Cache Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1450
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'debug-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'debug-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings' ) ) ); ?>"><?php _e( 'Debug Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1451
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'import-export-forms' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'import-export-forms' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) ); ?>"><?php _e( 'Import/Export', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1452 1452
 					</ul>
1453 1453
 					<?php
1454 1454
 						// create our add-on settings pages
1455
-						if ( !empty( $installed_addons ) ) {
1455
+						if ( ! empty( $installed_addons ) ) {
1456 1456
 							?>
1457 1457
 							<hr class="add-on-settings-divider" />
1458 1458
 							<strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1459 1459
 							<ul id="addon-settings-nav">
1460 1460
 							<?php
1461
-							foreach( $installed_addons as $addon_name ) {
1461
+							foreach ( $installed_addons as $addon_name ) {
1462 1462
 								?>
1463 1463
 									<li>
1464
-										<?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] ==  $addon_name ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => $addon_name, 'addon' => 'true' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section='.$addon_name ) ) ); ?>"><?php echo ucwords( str_replace( '-', ' ', $addon_name ) ); ?></a></li>
1464
+										<?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == $addon_name ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => $addon_name, 'addon' => 'true' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=' . $addon_name ) ) ); ?>"><?php echo ucwords( str_replace( '-', ' ', $addon_name ) ); ?></a></li>
1465 1465
 								<?php
1466 1466
 							}
1467 1467
 							?>
@@ -1510,19 +1510,19 @@  discard block
 block discarded – undo
1510 1510
 						<select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); disabled( true, empty( $lists ) ); ?>>
1511 1511
 							<?php
1512 1512
 							if ( ! empty( $lists ) ) {
1513
-								foreach( $lists as $mailing_list ) {
1513
+								foreach ( $lists as $mailing_list ) {
1514 1514
 									?>
1515
-									<option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1515
+									<option value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option>
1516 1516
 									<?php
1517 1517
 								}
1518 1518
 							} else {
1519 1519
 								if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1520 1520
 									?>
1521
-									<option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1521
+									<option><?php echo __( "Please enter a valid API key.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1522 1522
 									<?php
1523 1523
 								} else {
1524 1524
 									?>
1525
-									<option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1525
+									<option><?php echo __( "No lists were found on the account.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1526 1526
 									<?php
1527 1527
 
1528 1528
 								}
@@ -1531,8 +1531,8 @@  discard block
 block discarded – undo
1531 1531
 						</select>
1532 1532
 
1533 1533
 						<?php
1534
-						if ( isset( $_GET['transient-cleared'] ) ) {
1535
-							if ( 'true' === $_GET['transient-cleared'] ) {
1534
+						if ( isset( $_GET[ 'transient-cleared' ] ) ) {
1535
+							if ( 'true' === $_GET[ 'transient-cleared' ] ) {
1536 1536
 								?>
1537 1537
 								<div class="yikes-list-refreshed-notice">
1538 1538
 									<p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -1545,7 +1545,7 @@  discard block
 block discarded – undo
1545 1545
 							if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1546 1546
 								?>
1547 1547
 									<p class="description">
1548
-										<?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ) , __( 'Create a list', 'yikes-inc-easy-mailchimp-extender' ) ); ?>
1548
+										<?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ), __( 'Create a list', 'yikes-inc-easy-mailchimp-extender' ) ); ?>
1549 1549
 									</p>
1550 1550
 								<?php
1551 1551
 							}
@@ -1554,9 +1554,9 @@  discard block
 block discarded – undo
1554 1554
 					</label>
1555 1555
 					<?php
1556 1556
 						if ( $this->is_user_mc_api_valid_form( false ) ) {
1557
-							echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary', '', false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1557
+							echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ), 'primary', '', false, array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1558 1558
 						} else {
1559
-							echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1559
+							echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1560 1560
 							?>
1561 1561
 								<a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&settings-updated=true' ) ); ?>"><?php _e( 'general settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1562 1562
 							<?php
@@ -1586,7 +1586,7 @@  discard block
 block discarded – undo
1586 1586
 				$post_types = get_post_types();
1587 1587
 				?>
1588 1588
 				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1589
-					<?php _e( "Select A Page or Post" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1589
+					<?php _e( "Select A Page or Post", 'yikes-inc-easy-mailchimp-extender' ); ?>
1590 1590
 					<select id="redirect-user-to-selection" name="redirect-user-to-selection" onchange="shouldWeDisplayCustomURL( this );return;">
1591 1591
 				<?php
1592 1592
 
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
 					$excluded_post_types = apply_filters( 'yikes-mailchimp-excluded-redirect-post-types', $excluded_post_types );
1603 1603
 
1604 1604
 						// loop over registered post types, and query!
1605
-						foreach( $post_types as $registered_post_type ) {
1605
+						foreach ( $post_types as $registered_post_type ) {
1606 1606
 
1607 1607
 							// exclude a few built in custom post types and any defined by the filter
1608 1608
 							if ( ! in_array( $registered_post_type, $excluded_post_types ) ) {
@@ -1624,8 +1624,8 @@  discard block
 block discarded – undo
1624 1624
 									?>
1625 1625
 										<optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>">
1626 1626
 									<?php
1627
-											foreach( $post_ids as $post_id ) {
1628
-												?><option <?php selected( $redirect_page , $post_id ); ?> value="<?php echo $post_id; ?>"><?php echo get_the_title( $post_id ) ?></option><?php
1627
+											foreach ( $post_ids as $post_id ) {
1628
+												?><option <?php selected( $redirect_page, $post_id ); ?> value="<?php echo $post_id; ?>"><?php echo get_the_title( $post_id ) ?></option><?php
1629 1629
 											}
1630 1630
 									?>
1631 1631
 										</optgroup>
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 					</select>
1642 1642
 
1643 1643
 					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if ( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1644
-						<?php _e( "Enter Custom URL" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1644
+						<?php _e( "Enter Custom URL", 'yikes-inc-easy-mailchimp-extender' ); ?>
1645 1645
 						<input type="text" class="widefat custom-redirect-url" name="custom-redirect-url" value="<?php echo $custom_redirect_url; ?>" />
1646 1646
 					</label>
1647 1647
 
@@ -1700,7 +1700,7 @@  discard block
 block discarded – undo
1700 1700
 							</p>
1701 1701
 						</div>
1702 1702
 
1703
-						<p class="description sidebar-footer-text"><?php printf( __( "This plugin made with %s by %s" , 'yikes-inc-easy-mailchimp-extender' ), '<span class="dashicons dashicons-heart yikes-love"></span>', '<a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>' ); ?> </p>
1703
+						<p class="description sidebar-footer-text"><?php printf( __( "This plugin made with %s by %s", 'yikes-inc-easy-mailchimp-extender' ), '<span class="dashicons dashicons-heart yikes-love"></span>', '<a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>' ); ?> </p>
1704 1704
 
1705 1705
 						<section id="about-yikes-inc" class="inside">
1706 1706
 							<a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc.">
@@ -1718,7 +1718,7 @@  discard block
 block discarded – undo
1718 1718
 						<!-- review us container -->
1719 1719
 						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1720 1720
 						<div id="review-yikes-easy-mc" class="inside">
1721
-							<p><?php _e( "Check out available add-ons for some seriously enhanced features." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1721
+							<p><?php _e( "Check out available add-ons for some seriously enhanced features.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1722 1722
 							<p><a class="button-secondary" href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) ); ?>" title="<?php _e( 'View Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'View Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
1723 1723
 						</div>
1724 1724
 
@@ -1745,11 +1745,11 @@  discard block
 block discarded – undo
1745 1745
 
1746 1746
 			// if no list id, die!
1747 1747
 			if ( ! $list_id ) {
1748
-				wp_die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) );
1748
+				wp_die( __( "We've encountered an error. No list ID was sent.", 'yikes-inc-easy-mailchimp-extender' ) );
1749 1749
 			}
1750 1750
 
1751 1751
 			if ( ! $merge_variables ) {
1752
-				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support." , 'yikes-inc-easy-mailchimp-extender' ) );
1752
+				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support.", 'yikes-inc-easy-mailchimp-extender' ) );
1753 1753
 			}
1754 1754
 
1755 1755
 			if ( ! empty( $form_fields ) ) {
@@ -1760,17 +1760,17 @@  discard block
 block discarded – undo
1760 1760
 				$available_interest_groups	= array();
1761 1761
 
1762 1762
 				// Default variables as arrays - these are used for holding the MailChimp merge field ID
1763
-				$merge_field_ids			= array();
1764
-				$mailchimp_merge_field_ids	= array();
1763
+				$merge_field_ids = array();
1764
+				$mailchimp_merge_field_ids = array();
1765 1765
 
1766 1766
 				// loop over merge variables
1767
-				if ( ! empty( $merge_variables['merge_fields'] ) ) {
1768
-					$available_merge_variables = wp_list_pluck( $merge_variables['merge_fields'], 'tag' );
1769
-					$mailchimp_merge_field_ids = wp_list_pluck( $merge_variables['merge_fields'], 'merge_id' );
1767
+				if ( ! empty( $merge_variables[ 'merge_fields' ] ) ) {
1768
+					$available_merge_variables = wp_list_pluck( $merge_variables[ 'merge_fields' ], 'tag' );
1769
+					$mailchimp_merge_field_ids = wp_list_pluck( $merge_variables[ 'merge_fields' ], 'merge_id' );
1770 1770
 					
1771 1771
 					// Array will look like $merge_tag => $merge_id
1772
-					foreach( $available_merge_variables as $index => $merge_tag ) { 
1773
-						$merge_field_ids[$merge_tag] = $mailchimp_merge_field_ids[$index];
1772
+					foreach ( $available_merge_variables as $index => $merge_tag ) { 
1773
+						$merge_field_ids[ $merge_tag ] = $mailchimp_merge_field_ids[ $index ];
1774 1774
 					}
1775 1775
 				}
1776 1776
 
@@ -1785,46 +1785,46 @@  discard block
 block discarded – undo
1785 1785
 				$excluded_fields = array_diff( $assigned_fields, $merged_fields );
1786 1786
 
1787 1787
 				$i = 1;
1788
-				foreach( $form_fields as $field ) {
1788
+				foreach ( $form_fields as $field ) {
1789 1789
 
1790
-					if ( isset( $field['merge'] ) ) {
1790
+					if ( isset( $field[ 'merge' ] ) ) {
1791 1791
 						// @todo: don't use in_array()
1792
-						$excluded_field = in_array( $field['merge'], $excluded_fields, true );
1792
+						$excluded_field = in_array( $field[ 'merge' ], $excluded_fields, true );
1793 1793
 						?>
1794
-						<section class="draggable" id="<?php echo $field['merge']; ?>">
1794
+						<section class="draggable" id="<?php echo $field[ 'merge' ]; ?>">
1795 1795
 							<!-- top -->
1796 1796
 							<a class="expansion-section-title settings-sidebar">
1797 1797
 								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span>
1798
-								<span class="yikes-mc-expansion-section-field-label"> <?php echo stripslashes( $field['label'] ); ?> </span>
1798
+								<span class="yikes-mc-expansion-section-field-label"> <?php echo stripslashes( $field[ 'label' ] ); ?> </span>
1799 1799
 								<?php if ( $excluded_field ) { ?>
1800 1800
 									<img src="<?php echo YIKES_MC_URL . 'includes/images/warning.svg'; ?>" class="field-doesnt-exist-notice" title="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>" alt="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>">
1801 1801
 								<?php } ?>
1802
-								<input maxlength="50" type="text" class="yikes-mc-edit-field-label-input" value="<?php echo stripslashes( $field['label'] ); ?>" />
1802
+								<input maxlength="50" type="text" class="yikes-mc-edit-field-label-input" value="<?php echo stripslashes( $field[ 'label' ] ); ?>" />
1803 1803
 								<span class="dashicons dashicons-yes yikes-mc-save-field-label-edits-icon" title="<?php _e( 'Click to save changes.', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
1804 1804
 								<span class="dashicons dashicons-edit yikes-mc-edit-field-label-icon" title="<?php _e( 'Click to edit the label', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
1805 1805
 								<span class="yikes-mc-edit-field-label-message"></span>
1806
-								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
1806
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
1807 1807
 							</a>
1808 1808
 							<!-- expansion section -->
1809 1809
 							<div class="yikes-mc-settings-expansion-section">
1810 1810
 
1811 1811
 								<?php if ( $excluded_field ) { ?>
1812
-									<p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on your website." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1812
+									<p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on your website.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1813 1813
 								<?php } ?>
1814 1814
 
1815 1815
 								<!-- store field data -->
1816
-								<input type="hidden" class="yikes-mc-merge-field-label" name="field[<?php echo $field['merge']; ?>][label]" value="<?php echo htmlspecialchars( $field['label'] ); ?>" />
1817
-								<input type="hidden" class="yikes-mc-merge-field-type" name="field[<?php echo $field['merge']; ?>][type]" value="<?php echo $field['type']; ?>" />
1818
-								<input type="hidden" class="yikes-mc-merge-field-tag" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" />
1819
-								<input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" />
1820
-								<?php if ( isset( $merge_field_ids[ $field['merge'] ] ) && is_int( $merge_field_ids[ $field['merge'] ] ) ) { ?> 
1821
-									<input type="hidden" class="yikes-mc-merge-field-id" name="field[<?php echo $field['merge']; ?>][id]" value="<?php echo $merge_field_ids[ $field['merge'] ] ?>" />  
1816
+								<input type="hidden" class="yikes-mc-merge-field-label" name="field[<?php echo $field[ 'merge' ]; ?>][label]" value="<?php echo htmlspecialchars( $field[ 'label' ] ); ?>" />
1817
+								<input type="hidden" class="yikes-mc-merge-field-type" name="field[<?php echo $field[ 'merge' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
1818
+								<input type="hidden" class="yikes-mc-merge-field-tag" name="field[<?php echo $field[ 'merge' ]; ?>][merge]" value="<?php echo $field[ 'merge' ]; ?>" />
1819
+								<input type="hidden" class="field-<?php echo $field[ 'merge' ]; ?>-position position-input" name="field[<?php echo $field[ 'merge' ]; ?>][position]" value="<?php echo $i++; ?>" />
1820
+								<?php if ( isset( $merge_field_ids[ $field[ 'merge' ] ] ) && is_int( $merge_field_ids[ $field[ 'merge' ] ] ) ) { ?> 
1821
+									<input type="hidden" class="yikes-mc-merge-field-id" name="field[<?php echo $field[ 'merge' ]; ?>][id]" value="<?php echo $merge_field_ids[ $field[ 'merge' ] ] ?>" />  
1822 1822
 								<?php } ?>
1823 1823
 
1824
-								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1825
-									$choices = json_decode( $field['choices'], true );
1824
+								<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'dropdown' || $field[ 'type' ] == 'select' ) {
1825
+									$choices = json_decode( $field[ 'choices' ], true );
1826 1826
 								?>
1827
-									<input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1827
+									<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1828 1828
 								<?php } ?>
1829 1829
 
1830 1830
 								<!-- Single or Double Opt-in -->
@@ -1840,12 +1840,12 @@  discard block
 block discarded – undo
1840 1840
 												</label>
1841 1841
 											</td>
1842 1842
 											<td>
1843
-												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field['merge']; ?>">
1843
+												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field[ 'merge' ]; ?>">
1844 1844
 											</td>
1845 1845
 										</tr>
1846 1846
 
1847 1847
 										<!-- Placeholder Value -->
1848
-										<?php switch( $field['type'] ) {
1848
+										<?php switch ( $field[ 'type' ] ) {
1849 1849
 
1850 1850
 											case 'text':
1851 1851
 											case 'email':
@@ -1859,13 +1859,13 @@  discard block
 block discarded – undo
1859 1859
 										<!-- Placeholder -->
1860 1860
 										<tr valign="top">
1861 1861
 											<td scope="row">
1862
-												<label for="placeholder_<?php echo esc_attr( $field['merge'] ); ?>">
1862
+												<label for="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
1863 1863
 													<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1864 1864
 												</label>
1865 1865
 											</td>
1866 1866
 											<td>
1867
-												<input type="text" id="placeholder_<?php echo esc_attr( $field['merge'] ); ?>" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : '' ; ?>" />
1868
-												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1867
+												<input type="text" id="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>" />
1868
+												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1869 1869
 											</td>
1870 1870
 										</tr>
1871 1871
 										<?php
@@ -1876,13 +1876,13 @@  discard block
 block discarded – undo
1876 1876
 											?>
1877 1877
 												<tr valign="top">
1878 1878
 													<td scope="row">
1879
-														<label for="placeholder_<?php echo esc_attr( $field['merge'] ); ?>">
1879
+														<label for="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
1880 1880
 															<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1881 1881
 														</label>
1882 1882
 													</td>
1883 1883
 													<td>
1884
-														<input type="checkbox" id="placeholder_<?php echo esc_attr( $field['merge'] ); ?>" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="1" <?php echo isset( $field['placeholder'] ) && ! empty( $field['placeholder'] ) ? 'checked="checked"' : '' ; ?> />
1885
-														<span class="description"><small><?php _e( "Use placeholders for this field (these will be automatically filled in with field names).", 'yikes-inc-easy-mailchimp-extender' );?></small></span>
1884
+														<input type="checkbox" id="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="1" <?php echo isset( $field[ 'placeholder' ] ) && ! empty( $field[ 'placeholder' ] ) ? 'checked="checked"' : ''; ?> />
1885
+														<span class="description"><small><?php _e( "Use placeholders for this field (these will be automatically filled in with field names).", 'yikes-inc-easy-mailchimp-extender' ); ?></small></span>
1886 1886
 													</td>
1887 1887
 												</tr>
1888 1888
 											<?php
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
 										?>
1893 1893
 
1894 1894
 										<!-- Default Value -->
1895
-										<?php switch( $field['type'] ) {
1895
+										<?php switch ( $field[ 'type' ] ) {
1896 1896
 											default:
1897 1897
 											case 'text':
1898 1898
 											case 'number':
@@ -1900,15 +1900,15 @@  discard block
 block discarded – undo
1900 1900
 										?>
1901 1901
 											<tr valign="top">
1902 1902
 												<td scope="row">
1903
-													<label for="default_value_<?php echo esc_attr( $field['merge'] ); ?>">
1903
+													<label for="default_value_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
1904 1904
 														<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
1905 1905
 													</label>
1906 1906
 												</td>
1907 1907
 												<td>
1908
-													<input id="default_value_<?php echo esc_attr( $field['merge'] ); ?>" <?php if ( $field['type'] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field['merge']; ?>][default]" <?php if ( $field['type'] != 'url' ) { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( $field['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field['default'] ) ) ) : ''; ?>" <?php } ?> />
1909
-													<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1908
+													<input id="default_value_<?php echo esc_attr( $field[ 'merge' ] ); ?>" <?php if ( $field[ 'type' ] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][default]" <?php if ( $field[ 'type' ] != 'url' ) { ?> value="<?php echo isset( $field[ 'default' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'default' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field[ 'default' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field[ 'default' ] ) ) ) : ''; ?>" <?php } ?> />
1909
+													<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1910 1910
 													<?php
1911
-													switch( $field['type'] ) {
1911
+													switch ( $field[ 'type' ] ) {
1912 1912
 														case 'text':
1913 1913
 															?>
1914 1914
 																<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" onclick="storeGlobalClicked( jQuery( this ) );" class="thickbox"><?php _e( 'View Pre-Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
@@ -1930,28 +1930,28 @@  discard block
 block discarded – undo
1930 1930
 													</td>
1931 1931
 													<td>
1932 1932
 														<?php
1933
-															$field['default_choice'] = ! isset( $field['default_choice'] ) ? 'no-default' : $field['default_choice'];
1933
+															$field[ 'default_choice' ] = ! isset( $field[ 'default_choice' ] ) ? 'no-default' : $field[ 'default_choice' ];
1934 1934
 															$x = 0;
1935 1935
 														?>
1936
-														<label for="<?php echo $field['merge'] . '-no-default'; ?>">
1937
-															<input id="<?php echo $field['merge'] . '-no-default'; ?>"
1936
+														<label for="<?php echo $field[ 'merge' ] . '-no-default'; ?>">
1937
+															<input id="<?php echo $field[ 'merge' ] . '-no-default'; ?>"
1938 1938
 															       type="radio"
1939
-															       name="field[<?php echo $field['merge']; ?>][default_choice]"
1940
-															       value="no-default" <?php checked( $field['default_choice'], 'no-default' ); ?>
1939
+															       name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]"
1940
+															       value="no-default" <?php checked( $field[ 'default_choice' ], 'no-default' ); ?>
1941 1941
 															>
1942 1942
 															No Default&nbsp;
1943 1943
 														</label>
1944 1944
 														<?php
1945 1945
 														foreach ( $choices as $choice => $value ) { ?>
1946
-															<label for="<?php echo $field['merge'].'-'.$x; ?>">
1947
-																<input id="<?php echo $field['merge'].'-'.$x; ?>"
1946
+															<label for="<?php echo $field[ 'merge' ] . '-' . $x; ?>">
1947
+																<input id="<?php echo $field[ 'merge' ] . '-' . $x; ?>"
1948 1948
 																       type="radio"
1949
-																       name="field[<?php echo $field['merge']; ?>][default_choice]"
1950
-																       value="<?php echo $x; ?>" <?php checked( $field['default_choice'], $x ); ?>>
1949
+																       name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]"
1950
+																       value="<?php echo $x; ?>" <?php checked( $field[ 'default_choice' ], $x ); ?>>
1951 1951
 																<?php echo $value; ?>&nbsp;
1952 1952
 															</label>
1953 1953
 														<?php $x++; } ?>
1954
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1954
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1955 1955
 													</td>
1956 1956
 												</tr>
1957 1957
 
@@ -1967,13 +1967,13 @@  discard block
 block discarded – undo
1967 1967
 														</label>
1968 1968
 													</td>
1969 1969
 													<td>
1970
-														<select type="default" name="field[<?php echo $field['merge']; ?>][default_choice]">
1971
-															<option value="no-default" <?php selected( $field['default_choice'] , 'no-default' ); ?>>No Default</option>
1972
-															<?php foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1973
-																<option value="<?php echo $choice; ?>" <?php selected( $field['default_choice'] , $choice ); ?>><?php echo $value; ?></option>
1970
+														<select type="default" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]">
1971
+															<option value="no-default" <?php selected( $field[ 'default_choice' ], 'no-default' ); ?>>No Default</option>
1972
+															<?php foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1973
+																<option value="<?php echo $choice; ?>" <?php selected( $field[ 'default_choice' ], $choice ); ?>><?php echo $value; ?></option>
1974 1974
 															<?php } ?>
1975 1975
 														</select>
1976
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1976
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1977 1977
 													</td>
1978 1978
 												</tr>
1979 1979
 
@@ -1990,82 +1990,82 @@  discard block
 block discarded – undo
1990 1990
 										<!-- Field Description -->
1991 1991
 										<tr valign="top">
1992 1992
 											<td scope="row">
1993
-												<label for="description_<?php echo esc_attr( $field['merge'] ); ?>">
1993
+												<label for="description_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
1994 1994
 													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
1995 1995
 												</label>
1996 1996
 											</td>
1997 1997
 											<td>
1998
-												<textarea class="widefat field-description-input" id="description_<?php echo esc_attr( $field['merge'] ); ?>" name="field[<?php echo $field['merge']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
1999
-												<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and will provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1998
+												<textarea class="widefat field-description-input" id="description_<?php echo esc_attr( $field[ 'merge' ] ); ?>" name="field[<?php echo $field[ 'merge' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
1999
+												<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and will provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2000 2000
 											</td>
2001 2001
 										</tr>
2002 2002
 										<!-- Description Above Field -->
2003 2003
 										<tr valign="top" class="yikes-checkbox-container">
2004 2004
 											<td scope="row">
2005
-												<label for="description_above_<?php echo esc_attr( $field['merge'] ); ?>">
2005
+												<label for="description_above_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2006 2006
 													<?php _e( 'Description Above Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2007 2007
 												</label>
2008 2008
 											</td>
2009 2009
 											<td>
2010
-												<input type="checkbox" id="description_above_<?php echo esc_attr( $field['merge'] ); ?>" class="widefat field-description-input" name="field[<?php echo $field['merge']; ?>][description_above]" value="1" <?php echo isset( $field['description_above'] ) && $field['description_above'] === '1' ? 'checked="checked"' : ''; ?> />
2011
-												<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2010
+												<input type="checkbox" id="description_above_<?php echo esc_attr( $field[ 'merge' ] ); ?>" class="widefat field-description-input" name="field[<?php echo $field[ 'merge' ]; ?>][description_above]" value="1" <?php echo isset( $field[ 'description_above' ] ) && $field[ 'description_above' ] === '1' ? 'checked="checked"' : ''; ?> />
2011
+												<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2012 2012
 											</td>
2013 2013
 										</tr>
2014 2014
 										<!-- Additional Classes -->
2015 2015
 										<tr valign="top">
2016 2016
 											<td scope="row">
2017
-												<label for="classes_<?php echo esc_attr( $field['merge'] ); ?>">
2017
+												<label for="classes_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2018 2018
 													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2019 2019
 												</label>
2020 2020
 											</td>
2021 2021
 											<td>
2022
-												<input type="text" id="classes_<?php echo esc_attr( $field['merge'] ); ?>" class="widefat" name="field[<?php echo $field['merge']; ?>][additional-classes]" value="<?php echo isset( $field['additional-classes'] ) ? stripslashes( wp_strip_all_tags( $field['additional-classes'] ) ) : '' ; ?>" />
2023
-												<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
2022
+												<input type="text" id="classes_<?php echo esc_attr( $field[ 'merge' ] ); ?>" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][additional-classes]" value="<?php echo isset( $field[ 'additional-classes' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'additional-classes' ] ) ) : ''; ?>" />
2023
+												<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
2024 2024
 											</td>
2025 2025
 										</tr>
2026 2026
 										<!-- Required Toggle -->
2027 2027
 										<tr valign="top" class="yikes-checkbox-container yikes-checkbox-container-first">
2028 2028
 											<td scope="row">
2029
-												<label for="field-required-<?php echo esc_attr( $field['merge'] ); ?>">
2029
+												<label for="field-required-<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2030 2030
 													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2031 2031
 												</label>
2032 2032
 											</td>
2033 2033
 											<td>
2034
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2035
-												<input id="field-required-<?php echo esc_attr( $field['merge'] ); ?>" type="checkbox" class="widefat" value="1" name="field[<?php echo $field['merge']; ?>][require]" <?php checked( $checked , 1 ); ?> <?php if ( $field['merge'] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
2036
-												<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2034
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2035
+												<input id="field-required-<?php echo esc_attr( $field[ 'merge' ] ); ?>" type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'merge' ]; ?>][require]" <?php checked( $checked, 1 ); ?> <?php if ( $field[ 'merge' ] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
2036
+												<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2037 2037
 											</td>
2038 2038
 										</tr>
2039 2039
 										<!-- Visible Toggle -->
2040 2040
 										<tr valign="top" class="yikes-checkbox-container">
2041 2041
 											<td scope="row">
2042
-												<label for="hide-field-<?php echo esc_attr( $field['merge'] ); ?>">
2042
+												<label for="hide-field-<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2043 2043
 													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2044 2044
 												</label>
2045 2045
 											</td>
2046 2046
 											<td>
2047
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2048
-												<input id="hide-field-<?php echo esc_attr( $field['merge'] ); ?>" type="checkbox" class="widefat" value="1" name="field[<?php echo $field['merge']; ?>][hide]" <?php checked( $hide , 1 ); ?> <?php if ( $field['merge'] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
2049
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2047
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2048
+												<input id="hide-field-<?php echo esc_attr( $field[ 'merge' ] ); ?>" type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'merge' ]; ?>][hide]" <?php checked( $hide, 1 ); ?> <?php if ( $field[ 'merge' ] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
2049
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2050 2050
 											</td>
2051 2051
 										</tr>
2052 2052
 										<!-- Toggle Field Label Visibility -->
2053 2053
 										<tr valign="top" class="yikes-checkbox-container">
2054 2054
 											<td scope="row">
2055
-												<label for="hide-label-<?php echo esc_attr( $field['merge'] ); ?>">
2055
+												<label for="hide-label-<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2056 2056
 													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2057 2057
 												</label>
2058 2058
 											</td>
2059 2059
 											<td>
2060
-												<?php $hide_label = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2061
-												<input id="hide-label-<?php echo esc_attr( $field['merge'] ); ?>" type="checkbox" name="field[<?php echo $field['merge']; ?>][hide-label]" value="1" <?php checked( $hide_label , 1 ); ?>/>
2062
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2060
+												<?php $hide_label = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2061
+												<input id="hide-label-<?php echo esc_attr( $field[ 'merge' ] ); ?>" type="checkbox" name="field[<?php echo $field[ 'merge' ]; ?>][hide-label]" value="1" <?php checked( $hide_label, 1 ); ?>/>
2062
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2063 2063
 											</td>
2064 2064
 										</tr>
2065 2065
 										<!-- Display Phone/Date Formats back to the user -->
2066 2066
 										<!-- Phone Format Initial Load -->
2067 2067
 										<?php
2068
-											switch( $field['type'] ) {
2068
+											switch ( $field[ 'type' ] ) {
2069 2069
 												/* Store the phone format, for properly regex pattern */
2070 2070
 												case 'phone':
2071 2071
 												case 'birthday':
@@ -2075,23 +2075,23 @@  discard block
 block discarded – undo
2075 2075
 															<td scope="row">
2076 2076
 																<label for="placeholder">
2077 2077
 																	<?php
2078
-																		switch( $field['type'] ) {
2078
+																		switch ( $field[ 'type' ] ) {
2079 2079
 																			default:
2080 2080
 																			case 'birthday':
2081 2081
 																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
2082
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD';
2082
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD';
2083 2083
 																				$format_name = 'date_format';
2084 2084
 																				break;
2085 2085
 
2086 2086
 																			case 'date':
2087 2087
 																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
2088
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD/YYYY';
2088
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD/YYYY';
2089 2089
 																				$format_name = 'date_format';
2090 2090
 																				break;
2091 2091
 
2092 2092
 																			case 'phone':
2093 2093
 																				$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
2094
-																				$format = isset( $field['phone_format'] ) && ! empty( $field['phone_format'] ) ? $field['phone_format'] : __( 'International', 'yikes-inc-easy-mailchimp-extender' );
2094
+																				$format = isset( $field[ 'phone_format' ] ) && ! empty( $field[ 'phone_format' ] ) ? $field[ 'phone_format' ] : __( 'International', 'yikes-inc-easy-mailchimp-extender' );
2095 2095
 																				$format_name = 'phone_format';
2096 2096
 																				break;
2097 2097
 																		}
@@ -2101,7 +2101,7 @@  discard block
 block discarded – undo
2101 2101
 															</td>
2102 2102
 															<td>
2103 2103
 																<strong><?php echo $format; ?></strong>
2104
-																<input type="hidden" name="field[<?php echo $field['merge']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
2104
+																<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
2105 2105
 																<p class="description"><small>
2106 2106
 																	<?php printf( __( 'To change the %s please head over to <a href="%s" title="MailChimp" target="_blank">MailChimp</a>. If you alter the format, you should re-import this field.', 'yikes-inc-easy-mailchimp-extender' ), strtolower( $type ), esc_url( 'http://www.mailchimp.com' ) ); ?>
2107 2107
 																</small></p>
@@ -2122,8 +2122,8 @@  discard block
 block discarded – undo
2122 2122
 											</td>
2123 2123
 											<td>
2124 2124
 												<span class="toggle-container">
2125
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2126
-													<a href="#" class="remove-field" alt="<?php echo $field['merge']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2125
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2126
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'merge' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2127 2127
 												</span>
2128 2128
 											</td>
2129 2129
 										</tr>
@@ -2141,35 +2141,35 @@  discard block
 block discarded – undo
2141 2141
 						/**** Interest Group ****/
2142 2142
 
2143 2143
 						?>
2144
-						<section class="draggable" id="<?php echo $field['group_id']; ?>">
2144
+						<section class="draggable" id="<?php echo $field[ 'group_id' ]; ?>">
2145 2145
 							<!-- top -->
2146 2146
 							<a href="#" class="expansion-section-title settings-sidebar">
2147
-								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php echo stripslashes( $field['label'] ); ?>
2148
-								<?php if ( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2147
+								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
2148
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2149 2149
 									<img src="<?php echo YIKES_MC_URL . 'includes/images/warning.svg'; ?>" class="field-no-longer-exists-warning" title="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>" alt="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>">
2150 2150
 								<?php } ?>
2151
-								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
2151
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
2152 2152
 							</a>
2153 2153
 							<!-- expansion section -->
2154 2154
 							<div class="yikes-mc-settings-expansion-section">
2155 2155
 
2156 2156
 								<!-- check if this field exists in the available interest group array -->
2157
-								<?php if ( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2158
-									<p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on the front end." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
2157
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2158
+									<p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
2159 2159
 								<?php } ?>
2160 2160
 
2161 2161
 								<!-- store the label -->
2162
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][label]" value="<?php echo htmlspecialchars( $field['label'] ); ?>" />
2163
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][type]" value="<?php echo $field['type']; ?>" />
2164
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][group_id]" value="<?php echo $field['group_id']; ?>" />
2165
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field['groups'], true ) ) ); ?>' />
2162
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][label]" value="<?php echo htmlspecialchars( $field[ 'label' ] ); ?>" />
2163
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
2164
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][group_id]" value="<?php echo $field[ 'group_id' ]; ?>" />
2165
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field[ 'groups' ], true ) ) ); ?>' />
2166 2166
 
2167 2167
 								<!-- Single or Double Opt-in -->
2168 2168
 								<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
2169 2169
 
2170 2170
 									<table class="form-table form-field-container">
2171 2171
 										<!-- Default Value -->
2172
-										<?php switch( $field['type'] ) {
2172
+										<?php switch ( $field[ 'type' ] ) {
2173 2173
 											default:
2174 2174
 											case 'radio':
2175 2175
 											case 'checkboxes':
@@ -2182,15 +2182,15 @@  discard block
 block discarded – undo
2182 2182
 													</td>
2183 2183
 													<td>
2184 2184
 														<?php
2185
-														$field['default_choice'] = isset( $field['default_choice'] ) ? $field['default_choice'] : '';
2185
+														$field[ 'default_choice' ] = isset( $field[ 'default_choice' ] ) ? $field[ 'default_choice' ] : '';
2186 2186
 
2187 2187
 														$default_shown = false;
2188 2188
 
2189
-														foreach ( json_decode( $field['groups'], true ) as $id => $group ) {
2190
-															$field_id   = "{$field['group_id']}-{$id}";
2191
-															$field_type = 'hidden' == $field['type'] ? 'checkbox' : $field['type'];
2189
+														foreach ( json_decode( $field[ 'groups' ], true ) as $id => $group ) {
2190
+															$field_id   = "{$field[ 'group_id' ]}-{$id}";
2191
+															$field_type = 'hidden' == $field[ 'type' ] ? 'checkbox' : $field[ 'type' ];
2192 2192
 															$field_type = 'checkboxes' == $field_type ? 'checkbox' : $field_type;
2193
-															$field_name = "field[{$field['group_id']}][default_choice]";
2193
+															$field_name = "field[{$field[ 'group_id' ]}][default_choice]";
2194 2194
 															$field_name = 'checkbox' == $field_type ? $field_name . '[]' : $field_name;
2195 2195
 
2196 2196
 															// Determine if the current group is checked.
@@ -2198,13 +2198,13 @@  discard block
 block discarded – undo
2198 2198
 															switch ( $field_type ) {
2199 2199
 																case 'radio':
2200 2200
 																default:
2201
-																	$default = is_array( $field['default_choice'] ) ? current( $field['default_choice'] ) : $field['default_choice'];
2202
-																	$checked = is_array( $field['default_choice'] ) ? checked( current( $field['default_choice'] ), $id, false ) : checked( $field['default_choice'], $id, false );
2201
+																	$default = is_array( $field[ 'default_choice' ] ) ? current( $field[ 'default_choice' ] ) : $field[ 'default_choice' ];
2202
+																	$checked = is_array( $field[ 'default_choice' ] ) ? checked( current( $field[ 'default_choice' ] ), $id, false ) : checked( $field[ 'default_choice' ], $id, false );
2203 2203
 																break;
2204 2204
 
2205 2205
 																case 'checkbox':
2206 2206
 																case 'hidden':
2207
-																	if ( is_array( $field['default_choice'] ) && in_array( $id, $field['default_choice'] ) ) {
2207
+																	if ( is_array( $field[ 'default_choice' ] ) && in_array( $id, $field[ 'default_choice' ] ) ) {
2208 2208
 																		$checked = checked( true, true, false );
2209 2209
 																	}
2210 2210
 																break;
@@ -2219,7 +2219,7 @@  discard block
 block discarded – undo
2219 2219
 																	    type="<?php echo $field_type; ?>"
2220 2220
 																	    name="<?php echo $field_name; ?>"
2221 2221
 																	    value="no-default" 
2222
-																	    <?php is_array( $field['default_choice'] ) ? checked( current( $field['default_choice'] ), 'no-default' ) : checked( $field['default_choice'], 'no-default' ); ?>>
2222
+																	    <?php is_array( $field[ 'default_choice' ] ) ? checked( current( $field[ 'default_choice' ] ), 'no-default' ) : checked( $field[ 'default_choice' ], 'no-default' ); ?>>
2223 2223
 																	No Default&nbsp;
2224 2224
 																</label>
2225 2225
 																<?php
@@ -2235,7 +2235,7 @@  discard block
 block discarded – undo
2235 2235
 															</label>
2236 2236
 															<?php
2237 2237
 														} ?>
2238
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2238
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2239 2239
 													</td>
2240 2240
 												</tr>
2241 2241
 
@@ -2251,13 +2251,13 @@  discard block
 block discarded – undo
2251 2251
 														</label>
2252 2252
 													</td>
2253 2253
 													<td>
2254
-														<select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2254
+														<select type="default" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]">
2255 2255
 															<option value="no-default">No Default</option>
2256
-															<?php foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as $id => $group ) { ?>
2257
-																<option value="<?php echo $id; ?>" <?php selected( $field['default_choice'] , $id ); ?>><?php echo stripslashes( $group ); ?></option>
2256
+															<?php foreach ( json_decode( stripslashes_deep( $field[ 'groups' ] ), true ) as $id => $group ) { ?>
2257
+																<option value="<?php echo $id; ?>" <?php selected( $field[ 'default_choice' ], $id ); ?>><?php echo stripslashes( $group ); ?></option>
2258 2258
 															<?php } ?>
2259 2259
 														</select>
2260
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2260
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2261 2261
 													</td>
2262 2262
 												</tr>
2263 2263
 
@@ -2270,78 +2270,78 @@  discard block
 block discarded – undo
2270 2270
 										<!-- Field Description -->
2271 2271
 										<tr valign="top">
2272 2272
 											<td scope="row">
2273
-												<label for="description_<?php echo esc_attr( $field['group_id'] ); ?>">
2273
+												<label for="description_<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2274 2274
 													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
2275 2275
 												</label>
2276 2276
 											</td>
2277 2277
 											<td>
2278
-												<textarea id="description_<?php echo esc_attr( $field['group_id'] ); ?>" class="widefat field-description-input" name="field[<?php echo $field['group_id']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
2279
-												<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2278
+												<textarea id="description_<?php echo esc_attr( $field[ 'group_id' ] ); ?>" class="widefat field-description-input" name="field[<?php echo $field[ 'group_id' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
2279
+												<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2280 2280
 											</td>
2281 2281
 										</tr>
2282 2282
 
2283 2283
 										<!-- Description Above Field -->
2284 2284
 										<tr valign="top" class="yikes-checkbox-container">
2285 2285
 											<td scope="row">
2286
-												<label for="description_above_<?php echo $field['group_id']; ?>">
2286
+												<label for="description_above_<?php echo $field[ 'group_id' ]; ?>">
2287 2287
 													<?php _e( 'Description Above Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2288 2288
 												</label>
2289 2289
 											</td>
2290 2290
 											<td>
2291
-												<input type="checkbox" id="description_above_<?php echo $field['group_id']; ?>" class="widefat field-description-input" name="field[<?php echo $field['group_id']; ?>][description_above]" value="1" <?php echo isset( $field['description_above'] ) && $field['description_above'] === '1' ? 'checked="checked"' : ''; ?> />
2292
-												<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2291
+												<input type="checkbox" id="description_above_<?php echo $field[ 'group_id' ]; ?>" class="widefat field-description-input" name="field[<?php echo $field[ 'group_id' ]; ?>][description_above]" value="1" <?php echo isset( $field[ 'description_above' ] ) && $field[ 'description_above' ] === '1' ? 'checked="checked"' : ''; ?> />
2292
+												<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2293 2293
 											</td>
2294 2294
 										</tr>
2295 2295
 
2296 2296
 										<!-- Additional Classes -->
2297 2297
 										<tr valign="top">
2298 2298
 											<td scope="row">
2299
-												<label for="classes_<?php echo esc_attr( $field['group_id'] ); ?>">
2299
+												<label for="classes_<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2300 2300
 													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2301 2301
 												</label>
2302 2302
 											</td>
2303 2303
 											<td>
2304
-												<input type="text" id="classes_<?php echo esc_attr( $field['group_id'] ); ?>" class="widefat" name="field[<?php echo $field['group_id']; ?>][additional-classes]" value="<?php echo isset( $field['additional-classes'] ) ? stripslashes( wp_strip_all_tags( $field['additional-classes'] ) ) : '' ; ?>" />
2305
-												<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
2304
+												<input type="text" id="classes_<?php echo esc_attr( $field[ 'group_id' ] ); ?>" class="widefat" name="field[<?php echo $field[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $field[ 'additional-classes' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'additional-classes' ] ) ) : ''; ?>" />
2305
+												<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
2306 2306
 											</td>
2307 2307
 										</tr>
2308 2308
 										<!-- Required Toggle -->
2309 2309
 										<tr valign="top" class="yikes-checkbox-container">
2310 2310
 											<td scope="row">
2311
-												<label for="field-required-<?php echo esc_attr( $field['group_id'] ); ?>">
2311
+												<label for="field-required-<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2312 2312
 													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2313 2313
 												</label>
2314 2314
 											</td>
2315 2315
 											<td>
2316
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2317
-												<input type="checkbox" id="field-required-<?php echo esc_attr( $field['group_id'] ); ?>" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][require]" <?php checked( $checked , 1 ); ?>>
2318
-												<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2316
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2317
+												<input type="checkbox" id="field-required-<?php echo esc_attr( $field[ 'group_id' ] ); ?>" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][require]" <?php checked( $checked, 1 ); ?>>
2318
+												<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2319 2319
 											</td>
2320 2320
 										</tr>
2321 2321
 										<!-- Visible Toggle -->
2322 2322
 										<tr valign="top" class="yikes-checkbox-container">
2323 2323
 											<td scope="row">
2324
-												<label for="hide-field-<?php echo esc_attr( $field['group_id'] ); ?>">
2324
+												<label for="hide-field-<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2325 2325
 													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2326 2326
 												</label>
2327 2327
 											</td>
2328 2328
 											<td>
2329
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2330
-												<input type="checkbox" id="hide-field-<?php echo esc_attr( $field['group_id'] ); ?>" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][hide]" <?php checked( $hide , 1 ); ?>>
2331
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2329
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2330
+												<input type="checkbox" id="hide-field-<?php echo esc_attr( $field[ 'group_id' ] ); ?>" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][hide]" <?php checked( $hide, 1 ); ?>>
2331
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2332 2332
 											</td>
2333 2333
 										</tr>
2334 2334
 										<!-- Toggle Field Label Visibility -->
2335 2335
 										<tr valign="top" class="yikes-checkbox-container">
2336 2336
 											<td scope="row">
2337
-												<label for="hide-label-<?php echo esc_attr( $field['group_id'] ); ?>">
2337
+												<label for="hide-label-<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2338 2338
 													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2339 2339
 												</label>
2340 2340
 											</td>
2341 2341
 											<td>
2342
-												<?php $hide = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2343
-												<input type="checkbox" id="hide-label-<?php echo esc_attr( $field['group_id'] ); ?>" name="field[<?php echo $field['group_id']; ?>][hide-label]" value="1" <?php checked( $hide , 1 ); ?>/>
2344
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2342
+												<?php $hide = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2343
+												<input type="checkbox" id="hide-label-<?php echo esc_attr( $field[ 'group_id' ] ); ?>" name="field[<?php echo $field[ 'group_id' ]; ?>][hide-label]" value="1" <?php checked( $hide, 1 ); ?>/>
2344
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2345 2345
 											</td>
2346 2346
 										</tr>
2347 2347
 										<!-- Toggle Buttons -->
@@ -2351,8 +2351,8 @@  discard block
 block discarded – undo
2351 2351
 											</td>
2352 2352
 											<td>
2353 2353
 												<span class="toggle-container">
2354
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2355
-													<a href="#" class="remove-field" alt="<?php echo $field['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2354
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2355
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2356 2356
 												</span>
2357 2357
 											</td>
2358 2358
 										</tr>
@@ -2373,7 +2373,7 @@  discard block
 block discarded – undo
2373 2373
 				add_thickbox();
2374 2374
 				// enqueue jquery qtip for our tooltip
2375 2375
 				wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) );
2376
-				wp_enqueue_style( 'jquery-qtip-style',  YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2376
+				wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2377 2377
 					$available_tags = array(
2378 2378
 						array(
2379 2379
 							'tag' => '{page_title}',
@@ -2428,14 +2428,14 @@  discard block
 block discarded – undo
2428 2428
 						<h3><?php _e( 'Pre Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2429 2429
 						<p class="description"><?php _e( 'You can use any of the following tags to populate a MailChimp text field with dynamic content. This can be used to determine which page the user signed up on, if the user was logged in and more.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
2430 2430
 						<ul>
2431
-							<?php foreach( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2431
+							<?php foreach ( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2432 2432
 								<li class="tooltop-tag">
2433 2433
 									<!-- link/tag -->
2434
-									<a href="#" onclick="populateDefaultValue( '<?php echo $tag['tag']; ?>' );return false;" data-attr-tag="<?php echo $tag['tag']; ?>" title="<?php echo $tag['title']; ?>"><?php echo $tag['title']; ?></a>
2434
+									<a href="#" onclick="populateDefaultValue( '<?php echo $tag[ 'tag' ]; ?>' );return false;" data-attr-tag="<?php echo $tag[ 'tag' ]; ?>" title="<?php echo $tag[ 'title' ]; ?>"><?php echo $tag[ 'title' ]; ?></a>
2435 2435
 									<!-- help icon -->
2436 2436
 									<span class="dashicons dashicons-editor-help"></span>
2437 2437
 									<!-- tooltip -->
2438
-									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag['description']; ?></div>
2438
+									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag[ 'description' ]; ?></div>
2439 2439
 								</li>
2440 2440
 							<?php } ?>
2441 2441
 						</ul>
@@ -2451,46 +2451,46 @@  discard block
 block discarded – undo
2451 2451
 		*	-
2452 2452
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2453 2453
 		*/
2454
-		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2454
+		public function build_available_merge_vars( $form_fields, $available_merge_variables ) {
2455 2455
 			$fields_assigned_to_form = array();
2456 2456
 			foreach ( $form_fields as $field ) {
2457
-				if ( isset( $field['merge'] ) ) {
2458
-					$fields_assigned_to_form[ $field['merge'] ] = true;
2457
+				if ( isset( $field[ 'merge' ] ) ) {
2458
+					$fields_assigned_to_form[ $field[ 'merge' ] ] = true;
2459 2459
 				}
2460 2460
 			}
2461 2461
 
2462
-			if ( ! empty( $available_merge_variables['merge_fields'] ) ) {
2462
+			if ( ! empty( $available_merge_variables[ 'merge_fields' ] ) ) {
2463 2463
 				?>
2464 2464
 				<ul id="available-fields"><?php
2465
-				foreach ( $available_merge_variables['merge_fields'] as $merge_var ) {
2466
-					if ( isset( $fields_assigned_to_form[ $merge_var['tag'] ] ) ) {
2465
+				foreach ( $available_merge_variables[ 'merge_fields' ] as $merge_var ) {
2466
+					if ( isset( $fields_assigned_to_form[ $merge_var[ 'tag' ] ] ) ) {
2467 2467
 						?>
2468 2468
 						<li class="available-form-field not-available"
2469
-						    alt="<?php echo $merge_var['tag']; ?>"
2470
-						    data-attr-field-type="<?php echo esc_attr( $merge_var['type'] ); ?>"
2471
-						    data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>"
2472
-						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>"
2469
+						    alt="<?php echo $merge_var[ 'tag' ]; ?>"
2470
+						    data-attr-field-type="<?php echo esc_attr( $merge_var[ 'type' ] ); ?>"
2471
+						    data-attr-field-name="<?php echo esc_attr( $merge_var[ 'name' ] ); ?>"
2472
+						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables[ 'list_id' ] ); ?>"
2473 2473
 						    title="<?php esc_attr_e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>"
2474 2474
 						    disabled="disabled">
2475
-							<?php echo stripslashes( $merge_var['name'] );
2476
-							if ( $merge_var['required'] ) {
2475
+							<?php echo stripslashes( $merge_var[ 'name' ] );
2476
+							if ( $merge_var[ 'required' ] ) {
2477 2477
 								echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>';
2478 2478
 							} ?>
2479
-							<small class="field-type-text"><?php echo $merge_var['type']; ?></small>
2479
+							<small class="field-type-text"><?php echo $merge_var[ 'type' ]; ?></small>
2480 2480
 						</li>
2481 2481
 						<?php
2482 2482
 					} else {
2483 2483
 						?>
2484 2484
 						<li class="available-form-field"
2485
-						    alt="<?php echo $merge_var['tag']; ?>"
2486
-						    data-attr-field-type="<?php echo esc_attr( $merge_var['type'] ); ?>"
2487
-						    data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>"
2488
-						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>">
2489
-							<?php echo stripslashes( $merge_var['name'] );
2490
-							if ( $merge_var['required'] ) {
2485
+						    alt="<?php echo $merge_var[ 'tag' ]; ?>"
2486
+						    data-attr-field-type="<?php echo esc_attr( $merge_var[ 'type' ] ); ?>"
2487
+						    data-attr-field-name="<?php echo esc_attr( $merge_var[ 'name' ] ); ?>"
2488
+						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables[ 'list_id' ] ); ?>">
2489
+							<?php echo stripslashes( $merge_var[ 'name' ] );
2490
+							if ( $merge_var[ 'required' ] ) {
2491 2491
 								echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>';
2492 2492
 							} ?>
2493
-							<small class="field-type-text"><?php echo $merge_var['type']; ?></small>
2493
+							<small class="field-type-text"><?php echo $merge_var[ 'type' ]; ?></small>
2494 2494
 						</li>
2495 2495
 						<?php
2496 2496
 					}
@@ -2512,12 +2512,12 @@  discard block
 block discarded – undo
2512 2512
 		*	-
2513 2513
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2514 2514
 		*/
2515
-		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2515
+		public function build_available_interest_groups( $form_fields, $available_interest_groups, $list_id ) {
2516 2516
 			$fields_assigned_to_form = array();
2517 2517
 			if ( ! empty( $form_fields ) ) {
2518 2518
 				foreach ( $form_fields as $field ) {
2519
-					if ( isset( $field['group_id'] ) ) {
2520
-						$fields_assigned_to_form[ $field['group_id'] ] = true;
2519
+					if ( isset( $field[ 'group_id' ] ) ) {
2520
+						$fields_assigned_to_form[ $field[ 'group_id' ] ] = true;
2521 2521
 					}
2522 2522
 				}
2523 2523
 			}
@@ -2526,29 +2526,29 @@  discard block
 block discarded – undo
2526 2526
 				?>
2527 2527
 				<ul id="available-interest-groups"><?php
2528 2528
 				foreach ( $available_interest_groups as $interest_group ) {
2529
-					if ( isset( $fields_assigned_to_form[ $interest_group['id'] ] ) ) {
2529
+					if ( isset( $fields_assigned_to_form[ $interest_group[ 'id' ] ] ) ) {
2530 2530
 						?>
2531 2531
 						<li class="available-interest-group not-available" 
2532
-							alt="<?php echo $interest_group['id']; ?>" 
2533
-							data-attr-field-name="<?php echo htmlspecialchars( $interest_group['title'] ); ?>" 
2534
-							data-attr-field-type="<?php echo $interest_group['type']; ?>" 
2532
+							alt="<?php echo $interest_group[ 'id' ]; ?>" 
2533
+							data-attr-field-name="<?php echo htmlspecialchars( $interest_group[ 'title' ] ); ?>" 
2534
+							data-attr-field-type="<?php echo $interest_group[ 'type' ]; ?>" 
2535 2535
 							data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" 
2536 2536
 							disabled="disabled"
2537 2537
 						>
2538
-							<?php echo stripslashes( $interest_group['title'] ); ?>
2539
-							<small class="field-type-text"><?php echo $interest_group['type']; ?></small>
2538
+							<?php echo stripslashes( $interest_group[ 'title' ] ); ?>
2539
+							<small class="field-type-text"><?php echo $interest_group[ 'type' ]; ?></small>
2540 2540
 						</li>
2541 2541
 						<?php
2542 2542
 					} else {
2543 2543
 						?>
2544 2544
 						<li class="available-interest-group" 
2545
-							alt="<?php echo $interest_group['id']; ?>" 
2546
-							data-attr-field-name="<?php echo htmlspecialchars( $interest_group['title'] ); ?>" 
2547
-							data-attr-field-type="<?php echo $interest_group['type']; ?>" 
2545
+							alt="<?php echo $interest_group[ 'id' ]; ?>" 
2546
+							data-attr-field-name="<?php echo htmlspecialchars( $interest_group[ 'title' ] ); ?>" 
2547
+							data-attr-field-type="<?php echo $interest_group[ 'type' ]; ?>" 
2548 2548
 							data-attr-form-id="<?php echo $list_id; ?>"
2549 2549
 						>
2550
-							<?php echo stripslashes( $interest_group['title'] ); ?>
2551
-							<small class="field-type-text"><?php echo $interest_group['type']; ?></small>
2550
+							<?php echo stripslashes( $interest_group[ 'title' ] ); ?>
2551
+							<small class="field-type-text"><?php echo $interest_group[ 'type' ]; ?></small>
2552 2552
 						</li>
2553 2553
 						<?php
2554 2554
 					}
@@ -2570,15 +2570,15 @@  discard block
 block discarded – undo
2570 2570
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2571 2571
 		*/
2572 2572
 		public function yikes_easy_mailchimp_create_form() {
2573
-			$nonce = $_REQUEST['nonce'];
2573
+			$nonce = $_REQUEST[ 'nonce' ];
2574 2574
 			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2575
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) );
2575
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ) );
2576 2576
 			}
2577 2577
 
2578 2578
 			$result = $this->form_interface->create_form( array(
2579
-				'list_id'          => sanitize_key( $_POST['associated-list'] ),
2580
-				'form_name'        => stripslashes( $_POST['form-name'] ),
2581
-				'form_description' => stripslashes( $_POST['form-description'] ),
2579
+				'list_id'          => sanitize_key( $_POST[ 'associated-list' ] ),
2580
+				'form_name'        => stripslashes( $_POST[ 'form-name' ] ),
2581
+				'form_description' => stripslashes( $_POST[ 'form-description' ] ),
2582 2582
 			) );
2583 2583
 
2584 2584
 			// if an error occurs during the form creation process
@@ -2586,11 +2586,11 @@  discard block
 block discarded – undo
2586 2586
 				// write it to the error log
2587 2587
 				// if the form was not created successfully
2588 2588
 				$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2589
-				$error_logging->maybe_write_to_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender') , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2589
+				$error_logging->maybe_write_to_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ), __( "Creating a new form", 'yikes-inc-easy-mailchimp-extender' ), __( "Forms", 'yikes-inc-easy-mailchimp-extender' ) );
2590 2590
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ) ) ) ) );
2591 2591
 			} else {
2592 2592
 				// redirect the user to the new form edit page
2593
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result) ) );
2593
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result ) ) );
2594 2594
 			}
2595 2595
 			exit();
2596 2596
 		}
@@ -2603,11 +2603,11 @@  discard block
 block discarded – undo
2603 2603
 		*/
2604 2604
 		public function yikes_easy_mailchimp_delete_form() {
2605 2605
 			// grab & store our variables ( associated list & form name )
2606
-			$nonce = $_REQUEST['nonce'];
2607
-			$post_id_to_delete = $_REQUEST['mailchimp-form'];
2606
+			$nonce = $_REQUEST[ 'nonce' ];
2607
+			$post_id_to_delete = $_REQUEST[ 'mailchimp-form' ];
2608 2608
 			// verify our nonce
2609
-			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2610
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2609
+			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-' . $post_id_to_delete ) ) {
2610
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2611 2611
 			}
2612 2612
 
2613 2613
 			$this->form_interface->delete_form( $post_id_to_delete );
@@ -2623,19 +2623,19 @@  discard block
 block discarded – undo
2623 2623
 		*/
2624 2624
 		public function yikes_easy_mailchimp_duplicate_form() {
2625 2625
 			// grab & store our variables ( associated list & form name )
2626
-			$nonce = $_REQUEST['nonce'];
2627
-			$post_id_to_clone = $_REQUEST['mailchimp-form'];
2626
+			$nonce = $_REQUEST[ 'nonce' ];
2627
+			$post_id_to_clone = $_REQUEST[ 'mailchimp-form' ];
2628 2628
 			// verify our nonce
2629
-			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2630
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2629
+			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-' . $post_id_to_clone ) ) {
2630
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2631 2631
 			}
2632 2632
 
2633 2633
 			// Get the current form data.
2634 2634
 			$form_data = $this->form_interface->get_form( $post_id_to_clone );
2635 2635
 
2636 2636
 			// Update some of the data before duplication
2637
-			$form_data['form_name'] .= ' - Copy';
2638
-			$form_data['impressions'] = $form_data['submissions'] = 0;
2637
+			$form_data[ 'form_name' ] .= ' - Copy';
2638
+			$form_data[ 'impressions' ] = $form_data[ 'submissions' ] = 0;
2639 2639
 
2640 2640
 			// Create the new form, and handle the result.
2641 2641
 			$result = $this->form_interface->create_form( $form_data );
@@ -2666,11 +2666,11 @@  discard block
 block discarded – undo
2666 2666
 		*/
2667 2667
 		public function yikes_easy_mailchimp_reset_impression_stats() {
2668 2668
 			// grab & store our variables ( associated list & form name )
2669
-			$nonce = $_REQUEST['nonce'];
2670
-			$form_id_to_reset = $_REQUEST['mailchimp-form'];
2669
+			$nonce = $_REQUEST[ 'nonce' ];
2670
+			$form_id_to_reset = $_REQUEST[ 'mailchimp-form' ];
2671 2671
 			// verify our nonce
2672
-			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2673
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2672
+			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-' . $form_id_to_reset ) ) {
2673
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2674 2674
 			}
2675 2675
 
2676 2676
 			$result = $this->form_interface->update_form(
@@ -2698,8 +2698,8 @@  discard block
 block discarded – undo
2698 2698
 		*/
2699 2699
 		public function yikes_easy_mailchimp_update_form() {
2700 2700
 
2701
-			$nonce   = $_REQUEST['nonce'];
2702
-			$form_id = $_REQUEST['id'];
2701
+			$nonce   = $_REQUEST[ 'nonce' ];
2702
+			$form_id = $_REQUEST[ 'id' ];
2703 2703
 
2704 2704
 			// verify our nonce
2705 2705
 			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
@@ -2713,70 +2713,70 @@  discard block
 block discarded – undo
2713 2713
 			}
2714 2714
 
2715 2715
 			// Store our values!
2716
-			$list_id                 = $_POST['associated-list'];
2717
-			$form_name               = stripslashes( $_POST['form-name'] );
2718
-			$form_description        = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
2719
-			$redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2720
-			$redirect_page           = $_POST['redirect-user-to-selection'];
2716
+			$list_id                 = $_POST[ 'associated-list' ];
2717
+			$form_name               = stripslashes( $_POST[ 'form-name' ] );
2718
+			$form_description        = sanitize_text_field( stripslashes( $_POST[ 'form-description' ] ) );
2719
+			$redirect_user_on_submit = $_POST[ 'redirect-user-on-submission' ];
2720
+			$redirect_page           = $_POST[ 'redirect-user-to-selection' ];
2721 2721
 
2722 2722
 			// stripslashes_deep on save, to prevent foreign languages from added excessive backslashes
2723
-			$assigned_fields = isset( $_POST['field'] ) ? stripslashes_deep( $_POST['field'] ): array();
2723
+			$assigned_fields = isset( $_POST[ 'field' ] ) ? stripslashes_deep( $_POST[ 'field' ] ) : array();
2724 2724
 
2725 2725
 			// setup our submission settings serialized array
2726 2726
 			$submission_settings = array(
2727
-				'ajax'                   => $_POST['form-ajax-submission'],
2728
-				'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2729
-				'redirect_page'          => $_POST['redirect-user-to-selection'],
2730
-				'custom_redirect_url'    => esc_url( $_POST['custom-redirect-url'] ),
2731
-				'redirect_new_window'	 => $_POST['redirect_new_window'],
2732
-				'hide_form_post_signup'  => $_POST['hide-form-post-signup'],
2733
-				'replace_interests'      => $_POST['replace-interest-groups'],
2727
+				'ajax'                   => $_POST[ 'form-ajax-submission' ],
2728
+				'redirect_on_submission' => $_POST[ 'redirect-user-on-submission' ],
2729
+				'redirect_page'          => $_POST[ 'redirect-user-to-selection' ],
2730
+				'custom_redirect_url'    => esc_url( $_POST[ 'custom-redirect-url' ] ),
2731
+				'redirect_new_window'	 => $_POST[ 'redirect_new_window' ],
2732
+				'hide_form_post_signup'  => $_POST[ 'hide-form-post-signup' ],
2733
+				'replace_interests'      => $_POST[ 'replace-interest-groups' ],
2734 2734
 			);
2735 2735
 
2736 2736
 			// setup our opt-in settings serialized array
2737 2737
 			$optin_settings = array(
2738
-				'optin'                => $_POST['single-double-optin'],
2739
-				'update_existing_user' => $_POST['update-existing-user'],
2740
-				'send_update_email'    => $_POST['update-existing-email'],
2738
+				'optin'                => $_POST[ 'single-double-optin' ],
2739
+				'update_existing_user' => $_POST[ 'update-existing-user' ],
2740
+				'send_update_email'    => $_POST[ 'update-existing-email' ],
2741 2741
 			);
2742 2742
 
2743 2743
 			// Setup our error settings serialized array
2744 2744
 			$error_settings = array(
2745
-				'success'				=> trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2746
-				'success-single-optin'	=> trim( $_POST['yikes-easy-mc-success-single-optin-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-single-optin-message'] ) ) : '',
2747
-				'success-resubscribed'	=> trim( $_POST['yikes-easy-mc-user-resubscribed-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-resubscribed-success-message'] ) ) : '',
2748
-				'general-error'			=> trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2749
-				'already-subscribed'	=> trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2750
-				'update-link'			=> trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '',
2751
-				'email-subject'			=> trim( $_POST['yikes-easy-mc-user-email-subject'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-email-subject'] ) ) : '',
2752
-				'email-body'			=> trim( $_POST['yikes-easy-mc-user-email-body'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-email-body'] ) ) : '',
2753
-				'update-email-success'  => trim( $_POST['yikes-easy-mc-update-email-successful'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-update-email-successful'] ) ) : '',
2754
-				'update-email-failure'  => trim( $_POST['yikes-easy-mc-update-email-failure'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-update-email-failure'] ) ) : '',
2745
+				'success'				=> trim( $_POST[ 'yikes-easy-mc-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-message' ] ) ) : '',
2746
+				'success-single-optin'	=> trim( $_POST[ 'yikes-easy-mc-success-single-optin-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-single-optin-message' ] ) ) : '',
2747
+				'success-resubscribed'	=> trim( $_POST[ 'yikes-easy-mc-user-resubscribed-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-resubscribed-success-message' ] ) ) : '',
2748
+				'general-error'			=> trim( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ) : '',
2749
+				'already-subscribed'	=> trim( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ) : '',
2750
+				'update-link'			=> trim( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ) : '',
2751
+				'email-subject'			=> trim( $_POST[ 'yikes-easy-mc-user-email-subject' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-email-subject' ] ) ) : '',
2752
+				'email-body'			=> trim( $_POST[ 'yikes-easy-mc-user-email-body' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-email-body' ] ) ) : '',
2753
+				'update-email-success'  => trim( $_POST[ 'yikes-easy-mc-update-email-successful' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-update-email-successful' ] ) ) : '',
2754
+				'update-email-failure'  => trim( $_POST[ 'yikes-easy-mc-update-email-failure' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-update-email-failure' ] ) ) : '',
2755 2755
 			);
2756 2756
 
2757 2757
 			// Setup the new form settings array
2758 2758
 			// @since 6.0.3.8
2759 2759
 			// To Do: Combine date & time so it's a single unix timestamp
2760 2760
 			$form_settings = array(
2761
-				'yikes-easy-mc-form-class-names'                 => trim( $_POST['yikes-easy-mc-form-class-names'] ),
2762
-				'yikes-easy-mc-inline-form'                      => $_POST['yikes-easy-mc-inline-form'][0],
2763
-				'yikes-easy-mc-submit-button-type'               => $_POST['yikes-easy-mc-submit-button-type'][0],
2764
-				'yikes-easy-mc-submit-button-text'               => trim( $_POST['yikes-easy-mc-submit-button-text'] ),
2765
-				'yikes-easy-mc-submit-button-image'              => esc_url( trim( $_POST['yikes-easy-mc-submit-button-image'] ) ),
2766
-				'yikes-easy-mc-submit-button-classes'            => trim( $_POST['yikes-easy-mc-submit-button-classes'] ),
2767
-				'yikes-easy-mc-form-schedule'                    => ( isset( $_POST['yikes-easy-mc-form-schedule'] ) ) ? '1' : '0',
2768
-				'yikes-easy-mc-form-restriction-start'           => strtotime( $_POST['yikes-easy-mc-form-restriction-start-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-start-time'] ),
2769
-				'yikes-easy-mc-form-restriction-end'             => strtotime( $_POST['yikes-easy-mc-form-restriction-end-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-end-time'] ),
2770
-				'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST['yikes-easy-mc-form-restriction-pending-message'] ),
2771
-				'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST['yikes-easy-mc-form-restriction-expired-message'] ),
2772
-				'yikes-easy-mc-form-login-required'              => ( isset( $_POST['yikes-easy-mc-form-login-required'] ) ) ? '1' : '0',
2773
-				'yikes-easy-mc-form-restriction-login-message'   => trim( $_POST['yikes-easy-mc-form-restriction-login-message'] ),
2761
+				'yikes-easy-mc-form-class-names'                 => trim( $_POST[ 'yikes-easy-mc-form-class-names' ] ),
2762
+				'yikes-easy-mc-inline-form'                      => $_POST[ 'yikes-easy-mc-inline-form' ][ 0 ],
2763
+				'yikes-easy-mc-submit-button-type'               => $_POST[ 'yikes-easy-mc-submit-button-type' ][ 0 ],
2764
+				'yikes-easy-mc-submit-button-text'               => trim( $_POST[ 'yikes-easy-mc-submit-button-text' ] ),
2765
+				'yikes-easy-mc-submit-button-image'              => esc_url( trim( $_POST[ 'yikes-easy-mc-submit-button-image' ] ) ),
2766
+				'yikes-easy-mc-submit-button-classes'            => trim( $_POST[ 'yikes-easy-mc-submit-button-classes' ] ),
2767
+				'yikes-easy-mc-form-schedule'                    => ( isset( $_POST[ 'yikes-easy-mc-form-schedule' ] ) ) ? '1' : '0',
2768
+				'yikes-easy-mc-form-restriction-start'           => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-start-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-start-time' ] ),
2769
+				'yikes-easy-mc-form-restriction-end'             => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-end-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-end-time' ] ),
2770
+				'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-pending-message' ] ),
2771
+				'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-expired-message' ] ),
2772
+				'yikes-easy-mc-form-login-required'              => ( isset( $_POST[ 'yikes-easy-mc-form-login-required' ] ) ) ? '1' : '0',
2773
+				'yikes-easy-mc-form-restriction-login-message'   => trim( $_POST[ 'yikes-easy-mc-form-restriction-login-message' ] ),
2774 2774
 			);
2775 2775
 
2776 2776
 			// additional custom fields (extensions / user defined fields)
2777 2777
 			$custom_fields = array();
2778
-			if ( isset( $_POST['custom-field'] ) ) {
2779
-				foreach ( $_POST['custom-field'] as $custom_field => $custom_value ) {
2778
+			if ( isset( $_POST[ 'custom-field' ] ) ) {
2779
+				foreach ( $_POST[ 'custom-field' ] as $custom_field => $custom_value ) {
2780 2780
 					if ( is_array( $custom_value ) ) {
2781 2781
 						$custom_fields[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2782 2782
 					} else {
@@ -2808,7 +2808,7 @@  discard block
 block discarded – undo
2808 2808
 			$this->form_interface->update_form( $form_id, $form_updates );
2809 2809
 
2810 2810
 			/* Custom action hook which allows users to update specific options when a form is updated - used in add ons */
2811
-			do_action( 'yikes-mailchimp-save-form', $form_id,  $custom_fields );
2811
+			do_action( 'yikes-mailchimp-save-form', $form_id, $custom_fields );
2812 2812
 
2813 2813
 			// redirect the user to the manage forms page, display confirmation
2814 2814
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form_id . '&updated-form=true' ) ) );
@@ -2819,11 +2819,11 @@  discard block
 block discarded – undo
2819 2819
 			$email_body  = '<p>' . __( 'Greetings,', 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; 
2820 2820
 
2821 2821
 			$email_body .= '<p>';
2822
-			$email_body .= 	__( 'A request has been made to update your MailChimp account profile information.', 'yikes-inc-easy-mailchimp-extender' );
2823
-			$email_body .=	__( ' To do so please use the following link: ', 'yikes-inc-easy-mailchimp-extender' );
2824
-			$email_body .=	'[link]';
2825
-			$email_body .=		__( 'Update MailChimp Profile Info', 'yikes-inc-easy-mailchimp-extender' );
2826
-			$email_body .= 	'[/link]';
2822
+			$email_body .= __( 'A request has been made to update your MailChimp account profile information.', 'yikes-inc-easy-mailchimp-extender' );
2823
+			$email_body .= __( ' To do so please use the following link: ', 'yikes-inc-easy-mailchimp-extender' );
2824
+			$email_body .= '[link]';
2825
+			$email_body .= __( 'Update MailChimp Profile Info', 'yikes-inc-easy-mailchimp-extender' );
2826
+			$email_body .= '[/link]';
2827 2827
 			$email_body .= '</p>';
2828 2828
 
2829 2829
 			$email_body .= '<p>' . __( 'If you did not request this update, please disregard this email.', 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
@@ -2839,13 +2839,13 @@  discard block
 block discarded – undo
2839 2839
 
2840 2840
 		/* Unsubscribe a given user from our list */
2841 2841
 		public function yikes_easy_mailchimp_unsubscribe_user() {
2842
-			$nonce    = $_REQUEST['nonce'];
2843
-			$list_id  = $_REQUEST['mailchimp-list'];
2844
-			$email_id = $_REQUEST['email_id'];
2842
+			$nonce    = $_REQUEST[ 'nonce' ];
2843
+			$list_id  = $_REQUEST[ 'mailchimp-list' ];
2844
+			$email_id = $_REQUEST[ 'email_id' ];
2845 2845
 
2846 2846
 			// verify our nonce
2847 2847
 			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2848
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2848
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2849 2849
 			}
2850 2850
 
2851 2851
 			$response = yikes_get_mc_api_manager()->get_list_handler()->member_unsubscribe( $list_id, $email_id );
@@ -2864,21 +2864,21 @@  discard block
 block discarded – undo
2864 2864
 
2865 2865
 		public function yikes_easy_mailchimp_create_missing_error_log() {
2866 2866
 			// grab our nonnce
2867
-			$nonce = $_REQUEST['nonce'];
2867
+			$nonce = $_REQUEST[ 'nonce' ];
2868 2868
 			// validate nonce
2869
-			if ( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2870
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2869
+			if ( ! wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2870
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2871 2871
 			}
2872 2872
 			// setup the path to the error log
2873 2873
 			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' );
2874 2874
 			try {
2875 2875
 				// create the file
2876
-				fwrite( $error_log , '' );
2876
+				fwrite( $error_log, '' );
2877 2877
 				// close out
2878 2878
 				fclose( $error_log );
2879 2879
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=true' ) ) );
2880 2880
 			} catch ( Exception $e ) {
2881
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=false&error_message='.urlencode( $e->getMessage() ) ) ) );
2881
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=false&error_message=' . urlencode( $e->getMessage() ) ) ) );
2882 2882
 			}
2883 2883
 		}
2884 2884
 
@@ -2889,9 +2889,9 @@  discard block
 block discarded – undo
2889 2889
 		public function yikes_easy_mailchimp_clear_transient_data() {
2890 2890
 
2891 2891
 			// verify our nonce
2892
-			$nonce = $_REQUEST['nonce'];
2892
+			$nonce = $_REQUEST[ 'nonce' ];
2893 2893
 			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2894
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2894
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2895 2895
 			}
2896 2896
 
2897 2897
 			$this->delete_yikes_mailchimp_transients();
@@ -2900,10 +2900,10 @@  discard block
 block discarded – undo
2900 2900
 			$referer = wp_get_referer();
2901 2901
 			if ( $referer && ( strpos( $referer, 'yikes-inc-easy-mailchimp-settings' ) > 0 ) ) {
2902 2902
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings&transient-cleared=true' ) ) );
2903
-			} elseif ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] === 'yikes-mailchimp-edit-form' && isset( $_REQUEST['id'] ) && ! empty( $_REQUEST['id'] ) ) {
2903
+			} elseif ( isset( $_REQUEST[ 'page' ] ) && $_REQUEST[ 'page' ] === 'yikes-mailchimp-edit-form' && isset( $_REQUEST[ 'id' ] ) && ! empty( $_REQUEST[ 'id' ] ) ) {
2904 2904
 
2905 2905
 				// else check if we were editing a form.
2906
-				$id = filter_var( $_REQUEST['id'], FILTER_SANITIZE_NUMBER_INT );
2906
+				$id = filter_var( $_REQUEST[ 'id' ], FILTER_SANITIZE_NUMBER_INT );
2907 2907
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $id ) ) );
2908 2908
 			} else {
2909 2909
 				// else redirect to the manage forms page.
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
 		 */
2948 2948
 		public function yikes_mailchimp_load_helper_class() {
2949 2949
 			// check to see if it's already loaded up.
2950
-			if ( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2950
+			if ( ! class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2951 2951
 				// Include our main helper class file
2952 2952
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' );
2953 2953
 			}
Please login to merge, or discard this patch.
admin/partials/helpers/free-support.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@  discard block
 block discarded – undo
5 5
 	<div id="col-left">
6 6
 
7 7
 		<div class="col-wrap">
8
-			<h1><span class="dashicons dashicons-wordpress-alt support-page-wordpress-font"></span>&nbsp;<?php _e( 'WordPress.org Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
8
+			<h1><span class="dashicons dashicons-wordpress-alt support-page-wordpress-font"></span>&nbsp;<?php _e( 'WordPress.org Plugin Directory', 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
9 9
 			<div class="inside">
10 10
 				<p><?php _e( 'Use your WordPress.org username to submit support requests on the WordPress Directory support forum.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
11
-				<img class="support-page-logo" src="<?php echo YIKES_MC_URL; ?>includes/images/Support_Page/wordpress-issue-screenshot.png" title="<?php esc_attr_e( 'WordPress.org Issue Tracker Screenshot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" >
11
+				<img class="support-page-logo" src="<?php echo YIKES_MC_URL; ?>includes/images/Support_Page/wordpress-issue-screenshot.png" title="<?php esc_attr_e( 'WordPress.org Issue Tracker Screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" >
12 12
 				<a href="https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender" target="_blank" class="button-secondary support-page-button"><?php _e( 'Submit a New WordPress.org Support Request', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
13 13
 			</div>
14 14
 		</div>
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 						printf( '<h2>' . esc_attr__( 'Popular Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ) . '</h2>' );
61 61
 						printf( '<ol>' );
62 62
 						foreach ( $knowledge_base_links as $kb_link ) {
63
-							echo wp_kses_post( '<li><a href="' . esc_url( $kb_link['href'] ) . '" title="' . esc_attr( $kb_link['title'] ) . '" target="_blank">' . esc_attr( $kb_link['title'] ) . '</a></li>' );
63
+							echo wp_kses_post( '<li><a href="' . esc_url( $kb_link[ 'href' ] ) . '" title="' . esc_attr( $kb_link[ 'title' ] ) . '" target="_blank">' . esc_attr( $kb_link[ 'title' ] ) . '</a></li>' );
64 64
 						}
65 65
 						printf( '</ol>' );
66 66
 					}
Please login to merge, or discard this patch.
admin/partials/menu/support.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,21 +9,21 @@
 block discarded – undo
9 9
 <div class="wrap yikes-easy-mc-support-wrap"> 
10 10
 
11 11
 	<!-- Freddie Logo -->
12
-	<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" />
12
+	<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" />
13 13
 
14
-	<h1>Easy Forms for MailChimp | <?php _e( 'Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
14
+	<h1>Easy Forms for MailChimp | <?php _e( 'Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
15 15
 		<!-- Support Page Description -->
16
-	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'If you have questions, we have answers!' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
16
+	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'If you have questions, we have answers!', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
17 17
 
18
-	<?php if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) { ?>
19
-		<p><?php _e( 'Users of the free version of Easy Forms for MailChimp can post questions to our support forum on the WordPress Plugin Directory. We aim to respond to support requests for the free version of the plugin within a week.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
20
-		<p><?php printf( __( 'Purchasers of our paid add-ons qualify for premium support. <a href="%s" target="_blank" title="' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '</a>!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'https://yikesplugins.com/' ) ); ?></p>
18
+	<?php if ( get_option( 'yikes-easy-mc-active-addons', array() ) == array() ) { ?>
19
+		<p><?php _e( 'Users of the free version of Easy Forms for MailChimp can post questions to our support forum on the WordPress Plugin Directory. We aim to respond to support requests for the free version of the plugin within a week.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
20
+		<p><?php printf( __( 'Purchasers of our paid add-ons qualify for premium support. <a href="%s" target="_blank" title="' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '</a>!', 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'https://yikesplugins.com/' ) ); ?></p>
21 21
 	<?php } else { ?>
22
-		<p><?php _e( "It looks like you are one of our premium users! Fill out the form below to submit a priority support request." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
23
-		<p><?php _e( "If you have any problems with the form, send an email to <a href='mailto:[email protected]'>[email protected]</a> and a ticket will be created." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
22
+		<p><?php _e( "It looks like you are one of our premium users! Fill out the form below to submit a priority support request.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
23
+		<p><?php _e( "If you have any problems with the form, send an email to <a href='mailto:[email protected]'>[email protected]</a> and a ticket will be created.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
24 24
 	<?php } ?>
25 25
 
26
-		<p><?php printf( __( 'Before submitting a support request, please visit our %s.' , 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) . '" title="' . __( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'knowledge base', 'yikes-inc-easy-mailchimp-extender' ) . '</a> where we have step-by-step guides and troubleshooting help' ); ?></p>
26
+		<p><?php printf( __( 'Before submitting a support request, please visit our %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) . '" title="' . __( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'knowledge base', 'yikes-inc-easy-mailchimp-extender' ) . '</a> where we have step-by-step guides and troubleshooting help' ); ?></p>
27 27
 
28 28
 	<hr />
29 29
 	
Please login to merge, or discard this patch.
admin/partials/helpers/premium-support.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 			<h2 class="premium-support-title"><?php _e( 'Priority & Add-on Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
7 7
 
8 8
 			<?php
9
-				if ( isset( $_POST['submit-premium-support-request'] ) ) {
9
+				if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) {
10 10
 			?>
11 11
 					<h4><?php _e( 'Success!', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
12 12
 					<p><?php _e( 'We have received your support request and will get in touch shortly regarding your issue.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 			?>
16 16
 
17 17
 			<!-- Premium Support Form -->
18
-			<form id="premium-support-form" method="post" action="<?php echo esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#premium-support-form' ) ); ?>" <?php echo (isset($_POST['submit-premium-support-request'])) ? 'class="support-form-hidden"' : ''; ?>>
18
+			<form id="premium-support-form" method="post" action="<?php echo esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#premium-support-form' ) ); ?>" <?php echo ( isset( $_POST[ 'submit-premium-support-request' ] ) ) ? 'class="support-form-hidden"' : ''; ?>>
19 19
 
20 20
 				<label><?php _e( 'Add-On:', 'yikes-inc-easy-mailchimp-extender' ); ?>
21 21
 					<select name="license_key" id="license-key">
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 								// get the license for the respective extension
26 26
 								$options = get_option( 'yikes-mailchimp-' . $extension . '-settings', array() );
27 27
 
28
-								if ( isset( $options['license'] ) && $options['status'] == 'valid' ) {
29
-									echo '<option data-plugin-slug="' . esc_attr( $extension ) . '" data-plugin-name="' . esc_attr( ucwords( str_replace( '-', ' ', $extension ) ) ) . '" value="' . esc_attr( trim( $options['license'] ) ) . '">' . ucwords( str_replace( '-', ' ', $extension ) ) . ' ' . '</option>';
28
+								if ( isset( $options[ 'license' ] ) && $options[ 'status' ] == 'valid' ) {
29
+									echo '<option data-plugin-slug="' . esc_attr( $extension ) . '" data-plugin-name="' . esc_attr( ucwords( str_replace( '-', ' ', $extension ) ) ) . '" value="' . esc_attr( trim( $options[ 'license' ] ) ) . '">' . ucwords( str_replace( '-', ' ', $extension ) ) . ' ' . '</option>';
30 30
 								}
31 31
 							}
32 32
 						?>
33 33
 					</select>
34
-					<p class="description"><?php _e( 'Select the add-on that you are looking for help with.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
34
+					<p class="description"><?php _e( 'Select the add-on that you are looking for help with.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
35 35
 
36 36
 					<input type="hidden" name="plugin-slug" id="plugin-slug" value="">
37 37
 					<input type="hidden" name="plugin-name" id="plugin-name" value="">
@@ -39,31 +39,31 @@  discard block
 block discarded – undo
39 39
 
40 40
 				<label><?php _e( 'Name:', 'yikes-inc-easy-mailchimp-extender' ); ?>
41 41
 					<input type="text" name="user-name" required>
42
-					<p class="description"><?php _e( 'Enter your name.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
42
+					<p class="description"><?php _e( 'Enter your name.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
43 43
 				</label>
44 44
 
45 45
 				<label><?php _e( 'Contact Email:', 'yikes-inc-easy-mailchimp-extender' ); ?>
46 46
 					<input type="email" name="user-email" required>
47
-					<p class="description"><?php _e( 'Enter the email address you would prefer to be contact at.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
47
+					<p class="description"><?php _e( 'Enter the email address you would prefer to be contact at.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
48 48
 				</label>
49 49
 
50 50
 				<label><?php _e( 'Topic:', 'yikes-inc-easy-mailchimp-extender' ); ?>
51 51
 					<input type="text" name="support-topic" required>
52
-					<p class="description"><?php _e( 'Pleae enter the topic of your support request.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
52
+					<p class="description"><?php _e( 'Pleae enter the topic of your support request.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
53 53
 				</label>
54 54
 
55 55
 				<label><?php _e( 'Priority:', 'yikes-inc-easy-mailchimp-extender' ); ?>
56 56
 					<select name="support-priority">
57
-						<option value="1"><?php _e( 'Low' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
58
-						<option value="2"><?php _e( 'Medium' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
59
-						<option value="3"><?php _e( 'High' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
60
-						<option value="4"><?php _e( 'Urgent' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
57
+						<option value="1"><?php _e( 'Low', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
58
+						<option value="2"><?php _e( 'Medium', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
59
+						<option value="3"><?php _e( 'High', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
60
+						<option value="4"><?php _e( 'Urgent', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
61 61
 					</select>
62
-					<p class="description"><?php _e( 'Select the priority of this ticket.' , 'yikes-inc-easy-mailchimp-extender' ); ?><em><?php _e( 'Note: Please do not abuse "urgent".' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
62
+					<p class="description"><?php _e( 'Select the priority of this ticket.', 'yikes-inc-easy-mailchimp-extender' ); ?><em><?php _e( 'Note: Please do not abuse "urgent".', 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
63 63
 				</label>
64 64
 				<label><?php _e( 'Issue:', 'yikes-inc-easy-mailchimp-extender' ); ?>
65 65
 					<?php wp_editor( '', 'support-content', array( 'textarea_name' => 'support-content', 'media_buttons' => false ) ); ?>
66
-					<p class="description"><?php _e( 'Enter as much detail about the issue you are encontering as possible. After we make initial contact you can attach any screenshots necessary.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
66
+					<p class="description"><?php _e( 'Enter as much detail about the issue you are encontering as possible. After we make initial contact you can attach any screenshots necessary.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
67 67
 				</label>
68 68
 
69 69
 				<input type="hidden" name="action" value="yikes-support-request">
Please login to merge, or discard this patch.
admin/partials/front-end-widgets/front-end-widget-form.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 			// Widget name will appear in UI
26 26
 			__( 'Easy MailChimp Forms', 'yikes-inc-easy-mailchimp-extender' ),
27 27
 			// Widget description
28
-			array( 'description' => __( 'MailChimp opt-in widget for your sidebar.', 'yikes-inc-easy-mailchimp-extender' ), )
28
+			array( 'description' => __( 'MailChimp opt-in widget for your sidebar.', 'yikes-inc-easy-mailchimp-extender' ),)
29 29
 		);
30 30
 	}
31 31
 
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 		// Get all form IDs so we can use the first one as a default.
40 40
 		$form_ids = $this->form_interface->get_form_ids();
41 41
 
42
-		$title              = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : __( 'MailChimp Signup Form', 'yikes-inc-easy-mailchimp-extender' );
43
-		$form_id            = isset( $instance['form_id'] ) ? $instance['form_id'] : $form_ids[0];
44
-		$form_description   = isset( $instance['form_description'] ) ? $instance['form_description'] : '';
45
-		$submit_button_text = isset( $instance['submit_text'] ) ? $instance['submit_text'] : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
42
+		$title              = isset( $instance[ 'title' ] ) ? apply_filters( 'widget_title', $instance[ 'title' ] ) : __( 'MailChimp Signup Form', 'yikes-inc-easy-mailchimp-extender' );
43
+		$form_id            = isset( $instance[ 'form_id' ] ) ? $instance[ 'form_id' ] : $form_ids[ 0 ];
44
+		$form_description   = isset( $instance[ 'form_description' ] ) ? $instance[ 'form_description' ] : '';
45
+		$submit_button_text = isset( $instance[ 'submit_text' ] ) ? $instance[ 'submit_text' ] : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
46 46
 
47 47
 		// Build our array based on settings chosen
48 48
 		$shortcode_attributes = array(
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 		$shortcode_attributes = apply_filters( 'yikes_mailchimp_widget_shortcode_attributes', $shortcode_attributes, $instance );
55 55
 
56 56
 		// before and after widget arguments are defined by themes
57
-		echo $args['before_widget'];
57
+		echo $args[ 'before_widget' ];
58 58
 
59 59
 		if ( ! empty( $title ) ) {
60
-			echo $args['before_title'] . $title . $args['after_title'];
60
+			echo $args[ 'before_title' ] . $title . $args[ 'after_title' ];
61 61
 		}
62 62
 
63 63
 		// Custom action hooks to place content in the widget before the form
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		do_action( 'yikes-mailchimp-after-form-' . $form_id );
74 74
 		do_action( 'yikes-mailchimp-after-form' );
75 75
 
76
-		echo $args['after_widget'];
76
+		echo $args[ 'after_widget' ];
77 77
 	}
78 78
 
79 79
 	// Widget Backend 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		if ( empty( $all_forms ) ) {
84 84
 			?>
85 85
 				<section class="no-forms-widget">
86
-				<strong><span class="dashicons dashicons-no-alt no-forms-found-icon"></span><?php echo sprintf( __( 'No forms found. It looks like you need to <a href="%s" title="%s">%s</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form' , 'yikes-inc-easy-mailchimp-extender' ), __( 'create a form' , 'yikes-inc-easy-mailchimp-extender' ) ); ?></strong>
86
+				<strong><span class="dashicons dashicons-no-alt no-forms-found-icon"></span><?php echo sprintf( __( 'No forms found. It looks like you need to <a href="%s" title="%s">%s</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ), __( 'create a form', 'yikes-inc-easy-mailchimp-extender' ) ); ?></strong>
87 87
 				</section>
88 88
 			<?php
89 89
 			return;
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 			$submit_text = __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
111 111
 		}
112 112
 
113
-		 if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
113
+		 if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
114 114
 			?>
115
-				<p class="enter-valid-api-error-widget"><strong><?php _e( 'Please enter a valid MailChimp API key to connect your site to MailChimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
115
+				<p class="enter-valid-api-error-widget"><strong><?php _e( 'Please enter a valid MailChimp API key to connect your site to MailChimp.', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
116 116
 			<?php
117 117
 			return;
118 118
 		}
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 			<select id="<?php echo $this->get_field_id( 'form_id' ); ?>" name="<?php echo $this->get_field_name( 'form_id' ); ?>" class="widefat">
130 130
 				<?php
131 131
 				// build our array
132
-				foreach( $all_forms as $id => $form ) {
132
+				foreach ( $all_forms as $id => $form ) {
133 133
 					?>
134
-						<option <?php selected( $selected_form , $id ); ?> name="<?php echo $this->get_field_name( 'form_id' ); ?>" value="<?php echo $id; ?>"><?php echo stripslashes( $form['form_name'] ); ?></option>
134
+						<option <?php selected( $selected_form, $id ); ?> name="<?php echo $this->get_field_name( 'form_id' ); ?>" value="<?php echo $id; ?>"><?php echo stripslashes( $form[ 'form_name' ] ); ?></option>
135 135
 					<?php
136 136
 				}
137 137
 				?>
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 		<p>
142 142
 			<label for="<?php echo $this->get_field_id( 'form_description' ); ?>"><?php _e( 'Display Form Description:' ); ?></label>
143
-			<input class="widefat" id="<?php echo $this->get_field_id( 'form_description' ); ?>" name="<?php echo $this->get_field_name( 'form_description' ); ?>" type="checkbox" value="1" <?php if( isset( $instance['form_description'] ) ) { checked( $instance['form_description'] , 1 ); } ?> />
143
+			<input class="widefat" id="<?php echo $this->get_field_id( 'form_description' ); ?>" name="<?php echo $this->get_field_name( 'form_description' ); ?>" type="checkbox" value="1" <?php if ( isset( $instance[ 'form_description' ] ) ) { checked( $instance[ 'form_description' ], 1 ); } ?> />
144 144
 		</p>
145 145
 
146 146
 		<p>
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 	// Updating widget replacing old instances with new
154 154
 	public function update( $new_instance, $old_instance ) {
155 155
 		$instance = array();
156
-		$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
157
-		$instance['form_id'] = $new_instance['form_id'];
158
-		$instance['form_description'] = isset( $new_instance['form_description'] ) ? '1' : '';
159
-		$instance['submit_text'] = ( ! empty( $new_instance['submit_text'] ) ) ? strip_tags( $new_instance['submit_text'] ) : 'Submit';
156
+		$instance[ 'title' ] = ( ! empty( $new_instance[ 'title' ] ) ) ? strip_tags( $new_instance[ 'title' ] ) : '';
157
+		$instance[ 'form_id' ] = $new_instance[ 'form_id' ];
158
+		$instance[ 'form_description' ] = isset( $new_instance[ 'form_description' ] ) ? '1' : '';
159
+		$instance[ 'submit_text' ] = ( ! empty( $new_instance[ 'submit_text' ] ) ) ? strip_tags( $new_instance[ 'submit_text' ] ) : 'Submit';
160 160
 		return $instance;
161 161
 	}
162 162
 	
Please login to merge, or discard this patch.
admin/partials/menu/manage-lists.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -27,16 +27,16 @@  discard block
 block discarded – undo
27 27
 ?>
28 28
 <div class="wrap">
29 29
 	<!-- Freddie Logo -->
30
-	<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
30
+	<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
31 31
 
32
-	<h1>Easy Forms for MailChimp | <?php _e( 'Manage Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
32
+	<h1>Easy Forms for MailChimp | <?php _e( 'Manage Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
33 33
 
34 34
 	<!-- Settings Page Description -->
35
-	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your MailChimp lists.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
35
+	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your MailChimp lists.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
36 36
 
37 37
 	<?php
38 38
 		/* If the user hasn't authenticated yet, lets kill off */
39
-		if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
39
+		if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) {
40 40
 
41 41
 			$error_string = sprintf(
42 42
 				esc_html__( 'You need to connect to MailChimp before you can start creating forms. Head over to the %s and enter your API key.', 'yikes-inc-easy-mailchimp-extender' ),
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 									<!-- TABLE HEAD -->
73 73
 									<thead>
74 74
 										<tr>
75
-											<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
76
-											<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
75
+											<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
76
+											<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
77 77
 										</tr>
78 78
 									</thead>
79 79
 									<!-- end header -->
@@ -81,25 +81,25 @@  discard block
 block discarded – undo
81 81
 									<!-- FOOTER -->
82 82
 									<tfoot>
83 83
 										<tr>
84
-											<th class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
85
-											<th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
84
+											<th class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
85
+											<th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
86 86
 										</tr>
87 87
 									</tfoot>
88 88
 									<!-- end footer -->
89 89
 
90 90
 									<!-- TABLE BODY -->
91 91
 									<tbody>
92
-										<?php if( count( $list_data ) > 0 ) {
92
+										<?php if ( count( $list_data ) > 0 ) {
93 93
 											$i = 1;
94
-											foreach( $list_data as $list ) {
94
+											foreach ( $list_data as $list ) {
95 95
 												?>
96
-												<tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>">
96
+												<tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>">
97 97
 													<td class="column-columnname">
98
-														<a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>" class="row-title">
99
-															<?php echo stripslashes( $list['name'] ); ?>
98
+														<a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list[ 'id' ] ), admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>" class="row-title">
99
+															<?php echo stripslashes( $list[ 'name' ] ); ?>
100 100
 														</a>
101 101
 														<div class="row-actions">
102
-															<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View" , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span>
102
+															<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list[ 'id' ] ), admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View", 'yikes-inc-easy-mailchimp-extender' ); ?></a></span>
103 103
 															<?php
104 104
 																/*
105 105
 																*	Custom action to allow users to add additional action links
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 															?>
110 110
 														</div>
111 111
 													</td>
112
-													<td class="column-columnname num"><?php echo $list['stats']['member_count']; ?></td>
112
+													<td class="column-columnname num"><?php echo $list[ 'stats' ][ 'member_count' ]; ?></td>
113 113
 												</tr>
114 114
 												<?php
115 115
 												$i++;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 											} else {
118 118
 											?>
119 119
 											<tr class="no-items">
120
-												<td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php printf( __( 'No MailChimp lists found. Head over to <a href="%s" title="MailChimp.com">MailChimp.com</a> to setup your first mailing list. Once thats done you can head back here to customize it!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://mailchimp.com/' ) ); ?></em></td>
120
+												<td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php printf( __( 'No MailChimp lists found. Head over to <a href="%s" title="MailChimp.com">MailChimp.com</a> to setup your first mailing list. Once thats done you can head back here to customize it!', 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://mailchimp.com/' ) ); ?></em></td>
121 121
 											</tr>
122 122
 										<?php } ?>
123 123
 									</tbody>
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 					<div class="postbox yikes-easy-mc-postbox">
138 138
 						<div class="inside">
139 139
 
140
-							<a href="https://us3.admin.mailchimp.com/" title="<?php _e( 'MailChimp Site' , 'yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank">
141
-								<img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png'; ?>" title="<?php _e( 'MailChimp Site' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="list-page-mailchimp-logo">
140
+							<a href="https://us3.admin.mailchimp.com/" title="<?php _e( 'MailChimp Site', 'yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank">
141
+								<img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png'; ?>" title="<?php _e( 'MailChimp Site', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="list-page-mailchimp-logo">
142 142
 							</a>
143 143
 
144 144
 						</div>
@@ -148,42 +148,42 @@  discard block
 block discarded – undo
148 148
 					<div class="postbox yikes-easy-mc-postbox list-page-sidebar">
149 149
 						<div class="inside">
150 150
 
151
-							<h2 class="account-status"><?php echo $account_details['username']; ?> <small>(<?php echo $account_details['role']; ?>)</small></h2>
151
+							<h2 class="account-status"><?php echo $account_details[ 'username' ]; ?> <small>(<?php echo $account_details[ 'role' ]; ?>)</small></h2>
152 152
 
153
-							<img class="mailchimp-avatar" src="<?php echo esc_url_raw( $account_details['avatar_url'] ); ?>" title="<?php echo $account_details['username'] . ' ' . __( "MailChimp avatar" , 'yikes-inc-easy-mailchimp-extender' ); ?>">
153
+							<img class="mailchimp-avatar" src="<?php echo esc_url_raw( $account_details[ 'avatar_url' ] ); ?>" title="<?php echo $account_details[ 'username' ] . ' ' . __( "MailChimp avatar", 'yikes-inc-easy-mailchimp-extender' ); ?>">
154 154
 
155 155
 							<table class="form-table" id="account-details-table">
156 156
 								<tr valign="top">
157 157
 									<td scope="row">
158 158
 										<label for="tablecell">
159
-											<strong><?php _e( 'Company' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
159
+											<strong><?php _e( 'Company', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
160 160
 										</label>
161 161
 									</td>
162
-									<td><?php echo $account_details['contact']['company']; ?><br /><?php echo $account_details['contact']['city'] . ', ' . $account_details['contact']['state']; ?></td>
162
+									<td><?php echo $account_details[ 'contact' ][ 'company' ]; ?><br /><?php echo $account_details[ 'contact' ][ 'city' ] . ', ' . $account_details[ 'contact' ][ 'state' ]; ?></td>
163 163
 								</tr>
164 164
 								<tr valign="top">
165 165
 									<td scope="row">
166 166
 										<label for="tablecell">
167
-											<strong><?php _e( 'Industry' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
167
+											<strong><?php _e( 'Industry', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
168 168
 										</label>
169 169
 									</td>
170
-									<td><?php echo $account_details['account_industry']; ?></td>
170
+									<td><?php echo $account_details[ 'account_industry' ]; ?></td>
171 171
 								</tr>
172 172
 								<tr valign="top">
173 173
 									<td scope="row">
174 174
 										<label for="tablecell">
175
-											<strong><?php _e( 'Member Since' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
175
+											<strong><?php _e( 'Member Since', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
176 176
 										</label>
177 177
 									</td>
178
-									<td><?php echo date( get_option('date_format') , strtotime( $account_details['member_since'] ) ); ?></td>
178
+									<td><?php echo date( get_option( 'date_format' ), strtotime( $account_details[ 'member_since' ] ) ); ?></td>
179 179
 								</tr>
180 180
 								<tr valign="top">
181 181
 									<td scope="row">
182 182
 										<label for="tablecell">
183
-											<strong><?php _e( 'Plan Type' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
183
+											<strong><?php _e( 'Plan Type', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
184 184
 										</label>
185 185
 									</td>
186
-									<td><?php echo ucwords( $account_details['pricing_plan_type'] ); ?></td>
186
+									<td><?php echo ucwords( $account_details[ 'pricing_plan_type' ] ); ?></td>
187 187
 								</tr>
188 188
 							</table>
189 189
 
Please login to merge, or discard this patch.
includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
 	*	@returned_error 
123 123
 	*	@error_type - what was running when the error occured ie (new user subscription, remove user etc)
124 124
 	*/
125
-	public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) {
125
+	public function yikes_easy_mailchimp_write_to_error_log( $returned_error, $error_type, $page = '' ) {
126 126
 		
127 127
 		// confirm error logging is toggled on, else lets exit
128
-		if( get_option( 'yikes-mailchimp-debug-status' , '' )  != '1' ) {
128
+		if ( get_option( 'yikes-mailchimp-debug-status', '' ) != '1' ) {
129 129
 			return;
130 130
 		}
131 131
 		
@@ -171,12 +171,12 @@  discard block
 block discarded – undo
171 171
 	public function yikes_easy_mailchimp_generate_error_log_table() {		
172 172
 
173 173
 		// ensure file_get_contents exists
174
-		if( function_exists( 'file_get_contents' ) ) {	
174
+		if ( function_exists( 'file_get_contents' ) ) {	
175 175
 			// confirm that our file exists
176
-			if( file_exists( $this->error_log_file_path ) ) {
176
+			if ( file_exists( $this->error_log_file_path ) ) {
177 177
 				$error_log_contents = file_get_contents( $this->error_log_file_path, true );							
178
-				if( $error_log_contents === FALSE ) {
179
-					return _e( 'File get contents not available' , 'yikes-inc-easy-mailchimp-extender' );
178
+				if ( $error_log_contents === FALSE ) {
179
+					return _e( 'File get contents not available', 'yikes-inc-easy-mailchimp-extender' );
180 180
 				}
181 181
 				if ( $error_log_contents != '' ) {
182 182
 					// return $error_log_contents;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 						<tr class="error-log-tr">
188 188
 							<td class="row-title colspanchange" colspan="2">
189 189
 								<strong><span class='dashicons dashicons-no-alt'></span> <?php _e( 'No errors logged.', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
190
-								<?php if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '' ) { ?>
190
+								<?php if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '' ) { ?>
191 191
 									<br />
192 192
 									<p class="to-start-logging-errors-notice"><em><?php _e( "To start logging errors toggle on the 'Enable Debugging' option above.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
193 193
 								<?php } ?>
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 									);
216 216
 									?>
217 217
 									<form id="create-error-log" method="POST" action="<?php echo $url; ?>">
218
-										<?php submit_button( __( 'Attempt to Create Error Log' , 'yikes-inc-easy-mailchimp-extender' ) , 'secondary' , '' , '' , array() ); ?>
218
+										<?php submit_button( __( 'Attempt to Create Error Log', 'yikes-inc-easy-mailchimp-extender' ), 'secondary', '', '', array() ); ?>
219 219
 									</form>
220 220
 									
221 221
 								</p>
Please login to merge, or discard this patch.
Braces   +22 added lines, -21 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_Error_Logging {
28
+class Yikes_Inc_Easy_Mailchimp_Error_Logging {
29 29
 
30 30
 	/**
31 31
 	 * Whether we're doing debugging.
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 *
58 58
 	 * @since    1.0.0
59 59
 	 */
60
-	public function __construct() {
60
+	public function __construct() {
61 61
 		$this->is_debugging          = WP_DEBUG || (string) get_option( 'yikes-mailchimp-debug-status', '' ) === '1';
62 62
 		$this->error_log_file_path   = $this->get_error_log_file_path();
63 63
 		$this->error_log_folder_path = $this->get_error_log_folder();
@@ -78,35 +78,35 @@  discard block
 block discarded – undo
78 78
 	 * @param string $error_type     The error type.
79 79
 	 * @param string $page           The page information.
80 80
 	 */
81
-	public function maybe_write_to_log( $returned_error, $error_type, $page = '' ) {
82
-		if ( ! $this->is_debugging ) {
81
+	public function maybe_write_to_log( $returned_error, $error_type, $page = '' ) {
82
+		if ( ! $this->is_debugging ) {
83 83
 			return;
84 84
 		}
85 85
 
86 86
 		$this->yikes_easy_mailchimp_write_to_error_log( $returned_error, $error_type, $page );
87 87
 	}
88 88
 
89
-	public function create_error_log_folder() {
89
+	public function create_error_log_folder() {
90 90
 
91 91
 		// If our directory doesn't exist, make it.
92
-		if ( ! file_exists( $this->get_error_log_folder() ) ) {
92
+		if ( ! file_exists( $this->get_error_log_folder() ) ) {
93 93
 			mkdir( $this->get_error_log_folder() );
94 94
 		}
95 95
 	}
96 96
 
97
-	public function create_error_log_file() {
97
+	public function create_error_log_file() {
98 98
 
99 99
 		// If our error log doesn't exist, make it.
100
-		if ( ! file_exists( $this->error_log_file_path ) ) {
100
+		if ( ! file_exists( $this->error_log_file_path ) ) {
101 101
 			file_put_contents( $this->error_log_file_path, '' );
102 102
 		}
103 103
 	}
104 104
 
105
-	private function get_error_log_folder() {
105
+	private function get_error_log_folder() {
106 106
 		return WP_CONTENT_DIR . '/uploads/yikes-log/';
107 107
 	}
108 108
 
109
-	private function get_error_log_file_path() {
109
+	private function get_error_log_file_path() {
110 110
 		return WP_CONTENT_DIR . '/uploads/yikes-log/yikes-easy-mailchimp-error-log.txt';
111 111
 	}
112 112
 	
@@ -122,17 +122,17 @@  discard block
 block discarded – undo
122 122
 	*	@returned_error 
123 123
 	*	@error_type - what was running when the error occured ie (new user subscription, remove user etc)
124 124
 	*/
125
-	public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) {
125
+	public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) {
126 126
 		
127 127
 		// confirm error logging is toggled on, else lets exit
128
-		if( get_option( 'yikes-mailchimp-debug-status' , '' )  != '1' ) {
128
+		if( get_option( 'yikes-mailchimp-debug-status' , '' )  != '1' ) {
129 129
 			return;
130 130
 		}
131 131
 		
132 132
 		$contents = file_get_contents( $this->error_log_file_path, true );
133 133
 		
134 134
 		// if we pass in a custom page, don't set things up
135
-		if ( empty( $page ) ) {
135
+		if ( empty( $page ) ) {
136 136
 
137 137
 			// get the current page, admin or front end?
138 138
 			$page = is_admin() ? __( 'Admin', 'yikes-inc-easy-mailchimp-extender' ) : __( 'Front End', 'yikes-inc-easy-mailchimp-extender' );
@@ -168,20 +168,20 @@  discard block
 block discarded – undo
168 168
 	*
169 169
 	*  @since 5.6
170 170
 	*/	
171
-	public function yikes_easy_mailchimp_generate_error_log_table() {		
171
+	public function yikes_easy_mailchimp_generate_error_log_table() {
172 172
 
173 173
 		// ensure file_get_contents exists
174
-		if( function_exists( 'file_get_contents' ) ) {	
174
+		if( function_exists( 'file_get_contents' ) ) {
175 175
 			// confirm that our file exists
176
-			if( file_exists( $this->error_log_file_path ) ) {
176
+			if( file_exists( $this->error_log_file_path ) ) {
177 177
 				$error_log_contents = file_get_contents( $this->error_log_file_path, true );							
178
-				if( $error_log_contents === FALSE ) {
178
+				if( $error_log_contents === FALSE ) {
179 179
 					return _e( 'File get contents not available' , 'yikes-inc-easy-mailchimp-extender' );
180 180
 				}
181
-				if ( $error_log_contents != '' ) {
181
+				if ( $error_log_contents != '' ) {
182 182
 					// return $error_log_contents;
183 183
 					print_r( $error_log_contents );
184
-				} else {
184
+				} else {
185 185
 					?>
186 186
 						<!-- table body -->
187 187
 						<tr class="error-log-tr">
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 						</tr>
196 196
 					<?php
197 197
 				}
198
-			} else {
198
+			} else {
199 199
 				?>
200 200
 						<!-- table body -->
201 201
 						<tr class="error-log-tr">
@@ -223,7 +223,8 @@  discard block
 block discarded – undo
223 223
 						</tr>
224 224
 					<?php
225 225
 			}
226
-		} else { // if file_get_contents is disabled server side
226
+		} else {
227
+// if file_get_contents is disabled server side
227 228
 			?>
228 229
 				<!-- table body -->
229 230
 				<tr>
Please login to merge, or discard this patch.
admin/partials/menu/options-sections/integration-settings.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -54,23 +54,23 @@  discard block
 block discarded – undo
54 54
 
55 55
 	// Easy Digital Downloads.
56 56
 	if ( class_exists( 'Easy_Digital_Downloads' ) ) {
57
-		$active_plugins['easy_digital_downloads_checkout_form'] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' );
57
+		$active_plugins[ 'easy_digital_downloads_checkout_form' ] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' );
58 58
 	}
59 59
 	// WooCommerce.
60 60
 	if ( class_exists( 'WooCommerce' ) ) {
61
-		$active_plugins['woocommerce_checkout_form'] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' );
61
+		$active_plugins[ 'woocommerce_checkout_form' ] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' );
62 62
 	}
63 63
 	// BuddyPress.
64 64
 	if ( class_exists( 'BuddyPress' ) ) {
65
-		$active_plugins['buddypress_form'] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' );
65
+		$active_plugins[ 'buddypress_form' ] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' );
66 66
 	}
67 67
 	// bbPress.
68 68
 	if ( class_exists( 'bbPress' ) ) {
69
-		$active_plugins['bbpress_forms'] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' );
69
+		$active_plugins[ 'bbpress_forms' ] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' );
70 70
 	}
71 71
 	// Contact Form 7.
72 72
 	if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
73
-		$active_plugins['contact_form_7'] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' );
73
+		$active_plugins[ 'contact_form_7' ] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' );
74 74
 	}
75 75
 
76 76
 	// store our checkbox options.
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
88 88
 			$error_logging->maybe_write_to_log(
89 89
 				$list_data->get_error_code(),
90
-				__( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ),
90
+				__( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
91 91
 				"Integration Settings Page"
92 92
 			);
93 93
 		}
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
 		<?php
119 119
 			if ( ! empty( $active_plugins ) ) {
120 120
 
121
-				foreach( $active_plugins as $class => $value ) {
121
+				foreach ( $active_plugins as $class => $value ) {
122 122
 
123
-					$checked              = isset( $options[$class]['value'] ) ? 'checked="checked"' : '';
124
-					$hidden               = ! isset( $options[$class]['value'] ) ? 'yikes-easy-mc-hidden' : '';
125
-					$checkbox_label       = isset( $options[$class]['label'] ) ? esc_attr( $options[$class]['label'] ) : '';
126
-					$precheck_checkbox    = isset( $options[$class]['precheck'] ) ? $options[$class]['precheck'] : '';
127
-					$selected_list        = isset( $options[$class]['associated-list'] ) ? $options[$class]['associated-list'] : '-';
128
-					$list_interest_groups = isset( $options[$class]['interest-groups'] ) ? $options[$class]['interest-groups'] : false;
123
+					$checked              = isset( $options[ $class ][ 'value' ] ) ? 'checked="checked"' : '';
124
+					$hidden               = ! isset( $options[ $class ][ 'value' ] ) ? 'yikes-easy-mc-hidden' : '';
125
+					$checkbox_label       = isset( $options[ $class ][ 'label' ] ) ? esc_attr( $options[ $class ][ 'label' ] ) : '';
126
+					$precheck_checkbox    = isset( $options[ $class ][ 'precheck' ] ) ? $options[ $class ][ 'precheck' ] : '';
127
+					$selected_list        = isset( $options[ $class ][ 'associated-list' ] ) ? $options[ $class ][ 'associated-list' ] : '-';
128
+					$list_interest_groups = isset( $options[ $class ][ 'interest-groups' ] ) ? $options[ $class ][ 'interest-groups' ] : false;
129 129
 
130 130
 					// Force the selected list to be an array (@since 6.4).
131 131
 					$selected_list        = is_array( $selected_list ) ? $selected_list : array( $selected_list );
132 132
 					?>
133 133
 						<li class="yikes-mailchimp-checkbox-integration-item">
134 134
 							<label>
135
-								<input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[$class]; ?></div>
135
+								<input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[ $class ]; ?></div>
136 136
 							</label>
137 137
 						</li>
138 138
 						<!-- checkbox settings, text - associated list etc. -->
139 139
 						<li class="optin-checkbox-init[<?php echo $class; ?>]-settings <?php echo $hidden; ?>">
140
-							<?php if( $class == 'contact_form_7' ) { ?>
140
+							<?php if ( $class == 'contact_form_7' ) { ?>
141 141
 								<p style="margin-top:0;"><small class="contact-form-7-notice"><?php printf( __( 'Use %s in Contact Form 7 to display the checkbox.', 'yikes-inc-easy-mailchimp-extender' ), '<code>[yikes_mailchimp_checkbox]</code>' ); ?></small></p>
142 142
 							<?php } ?>
143 143
 							<p style="margin-top:0;padding-top:0;margin-bottom:0;padding-bottom:0;">
@@ -147,24 +147,24 @@  discard block
 block discarded – undo
147 147
 									<?php
148 148
 									if ( count( $list_data ) > 0 ) {
149 149
 									?>
150
-										<?php foreach( $list_data as $list ) { ?>
150
+										<?php foreach ( $list_data as $list ) { ?>
151 151
 
152 152
 											<?php
153
-												$list_interest_groups = isset( $list_interest_groups[ $list['id'] ] ) ? $list_interest_groups[ $list['id'] ] : $list_interest_groups;
153
+												$list_interest_groups = isset( $list_interest_groups[ $list[ 'id' ] ] ) ? $list_interest_groups[ $list[ 'id' ] ] : $list_interest_groups;
154 154
 											?>
155 155
 
156
-											<label class="yikes-mailchimp-checkbox-integration-list" for="list-<?php echo $class ?>-<?php echo $list['id']; ?>">
156
+											<label class="yikes-mailchimp-checkbox-integration-list" for="list-<?php echo $class ?>-<?php echo $list[ 'id' ]; ?>">
157 157
 												<input type="checkbox" class="checkbox-settings-list-item" data-integration="<?php echo $class; ?>" 
158 158
 													name="optin-checkbox-init[<?php echo $class; ?>][associated-list][]"
159
-													value="<?php echo $list['id']; ?>" <?php echo in_array( $list['id'], $selected_list ) ? 'checked="checked"' : ''; ?> 
160
-													id="list-<?php echo $class ?>-<?php echo $list['id']; ?>">
161
-												<?php echo $list['name']; ?>
159
+													value="<?php echo $list[ 'id' ]; ?>" <?php echo in_array( $list[ 'id' ], $selected_list ) ? 'checked="checked"' : ''; ?> 
160
+													id="list-<?php echo $class ?>-<?php echo $list[ 'id' ]; ?>">
161
+												<?php echo $list[ 'name' ]; ?>
162 162
 											</label>
163 163
 
164 164
 											<!-- If interest groups have been selected already, load them here -->
165 165
 											<?php
166
-											if ( in_array( $list['id'], $selected_list ) && $list_interest_groups ) {
167
-												YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list['id'], $class, true );
166
+											if ( in_array( $list[ 'id' ], $selected_list ) && $list_interest_groups ) {
167
+												YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list[ 'id' ], $class, true );
168 168
 											}
169 169
 											?>
170 170
 
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 								<label class="optin-checkbox-label">
186 186
 									<strong><?php _e( 'Precheck Checkbox?', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
187 187
 									<select id="optin-checkbox-init[<?php echo $class; ?>][precheck]" name="optin-checkbox-init[<?php echo $class; ?>][precheck]" class="optin-checkbox-init[<?php echo $class; ?>][precheck] checkbox-settings-list-dropdown">
188
-										<option value="true" <?php selected( $precheck_checkbox , 'true' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
189
-										<option value="false" <?php selected( $precheck_checkbox , 'false' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
188
+										<option value="true" <?php selected( $precheck_checkbox, 'true' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
189
+										<option value="false" <?php selected( $precheck_checkbox, 'false' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
190 190
 									</select>
191 191
 								</label>
192 192
 							</p>
Please login to merge, or discard this patch.
Braces   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -53,23 +53,23 @@  discard block
 block discarded – undo
53 53
 	);
54 54
 
55 55
 	// Easy Digital Downloads.
56
-	if ( class_exists( 'Easy_Digital_Downloads' ) ) {
56
+	if ( class_exists( 'Easy_Digital_Downloads' ) ) {
57 57
 		$active_plugins['easy_digital_downloads_checkout_form'] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' );
58 58
 	}
59 59
 	// WooCommerce.
60
-	if ( class_exists( 'WooCommerce' ) ) {
60
+	if ( class_exists( 'WooCommerce' ) ) {
61 61
 		$active_plugins['woocommerce_checkout_form'] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' );
62 62
 	}
63 63
 	// BuddyPress.
64
-	if ( class_exists( 'BuddyPress' ) ) {
64
+	if ( class_exists( 'BuddyPress' ) ) {
65 65
 		$active_plugins['buddypress_form'] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' );
66 66
 	}
67 67
 	// bbPress.
68
-	if ( class_exists( 'bbPress' ) ) {
68
+	if ( class_exists( 'bbPress' ) ) {
69 69
 		$active_plugins['bbpress_forms'] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' );
70 70
 	}
71 71
 	// Contact Form 7.
72
-	if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
72
+	if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
73 73
 		$active_plugins['contact_form_7'] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' );
74 74
 	}
75 75
 
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 
82 82
 	<?php
83 83
 	// lets confirm the user has a valid API key stored.
84
-	if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
84
+	if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
85 85
 		$list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists();
86
-		if ( is_wp_error( $list_data ) ) {
86
+		if ( is_wp_error( $list_data ) ) {
87 87
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
88 88
 			$error_logging->maybe_write_to_log(
89 89
 				$list_data->get_error_code(),
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 				"Integration Settings Page"
92 92
 			);
93 93
 		}
94
-	} else {
94
+	} else {
95 95
 		?>
96 96
 		<div class="inside">
97 97
 			<?php
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
 	<ul>
118 118
 		<?php
119
-			if ( ! empty( $active_plugins ) ) {
119
+			if ( ! empty( $active_plugins ) ) {
120 120
 
121
-				foreach( $active_plugins as $class => $value ) {
121
+				foreach( $active_plugins as $class => $value ) {
122 122
 
123 123
 					$checked              = isset( $options[$class]['value'] ) ? 'checked="checked"' : '';
124 124
 					$hidden               = ! isset( $options[$class]['value'] ) ? 'yikes-easy-mc-hidden' : '';
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 								<!-- Associated Lists -->
146 146
 								<div class="checkbox-lists"><strong><?php _e( 'Choose Lists: ', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
147 147
 									<?php
148
-									if ( count( $list_data ) > 0 ) {
148
+									if ( count( $list_data ) > 0 ) {
149 149
 									?>
150 150
 										<?php foreach( $list_data as $list ) { ?>
151 151
 
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 
164 164
 											<!-- If interest groups have been selected already, load them here -->
165 165
 											<?php
166
-											if ( in_array( $list['id'], $selected_list ) && $list_interest_groups ) {
166
+											if ( in_array( $list['id'], $selected_list ) && $list_interest_groups ) {
167 167
 												YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list['id'], $class, true );
168 168
 											}
169 169
 											?>
170 170
 
171 171
 										<?php } ?>
172 172
 									<?php
173
-								} else {
173
+								} else {
174 174
 									echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. Head over to MailChimp and setup your first list.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>';
175 175
 								}
176 176
 								?>
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 						</li>
194 194
 					<?php
195 195
 			}
196
-		} else {
196
+		} else {
197 197
 			?>
198 198
 				<li>
199 199
 					<?php _e( 'Nothing is active.', 'yikes-inc-easy-mailchimp-extender' ); ?>
Please login to merge, or discard this patch.