Completed
Push — staging ( 288ed8...5eea33 )
by Evan
18:56 queued 01:06
created
admin/class-yikes-inc-easy-mailchimp-extender-admin.php 1 patch
Spacing   +551 added lines, -551 removed lines patch added patch discarded remove patch
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
 		$this->yikes_inc_easy_mailchimp_extender = $yikes_inc_easy_mailchimp_extender;
39 39
 		$this->version = $version;
40 40
 		// check for old plugin options and migrate if exist
41
-		add_action( 'admin_menu' , array( $this , 'register_admin_pages' ) , 11 );
41
+		add_action( 'admin_menu', array( $this, 'register_admin_pages' ), 11 );
42 42
 		// check for old plugin options and migrate if exist
43
-		add_action( 'admin_init' , array( $this , 'check_for_old_yks_mc_options' ) );
43
+		add_action( 'admin_init', array( $this, 'check_for_old_yks_mc_options' ) );
44 44
 		// Ajax function to update new options...
45
-		add_action( 'wp_ajax_migrate_old_plugin_settings', array( $this , 'migrate_archived_options' ) );
45
+		add_action( 'wp_ajax_migrate_old_plugin_settings', array( $this, 'migrate_archived_options' ) );
46 46
 		// Ajax function to migrate our forms
47
-		add_action( 'wp_ajax_migrate_prevoious_forms', array( $this , 'migrate_previously_setup_forms' ) );
47
+		add_action( 'wp_ajax_migrate_prevoious_forms', array( $this, 'migrate_previously_setup_forms' ) );
48 48
 		// fix menu icon spacing
49
-		add_action( 'admin_head' , array( $this , 'fix_menu_icon_spacing' ) );
49
+		add_action( 'admin_head', array( $this, 'fix_menu_icon_spacing' ) );
50 50
 		// register our plugin settings
51
-		add_action( 'admin_init', array( $this , 'yikes_easy_mc_settings_init' ) );
51
+		add_action( 'admin_init', array( $this, 'yikes_easy_mc_settings_init' ) );
52 52
 		// plugin redirect on activation
53
-		add_action( 'admin_init' , array( $this , 'yikes_easy_mc_activation_redirect' ) );
53
+		add_action( 'admin_init', array( $this, 'yikes_easy_mc_activation_redirect' ) );
54 54
 		// Include Third Party Extensions
55 55
 		include_once( YIKES_MC_PATH . 'includes/third-party-integrations/third-party-init.php' );
56 56
 		// Include our dashboard widget class
@@ -60,111 +60,111 @@  discard block
 block discarded – undo
60 60
 		// Include our ajax processing class
61 61
 		include_once( YIKES_MC_PATH . 'admin/partials/ajax/class.ajax.php' );
62 62
 		// load up our helper class
63
-		add_action( 'admin_init' , array( $this , 'yikes_mailchimp_load_helper_class' ) );
63
+		add_action( 'admin_init', array( $this, 'yikes_mailchimp_load_helper_class' ) );
64 64
 		// process the subscriber count shortcode in form descriptions
65 65
 		add_action( 'yikes-mailchimp-form-description', array( $this, 'process_subscriber_count_shortcode_in_form_descriptions' ), 10, 2 );
66 66
 		/***********************/
67 67
 		/** Create A Form **/
68 68
 		/**********************/
69 69
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-form' ) {
70
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_create_form' ) );
70
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
71 71
 		}
72 72
 		/***********************/
73 73
 		/** Delete A Form **/
74 74
 		/**********************/
75 75
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-delete-form' ) {
76
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_delete_form' ) );
76
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
77 77
 		}
78 78
 		/**********************************/
79 79
 		/** Duplicate/Clone A Form 	**/
80 80
 		/********************************/
81 81
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-duplicate-form' ) {
82
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_duplicate_form' ) );
82
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
83 83
 		}
84 84
 		/*************************************/
85 85
 		/**  Reset Form Impression Stats **/
86 86
 		/***********************************/
87 87
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-reset-stats' ) {
88
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_reset_impression_stats' ) );
88
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
89 89
 		}
90 90
 		/**********************************/
91 91
 		/** 	     Update A Form 		**/
92 92
 		/********************************/
93 93
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-update-form' ) {
94
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_update_form' ) );
94
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
95 95
 		}
96 96
 		/**************************************************/
97 97
 		/** 	 Clear Store MailChimp Transient Data   **/
98 98
 		/*************************************************/
99 99
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-transient-data' ) {
100
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_clear_transient_data' ) );
100
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
101 101
 		}
102 102
 		/*******************************************/
103 103
 		/** Remove a user from a mailing list 	 **/
104 104
 		/*****************************************/
105 105
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-unsubscribe-user' ) {
106
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_unsubscribe_user' ) );
106
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
107 107
 		}
108 108
 		/*******************************************/
109 109
 		/** 	Create misisng error log file  **/
110 110
 		/*****************************************/
111 111
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-error-log' ) {
112
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_create_missing_error_log' ) );
112
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
113 113
 		}
114 114
 		/*******************************************/
115 115
 		/**   TinyMCE Initialization Functions	 **/
116 116
 		/*****************************************/
117
-		add_action( 'admin_head' , array( $this, 'add_tinyMCE_buttons' ) );
117
+		add_action( 'admin_head', array( $this, 'add_tinyMCE_buttons' ) );
118 118
 		// pass our lists data to tinyMCE button for use
119
-		foreach ( array('post.php','post-new.php') as $hook ) {
119
+		foreach ( array( 'post.php', 'post-new.php' ) as $hook ) {
120 120
 			add_action( "admin_head-$hook", array( $this, 'tinymce_yikes_easy_mc' ) );
121 121
 		}
122 122
 		// display an admin notice for users on PHP < 5.3
123
-		if( phpversion() < '5.3' ) {
123
+		if ( phpversion() < '5.3' ) {
124 124
 			add_action( "admin_notices", array( $this, 'display_php_warning' ), 999 );
125 125
 		}
126 126
 		// two week , dismissable notification - check the users plugin installation date
127
-		add_action( 'admin_init', array( $this , 'yikes_easy_mailchimp_check_installation_date' ) );
127
+		add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_check_installation_date' ) );
128 128
 		// dismissable notice admin side
129
-		add_action( 'admin_init', array( $this , 'yikes_easy_mailchimp_stop_bugging_me' ), 5 );
129
+		add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_stop_bugging_me' ), 5 );
130 130
 		/**************************************************/
131 131
 		/** 	 	Clear MailChimp Error Log Data 	    **/
132 132
 		/*************************************************/
133 133
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-error-log' ) {
134
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_clear_error_log' ) );
134
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
135 135
 		}
136 136
 		/*********************************************/
137 137
 		/** 		Export MailChimp Opt-in Forms   **/
138 138
 		/*******************************************/
139 139
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-forms' ) {
140
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_export_forms' ) );
140
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
141 141
 		}
142 142
 		/*********************************************/
143 143
 		/** 				Export Plugin Settings    	   **/
144 144
 		/*******************************************/
145 145
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-settings' ) {
146
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_export_plugin_settings' ) );
146
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
147 147
 		}
148 148
 		/*******************************************/
149 149
 		/** 		Import Class Inclusion	   **/
150 150
 		/*****************************************/
151 151
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) {
152
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_import_forms' ) );
152
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
153 153
 		}
154 154
 		/*******************************************/
155 155
 		/** 	Premium Support Request     **/
156 156
 		/*****************************************/
157 157
 		if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) {
158
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_premium_support_request' ) );
158
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
159 159
 		}
160 160
 		/****************************************/
161 161
 		/**	Dismiss Options Migrations		**/
162 162
 		/****************************************/
163
-		if( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
164
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
163
+		if ( isset( $_REQUEST[ 'dismiss_migration_nonce' ] ) ) {
164
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
165 165
 		}
166 166
 		/** Parse default value into usable dynamic data **/
167
-		add_filter( 'yikes-mailchimp-process-default-tag' , array( $this , 'parse_mailchimp_default_tag' ) );
167
+		add_filter( 'yikes-mailchimp-process-default-tag', array( $this, 'parse_mailchimp_default_tag' ) );
168 168
 		/** Add a disclaimer to ensure that we let people know we are not endorsed/backed by MailChimp at all **/
169 169
 		add_filter( 'admin_footer_text', array( $this, 'yikes_easy_forms_admin_disclaimer' ) );
170 170
 		/** Add custom plugin action links **/
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 		*	@ return	array	$links		New array of plugin actions
185 185
 		*/
186 186
 		public function easy_forms_plugin_action_links( $links ) {
187
-		   $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
188
-		   $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' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
187
+		   $links[ ] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) . '">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
188
+		   $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', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
189 189
 		   return $links;
190 190
 		}
191 191
 
@@ -218,29 +218,29 @@  discard block
 block discarded – undo
218 218
 		*	@return	parsed tag content
219 219
 		*/
220 220
 		public function parse_mailchimp_default_tag( $default_tag ) {
221
-			if( ! $default_tag || $default_tag == '' ) {
221
+			if ( ! $default_tag || $default_tag == '' ) {
222 222
 				return $default_tag;
223 223
 			}
224 224
 			global $post;
225 225
 			// page title
226
-			if( $default_tag == '{page_title}' ) {
226
+			if ( $default_tag == '{page_title}' ) {
227 227
 				$default_tag = get_the_title( $post->ID );
228 228
 			}
229 229
 			// page id
230
-			if( $default_tag == '{page_title}' ) {
230
+			if ( $default_tag == '{page_title}' ) {
231 231
 				$default_tag = $post->ID;
232 232
 			}
233 233
 			// page url
234
-			if( $default_tag == '{page_url}' ) {
234
+			if ( $default_tag == '{page_url}' ) {
235 235
 				$default_tag = get_permalink( $post->ID );
236 236
 			}
237 237
 			// blog name
238
-			if( $default_tag == '{blog_name}' ) {
238
+			if ( $default_tag == '{blog_name}' ) {
239 239
 				$default_tag = get_bloginfo( 'name' );
240 240
 			}
241 241
 			// is user logged in
242
-			if( $default_tag == '{user_logged_in}' ) {
243
-				if( is_user_logged_in() ) {
242
+			if ( $default_tag == '{user_logged_in}' ) {
243
+				if ( is_user_logged_in() ) {
244 244
 					$default_tag = 'Registered User';
245 245
 				} else {
246 246
 					$default_tag = 'Guest User';
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
 		*/
259 259
 		public function yikes_easy_mailchimp_clear_error_log() {
260 260
 			// file put contents $returned error + other data
261
-			if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
261
+			if ( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
262 262
 				$clear_log = file_put_contents(
263 263
 					YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php',
264 264
 					''
265 265
 				);
266
-				if( $clear_log === false ) {
266
+				if ( $clear_log === false ) {
267 267
 					// redirect the user to the manage forms page, display error message
268 268
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error-log-cleared=false' ) ) );
269 269
 				} else {
@@ -281,20 +281,20 @@  discard block
 block discarded – undo
281 281
 		*/
282 282
 		public function yikes_easy_mailchimp_export_forms() {
283 283
 			// grab our nonce
284
-			$nonce = $_REQUEST['nonce'];
284
+			$nonce = $_REQUEST[ 'nonce' ];
285 285
 			// grab the forms
286
-			$forms = isset( $_REQUEST['export_forms'] ) ? $_REQUEST['export_forms'] : 'all';
286
+			$forms = isset( $_REQUEST[ 'export_forms' ] ) ? $_REQUEST[ 'export_forms' ] : 'all';
287 287
 			// validate nonce
288
-			if( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
289
-				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 ) );
288
+			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
289
+				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 ) );
290 290
 			}
291 291
 			// include the export class
292
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
292
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
293 293
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-export.class.php' );
294 294
 			}
295 295
 			// run the export function
296 296
 			// parameters: ( $table_name, $form_ids, $file_name )
297
-			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'yikes_easy_mc_forms' , $forms, 'Yikes-Inc-Easy-MailChimp-Forms-Export' );
297
+			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'yikes_easy_mc_forms', $forms, 'Yikes-Inc-Easy-MailChimp-Forms-Export' );
298 298
 			// re-direct the user back to the page
299 299
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) );
300 300
 			die();
@@ -308,13 +308,13 @@  discard block
 block discarded – undo
308 308
 		*/
309 309
 		public function yikes_easy_mailchimp_export_plugin_settings() {
310 310
 			// grab our nonce
311
-			$nonce = $_REQUEST['nonce'];
311
+			$nonce = $_REQUEST[ 'nonce' ];
312 312
 			// validate nonce
313
-			if( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
314
-				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 ) );
313
+			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
314
+				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 ) );
315 315
 			}
316 316
 			// include the export class
317
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
317
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
318 318
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-export.class.php' );
319 319
 			}
320 320
 			// run the export function
@@ -331,13 +331,13 @@  discard block
 block discarded – undo
331 331
 		*/
332 332
 		public function yikes_easy_mailchimp_import_forms() {
333 333
 			// grab our nonce
334
-			$nonce = $_REQUEST['nonce'];
334
+			$nonce = $_REQUEST[ 'nonce' ];
335 335
 			// validate nonce
336
-			if( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
337
-				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 ) );
336
+			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
337
+				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 ) );
338 338
 			}
339 339
 			// include the export class
340
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
340
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
341 341
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-import.class.php' );
342 342
 			}
343 343
 			// run the import function
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 		*/
356 356
 		public function yikes_easy_mailchimp_premium_support_request() {
357 357
 
358
-			if( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
359
-				return __( 'We encountered an error. Please contact the YIKES Inc. support team.' , 'yikes-inc-easy-mailchimp-extender' );
358
+			if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] != 'yikes-support-request' ) {
359
+				return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' );
360 360
 			}
361 361
 
362
-			$license = $_POST['license_key'];
363
-			$user_email = $_POST['user-email'];
364
-			$support_topic = $_POST['support-topic'];
365
-			$support_priority = $_POST['support-priority'];
366
-			$support_content = $_POST['support-content'];
362
+			$license = $_POST[ 'license_key' ];
363
+			$user_email = $_POST[ 'user-email' ];
364
+			$support_topic = $_POST[ 'support-topic' ];
365
+			$support_priority = $_POST[ 'support-priority' ];
366
+			$support_content = $_POST[ 'support-content' ];
367 367
 
368 368
 			// wp_die( print_r( $support_content) );
369 369
 
@@ -379,18 +379,18 @@  discard block
 block discarded – undo
379 379
 
380 380
 			$yikes_plugin_support_url = 'https://yikesplugins.com';
381 381
 
382
-			if( $license != 'plugin-core' ) {
382
+			if ( $license != 'plugin-core' ) {
383 383
 				$split_license = explode( '|', $license );
384 384
 				// first let's check that the license key is actually active
385 385
 				$is_license_key_active = wp_remote_post( esc_url( $yikes_plugin_support_url ), array(
386 386
 					'action' => 'check_license',
387
-					'product_name' => urlencode( str_replace( '-', '', $split_license[1] ) . 'for Easy MailChimp' ),
388
-					'license' => $split_license[0],
387
+					'product_name' => urlencode( str_replace( '-', '', $split_license[ 1 ] ) . 'for Easy MailChimp' ),
388
+					'license' => $split_license[ 0 ],
389 389
 				) );
390 390
 
391
-				$response_body =  wp_remote_retrieve_body( $is_license_key_active );
392
-				if( $response_body ) {
393
-					if( $response_body->status != 'valid' ) {
391
+				$response_body = wp_remote_retrieve_body( $is_license_key_active );
392
+				if ( $response_body ) {
393
+					if ( $response_body->status != 'valid' ) {
394 394
 						wp_die( 'Invalid License Key...' );
395 395
 					}
396 396
 				}
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 			) );
405 405
 
406 406
 			// catch the error
407
-			if( is_wp_error( $response ) ) {
407
+			if ( is_wp_error( $response ) ) {
408 408
 				wp_die( $create_ticket_request->getMessage() );
409 409
 				return;
410 410
 			}
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			$create_ticket_response = wp_remote_retrieve_body( $response );
414 414
 
415 415
 			// display it
416
-			if( $create_ticket_response )
416
+			if ( $create_ticket_response )
417 417
 				echo $create_ticket_response;
418 418
 
419 419
 		}
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 			// delete the options and allow the user to manually updadte things
428 428
 
429 429
 			// Verify the NONCE is valid
430
-			check_admin_referer( 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' );
430
+			check_admin_referer( 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' );
431 431
 
432 432
 			// re-direct the user back to the page
433 433
 			wp_redirect( esc_url_raw( admin_url( 'index.php?yikes-mc-options-migration-dismissed="true"' ) ) );
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 		 * @since 6.0.0
443 443
 		 */
444 444
 		public function load_error_logging_class() {
445
-			if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
445
+			if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
446 446
 				// if error logging is enabled we should include our error logging class
447 447
 				/* Generate oure error logging table */
448 448
 				require_once YIKES_MC_PATH . '/includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
@@ -461,17 +461,17 @@  discard block
 block discarded – undo
461 461
 			// add a new option to store the plugin activation date/time
462 462
 			// @since v6.0.0
463 463
 			// this is used to notify the user that they should review after 2 weeks
464
-			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
464
+			if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
465 465
 				add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) );
466 466
 			}
467 467
 
468 468
 			$stop_bugging_me = get_option( 'yikes_easy_mailchimp_review_stop_bugging_me' );
469 469
 
470
-			if( !$stop_bugging_me ) {
470
+			if ( ! $stop_bugging_me ) {
471 471
 				$install_date = get_option( 'yikes_easy_mailchimp_activation_date' );
472 472
 				$past_date = strtotime( '-14 days' );
473 473
 				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
474
-					add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) );
474
+					add_action( 'admin_notices', array( $this, 'yikes_easy_mailchimp_display_review_us_notice' ) );
475 475
 				}
476 476
 			}
477 477
 
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 		*/
485 485
 		public function yikes_easy_mailchimp_display_review_us_notice() {
486 486
 			/* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
487
-			if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
487
+			if ( in_array( get_current_screen()->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base, 'yikes-inc-easy-mailchimp' ) !== false ) {
488 488
 				// Review URL - Change to the URL of your plugin on WordPress.org
489 489
 				$reviewurl = 'https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender';
490 490
 				$addons_url = esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) );
@@ -493,11 +493,11 @@  discard block
 block discarded – undo
493 493
 				get_currentuserinfo();
494 494
 				if ( isset( $current_user->user_firstname ) && '' != $current_user->user_firstname ) {
495 495
 					$review_message = '<div id="yikes-mailchimp-logo"></div>';
496
-						$review_message .= sprintf( __( "Hi, %s, you've been using %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 provide us with feedback to grow and improve the plugin. 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' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", $current_user->user_firstname, '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl );
496
+						$review_message .= sprintf( __( "Hi, %s, you've been using %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 provide us with feedback to grow and improve the plugin. 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' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review", 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons", 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss", 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", $current_user->user_firstname, '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl );
497 497
 					$review_message .= '';
498 498
 				} else {
499 499
 					$review_message = '<div id="yikes-mailchimp-logo"></div>';
500
-					$review_message .= sprintf( __( "It looks like you've been using %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' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl ) . '';
500
+					$review_message .= sprintf( __( "It looks like you've been using %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' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review", 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons", 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss", 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl ) . '';
501 501
 				}
502 502
 				?>
503 503
 					<div id="review-yikes-easy-mailchimp-notice">
@@ -514,8 +514,8 @@  discard block
 block discarded – undo
514 514
 		*/
515 515
 		public function yikes_easy_mailchimp_stop_bugging_me() {
516 516
 			$nobug = "";
517
-			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) ) {
518
-				$nobug = (int) esc_attr( $_GET['yikes_easy_mc_icons_nobug'] );
517
+			if ( isset( $_GET[ 'yikes_easy_mc_icons_nobug' ] ) ) {
518
+				$nobug = (int) esc_attr( $_GET[ 'yikes_easy_mc_icons_nobug' ] );
519 519
 			}
520 520
 			if ( 1 == $nobug ) {
521 521
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', TRUE );
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 
527 527
 		/* Display a warning users who are using PHP < 5.3 */
528 528
 		public function display_php_warning() {
529
-			$message = __( 'YIKES Inc. Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Reach out to your host provider for assistance.' , 'yikes-inc-easy-mailchimp-extender' );
529
+			$message = __( 'YIKES Inc. Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Reach out to your host provider for assistance.', 'yikes-inc-easy-mailchimp-extender' );
530 530
 			echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>";
531 531
 		}
532 532
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 		public function add_tinyMCE_buttons() {
538 538
 			global $typenow;
539 539
 			// only on Post Type: post and page
540
-			if( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
540
+			if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
541 541
 				return;
542 542
 			}
543 543
 			add_filter( 'mce_buttons', array( $this, 'yks_mc_add_tinymce_button' ) );
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 
554 554
 		// inlcude the js for tinymce
555 555
 		public function yks_mc_add_tinymce_plugin( $plugin_array ) {
556
-			$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
556
+			$plugin_array[ 'yks_mc_tinymce_button' ] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
557 557
 			// Print all plugin js path
558 558
 			// var_dump( $plugin_array );
559 559
 			return $plugin_array;
@@ -566,25 +566,25 @@  discard block
 block discarded – undo
566 566
 		*/
567 567
 		public function tinymce_yikes_easy_mc() {
568 568
 			// check capabilities
569
-			if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
569
+			if ( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
570 570
 				return;
571 571
 			}
572 572
 			global $wpdb;
573 573
 			$list_data = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A );
574 574
 			$lists = array();
575 575
 			$i = 0;
576
-			if( !empty( $list_data ) ) {
576
+			if ( ! empty( $list_data ) ) {
577 577
 				// build an array to pass to our javascript
578
-				foreach( $list_data as $form ) {
579
-						$lists[$i] = array(
580
-							'text' => urlencode( $form['form_name'] ),
581
-							'value' => $form['id']
578
+				foreach ( $list_data as $form ) {
579
+						$lists[ $i ] = array(
580
+							'text' => urlencode( $form[ 'form_name' ] ),
581
+							'value' => $form[ 'id' ]
582 582
 						);
583 583
 						$i++;
584 584
 				}
585 585
 			} else {
586
-				$lists[0] = array(
587
-					'text' => __( 'Please Import Some MailChimp Lists' , 'yikes-inc-easy-mailchimp-extender' ),
586
+				$lists[ 0 ] = array(
587
+					'text' => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ),
588 588
 					'value' => '-'
589 589
 				);
590 590
 			}
@@ -597,10 +597,10 @@  discard block
 block discarded – undo
597 597
 				var localized_data = {
598 598
 					'button_title' : '<?php _e( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ); ?>',
599 599
 					'popup_title' : '<?php _e( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ); ?>',
600
-					'list_id_label' : '<?php _e( 'MailChimp Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
601
-					'show_title_label' : '<?php _e( 'Display Form Title' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
602
-					'show_description_label' : '<?php _e( 'Display Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
603
-					'submit_button_text_label' : '<?php _e( 'Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
600
+					'list_id_label' : '<?php _e( 'MailChimp Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ); ?>',
601
+					'show_title_label' : '<?php _e( 'Display Form Title', 'yikes-inc-easy-mailchimp-extender' ); ?>',
602
+					'show_description_label' : '<?php _e( 'Display Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?>',
603
+					'submit_button_text_label' : '<?php _e( 'Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ); ?>',
604 604
 				};
605 605
 				<?php
606 606
 					$link = sprintf( __( 'You need to <a href="%s" title="%s">create a form</a> before you can add one to a page or post.', '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' ) );
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 		if ( get_option( 'yikes_mailchimp_activation_redirect', 'true' ) == 'true' ) {
620 620
 			update_option( 'yikes_mailchimp_activation_redirect', 'false' );
621 621
 			/* If the user had this plugin activated prior to today, redirect to 'Whats New' */
622
-			if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
622
+			if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
623 623
 				wp_redirect( esc_url( admin_url( 'admin.php?page=yikes-mailchimp-welcome' ) ) );
624 624
 			} else {
625 625
 				/* Else redirect the user over to the 'Getting Started' tab */
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 		/**
676 676
 		 * Enqueue our scripts across the dashboard as needed
677 677
 		 */
678
-		wp_register_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 );
678
+		wp_register_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 );
679 679
 		$localized_data = array(
680 680
 			'admin_url' => esc_url_raw( admin_url() ),
681 681
 			'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
@@ -683,19 +683,19 @@  discard block
 block discarded – undo
683 683
 			'search_preloader_url' => YIKES_MC_URL . 'includes/images/search-interest-group-preloader.gif',
684 684
 			'preloader_url' => esc_url_raw( admin_url( '/images/wpspin_light.gif' ) )
685 685
 		);
686
-		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js' , 'object_data' , $localized_data );
686
+		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js', 'object_data', $localized_data );
687 687
 		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js' );
688 688
 
689 689
 
690 690
 		/*
691 691
 		*	Enqueue required scripts for the form editor
692 692
 		*/
693
-		if( get_current_screen()->base == 'admin_page_yikes-mailchimp-edit-form' ) {
693
+		if ( get_current_screen()->base == 'admin_page_yikes-mailchimp-edit-form' ) {
694 694
 			global $wp_locale;
695 695
 			wp_enqueue_style( 'wp-color-picker' );
696 696
 			wp_enqueue_script( 'wp-color-picker' );
697
-			wp_enqueue_script( 'jquery.timepicker.js',YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js' , array( 'jquery' ) , $this->version, false );
698
-			wp_register_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 );
697
+			wp_enqueue_script( 'jquery.timepicker.js', YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ), $this->version, false );
698
+			wp_register_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 );
699 699
 			$localized_data = array(
700 700
 				'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
701 701
 				'no_fields_assigned' => __( 'No fields assigned to this form. Select some fields to add to this form from the right hand column.', 'yikes-inc-easy-mailchimp-extender' ),
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 				'isRTL'             => $wp_locale->is_rtl(),
717 717
 				'start_date_exceeds_end_date_error' => __( 'Error: The start date and time cannot occur after the end date and time. Chosen date reverted to previous selection.', 'yikes-inc-easy-mailchimp-extender' ),
718 718
 			);
719
-			wp_localize_script( 'edit-form-js' , 'object' , $localized_data );
719
+			wp_localize_script( 'edit-form-js', 'object', $localized_data );
720 720
 			wp_enqueue_script( 'edit-form-js' );
721 721
 		}
722 722
 
@@ -736,8 +736,8 @@  discard block
 block discarded – undo
736 736
 		 * the datepicker wants a numerical index. This function replaces the index with a number
737 737
 		 */
738 738
 		public function yikes_jQuery_datepicker_strip_array_indices( $ArrayToStrip ) {
739
-			foreach( $ArrayToStrip as $objArrayItem) {
740
-				$NewArray[] =  $objArrayItem;
739
+			foreach ( $ArrayToStrip as $objArrayItem ) {
740
+				$NewArray[ ] = $objArrayItem;
741 741
 			}
742 742
 			return( $NewArray );
743 743
 		}
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 		 * Convert the php date format string to a js date format
747 747
 		 */
748 748
 		public function yikes_jQuery_datepicker_date_format_php_to_js( $sFormat ) {
749
-			switch( $sFormat ) {
749
+			switch ( $sFormat ) {
750 750
 				//Predefined WP date formats
751 751
 				case 'F j, Y':
752 752
 				case 'j F Y':
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 		 * Convert the php date format string to a js date format
773 773
 		 */
774 774
 		public function yikes_jQuery_datepicker_date_format( $site_option ) {
775
-			switch( $site_option ) {
775
+			switch ( $site_option ) {
776 776
 				//Predefined WP date formats
777 777
 				default:
778 778
 				case 'F j, Y':
@@ -799,9 +799,9 @@  discard block
 block discarded – undo
799 799
 
800 800
 		/* Top Level Menu 'Easy MailChimp' */
801 801
 		add_menu_page(
802
-			__( 'Easy Forms' , 'yikes-inc-easy-mailchimp-extender' ),
802
+			__( 'Easy Forms', 'yikes-inc-easy-mailchimp-extender' ),
803 803
 			'Easy Forms',
804
-			apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
804
+			apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
805 805
 			'yikes-inc-easy-mailchimp',
806 806
 			'', // no callback,
807 807
 			YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_wink_icon.png'
@@ -815,9 +815,9 @@  discard block
 block discarded – undo
815 815
 				/* YIKES Inc. Easy MailChimp Manage Forms */
816 816
 				add_submenu_page(
817 817
 					'yikes-inc-easy-mailchimp',
818
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
819
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
820
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
818
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
819
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
820
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
821 821
 					'yikes-inc-easy-mailchimp',
822 822
 					array( $this, 'generateManageFormsPage' )
823 823
 				);
@@ -825,9 +825,9 @@  discard block
 block discarded – undo
825 825
 				/* YIKES Inc. Easy MailChimp Manage Lists */
826 826
 				add_submenu_page(
827 827
 					'yikes-inc-easy-mailchimp',
828
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
829
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
830
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
828
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
829
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
830
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
831 831
 					'yikes-inc-easy-mailchimp-lists',
832 832
 					array( $this, 'generateManageListsPage' )
833 833
 				);
@@ -841,13 +841,13 @@  discard block
 block discarded – undo
841 841
 
842 842
 
843 843
 			/* YIKES Inc. Easy MailChimp Account Overview */
844
-			if ( get_option('yikes-mc-api-validation') == 'valid_api_key' ) {
844
+			if ( get_option( 'yikes-mc-api-validation' ) == 'valid_api_key' ) {
845 845
 				/* YIKES Inc. Easy MailChimp Settings */
846 846
 				add_submenu_page(
847 847
 					'yikes-inc-easy-mailchimp',
848
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
849
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
850
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
848
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
849
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
850
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
851 851
 					'yikes-inc-easy-mailchimp-account-overview',
852 852
 					array( $this, 'generateAccountDetailsPage' )
853 853
 				);
@@ -857,9 +857,9 @@  discard block
 block discarded – undo
857 857
 			/* YIKES Inc. Easy MailChimp Settings */
858 858
 			add_submenu_page(
859 859
 				'yikes-inc-easy-mailchimp',
860
-				__( 'Settings.' , 'yikes-inc-easy-mailchimp-extender' ),
861
-				__( 'Settings' , 'yikes-inc-easy-mailchimp-extender' ),
862
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
860
+				__( 'Settings.', 'yikes-inc-easy-mailchimp-extender' ),
861
+				__( 'Settings', 'yikes-inc-easy-mailchimp-extender' ),
862
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
863 863
 				'yikes-inc-easy-mailchimp-settings',
864 864
 				array( $this, 'generatePageOptions' )
865 865
 			);
@@ -867,9 +867,9 @@  discard block
 block discarded – undo
867 867
 			/* Support Page */
868 868
 			add_submenu_page(
869 869
 				'yikes-inc-easy-mailchimp',
870
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
871
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
872
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
870
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
871
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
872
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
873 873
 				'yikes-inc-easy-mailchimp-support',
874 874
 				array( $this, 'generateSupportPage' )
875 875
 			);
@@ -877,11 +877,11 @@  discard block
 block discarded – undo
877 877
 			/* Add-Ons Page */
878 878
 			add_submenu_page(
879 879
 				'yikes-inc-easy-mailchimp',
880
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
881
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
882
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
880
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
881
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
882
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
883 883
 				'yikes-inc-easy-mailchimp-addons',
884
-				array( $this , 'generateAddOnsPage' )
884
+				array( $this, 'generateAddOnsPage' )
885 885
 			);
886 886
 
887 887
 			/** Hidden Pages **/
@@ -889,9 +889,9 @@  discard block
 block discarded – undo
889 889
 				/* Add Hidden Edit Form Page */
890 890
 				add_submenu_page(
891 891
 					'options.php',
892
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
893
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
894
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
892
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
893
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
894
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
895 895
 					'yikes-mailchimp-edit-form',
896 896
 					array( $this, 'generateEditFormPage' )
897 897
 				);
@@ -899,19 +899,19 @@  discard block
 block discarded – undo
899 899
 				/* Add Hidden Migrate Options Page */
900 900
 				add_submenu_page(
901 901
 					'options-writing.php',
902
-					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure' , 'yikes-inc-easy-mailchimp-extender' ),
902
+					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure', 'yikes-inc-easy-mailchimp-extender' ),
903 903
 					'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure',
904 904
 					'manage_options',
905
-					'yikes-inc-easy-mailchimp-update' ,
906
-					array( $this , 'migrate_old_yks_mc_options' )
905
+					'yikes-inc-easy-mailchimp-update',
906
+					array( $this, 'migrate_old_yks_mc_options' )
907 907
 				);
908 908
 
909 909
 				/* Add Hidden Welcome Page */
910 910
 				add_submenu_page(
911 911
 					'options.php',
912
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
913
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
914
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
912
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
913
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
914
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
915 915
 					'yikes-mailchimp-welcome',
916 916
 					array( $this, 'generateWelcomePage' )
917 917
 				);
@@ -919,9 +919,9 @@  discard block
 block discarded – undo
919 919
 				/* Add Hidden 'View List' Page */
920 920
 				add_submenu_page(
921 921
 					'options.php',
922
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
923
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
924
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
922
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
923
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
924
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
925 925
 					'yikes-mailchimp-view-list',
926 926
 					array( $this, 'generateViewListPage' )
927 927
 				);
@@ -929,9 +929,9 @@  discard block
 block discarded – undo
929 929
 				/* Add Hidden View User Page */
930 930
 				add_submenu_page(
931 931
 					'options.php',
932
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
933
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
934
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
932
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
933
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
934
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
935 935
 					'yikes-mailchimp-view-user',
936 936
 					array( $this, 'generateViewUserPage' )
937 937
 				);
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
 
1029 1029
 		/* Register General Settings Section */
1030 1030
 
1031
-		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this , 'yikes_mc_validate_api_key' ) );
1031
+		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this, 'yikes_mc_validate_api_key' ) );
1032 1032
 
1033 1033
 		add_settings_section(
1034 1034
 			'yikes_easy_mc_settings_general_section_callback',
@@ -1071,16 +1071,16 @@  discard block
 block discarded – undo
1071 1071
 		add_settings_field(
1072 1072
 			'optin-checkbox-init',
1073 1073
 			__( 'Select Checkboxes to Generate', 'yikes-inc-easy-mailchimp-extender' ),
1074
-			'',  // callback + validation inside of admin/partials/menu/options.php
1074
+			'', // callback + validation inside of admin/partials/menu/options.php
1075 1075
 			'yikes_inc_easy_mc_checkbox_settings'
1076 1076
 		);
1077 1077
 		/* End Checkbox Settings */
1078 1078
 
1079 1079
 		/* reCAPTCHA Settings */
1080 1080
 
1081
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-status' );
1082
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-site-key' );
1083
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-secret-key' );
1081
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-status' );
1082
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-site-key' );
1083
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-secret-key' );
1084 1084
 
1085 1085
 			/* Register reCAPTCHA Settings Section */
1086 1086
 			add_settings_section(
@@ -1093,28 +1093,28 @@  discard block
 block discarded – undo
1093 1093
 			add_settings_field(
1094 1094
 				'yikes-mc-recaptcha-site-key',
1095 1095
 				__( 'Enter reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ),
1096
-				'',  // callback + validation inside of admin/partials/menu/options.php
1096
+				'', // callback + validation inside of admin/partials/menu/options.php
1097 1097
 				'yikes_easy_mc_settings_recpatcha_section'
1098 1098
 			);
1099 1099
 
1100 1100
 			add_settings_field(
1101 1101
 				'yikes-mc-recaptcha-secret-key',
1102 1102
 				__( 'Enter reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ),
1103
-				'',  // callback + validation inside of admin/partials/menu/options.php
1103
+				'', // callback + validation inside of admin/partials/menu/options.php
1104 1104
 				'yikes_easy_mc_settings_recpatcha_section'
1105 1105
 			);
1106 1106
 
1107 1107
 			add_settings_field(
1108 1108
 				'yikes-mc-recaptcha-status',
1109 1109
 				__( 'Enable ReCaptcha', 'yikes-inc-easy-mailchimp-extender' ),
1110
-				'',  // callback + validation inside of admin/partials/menu/options.php
1110
+				'', // callback + validation inside of admin/partials/menu/options.php
1111 1111
 				'yikes_easy_mc_settings_recpatcha_section'
1112 1112
 			);
1113 1113
 
1114 1114
 		/* End reCAPTCHA Settings */
1115 1115
 
1116 1116
 		/* Debug Settings */
1117
-			register_setting( 'yikes_inc_easy_mc_debug_settings_page' , 'yikes-mailchimp-debug-status' );
1117
+			register_setting( 'yikes_inc_easy_mc_debug_settings_page', 'yikes-mailchimp-debug-status' );
1118 1118
 
1119 1119
 			/* Register Debug Settings Section */
1120 1120
 			add_settings_section(
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
 			add_settings_field(
1128 1128
 				'yikes-mailchimp-debug-status',
1129 1129
 				__( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ),
1130
-				'',  // callback + validation inside of admin/partials/menu/options.php
1130
+				'', // callback + validation inside of admin/partials/menu/options.php
1131 1131
 				'yikes_easy_mc_settings_debug_section'
1132 1132
 			);
1133 1133
 
@@ -1143,16 +1143,16 @@  discard block
 block discarded – undo
1143 1143
 	*	@since complete re-write
1144 1144
 	**/
1145 1145
 	function yikes_mc_validate_api_key( $input ) {
1146
-		if( $input == '' ) {
1146
+		if ( $input == '' ) {
1147 1147
 			return;
1148 1148
 		}
1149 1149
 		$api_key = trim( $input );
1150 1150
 		$dash_position = strpos( trim( $input ), '-' );
1151
-		if( $dash_position !== false ) {
1151
+		if ( $dash_position !== false ) {
1152 1152
 			$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/ping.json';
1153 1153
 		} else {
1154 1154
 			update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) );
1155
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1155
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1156 1156
 			return $api_key;
1157 1157
 		}
1158 1158
 		$request_args = array(
@@ -1163,17 +1163,17 @@  discard block
 block discarded – undo
1163 1163
 			'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
1164 1164
 		);
1165 1165
 		$api_key_response = wp_remote_post( $api_endpoint, $request_args );
1166
-		if( ! is_wp_error( $api_key_response ) ) {
1166
+		if ( ! is_wp_error( $api_key_response ) ) {
1167 1167
 			$body = json_decode( wp_remote_retrieve_body( $api_key_response ), true );
1168
-			if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) {
1169
-				update_option( 'yikes-mc-api-validation' , 'valid_api_key' );
1168
+			if ( isset( $body[ 'msg' ] ) && $body[ 'msg' ] == "Everything's Chimpy!" ) {
1169
+				update_option( 'yikes-mc-api-validation', 'valid_api_key' );
1170 1170
 			}
1171
-		}  else {
1171
+		} else {
1172 1172
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
1173 1173
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1174
-			$error_logging->yikes_easy_mailchimp_write_to_error_log( $api_key_response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) );
1175
-			update_option( 'yikes-mc-api-invalid-key-response' , $api_key_response->get_error_message() );
1176
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1174
+			$error_logging->yikes_easy_mailchimp_write_to_error_log( $api_key_response->get_error_message(), __( "Connecting to MailChimp", 'yikes-inc-easy-mailchimp-extender' ), __( "Settings Page/General Settings", 'yikes-inc-easy-mailchimp-extender' ) );
1175
+			update_option( 'yikes-mc-api-invalid-key-response', $api_key_response->get_error_message() );
1176
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1177 1177
 		}
1178 1178
 		// returned the api key
1179 1179
 		return $api_key;
@@ -1194,13 +1194,13 @@  discard block
 block discarded – undo
1194 1194
 	*	to form fields. (input, dropdowns, buttons etc.)
1195 1195
 	* 	@since v5.5 re-write
1196 1196
 	**/
1197
-	public function is_user_mc_api_valid_form( $echo=true ) {
1198
-		if( $echo == true ) {
1199
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1197
+	public function is_user_mc_api_valid_form( $echo = true ) {
1198
+		if ( $echo == true ) {
1199
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1200 1200
 				echo 'disabled="disabled"';
1201 1201
 			}
1202 1202
 		} else {
1203
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1203
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1204 1204
 				return false;
1205 1205
 			} else {
1206 1206
 				return true;
@@ -1220,11 +1220,11 @@  discard block
 block discarded – undo
1220 1220
 	public function check_for_old_yks_mc_options() {
1221 1221
 		$old_plugin_options = get_option( 'ykseme_storage' );
1222 1222
 		// only perform options migrations if the site is not a multi-site setup
1223
-		if ( !is_multisite() ) {
1224
-			if( apply_filters( 'yikes_mc_old_options_filter' , $old_plugin_options ) ) {
1223
+		if ( ! is_multisite() ) {
1224
+			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1225 1225
 				// display a notice to the user that they should 'migrate'
1226 1226
 				// from the old plugin settings to the new ones
1227
-				add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 );
1227
+				add_action( 'admin_notices', array( $this, 'display_options_migrate_notice' ), 11 );
1228 1228
 			}
1229 1229
 		}
1230 1230
 	}
@@ -1257,11 +1257,11 @@  discard block
 block discarded – undo
1257 1257
 
1258 1258
 			// Confirm that the necessary forms table in the database exists, else bail
1259 1259
 			global $wpdb;
1260
-			if( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1260
+			if ( $wpdb->get_var( "show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'" ) != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1261 1261
 				return;
1262 1262
 			}
1263 1263
 
1264
-			if( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1264
+			if ( isset( $_GET[ 'yikes-mc-options-migration-dismissed' ] ) && $_GET[ 'yikes-mc-options-migration-dismissed' ] == 'true' ) {
1265 1265
 					// Delete the options, start a-new! (this will disable the migration notice altogether)
1266 1266
 					delete_option( 'widget_yikes_mc_widget' );
1267 1267
 					delete_option( 'api_validation' );
@@ -1275,18 +1275,18 @@  discard block
 block discarded – undo
1275 1275
 			} else {
1276 1276
 			?>
1277 1277
 				<div class="yikes-easy-mc-updated migrate-options-notice">
1278
-					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. 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>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?></p>
1278
+					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. 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>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?></p>
1279 1279
 					<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>
1280 1280
 					<p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1281 1281
 					<section id="migration-buttons">
1282 1282
 						<!-- migrate button -->
1283 1283
 						<form>
1284 1284
 							<input type="hidden" name="yikes-mc-update-option-structure" value="yikes-mc-update-option-structure" />
1285
-							<a href="<?php echo wp_nonce_url( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-update' ) ), 'yikes-mc-migrate-options' , 'migrate_options_nonce' ); ?>" class="button-secondary"><?php _e( 'Perform Migration' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1285
+							<a href="<?php echo wp_nonce_url( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-update' ) ), 'yikes-mc-migrate-options', 'migrate_options_nonce' ); ?>" class="button-secondary"><?php _e( 'Perform Migration', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1286 1286
 						</form>
1287 1287
 						<!-- dismiss button -->
1288 1288
 						<form>
1289
-							<a href="<?php echo wp_nonce_url( esc_url_raw( admin_url() ), 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' ); ?>" class="button-secondary"><?php _e( 'Dismiss Notice' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1289
+							<a href="<?php echo wp_nonce_url( esc_url_raw( admin_url() ), 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' ); ?>" class="button-secondary"><?php _e( 'Dismiss Notice', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1290 1290
 						</form>
1291 1291
 					</section>
1292 1292
 
@@ -1300,9 +1300,9 @@  discard block
 block discarded – undo
1300 1300
 		*	and return the index ( used to find the list name assigned to a form )
1301 1301
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1302 1302
 		*/
1303
-		function findMCListID($id, $array) {
1304
-		   foreach ($array as $key => $val) {
1305
-			   if ($val['id'] === $id) {
1303
+		function findMCListID( $id, $array ) {
1304
+		   foreach ( $array as $key => $val ) {
1305
+			   if ( $val[ 'id' ] === $id ) {
1306 1306
 				   return $key;
1307 1307
 			   }
1308 1308
 		   }
@@ -1312,9 +1312,9 @@  discard block
 block discarded – undo
1312 1312
 		/* Ajax Migrate Options */
1313 1313
 		function migrate_archived_options() {
1314 1314
 			// all options prefixed with 'yikes-mc-'
1315
-			$option_name = 'yikes-mc-'.$_POST['option_name'];
1316
-			$option_value = $_POST['option_value'];
1317
-			if( json_decode( $option_value ) ) {
1315
+			$option_name = 'yikes-mc-' . $_POST[ 'option_name' ];
1316
+			$option_value = $_POST[ 'option_value' ];
1317
+			if ( json_decode( $option_value ) ) {
1318 1318
 				// decode our lists() array, and store it
1319 1319
 				$opt_value = json_decode( $option_value, true );
1320 1320
 			} else {
@@ -1327,24 +1327,24 @@  discard block
 block discarded – undo
1327 1327
 
1328 1328
 		/* Ajax Migrate Forms */
1329 1329
 		function migrate_previously_setup_forms() {
1330
-			$option_name = $_POST['option_name'];
1331
-			$done = $_POST['done_import'];
1330
+			$option_name = $_POST[ 'option_name' ];
1331
+			$done = $_POST[ 'done_import' ];
1332 1332
 			// Create some starter forms for the user
1333 1333
 			// based on previously imported lists (to our old version)
1334
-			if( $option_name == 'yikes-mc-lists' ) {
1334
+			if ( $option_name == 'yikes-mc-lists' ) {
1335 1335
 				global $wpdb;
1336
-				$option_value = $_POST['option_value'];
1337
-				$new_options = json_decode( stripslashes_deep( $option_value ) , true );
1336
+				$option_value = $_POST[ 'option_value' ];
1337
+				$new_options = json_decode( stripslashes_deep( $option_value ), true );
1338 1338
 
1339
-				$list_id = $new_options['id'];
1340
-				$form_name = $new_options['name'];
1341
-				$fields = $new_options['fields']; // our fields array
1339
+				$list_id = $new_options[ 'id' ];
1340
+				$form_name = $new_options[ 'name' ];
1341
+				$fields = $new_options[ 'fields' ]; // our fields array
1342 1342
 
1343
-				$custom_styles = isset( $new_options['custom_styles'] ) ? json_encode( $new_options['custom_styles'] ) : '0'; // store as an array with all of our styles
1344
-				$custom_template = isset( $new_options['custom_template'] ) ? json_encode( $new_options['custom_template'] ) : '0'; // store template data as an array ( active , template used )
1345
-				$send_welcome_email = isset( $new_options['yks_mailchimp_send_welcome_'.$list_id] ) ? '0' : '1';
1346
-				$redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1347
-				$redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1343
+				$custom_styles = isset( $new_options[ 'custom_styles' ] ) ? json_encode( $new_options[ 'custom_styles' ] ) : '0'; // store as an array with all of our styles
1344
+				$custom_template = isset( $new_options[ 'custom_template' ] ) ? json_encode( $new_options[ 'custom_template' ] ) : '0'; // store template data as an array ( active , template used )
1345
+				$send_welcome_email = isset( $new_options[ 'yks_mailchimp_send_welcome_' . $list_id ] ) ? '0' : '1';
1346
+				$redirect_user_on_submit = isset( $new_options[ 'yks_mailchimp_redirect_' . $list_id ] ) ? '1' : '0';
1347
+				$redirect_page = isset( $new_options[ 'page_id_' . $list_id ] ) ? $new_options[ 'page_id_' . $list_id ] : '';
1348 1348
 
1349 1349
 				/* Insert Forms Function  */
1350 1350
 				$wpdb->insert(
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
 					)
1370 1370
 				);
1371 1371
 			}
1372
-			if( $done == 'done' ) {
1372
+			if ( $done == 'done' ) {
1373 1373
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => true ) );
1374 1374
 			} else {
1375 1375
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => false ) );
@@ -1384,35 +1384,35 @@  discard block
 block discarded – undo
1384 1384
 		*	@since v5.6 - complete re-write
1385 1385
 		*/
1386 1386
 		public function generate_options_pages_sidebar_menu() {
1387
-			if( isset( $_REQUEST['section'] ) ) {
1388
-				$selected = $_REQUEST['section'];
1387
+			if ( isset( $_REQUEST[ 'section' ] ) ) {
1388
+				$selected = $_REQUEST[ 'section' ];
1389 1389
 			}
1390
-			$installed_addons = get_option( 'yikes-easy-mc-active-addons' , array() );
1390
+			$installed_addons = get_option( 'yikes-easy-mc-active-addons', array() );
1391 1391
 			// sort our addons array alphabetically so they appear in similar orders across all sites
1392 1392
 			asort( $installed_addons );
1393 1393
 			?>
1394
-				<h3><span><?php _e( 'Additional Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1394
+				<h3><span><?php _e( 'Additional Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1395 1395
 				<div class="inside">
1396 1396
 					<ul id="settings-nav">
1397
-						<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>
1398
-						<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>
1399
-						<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>
1400
-						<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>
1401
-						<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>
1402
-						<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>
1397
+						<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>
1398
+						<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>
1399
+						<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>
1400
+						<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>
1401
+						<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>
1402
+						<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>
1403 1403
 					</ul>
1404 1404
 					<?php
1405 1405
 						// create our add-on settings pages
1406
-						if( !empty( $installed_addons ) ) {
1406
+						if ( ! empty( $installed_addons ) ) {
1407 1407
 							?>
1408 1408
 							<hr class="add-on-settings-divider" />
1409
-							<strong><?php _e( 'Addon Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1409
+							<strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1410 1410
 							<ul id="addon-settings-nav">
1411 1411
 							<?php
1412
-							foreach( $installed_addons as $addon_name ) {
1412
+							foreach ( $installed_addons as $addon_name ) {
1413 1413
 								?>
1414 1414
 									<li>
1415
-										<?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>
1415
+										<?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>
1416 1416
 								<?php
1417 1417
 							}
1418 1418
 							?>
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 				)
1441 1441
 			);
1442 1442
 			?>
1443
-				<h3><?php _e( 'Create a New Signup Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1443
+				<h3><?php _e( 'Create a New Signup Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1444 1444
 
1445 1445
 				<div class="inside">
1446 1446
 
@@ -1449,31 +1449,31 @@  discard block
 block discarded – undo
1449 1449
 					<form id="import-list-to-site" method="POST" action="<?php echo $url; ?>">
1450 1450
 						<input type="hidden" name="import-list-to-site" value="1" />
1451 1451
 						<!-- Name your new form -->
1452
-						<label for="form-name"><strong><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1453
-							<input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required>
1452
+						<label for="form-name"><strong><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1453
+							<input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required>
1454 1454
 						</label>
1455 1455
 						<!-- Name your new form -->
1456
-						<label for="form-description"><strong><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1457
-							<textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea>
1456
+						<label for="form-description"><strong><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1457
+							<textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea>
1458 1458
 						</label>
1459 1459
 						<!-- Associate this form with a list! -->
1460
-						<label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1461
-							<select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); if( isset( $lists ) && empty( $lists ) ) { echo 'disabled="disabled"'; } ?>>
1460
+						<label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1461
+							<select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); if ( isset( $lists ) && empty( $lists ) ) { echo 'disabled="disabled"'; } ?>>
1462 1462
 								<?php
1463
-									if( isset( $lists ) && !empty( $lists ) ) {
1464
-										foreach( $lists as $mailing_list ) {
1463
+									if ( isset( $lists ) && ! empty( $lists ) ) {
1464
+										foreach ( $lists as $mailing_list ) {
1465 1465
 											?>
1466
-												<option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1466
+												<option value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option>
1467 1467
 											<?php
1468 1468
 										}
1469 1469
 									} else {
1470
-										if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1470
+										if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1471 1471
 											?>
1472
-												<option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1472
+												<option><?php echo __( "Please enter a valid API key.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1473 1473
 											<?php
1474 1474
 										} else {
1475 1475
 											?>
1476
-												<option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1476
+												<option><?php echo __( "No lists were found on the account.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1477 1477
 											<?php
1478 1478
 
1479 1479
 										}
@@ -1481,11 +1481,11 @@  discard block
 block discarded – undo
1481 1481
 								?>
1482 1482
 							</select>
1483 1483
 							<?php
1484
-								if( isset( $lists ) && empty( $lists ) ) {
1485
-									if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'invalid_api_key' ) {
1484
+								if ( isset( $lists ) && empty( $lists ) ) {
1485
+									if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1486 1486
 										?>
1487 1487
 											<p class="description">
1488
-												<?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' ) ); ?>
1488
+												<?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' ) ); ?>
1489 1489
 											</p>
1490 1490
 										<?php
1491 1491
 									}
@@ -1493,12 +1493,12 @@  discard block
 block discarded – undo
1493 1493
 							?>
1494 1494
 						</label>
1495 1495
 						<?php
1496
-							if( $this->is_user_mc_api_valid_form( false ) ) {
1497
-								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary' , '' , false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1496
+							if ( $this->is_user_mc_api_valid_form( false ) ) {
1497
+								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ), 'primary', '', false, array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1498 1498
 							} else {
1499
-								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1499
+								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1500 1500
 								?>
1501
-									<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>
1501
+									<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>
1502 1502
 								<?php
1503 1503
 							}
1504 1504
 						?>
@@ -1514,14 +1514,14 @@  discard block
 block discarded – undo
1514 1514
 		public function generate_page_redirect_dropdown( $redirect, $redirect_page, $custom_redirect_url ) {
1515 1515
 				$post_types = get_post_types();
1516 1516
 				?>
1517
-				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1518
-					<?php _e( "Select A Page or Post" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1517
+				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1518
+					<?php _e( "Select A Page or Post", 'yikes-inc-easy-mailchimp-extender' ); ?>
1519 1519
 					<select id="redirect-user-to-selection" name="redirect-user-to-selection" onchange="shouldWeDisplayCustomURL( this );return;">
1520 1520
 				<?php
1521 1521
 					// loop over registered post types, and query!
1522
-						foreach( $post_types as $registered_post_type ) {
1522
+						foreach ( $post_types as $registered_post_type ) {
1523 1523
 							// exclude a few built in custom post types
1524
-							if( ! in_array( $registered_post_type , array( 'attachment' , 'revision' , 'nav_menu_item' ) ) ) {
1524
+							if ( ! in_array( $registered_post_type, array( 'attachment', 'revision', 'nav_menu_item' ) ) ) {
1525 1525
 								// run our query, to retreive the posts
1526 1526
 								$pages = get_posts( array(
1527 1527
 									'order' => 'ASC',
@@ -1531,12 +1531,12 @@  discard block
 block discarded – undo
1531 1531
 									'numberposts' => -1
1532 1532
 								) );
1533 1533
 								// only show cpt's that have posts assigned
1534
-								if( !empty( $pages ) ) {
1534
+								if ( ! empty( $pages ) ) {
1535 1535
 									?>
1536
-									<optgroup label="<?php echo ucwords( str_replace( '_' , ' ' , $registered_post_type ) ); ?>">
1536
+									<optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>">
1537 1537
 									<?php
1538
-										foreach( $pages as $page ) {
1539
-											?><option <?php selected( $redirect_page , $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1538
+										foreach ( $pages as $page ) {
1539
+											?><option <?php selected( $redirect_page, $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1540 1540
 										}
1541 1541
 									?>
1542 1542
 									<option <?php selected( $redirect_page, 'custom_url' ); ?> value="custom_url"><?php echo __( 'Custom URL', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
@@ -1548,8 +1548,8 @@  discard block
 block discarded – undo
1548 1548
 					?>
1549 1549
 					</select>
1550 1550
 
1551
-					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1552
-						<?php _e( "Enter Custom URL" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1551
+					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if ( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1552
+						<?php _e( "Enter Custom URL", 'yikes-inc-easy-mailchimp-extender' ); ?>
1553 1553
 						<input type="text" class="widefat custom-redirect-url" name="custom-redirect-url" value="<?php echo $custom_redirect_url; ?>" />
1554 1554
 					</label>
1555 1555
 
@@ -1566,11 +1566,11 @@  discard block
 block discarded – undo
1566 1566
 		public function generate_show_some_love_container() {
1567 1567
 			// if no active add-ons are installed,
1568 1568
 			// lets display our branding and add-on sidebar
1569
-			if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) {
1569
+			if ( get_option( 'yikes-easy-mc-active-addons', array() ) == array() ) {
1570 1570
 
1571 1571
 				/* On Edit Forms Page Display Upsell to Customizer */
1572 1572
 				$screen = get_current_screen();
1573
-				if( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1573
+				if ( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1574 1574
 				?>
1575 1575
 
1576 1576
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
@@ -1584,11 +1584,11 @@  discard block
 block discarded – undo
1584 1584
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
1585 1585
 
1586 1586
 						<!-- review us container -->
1587
-						<h3 data-alt-text="<?php _e( 'About YIKES Inc.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Show YIKES Inc. Some Love' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1587
+						<h3 data-alt-text="<?php _e( 'About YIKES Inc.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Show YIKES Inc. Some Love', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1588 1588
 						<div id="review-yikes-easy-mc" class="inside">
1589 1589
 
1590 1590
 							<p>
1591
-								<?php _e( 'Leave a review' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1591
+								<?php _e( 'Leave a review', 'yikes-inc-easy-mailchimp-extender' ); ?>
1592 1592
 								<p class="star-container">
1593 1593
 									<a href="https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender" target="_blank">
1594 1594
 										<b class="dashicons dashicons-star-filled"></b>
@@ -1600,21 +1600,21 @@  discard block
 block discarded – undo
1600 1600
 								</p>
1601 1601
 							</p>
1602 1602
 
1603
-							<?php _e( 'Tweet about it' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1603
+							<?php _e( 'Tweet about it', 'yikes-inc-easy-mailchimp-extender' ); ?>
1604 1604
 							<p class="sidebar-container">
1605 1605
 								<a href="https://twitter.com/share" class="twitter-share-button" data-url="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" data-text="I'm using the Easy Forms for MailChimp plugin by @YikesInc to grow my mailing list - it's awesome! -" data-hashtags="MailChimp">Tweet</a>
1606 1606
 								<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
1607 1607
 							</p>
1608 1608
 
1609
-							<?php _e( 'Vote that the plugin works' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1609
+							<?php _e( 'Vote that the plugin works', 'yikes-inc-easy-mailchimp-extender' ); ?>
1610 1610
 							<p class="sidebar-container">
1611 1611
 								<a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">
1612
-									<?php _e( 'Vote for Compatibility' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1612
+									<?php _e( 'Vote for Compatibility', 'yikes-inc-easy-mailchimp-extender' ); ?>
1613 1613
 								</a>
1614 1614
 							</p>
1615 1615
 						</div>
1616 1616
 
1617
-						<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>
1617
+						<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>
1618 1618
 
1619 1619
 						<section id="about-yikes-inc" class="inside">
1620 1620
 							<a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc.">
@@ -1632,10 +1632,10 @@  discard block
 block discarded – undo
1632 1632
 				<div class="postbox yikes-easy-mc-postbox">
1633 1633
 
1634 1634
 					<!-- review us container -->
1635
-					<h3><?php _e( 'Easy Forms for MailChimp Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1635
+					<h3><?php _e( 'Easy Forms for MailChimp Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1636 1636
 					<div id="review-yikes-easy-mc" class="inside">
1637
-						<p><?php _e( "Check out available add-ons for some seriously enhanced features." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1638
-						<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>
1637
+						<p><?php _e( "Check out available add-ons for some seriously enhanced features.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1638
+						<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>
1639 1639
 					</div>
1640 1640
 
1641 1641
 				</div>
@@ -1660,76 +1660,76 @@  discard block
 block discarded – undo
1660 1660
 		public function generate_form_editor( $form_fields, $list_id, $merge_variables, $interest_groups ) {
1661 1661
 
1662 1662
 			// if no list id, die!
1663
-			if( ! $list_id ) {
1664
-				die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) );
1663
+			if ( ! $list_id ) {
1664
+				die( __( "We've encountered an error. No list ID was sent.", 'yikes-inc-easy-mailchimp-extender' ) );
1665 1665
 			}
1666 1666
 
1667
-			if( ! $merge_variables ) {
1668
-				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' ) );
1667
+			if ( ! $merge_variables ) {
1668
+				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' ) );
1669 1669
 			}
1670 1670
 
1671
-			if( ! empty( $form_fields ) ) {
1671
+			if ( ! empty( $form_fields ) ) {
1672 1672
 
1673 1673
 				// find any fields that are assigned to this form, that don't exist in MailChimp
1674 1674
 				// or else were going to run into issues when we submit the form
1675 1675
 				$available_merge_variables = array();
1676 1676
 				$available_interest_groups = array();
1677 1677
 
1678
-				$assigned_fields= array();
1678
+				$assigned_fields = array();
1679 1679
 
1680 1680
 				// loop over merge variables
1681
-				if( ! empty( $merge_variables['data'][0]['merge_vars'] ) ) {
1682
-					foreach( $merge_variables['data'][0]['merge_vars'] as $merge_tag ) {
1683
-						$available_merge_variables[] = $merge_tag['tag'];
1681
+				if ( ! empty( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] ) ) {
1682
+					foreach ( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] as $merge_tag ) {
1683
+						$available_merge_variables[ ] = $merge_tag[ 'tag' ];
1684 1684
 					}
1685 1685
 				}
1686 1686
 
1687 1687
 				// loop over interest groups
1688
-				if( ! empty( $interest_groups ) && ! isset( $interest_groups['error'] ) ) {
1689
-					foreach( $interest_groups as $interest_group ) {
1690
-						$available_interest_groups[] = $interest_group['id'];
1688
+				if ( ! empty( $interest_groups ) && ! isset( $interest_groups[ 'error' ] ) ) {
1689
+					foreach ( $interest_groups as $interest_group ) {
1690
+						$available_interest_groups[ ] = $interest_group[ 'id' ];
1691 1691
 					}
1692 1692
 				}
1693 1693
 
1694 1694
 				// build our assigned fields
1695
-				foreach( $form_fields as $field => $value ) {
1696
-					$assigned_fields[] = $field;
1695
+				foreach ( $form_fields as $field => $value ) {
1696
+					$assigned_fields[ ] = $field;
1697 1697
 				}
1698 1698
 
1699
-				$merged_fields = array_merge( $available_merge_variables , $available_interest_groups );
1700
-				$excluded_fields = array_diff( $assigned_fields , $merged_fields );
1699
+				$merged_fields = array_merge( $available_merge_variables, $available_interest_groups );
1700
+				$excluded_fields = array_diff( $assigned_fields, $merged_fields );
1701 1701
 
1702 1702
 				$i = 1;
1703
-				foreach( $form_fields as $field ) {
1703
+				foreach ( $form_fields as $field ) {
1704 1704
 
1705
-					if( isset( $field['merge'] ) ) {
1705
+					if ( isset( $field[ 'merge' ] ) ) {
1706 1706
 					?>
1707
-						<section class="draggable" id="<?php echo $field['merge']; ?>">
1707
+						<section class="draggable" id="<?php echo $field[ 'merge' ]; ?>">
1708 1708
 							<!-- top -->
1709 1709
 							<a href="#" class="expansion-section-title settings-sidebar">
1710
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
1711
-								<?php if( in_array( $field['merge'] , $excluded_fields ) ) { ?>
1712
-									<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' ); ?>">
1710
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
1711
+								<?php if ( in_array( $field[ 'merge' ], $excluded_fields ) ) { ?>
1712
+									<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' ); ?>">
1713 1713
 								<?php } ?>
1714
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
1714
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
1715 1715
 							</a>
1716 1716
 							<!-- expansion section -->
1717 1717
 							<div class="yikes-mc-settings-expansion-section">
1718 1718
 
1719
-								<?php if( in_array( $field['merge'] , $excluded_fields ) ) { ?>
1720
-									<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>
1719
+								<?php if ( in_array( $field[ 'merge' ], $excluded_fields ) ) { ?>
1720
+									<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>
1721 1721
 								<?php } ?>
1722 1722
 
1723 1723
 								<!-- store the label -->
1724
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][label]" value="<?php echo $field['label']; ?>" />
1725
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][type]" value="<?php echo $field['type']; ?>" />
1726
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" />
1727
-								<input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" />
1724
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
1725
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
1726
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][merge]" value="<?php echo $field[ 'merge' ]; ?>" />
1727
+								<input type="hidden" class="field-<?php echo $field[ 'merge' ]; ?>-position position-input" name="field[<?php echo $field[ 'merge' ]; ?>][position]" value="<?php echo $i++; ?>" />
1728 1728
 
1729
-								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1730
-									$choices = json_decode( $field['choices'], true );
1729
+								<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'dropdown' || $field[ 'type' ] == 'select' ) {
1730
+									$choices = json_decode( $field[ 'choices' ], true );
1731 1731
 								?>
1732
-									<input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1732
+									<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1733 1733
 								<?php } ?>
1734 1734
 
1735 1735
 								<!-- Single or Double Opt-in -->
@@ -1741,16 +1741,16 @@  discard block
 block discarded – undo
1741 1741
 										<tr valign="top">
1742 1742
 											<td scope="row">
1743 1743
 												<label for="merge-tag">
1744
-													<?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1744
+													<?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?>
1745 1745
 												</label>
1746 1746
 											</td>
1747 1747
 											<td>
1748
-												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field['merge']; ?>">
1748
+												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field[ 'merge' ]; ?>">
1749 1749
 											</td>
1750 1750
 										</tr>
1751 1751
 
1752 1752
 										<!-- Placeholder Value -->
1753
-										<?php switch( $field['type'] ) {
1753
+										<?php switch ( $field[ 'type' ] ) {
1754 1754
 
1755 1755
 											case 'text':
1756 1756
 											case 'email':
@@ -1765,12 +1765,12 @@  discard block
 block discarded – undo
1765 1765
 										<tr valign="top">
1766 1766
 											<td scope="row">
1767 1767
 												<label for="placeholder">
1768
-													<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1768
+													<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1769 1769
 												</label>
1770 1770
 											</td>
1771 1771
 											<td>
1772
-												<input type="text" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : '' ; ?>" />
1773
-												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1772
+												<input type="text" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>" />
1773
+												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1774 1774
 											</td>
1775 1775
 										</tr>
1776 1776
 										<?php
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
 										?>
1780 1780
 
1781 1781
 										<!-- Default Value -->
1782
-										<?php switch( $field['type'] ) {
1782
+										<?php switch ( $field[ 'type' ] ) {
1783 1783
 											default:
1784 1784
 											case 'text':
1785 1785
 											case 'number':
@@ -1788,17 +1788,17 @@  discard block
 block discarded – undo
1788 1788
 											<tr valign="top">
1789 1789
 												<td scope="row">
1790 1790
 													<label for="placeholder">
1791
-														<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1791
+														<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
1792 1792
 													</label>
1793 1793
 												</td>
1794 1794
 												<td>
1795
-													<input <?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 } ?> />
1796
-													<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>
1795
+													<input <?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 } ?> />
1796
+													<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>
1797 1797
 													<?php
1798
-													switch( $field['type'] ) {
1798
+													switch ( $field[ 'type' ] ) {
1799 1799
 														case 'text':
1800 1800
 															?>
1801
-																<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>
1801
+																<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>
1802 1802
 															<?php
1803 1803
 														break;
1804 1804
 													} ?>
@@ -1812,18 +1812,18 @@  discard block
 block discarded – undo
1812 1812
 												<tr valign="top">
1813 1813
 													<td scope="row">
1814 1814
 														<label for="placeholder">
1815
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1815
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1816 1816
 														</label>
1817 1817
 													</td>
1818 1818
 													<td>
1819
-														<?php if( ! isset( $field['default_choice'] ) || empty( $field['default_choice'] ) ) { $decode = json_decode( $field['choices'], true ); $field['default_choice'] = $decode[0]; }
1819
+														<?php if ( ! isset( $field[ 'default_choice' ] ) || empty( $field[ 'default_choice' ] ) ) { $decode = json_decode( $field[ 'choices' ], true ); $field[ 'default_choice' ] = $decode[ 0 ]; }
1820 1820
 														$x = 0;
1821
-														foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1822
-															<label for="<?php echo $field['merge'].'-'.$x; ?>">
1823
-																<input id="<?php echo $field['merge'].'-'.$x; ?>" type="radio" name="field[<?php echo $field['merge']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $field['default_choice'], $x ); ?>><?php echo $value; ?>&nbsp;
1821
+														foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1822
+															<label for="<?php echo $field[ 'merge' ] . '-' . $x; ?>">
1823
+																<input id="<?php echo $field[ 'merge' ] . '-' . $x; ?>" type="radio" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $field[ 'default_choice' ], $x ); ?>><?php echo $value; ?>&nbsp;
1824 1824
 															</label>
1825 1825
 														<?php $x++; } ?>
1826
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1826
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1827 1827
 													</td>
1828 1828
 												</tr>
1829 1829
 
@@ -1835,16 +1835,16 @@  discard block
 block discarded – undo
1835 1835
 												<tr valign="top">
1836 1836
 													<td scope="row">
1837 1837
 														<label for="placeholder">
1838
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1838
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1839 1839
 														</label>
1840 1840
 													</td>
1841 1841
 													<td>
1842
-														<select type="default" name="field[<?php echo $field['merge']; ?>][default_choice]">
1843
-															<?php foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1844
-																<option value="<?php echo $choice; ?>" <?php selected( $field['default_choice'] , $choice ); ?>><?php echo $value; ?></option>
1842
+														<select type="default" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]">
1843
+															<?php foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1844
+																<option value="<?php echo $choice; ?>" <?php selected( $field[ 'default_choice' ], $choice ); ?>><?php echo $value; ?></option>
1845 1845
 															<?php } ?>
1846 1846
 														</select>
1847
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1847
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1848 1848
 													</td>
1849 1849
 												</tr>
1850 1850
 
@@ -1864,69 +1864,69 @@  discard block
 block discarded – undo
1864 1864
 										<tr valign="top">
1865 1865
 											<td scope="row">
1866 1866
 												<label for="placeholder">
1867
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1867
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
1868 1868
 												</label>
1869 1869
 											</td>
1870 1870
 											<td>
1871
-												<textarea class="widefat field-description-input" name="field[<?php echo $field['merge']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
1872
-												<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>
1871
+												<textarea class="widefat field-description-input" name="field[<?php echo $field[ 'merge' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
1872
+												<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>
1873 1873
 											</td>
1874 1874
 										</tr>
1875 1875
 										<!-- Additional Classes -->
1876 1876
 										<tr valign="top">
1877 1877
 											<td scope="row">
1878 1878
 												<label for="placeholder">
1879
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1879
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
1880 1880
 												</label>
1881 1881
 											</td>
1882 1882
 											<td>
1883
-												<input type="text" 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'] ) ) : '' ; ?>" />
1884
-												<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>
1883
+												<input type="text" 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' ] ) ) : ''; ?>" />
1884
+												<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>
1885 1885
 											</td>
1886 1886
 										</tr>
1887 1887
 										<!-- Required Toggle -->
1888 1888
 										<tr valign="top">
1889 1889
 											<td scope="row">
1890 1890
 												<label for="field-required">
1891
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1891
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
1892 1892
 												</label>
1893 1893
 											</td>
1894 1894
 											<td>
1895
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
1896
-												<input 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' ); } ?>">
1897
-												<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>
1895
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
1896
+												<input 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' ); } ?>">
1897
+												<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>
1898 1898
 											</td>
1899 1899
 										</tr>
1900 1900
 										<!-- Visible Toggle -->
1901 1901
 										<tr valign="top">
1902 1902
 											<td scope="row">
1903 1903
 												<label for="hide-field">
1904
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1904
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
1905 1905
 												</label>
1906 1906
 											</td>
1907 1907
 											<td>
1908
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
1909
-												<input 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' ); } ?>">
1910
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1908
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
1909
+												<input 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' ); } ?>">
1910
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1911 1911
 											</td>
1912 1912
 										</tr>
1913 1913
 										<!-- Toggle Field Label Visibility -->
1914 1914
 										<tr valign="top">
1915 1915
 											<td scope="row">
1916 1916
 												<label for="placeholder">
1917
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1917
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
1918 1918
 												</label>
1919 1919
 											</td>
1920 1920
 											<td>
1921
-												<?php $hide_label = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
1922
-												<input type="checkbox" name="field[<?php echo $field['merge']; ?>][hide-label]" value="1" <?php checked( $hide_label , 1 ); ?>/>
1923
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1921
+												<?php $hide_label = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
1922
+												<input type="checkbox" name="field[<?php echo $field[ 'merge' ]; ?>][hide-label]" value="1" <?php checked( $hide_label, 1 ); ?>/>
1923
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1924 1924
 											</td>
1925 1925
 										</tr>
1926 1926
 										<!-- Display Phone/Date Formats back to the user -->
1927 1927
 										<!-- Phone Format Initial Load -->
1928 1928
 										<?php
1929
-											switch( $field['type'] ) {
1929
+											switch ( $field[ 'type' ] ) {
1930 1930
 												/* Store the phone format, for properly regex pattern */
1931 1931
 												case 'phone':
1932 1932
 												case 'birthday':
@@ -1936,23 +1936,23 @@  discard block
 block discarded – undo
1936 1936
 															<td scope="row">
1937 1937
 																<label for="placeholder">
1938 1938
 																	<?php
1939
-																		switch( $field['type'] ) {
1939
+																		switch ( $field[ 'type' ] ) {
1940 1940
 																			default:
1941 1941
 																			case 'birthday':
1942
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
1943
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD';
1942
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
1943
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD';
1944 1944
 																				$format_name = 'date_format';
1945 1945
 																				break;
1946 1946
 
1947 1947
 																			case 'date':
1948
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
1949
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD/YYYY';
1948
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
1949
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD/YYYY';
1950 1950
 																				$format_name = 'date_format';
1951 1951
 																				break;
1952 1952
 
1953 1953
 																			case 'phone':
1954
-																				$type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
1955
-																				$format = ( ( $field['phone_format'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $field['phone_format'] . ' - (###) ### - ####' );
1954
+																				$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
1955
+																				$format = ( ( $field[ 'phone_format' ] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $field[ 'phone_format' ] . ' - (###) ### - ####' );
1956 1956
 																				$format_name = 'phone_format';
1957 1957
 																				break;
1958 1958
 																		}
@@ -1962,7 +1962,7 @@  discard block
 block discarded – undo
1962 1962
 															</td>
1963 1963
 															<td>
1964 1964
 																<strong><?php echo $format; ?></strong>
1965
-																<input type="hidden" name="field[<?php echo $field['merge']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
1965
+																<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
1966 1966
 																<p class="description"><small>
1967 1967
 																	<?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' ) ); ?>
1968 1968
 																</small></p>
@@ -1983,8 +1983,8 @@  discard block
 block discarded – undo
1983 1983
 											</td>
1984 1984
 											<td>
1985 1985
 												<span class="toggle-container">
1986
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
1987
-													<a href="#" class="remove-field" alt="<?php echo $field['merge']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1986
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
1987
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'merge' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1988 1988
 												</span>
1989 1989
 											</td>
1990 1990
 										</tr>
@@ -2000,35 +2000,35 @@  discard block
 block discarded – undo
2000 2000
 					} else { // THIS IS AN INTEREST GROUP!
2001 2001
 
2002 2002
 						?>
2003
-						<section class="draggable" id="<?php echo $field['group_id']; ?>">
2003
+						<section class="draggable" id="<?php echo $field[ 'group_id' ]; ?>">
2004 2004
 							<!-- top -->
2005 2005
 							<a href="#" class="expansion-section-title settings-sidebar">
2006
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
2007
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2008
-									<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' ); ?>">
2006
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
2007
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2008
+									<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' ); ?>">
2009 2009
 								<?php } ?>
2010
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
2010
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
2011 2011
 							</a>
2012 2012
 							<!-- expansion section -->
2013 2013
 							<div class="yikes-mc-settings-expansion-section">
2014 2014
 
2015 2015
 								<!-- check if this field exists in the available interest group array -->
2016
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2017
-									<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>
2016
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2017
+									<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>
2018 2018
 								<?php } ?>
2019 2019
 
2020 2020
 								<!-- store the label -->
2021
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][label]" value="<?php echo $field['label']; ?>" />
2022
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][type]" value="<?php echo $field['type']; ?>" />
2023
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][group_id]" value="<?php echo $field['group_id']; ?>" />
2024
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field['groups'], true ) ) ); ?>' />
2021
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
2022
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
2023
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][group_id]" value="<?php echo $field[ 'group_id' ]; ?>" />
2024
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field[ 'groups' ], true ) ) ); ?>' />
2025 2025
 
2026 2026
 								<!-- Single or Double Opt-in -->
2027 2027
 								<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
2028 2028
 
2029 2029
 									<table class="form-table form-field-container">
2030 2030
 										<!-- Default Value -->
2031
-										<?php switch( $field['type'] ) {
2031
+										<?php switch ( $field[ 'type' ] ) {
2032 2032
 
2033 2033
 											default:
2034 2034
 											case 'radio':
@@ -2037,26 +2037,26 @@  discard block
 block discarded – undo
2037 2037
 												<tr valign="top">
2038 2038
 													<td scope="row">
2039 2039
 														<label for="placeholder">
2040
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2040
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2041 2041
 														</label>
2042 2042
 													</td>
2043 2043
 													<td>
2044 2044
 														<?php
2045
-															if( $field['type'] != 'checkboxes' ) {
2046
-																if( !isset( $field['default_choice'] ) ) { $field['default_choice'] =  json_decode( stripslashes( $field['groups'] ) , true ); }
2045
+															if ( $field[ 'type' ] != 'checkboxes' ) {
2046
+																if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = json_decode( stripslashes( $field[ 'groups' ] ), true ); }
2047 2047
 															} else {
2048
-																if( !isset( $field['default_choice'] ) ) { $field['default_choice'] = array(); }
2048
+																if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = array(); }
2049 2049
 															}
2050 2050
 														$i = 0;
2051
-														foreach( json_decode( $field['groups'], true ) as $group ) { ?>
2052
-															<label for="<?php echo $field['group_id'].'-'.$i; ?>">
2053
-																<input id="<?php echo $field['group_id'].'-'.$i; ?>" type="<?php if( $field['type'] == 'radio' || $field['type'] == 'hidden' ) { ?>radio<?php } else if( $field['type'] == 'checkboxes' ) { ?>checkbox<?php } ?>" name="field[<?php echo $field['group_id']; ?>][default_choice]<?php if( $field['type'] == 'checkboxes' ) {echo '[]';}?>" value="<?php echo $i; ?>" <?php if( $field['type'] == 'radio' || $field['type'] == 'hidden' ) { checked( $field['default_choice'][0] , $i ); } else if( $field['type'] == 'checkboxes' ) { if( in_array( $i , $field['default_choice'] ) ) { echo 'checked="checked"'; } }?>><?php echo stripslashes( str_replace( '' , '\'' , $group['name'] ) ); ?>&nbsp;
2051
+														foreach ( json_decode( $field[ 'groups' ], true ) as $group ) { ?>
2052
+															<label for="<?php echo $field[ 'group_id' ] . '-' . $i; ?>">
2053
+																<input id="<?php echo $field[ 'group_id' ] . '-' . $i; ?>" type="<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'hidden' ) { ?>radio<?php } else if ( $field[ 'type' ] == 'checkboxes' ) { ?>checkbox<?php } ?>" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]<?php if ( $field[ 'type' ] == 'checkboxes' ) {echo '[]'; }?>" value="<?php echo $i; ?>" <?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'hidden' ) { checked( $field[ 'default_choice' ][ 0 ], $i ); } else if ( $field[ 'type' ] == 'checkboxes' ) { if ( in_array( $i, $field[ 'default_choice' ] ) ) { echo 'checked="checked"'; } }?>><?php echo stripslashes( str_replace( '', '\'', $group[ 'name' ] ) ); ?>&nbsp;
2054 2054
 															</label>
2055 2055
 														<?php
2056 2056
 															$i++;
2057 2057
 															}
2058 2058
 														?>
2059
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2059
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2060 2060
 													</td>
2061 2061
 												</tr>
2062 2062
 
@@ -2068,16 +2068,16 @@  discard block
 block discarded – undo
2068 2068
 												<tr valign="top">
2069 2069
 													<td scope="row">
2070 2070
 														<label for="placeholder">
2071
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2071
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2072 2072
 														</label>
2073 2073
 													</td>
2074 2074
 													<td>
2075
-														<select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2076
-															<?php $i = 0; foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as  $group ) { ?>
2077
-																<option value="<?php echo $i; ?>" <?php selected( $field['default_choice'] , $i ); ?>><?php echo stripslashes( $group['name'] ); ?></option>
2075
+														<select type="default" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]">
2076
+															<?php $i = 0; foreach ( json_decode( stripslashes_deep( $field[ 'groups' ] ), true ) as  $group ) { ?>
2077
+																<option value="<?php echo $i; ?>" <?php selected( $field[ 'default_choice' ], $i ); ?>><?php echo stripslashes( $group[ 'name' ] ); ?></option>
2078 2078
 															<?php $i++; } ?>
2079 2079
 														</select>
2080
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2080
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2081 2081
 													</td>
2082 2082
 												</tr>
2083 2083
 
@@ -2091,12 +2091,12 @@  discard block
 block discarded – undo
2091 2091
 										<tr valign="top">
2092 2092
 											<td scope="row">
2093 2093
 												<label for="placeholder">
2094
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2094
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
2095 2095
 												</label>
2096 2096
 											</td>
2097 2097
 											<td>
2098
-												<textarea class="widefat field-description-input" name="field[<?php echo $field['group_id']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
2099
-												<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>
2098
+												<textarea class="widefat field-description-input" name="field[<?php echo $field[ 'group_id' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
2099
+												<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>
2100 2100
 											</td>
2101 2101
 										</tr>
2102 2102
 
@@ -2104,51 +2104,51 @@  discard block
 block discarded – undo
2104 2104
 										<tr valign="top">
2105 2105
 											<td scope="row">
2106 2106
 												<label for="placeholder">
2107
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2107
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2108 2108
 												</label>
2109 2109
 											</td>
2110 2110
 											<td>
2111
-												<input type="text" 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'] ) ) : '' ; ?>" />
2112
-												<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>
2111
+												<input type="text" 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' ] ) ) : ''; ?>" />
2112
+												<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>
2113 2113
 											</td>
2114 2114
 										</tr>
2115 2115
 										<!-- Required Toggle -->
2116 2116
 										<tr valign="top">
2117 2117
 											<td scope="row">
2118 2118
 												<label for="field-required">
2119
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2119
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2120 2120
 												</label>
2121 2121
 											</td>
2122 2122
 											<td>
2123
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2124
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][require]" <?php checked( $checked , 1 ); ?>>
2125
-												<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>
2123
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2124
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][require]" <?php checked( $checked, 1 ); ?>>
2125
+												<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>
2126 2126
 											</td>
2127 2127
 										</tr>
2128 2128
 										<!-- Visible Toggle -->
2129 2129
 										<tr valign="top">
2130 2130
 											<td scope="row">
2131 2131
 												<label for="hide-field">
2132
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2132
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2133 2133
 												</label>
2134 2134
 											</td>
2135 2135
 											<td>
2136
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2137
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][hide]" <?php checked( $hide , 1 ); ?>>
2138
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2136
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2137
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][hide]" <?php checked( $hide, 1 ); ?>>
2138
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2139 2139
 											</td>
2140 2140
 										</tr>
2141 2141
 										<!-- Toggle Field Label Visibility -->
2142 2142
 										<tr valign="top">
2143 2143
 											<td scope="row">
2144 2144
 												<label for="placeholder">
2145
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2145
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2146 2146
 												</label>
2147 2147
 											</td>
2148 2148
 											<td>
2149
-												<?php $hide = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2150
-												<input type="checkbox" name="field[<?php echo $field['group_id']; ?>][hide-label]" value="1" <?php checked( $hide , 1 ); ?>/>
2151
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2149
+												<?php $hide = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2150
+												<input type="checkbox" name="field[<?php echo $field[ 'group_id' ]; ?>][hide-label]" value="1" <?php checked( $hide, 1 ); ?>/>
2151
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2152 2152
 											</td>
2153 2153
 										</tr>
2154 2154
 										<!-- Toggle Buttons -->
@@ -2158,8 +2158,8 @@  discard block
 block discarded – undo
2158 2158
 											</td>
2159 2159
 											<td>
2160 2160
 												<span class="toggle-container">
2161
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2162
-													<a href="#" class="remove-field" alt="<?php echo $field['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2161
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2162
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2163 2163
 												</span>
2164 2164
 											</td>
2165 2165
 										</tr>
@@ -2173,38 +2173,38 @@  discard block
 block discarded – undo
2173 2173
 				}
2174 2174
 			} else {
2175 2175
 				?>
2176
-					<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>
2176
+					<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>
2177 2177
 				<?php
2178 2178
 			}
2179 2179
 				/* Pre Defined Merge Tag Container - Always rendered so the modal appears and links are clickable on initial page load */
2180 2180
 				add_thickbox();
2181 2181
 				// enqueue jquery qtip for our tooltip
2182
-				wp_enqueue_script( 'jquery-qtip-tooltip' , YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) );
2183
-				wp_enqueue_style( 'jquery-qtip-style' ,  YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2182
+				wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) );
2183
+				wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2184 2184
 					$available_tags = array(
2185 2185
 						array(
2186 2186
 							'tag' => '{page_title}',
2187
-							'description' => '<h4 class="tooltip-title">' . __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_title}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post title that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ),
2187
+							'description' => '<h4 class="tooltip-title">' . __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_title}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post title that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ),
2188 2188
 							'title' => __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' )
2189 2189
 						),
2190 2190
 						array(
2191 2191
 							'tag' => '{page_id}',
2192
-							'description' => '<h4 class="tooltip-title">' . __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_id}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post ID that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ),
2192
+							'description' => '<h4 class="tooltip-title">' . __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_id}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post ID that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ),
2193 2193
 							'title' => __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' )
2194 2194
 						),
2195 2195
 						array(
2196 2196
 							'tag' => '{page_url}',
2197
-							'description' => '<h4 class="tooltip-title">' . __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_url}</small></h4><hr />' . __( 'Pre-populate the field with the current page URL that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ),
2197
+							'description' => '<h4 class="tooltip-title">' . __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_url}</small></h4><hr />' . __( 'Pre-populate the field with the current page URL that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ),
2198 2198
 							'title' => __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' )
2199 2199
 						),
2200 2200
 						array(
2201 2201
 							'tag' => '{blog_name}',
2202
-							'description' => '<h4 class="tooltip-title">' . __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{blog_name}</small></h4><hr />' . __( 'Pre-populate the field with the current blog name that the user is on when opting in to your mailing list. This is especially helpful for multi-site networks.' , 'yikes-inc-easy-mailchimp-extender' ),
2202
+							'description' => '<h4 class="tooltip-title">' . __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{blog_name}</small></h4><hr />' . __( 'Pre-populate the field with the current blog name that the user is on when opting in to your mailing list. This is especially helpful for multi-site networks.', 'yikes-inc-easy-mailchimp-extender' ),
2203 2203
 							'title' => __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' )
2204 2204
 						),
2205 2205
 						array(
2206 2206
 							'tag' => '{user_logged_in}',
2207
-							'description' => '<h4 class="tooltip-title">' . __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{user_logged_in}</small></h4><hr />' . __( 'Detects if a user is logged in and pre-populates the field with an appropriate value.' , 'yikes-inc-easy-mailchimp-extender' ),
2207
+							'description' => '<h4 class="tooltip-title">' . __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{user_logged_in}</small></h4><hr />' . __( 'Detects if a user is logged in and pre-populates the field with an appropriate value.', 'yikes-inc-easy-mailchimp-extender' ),
2208 2208
 							'title' => __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' )
2209 2209
 						),
2210 2210
 					);
@@ -2232,17 +2232,17 @@  discard block
 block discarded – undo
2232 2232
 				<div id="pre-defined-tag-container">
2233 2233
 					<input type="hidden" value="" class="clicked-input">
2234 2234
 					<div id="pre-defined-tag-interior-container">
2235
-						<h3><?php _e( 'Pre Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2236
-						<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>
2235
+						<h3><?php _e( 'Pre Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2236
+						<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>
2237 2237
 						<ul>
2238
-							<?php foreach( apply_filters( 'yikes-mailchimp-custom-default-value-tags' , $available_tags ) as $tag ) { ?>
2238
+							<?php foreach ( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2239 2239
 								<li class="tooltop-tag">
2240 2240
 									<!-- link/tag -->
2241
-									<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>
2241
+									<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>
2242 2242
 									<!-- help icon -->
2243 2243
 									<span class="dashicons dashicons-editor-help"></span>
2244 2244
 									<!-- tooltip -->
2245
-									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag['description']; ?></div>
2245
+									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag[ 'description' ]; ?></div>
2246 2246
 								</li>
2247 2247
 							<?php } ?>
2248 2248
 						</ul>
@@ -2258,32 +2258,32 @@  discard block
 block discarded – undo
2258 2258
 		*	-
2259 2259
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2260 2260
 		*/
2261
-		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2261
+		public function build_available_merge_vars( $form_fields, $available_merge_variables ) {
2262 2262
 			$fields_assigned_to_form = array();
2263
-			if( !empty( $form_fields ) ) {
2264
-				foreach( $form_fields as $assigned_field ) {
2263
+			if ( ! empty( $form_fields ) ) {
2264
+				foreach ( $form_fields as $assigned_field ) {
2265 2265
 					// print_r( $assigned_field) ;
2266 2266
 					// switch between merge variables and interest groups
2267
-					if( isset( $assigned_field['merge'] ) ) {
2268
-						$fields_assigned_to_form[] = $assigned_field['merge'];
2267
+					if ( isset( $assigned_field[ 'merge' ] ) ) {
2268
+						$fields_assigned_to_form[ ] = $assigned_field[ 'merge' ];
2269 2269
 					}
2270 2270
 				}
2271 2271
 			}
2272
-			if( !empty( $available_merge_variables['data'][0] ) ) {
2272
+			if ( ! empty( $available_merge_variables[ 'data' ][ 0 ] ) ) {
2273 2273
 				?><ul id="available-fields"><?php
2274
-				foreach( $available_merge_variables['data'][0]['merge_vars'] as $merge_var ) {
2275
-					if( in_array( $merge_var['tag'] , $fields_assigned_to_form ) ) {
2274
+				foreach ( $available_merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] as $merge_var ) {
2275
+					if ( in_array( $merge_var[ 'tag' ], $fields_assigned_to_form ) ) {
2276 2276
 						?>
2277
-							<li class="available-form-field not-available" alt="<?php echo $merge_var['tag']; ?>" data-attr-field-type="<?php echo $merge_var['field_type']; ?>" data-attr-field-name="<?php echo $merge_var['name']; ?>" data-attr-form-id="<?php echo $available_merge_variables['data'][0]['id']; ?>" title="<?php _e( 'Already assigned to your form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $merge_var['name'] ); if( $merge_var['req'] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field' , 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var['field_type']; ?></small></li>
2277
+							<li class="available-form-field not-available" alt="<?php echo $merge_var[ 'tag' ]; ?>" data-attr-field-type="<?php echo $merge_var[ 'field_type' ]; ?>" data-attr-field-name="<?php echo $merge_var[ 'name' ]; ?>" data-attr-form-id="<?php echo $available_merge_variables[ 'data' ][ 0 ][ 'id' ]; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $merge_var[ 'name' ] ); if ( $merge_var[ 'req' ] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var[ 'field_type' ]; ?></small></li>
2278 2278
 						<?php
2279 2279
 					} else {
2280 2280
 						?>
2281
-							<li class="available-form-field" alt="<?php echo $merge_var['tag']; ?>" data-attr-field-type="<?php echo $merge_var['field_type']; ?>" data-attr-field-name="<?php echo $merge_var['name']; ?>" data-attr-form-id="<?php echo $available_merge_variables['data'][0]['id']; ?>"><?php echo stripslashes( $merge_var['name'] ); if( $merge_var['req'] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field' , 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var['field_type']; ?></small></li>
2281
+							<li class="available-form-field" alt="<?php echo $merge_var[ 'tag' ]; ?>" data-attr-field-type="<?php echo $merge_var[ 'field_type' ]; ?>" data-attr-field-name="<?php echo $merge_var[ 'name' ]; ?>" data-attr-form-id="<?php echo $available_merge_variables[ 'data' ][ 0 ][ 'id' ]; ?>"><?php echo stripslashes( $merge_var[ 'name' ] ); if ( $merge_var[ 'req' ] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var[ 'field_type' ]; ?></small></li>
2282 2282
 						<?php
2283 2283
 					}
2284 2284
 				}
2285 2285
 				?></ul>
2286
-				<a href="#" class="add-field-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
2286
+				<a href="#" class="add-field-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
2287 2287
 				<?php
2288 2288
 			}
2289 2289
 		}
@@ -2295,30 +2295,30 @@  discard block
 block discarded – undo
2295 2295
 		*	-
2296 2296
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2297 2297
 		*/
2298
-		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2298
+		public function build_available_interest_groups( $form_fields, $available_interest_groups, $list_id ) {
2299 2299
 			$fields_assigned_to_form = array();
2300
-			if( !empty( $form_fields ) ) {
2301
-					foreach( $form_fields as $assigned_interest_group ) {
2302
-					if( isset( $assigned_interest_group['group_id'] ) ) {
2303
-						$fields_assigned_to_form[] = $assigned_interest_group['group_id'];
2300
+			if ( ! empty( $form_fields ) ) {
2301
+					foreach ( $form_fields as $assigned_interest_group ) {
2302
+					if ( isset( $assigned_interest_group[ 'group_id' ] ) ) {
2303
+						$fields_assigned_to_form[ ] = $assigned_interest_group[ 'group_id' ];
2304 2304
 					}
2305 2305
 				}
2306 2306
 			}
2307
-			if( !empty( $available_interest_groups) ) {
2307
+			if ( ! empty( $available_interest_groups ) ) {
2308 2308
 				?><ul id="available-interest-groups"><?php
2309
-				foreach( $available_interest_groups as $interest_group ) {
2310
-					if( in_array( $interest_group['id'] , $fields_assigned_to_form ) ) {
2309
+				foreach ( $available_interest_groups as $interest_group ) {
2310
+					if ( in_array( $interest_group[ 'id' ], $fields_assigned_to_form ) ) {
2311 2311
 						?>
2312
-							<li class="available-interest-group not-available" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['name'] ); ?>" data-attr-field-type="<?php echo $interest_group['form_field']; ?>" data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $interest_group['name'] ); ?> <small class="field-type-text"><?php echo $interest_group['form_field']; ?></small></li>
2312
+							<li class="available-interest-group not-available" alt="<?php echo $interest_group[ 'id' ]; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group[ 'name' ] ); ?>" data-attr-field-type="<?php echo $interest_group[ 'form_field' ]; ?>" data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $interest_group[ 'name' ] ); ?> <small class="field-type-text"><?php echo $interest_group[ 'form_field' ]; ?></small></li>
2313 2313
 						<?php
2314 2314
 					} else {
2315 2315
 						?>
2316
-							<li class="available-interest-group" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['name'] ); ?>" data-attr-field-type="<?php echo $interest_group['form_field']; ?>" data-attr-form-id="<?php echo $list_id; ?>"><?php echo stripslashes( $interest_group['name'] ); ?> <small class="field-type-text"><?php echo $interest_group['form_field']; ?></small></li>
2316
+							<li class="available-interest-group" alt="<?php echo $interest_group[ 'id' ]; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group[ 'name' ] ); ?>" data-attr-field-type="<?php echo $interest_group[ 'form_field' ]; ?>" data-attr-form-id="<?php echo $list_id; ?>"><?php echo stripslashes( $interest_group[ 'name' ] ); ?> <small class="field-type-text"><?php echo $interest_group[ 'form_field' ]; ?></small></li>
2317 2317
 						<?php
2318 2318
 					}
2319 2319
 				}
2320 2320
 				?></ul>
2321
-				<a href="#" class="add-interest-group-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
2321
+				<a href="#" class="add-interest-group-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
2322 2322
 				<?php
2323 2323
 			}
2324 2324
 		}
@@ -2330,9 +2330,9 @@  discard block
 block discarded – undo
2330 2330
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2331 2331
 		*/
2332 2332
 		public function yikes_easy_mailchimp_create_form() {
2333
-			$nonce = $_REQUEST['nonce'];
2334
-			if( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2335
-				die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) );
2333
+			$nonce = $_REQUEST[ 'nonce' ];
2334
+			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2335
+				die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ) );
2336 2336
 			}
2337 2337
 			global $wpdb;
2338 2338
 				/* Default values */
@@ -2354,7 +2354,7 @@  discard block
 block discarded – undo
2354 2354
 					)
2355 2355
 				);
2356 2356
 				// setup our default error message array
2357
-				$error_settings= json_encode(
2357
+				$error_settings = json_encode(
2358 2358
 					array(
2359 2359
 						'success' => '',
2360 2360
 						'general-error' => '',
@@ -2367,9 +2367,9 @@  discard block
 block discarded – undo
2367 2367
 				$wpdb->insert(
2368 2368
 					$wpdb->prefix . 'yikes_easy_mc_forms',
2369 2369
 					array(
2370
-						'list_id' => $_POST['associated-list'],
2371
-						'form_name' => stripslashes( $_POST['form-name'] ),
2372
-						'form_description' => stripslashes( $_POST['form-description'] ),
2370
+						'list_id' => $_POST[ 'associated-list' ],
2371
+						'form_name' => stripslashes( $_POST[ 'form-name' ] ),
2372
+						'form_description' => stripslashes( $_POST[ 'form-description' ] ),
2373 2373
 						'fields' => '',
2374 2374
 						'custom_styles' => 0,
2375 2375
 						'custom_template' => 0,
@@ -2390,33 +2390,33 @@  discard block
 block discarded – undo
2390 2390
 						'%s', // form description
2391 2391
 						'%s', // fields
2392 2392
 						'%s', // custom styles
2393
-						'%d',	// custom template
2394
-						'%d',	// send welcome email
2395
-						'%s',	// redirect user
2396
-						'%s',	// redirect page
2397
-						'%s',	// submission
2398
-						'%s',	// optin
2393
+						'%d', // custom template
2394
+						'%d', // send welcome email
2395
+						'%s', // redirect user
2396
+						'%s', // redirect page
2397
+						'%s', // submission
2398
+						'%s', // optin
2399 2399
 						'%s', // error
2400 2400
 						'%s', // custom notifications
2401
-						'%d',	// impressions #
2402
-						'%d',	// submissions #
2401
+						'%d', // impressions #
2402
+						'%d', // submissions #
2403 2403
 						'%s', // custom fields
2404 2404
 					)
2405 2405
 				);
2406 2406
 
2407 2407
 			// if an error occurs during the form creation process
2408
-			if( $wpdb->insert_id == '0' ) {
2408
+			if ( $wpdb->insert_id == '0' ) {
2409 2409
 				// write it to the error log
2410 2410
 				// if the form was not created successfully
2411
-				if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2411
+				if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2412 2412
 					require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2413 2413
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2414
-					$error_logging->yikes_easy_mailchimp_write_to_error_log( $wpdb->last_error , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2414
+					$error_logging->yikes_easy_mailchimp_write_to_error_log( $wpdb->last_error, __( "Creating a new form", 'yikes-inc-easy-mailchimp-extender' ), __( "Forms", 'yikes-inc-easy-mailchimp-extender' ) );
2415 2415
 				}
2416
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error='.urlencode( $wpdb->last_error ) ) ) );
2416
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( $wpdb->last_error ) ) ) );
2417 2417
 			} else {
2418 2418
 				// redirect the user to the new form edit page
2419
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id='.$wpdb->insert_id ) ) );
2419
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $wpdb->insert_id ) ) );
2420 2420
 			}
2421 2421
 			exit();
2422 2422
 			die();
@@ -2430,11 +2430,11 @@  discard block
 block discarded – undo
2430 2430
 		*/
2431 2431
 		public function yikes_easy_mailchimp_delete_form() {
2432 2432
 			// grab & store our variables ( associated list & form name )
2433
-			$nonce = $_REQUEST['nonce'];
2434
-			$post_id_to_delete = $_REQUEST['mailchimp-form'];
2433
+			$nonce = $_REQUEST[ 'nonce' ];
2434
+			$post_id_to_delete = $_REQUEST[ 'mailchimp-form' ];
2435 2435
 			// verify our nonce
2436
-			if( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2437
-				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 ) );
2436
+			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-' . $post_id_to_delete ) ) {
2437
+				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 ) );
2438 2438
 			}
2439 2439
 			global $wpdb;
2440 2440
 				/* Working Insert Function */
@@ -2459,39 +2459,39 @@  discard block
 block discarded – undo
2459 2459
 		*/
2460 2460
 		public function yikes_easy_mailchimp_duplicate_form() {
2461 2461
 			// grab & store our variables ( associated list & form name )
2462
-			$nonce = $_REQUEST['nonce'];
2463
-			$post_id_to_clone = $_REQUEST['mailchimp-form'];
2462
+			$nonce = $_REQUEST[ 'nonce' ];
2463
+			$post_id_to_clone = $_REQUEST[ 'mailchimp-form' ];
2464 2464
 			// verify our nonce
2465
-			if( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2466
-				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 ) );
2465
+			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-' . $post_id_to_clone ) ) {
2466
+				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 ) );
2467 2467
 			}
2468 2468
 			global $wpdb;
2469 2469
 				/* Working Insert Function */
2470
-				$form_data = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "yikes_easy_mc_forms WHERE id = ".$post_id_to_clone."");
2470
+				$form_data = $wpdb->get_row( "SELECT * FROM " . $wpdb->prefix . "yikes_easy_mc_forms WHERE id = " . $post_id_to_clone . "" );
2471 2471
 				// create empty array to populate with row data
2472 2472
 				$data = array();
2473 2473
 				// build a data array to duplicate
2474
-				foreach( $form_data as $id => $value ) {
2474
+				foreach ( $form_data as $id => $value ) {
2475 2475
 					// skip the ID field this is unique
2476
-					if( $id != 'id' ) {
2476
+					if ( $id != 'id' ) {
2477 2477
 						// append -Copy- to our new form
2478
-						if( $id == 'form_name' ) {
2478
+						if ( $id == 'form_name' ) {
2479 2479
 							$value = $value . ' - Copy -';
2480 2480
 						}
2481 2481
 						// reset the impressions and submissions back to 0
2482
-						if( $id == 'impressions' || $id == 'submissions' ) {
2482
+						if ( $id == 'impressions' || $id == 'submissions' ) {
2483 2483
 							$value = '0';
2484 2484
 						}
2485 2485
 
2486 2486
 						// add data to our array
2487
-						$data[$id] = $value;
2487
+						$data[ $id ] = $value;
2488 2488
 					}
2489 2489
 				}
2490 2490
 				// insert our new data
2491
-				if( $wpdb->insert(
2491
+				if ( $wpdb->insert(
2492 2492
 					$wpdb->prefix . 'yikes_easy_mc_forms',
2493 2493
 					apply_filters( 'yikes-mailchimp-duplicate-form-data', $data )
2494
-				)  === FALSE ) {
2494
+				) === FALSE ) {
2495 2495
 					// redirect the user to the manage forms page, display error
2496 2496
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp&duplicated-form=false' ) ) );
2497 2497
 				} else {
@@ -2507,15 +2507,15 @@  discard block
 block discarded – undo
2507 2507
 		*/
2508 2508
 		public function yikes_easy_mailchimp_reset_impression_stats() {
2509 2509
 			// grab & store our variables ( associated list & form name )
2510
-			$nonce = $_REQUEST['nonce'];
2511
-			$form_id_to_reset = $_REQUEST['mailchimp-form'];
2510
+			$nonce = $_REQUEST[ 'nonce' ];
2511
+			$form_id_to_reset = $_REQUEST[ 'mailchimp-form' ];
2512 2512
 			// verify our nonce
2513
-			if( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2514
-				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 ) );
2513
+			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-' . $form_id_to_reset ) ) {
2514
+				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 ) );
2515 2515
 			}
2516 2516
 			global $wpdb;
2517 2517
 			/* Update 'Impressions/Submissions' */
2518
-			if( $wpdb->update(
2518
+			if ( $wpdb->update(
2519 2519
 				$wpdb->prefix . 'yikes_easy_mc_forms',
2520 2520
 				array(
2521 2521
 					'impressions' => 0,
@@ -2539,35 +2539,35 @@  discard block
 block discarded – undo
2539 2539
 		*/
2540 2540
 		public function yikes_easy_mailchimp_update_form() {
2541 2541
 			// grab & store our variables ( associated list & form name )
2542
-			$nonce = $_REQUEST['nonce'];
2543
-			$form_id = $_REQUEST['id'];
2542
+			$nonce = $_REQUEST[ 'nonce' ];
2543
+			$form_id = $_REQUEST[ 'id' ];
2544 2544
 
2545 2545
 			// store our values!
2546
-			$list_id = $_POST['associated-list'];
2547
-			$form_name = stripslashes( $_POST['form-name'] );
2548
-			$form_description = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
2549
-			$send_welcome_email = $_POST['send-welcome-email'];
2550
-			$redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2551
-			$redirect_page = $_POST['redirect-user-to-selection'];
2552
-			if( isset( $_POST['custom-styles'] ) ) {
2553
-				$custom_styles = $_POST['custom-styles'];
2546
+			$list_id = $_POST[ 'associated-list' ];
2547
+			$form_name = stripslashes( $_POST[ 'form-name' ] );
2548
+			$form_description = sanitize_text_field( stripslashes( $_POST[ 'form-description' ] ) );
2549
+			$send_welcome_email = $_POST[ 'send-welcome-email' ];
2550
+			$redirect_user_on_submit = $_POST[ 'redirect-user-on-submission' ];
2551
+			$redirect_page = $_POST[ 'redirect-user-to-selection' ];
2552
+			if ( isset( $_POST[ 'custom-styles' ] ) ) {
2553
+				$custom_styles = $_POST[ 'custom-styles' ];
2554 2554
 			}
2555 2555
 
2556 2556
 			// stripslashes_deep on save, to prevent foreign languages from added excessive backslashes
2557
-			$assigned_fields = isset( $_POST['field'] ) ? json_encode( stripslashes_deep( $_POST['field'] ) ) : '';
2557
+			$assigned_fields = isset( $_POST[ 'field' ] ) ? json_encode( stripslashes_deep( $_POST[ 'field' ] ) ) : '';
2558 2558
 
2559 2559
 			// setup our custom styles serialized array
2560
-			if( isset( $custom_styles ) ) {
2560
+			if ( isset( $custom_styles ) ) {
2561 2561
 				$custom_styles = json_encode( array(
2562
-					'active' => $_POST['custom-styles'],
2563
-					'background_color' => $_POST['form-background-color'],
2564
-					'font_color' => $_POST['form-font-color'],
2565
-					'submit_button_color' => $_POST['form-submit-button-color'],
2566
-					'submit_button_text_color' => $_POST['form-submit-button-text-color'],
2567
-					'form_padding' => $_POST['form-padding'],
2568
-					'form_width' => $_POST['form-width'],
2569
-					'form_alignment' => $_POST['form-alignment'],
2570
-					'label_visible' => $_POST['label-visible']
2562
+					'active' => $_POST[ 'custom-styles' ],
2563
+					'background_color' => $_POST[ 'form-background-color' ],
2564
+					'font_color' => $_POST[ 'form-font-color' ],
2565
+					'submit_button_color' => $_POST[ 'form-submit-button-color' ],
2566
+					'submit_button_text_color' => $_POST[ 'form-submit-button-text-color' ],
2567
+					'form_padding' => $_POST[ 'form-padding' ],
2568
+					'form_width' => $_POST[ 'form-width' ],
2569
+					'form_alignment' => $_POST[ 'form-alignment' ],
2570
+					'label_visible' => $_POST[ 'label-visible' ]
2571 2571
 				) );
2572 2572
 			} else {
2573 2573
 				$custom_styles = 0;
@@ -2576,31 +2576,31 @@  discard block
 block discarded – undo
2576 2576
 			// setup our submission settings serialized array
2577 2577
 			$submission_settings = json_encode(
2578 2578
 				array(
2579
-					'ajax' => $_POST['form-ajax-submission'],
2580
-					'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2581
-					'redirect_page' => $_POST['redirect-user-to-selection'],
2582
-					'custom_redirect_url' => esc_url( $_POST['custom-redirect-url'] ),
2583
-					'hide_form_post_signup' => $_POST['hide-form-post-signup'],
2584
-					'replace_interests' => $_POST['replace-interest-groups'],
2579
+					'ajax' => $_POST[ 'form-ajax-submission' ],
2580
+					'redirect_on_submission' => $_POST[ 'redirect-user-on-submission' ],
2581
+					'redirect_page' => $_POST[ 'redirect-user-to-selection' ],
2582
+					'custom_redirect_url' => esc_url( $_POST[ 'custom-redirect-url' ] ),
2583
+					'hide_form_post_signup' => $_POST[ 'hide-form-post-signup' ],
2584
+					'replace_interests' => $_POST[ 'replace-interest-groups' ],
2585 2585
 				)
2586 2586
 			);
2587 2587
 
2588 2588
 			// setup our opt-in settings serialized array
2589 2589
 			$optin_settings = json_encode(
2590 2590
 				array(
2591
-					'optin' => $_POST['single-double-optin'],
2592
-					'update_existing_user' => $_POST['update-existing-user'],
2593
-					'send_welcome_email' => $_POST['send-welcome-email'],
2591
+					'optin' => $_POST[ 'single-double-optin' ],
2592
+					'update_existing_user' => $_POST[ 'update-existing-user' ],
2593
+					'send_welcome_email' => $_POST[ 'send-welcome-email' ],
2594 2594
 				)
2595 2595
 			);
2596 2596
 
2597 2597
 			// setup our error settings serialized array
2598 2598
 			$error_settings = json_encode(
2599 2599
 				array(
2600
-					'success' => trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2601
-					'general-error' => trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2602
-					'invalid-email' => trim( $_POST['yikes-easy-mc-invalid-email-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-invalid-email-message'] ) ) : '',
2603
-					'already-subscribed' => trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2600
+					'success' => trim( $_POST[ 'yikes-easy-mc-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-message' ] ) ) : '',
2601
+					'general-error' => trim( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ) : '',
2602
+					'invalid-email' => trim( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ) : '',
2603
+					'already-subscribed' => trim( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ) : '',
2604 2604
 				)
2605 2605
 			);
2606 2606
 
@@ -2609,33 +2609,33 @@  discard block
 block discarded – undo
2609 2609
 			// To Do: Combine date & time so it's a single unix timestamp
2610 2610
 			$form_settings = json_encode(
2611 2611
 				array(
2612
-					'yikes-easy-mc-form-class-names' => trim( $_POST['yikes-easy-mc-form-class-names'] ),
2613
-					'yikes-easy-mc-inline-form' => $_POST['yikes-easy-mc-inline-form'][0],
2614
-					'yikes-easy-mc-submit-button-type' => $_POST['yikes-easy-mc-submit-button-type'][0],
2615
-					'yikes-easy-mc-submit-button-text' => trim( $_POST['yikes-easy-mc-submit-button-text'] ),
2616
-					'yikes-easy-mc-submit-button-image' => esc_url( trim( $_POST['yikes-easy-mc-submit-button-image'] ) ),
2617
-					'yikes-easy-mc-submit-button-classes' => trim( $_POST['yikes-easy-mc-submit-button-classes'] ),
2618
-					'yikes-easy-mc-form-schedule' => ( isset( $_POST['yikes-easy-mc-form-schedule'] ) ) ? '1' : '0',
2619
-					'yikes-easy-mc-form-restriction-start' => strtotime( $_POST['yikes-easy-mc-form-restriction-start-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-start-time'] ),
2620
-					'yikes-easy-mc-form-restriction-end' => strtotime( $_POST['yikes-easy-mc-form-restriction-end-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-end-time'] ),
2621
-					'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST['yikes-easy-mc-form-restriction-pending-message'] ),
2622
-					'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST['yikes-easy-mc-form-restriction-expired-message'] ),
2623
-					'yikes-easy-mc-form-login-required' => ( isset( $_POST['yikes-easy-mc-form-login-required'] ) ) ? '1' : '0',
2624
-					'yikes-easy-mc-form-restriction-login-message' => trim( $_POST['yikes-easy-mc-form-restriction-login-message'] ),
2612
+					'yikes-easy-mc-form-class-names' => trim( $_POST[ 'yikes-easy-mc-form-class-names' ] ),
2613
+					'yikes-easy-mc-inline-form' => $_POST[ 'yikes-easy-mc-inline-form' ][ 0 ],
2614
+					'yikes-easy-mc-submit-button-type' => $_POST[ 'yikes-easy-mc-submit-button-type' ][ 0 ],
2615
+					'yikes-easy-mc-submit-button-text' => trim( $_POST[ 'yikes-easy-mc-submit-button-text' ] ),
2616
+					'yikes-easy-mc-submit-button-image' => esc_url( trim( $_POST[ 'yikes-easy-mc-submit-button-image' ] ) ),
2617
+					'yikes-easy-mc-submit-button-classes' => trim( $_POST[ 'yikes-easy-mc-submit-button-classes' ] ),
2618
+					'yikes-easy-mc-form-schedule' => ( isset( $_POST[ 'yikes-easy-mc-form-schedule' ] ) ) ? '1' : '0',
2619
+					'yikes-easy-mc-form-restriction-start' => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-start-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-start-time' ] ),
2620
+					'yikes-easy-mc-form-restriction-end' => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-end-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-end-time' ] ),
2621
+					'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-pending-message' ] ),
2622
+					'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-expired-message' ] ),
2623
+					'yikes-easy-mc-form-login-required' => ( isset( $_POST[ 'yikes-easy-mc-form-login-required' ] ) ) ? '1' : '0',
2624
+					'yikes-easy-mc-form-restriction-login-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-login-message' ] ),
2625 2625
 				)
2626 2626
 			);
2627 2627
 
2628 2628
 			// setup and store our notification array
2629
-			$custom_notifications = isset( $_POST['custom-notification'] ) ? stripslashes( json_encode( $_POST['custom-notification'] ) ) : '';
2629
+			$custom_notifications = isset( $_POST[ 'custom-notification' ] ) ? stripslashes( json_encode( $_POST[ 'custom-notification' ] ) ) : '';
2630 2630
 
2631 2631
 			// additional custom fields (extensions / user defined fields)
2632
-			if( isset( $_POST['custom-field'] ) ) {
2632
+			if ( isset( $_POST[ 'custom-field' ] ) ) {
2633 2633
 				$custom_field_array = array();
2634
-				foreach( $_POST['custom-field'] as $custom_field => $custom_value ) {
2635
-					if( is_array( $custom_value ) ) {
2636
-						$custom_field_array[$custom_field] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2634
+				foreach ( $_POST[ 'custom-field' ] as $custom_field => $custom_value ) {
2635
+					if ( is_array( $custom_value ) ) {
2636
+						$custom_field_array[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2637 2637
 					} else {
2638
-						$custom_field_array[$custom_field] = stripslashes( $custom_value );
2638
+						$custom_field_array[ $custom_field ] = stripslashes( $custom_value );
2639 2639
 					}
2640 2640
 				}
2641 2641
 				$custom_fields = json_encode( $custom_field_array );
@@ -2644,8 +2644,8 @@  discard block
 block discarded – undo
2644 2644
 			}
2645 2645
 
2646 2646
 			// verify our nonce
2647
-			if( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-'.$form_id ) ) {
2648
-				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 ) );
2647
+			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
2648
+				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 ) );
2649 2649
 			}
2650 2650
 
2651 2651
 				global $wpdb;
@@ -2677,12 +2677,12 @@  discard block
 block discarded – undo
2677 2677
 						'%s', // form description
2678 2678
 						'%s', // fields
2679 2679
 						'%s', // custom styles
2680
-						'%d',	//custom template
2681
-						'%d',	// send welcome email
2682
-						'%s',	// redirect user
2683
-						'%s',	// redirect page
2684
-						'%s',	// submission
2685
-						'%s',	// opt-in
2680
+						'%d', //custom template
2681
+						'%d', // send welcome email
2682
+						'%s', // redirect user
2683
+						'%s', // redirect page
2684
+						'%s', // submission
2685
+						'%s', // opt-in
2686 2686
 						'%s', // error
2687 2687
 						'%s', // custom notifications
2688 2688
 						'%s', // custom fields
@@ -2691,7 +2691,7 @@  discard block
 block discarded – undo
2691 2691
 				);
2692 2692
 
2693 2693
 			/* Custom action hook which allows users to update specific options when a form is updated - used in add ons */
2694
-			do_action( 'yikes-mailchimp-save-form', $form_id,  json_decode( $custom_fields, true ) );
2694
+			do_action( 'yikes-mailchimp-save-form', $form_id, json_decode( $custom_fields, true ) );
2695 2695
 
2696 2696
 			// redirect the user to the manage forms page, display confirmation
2697 2697
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form_id . '&updated-form=true' ) ) );
@@ -2701,18 +2701,18 @@  discard block
 block discarded – undo
2701 2701
 
2702 2702
 		/* Unsubscribe a given user from our list */
2703 2703
 		public function yikes_easy_mailchimp_unsubscribe_user() {
2704
-			$nonce = $_REQUEST['nonce'];
2705
-			$list_id = $_REQUEST['mailchimp-list'];
2706
-			$email_id = $_REQUEST['email_id'];
2704
+			$nonce = $_REQUEST[ 'nonce' ];
2705
+			$list_id = $_REQUEST[ 'mailchimp-list' ];
2706
+			$email_id = $_REQUEST[ 'email_id' ];
2707 2707
 			// verify our nonce
2708
-			if( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2709
-				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 ) );
2708
+			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2709
+				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 ) );
2710 2710
 			}
2711 2711
 			// only re-run the API request if our API key has changed
2712 2712
 			// initialize MailChimp Class
2713
-			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
2713
+			$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
2714 2714
 			$dash_position = strpos( $api_key, '-' );
2715
-			if( $dash_position !== false ) {
2715
+			if ( $dash_position !== false ) {
2716 2716
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/unsubscribe.json';
2717 2717
 			}
2718 2718
 			$response = wp_remote_post( $api_endpoint, array(
@@ -2726,13 +2726,13 @@  discard block
 block discarded – undo
2726 2726
 				'timeout' => 10,
2727 2727
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2728 2728
 			) );
2729
-			if( ! is_wp_error( $response ) ) {
2729
+			if ( ! is_wp_error( $response ) ) {
2730 2730
 				$response_body = json_decode( wp_remote_retrieve_body( $response ), true );
2731
-				if( isset( $response_body['error'] ) ) {
2732
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2731
+				if ( isset( $response_body[ 'error' ] ) ) {
2732
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2733 2733
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2734 2734
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2735
-						$error_logging->yikes_easy_mailchimp_write_to_error_log( $response_body['error'], __( "Unsubscribe User" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Manage List Page" , 'yikes-inc-easy-mailchimp-extender' ) );
2735
+						$error_logging->yikes_easy_mailchimp_write_to_error_log( $response_body[ 'error' ], __( "Unsubscribe User", 'yikes-inc-easy-mailchimp-extender' ), __( "Manage List Page", 'yikes-inc-easy-mailchimp-extender' ) );
2736 2736
 					}
2737 2737
 				}
2738 2738
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id . '&user-unsubscribed=true' ) ) );
@@ -2743,21 +2743,21 @@  discard block
 block discarded – undo
2743 2743
 
2744 2744
 		public function yikes_easy_mailchimp_create_missing_error_log() {
2745 2745
 			// grab our nonnce
2746
-			$nonce = $_REQUEST['nonce'];
2746
+			$nonce = $_REQUEST[ 'nonce' ];
2747 2747
 			// validate nonce
2748
-			if( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2749
-				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 ) );
2748
+			if ( ! wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2749
+				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 ) );
2750 2750
 			}
2751 2751
 			// setup the path to the error log
2752
-			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php' , 'w' );
2752
+			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' );
2753 2753
 			try {
2754 2754
 				// create the file
2755
-				fwrite( $error_log , '' );
2755
+				fwrite( $error_log, '' );
2756 2756
 				// close out
2757 2757
 				fclose( $error_log );
2758 2758
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=true' ) ) );
2759 2759
 			} catch ( Exception $e ) {
2760
-				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() ) ) ) );
2760
+				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() ) ) ) );
2761 2761
 			}
2762 2762
 		}
2763 2763
 
@@ -2767,16 +2767,16 @@  discard block
 block discarded – undo
2767 2767
 		*/
2768 2768
 		public function yikes_easy_mailchimp_clear_transient_data() {
2769 2769
 			// grab & store our variables ( associated list & form name )
2770
-			$nonce = $_REQUEST['nonce'];
2770
+			$nonce = $_REQUEST[ 'nonce' ];
2771 2771
 			// verify our nonce
2772
-			if( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2773
-				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 ) );
2772
+			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2773
+				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 ) );
2774 2774
 			}
2775 2775
 			// delete all of the integration settings list data in the cache
2776 2776
 			$list_ids = $this->get_mailchimp_list_ids_on_account();
2777 2777
 			// confirm the list IDs was returned and is not empty
2778
-			if( isset( $list_ids ) && ! empty( $list_ids ) ) {
2779
-				foreach( $list_ids as $id ) {
2778
+			if ( isset( $list_ids ) && ! empty( $list_ids ) ) {
2779
+				foreach ( $list_ids as $id ) {
2780 2780
 					// loop over each interest group and delete the transient associated with it
2781 2781
 					// this is created & stored on the integration list page
2782 2782
 					// id = groupID_interest_group
@@ -2802,13 +2802,13 @@  discard block
 block discarded – undo
2802 2802
 		*	@return 	$list_id_array - array of list id's to loop over
2803 2803
 		*/
2804 2804
 		public function get_mailchimp_list_ids_on_account() {
2805
-			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
2806
-			if( ! $api_key ) {
2805
+			$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
2806
+			if ( ! $api_key ) {
2807 2807
 				// if no api key is set/site is not connected, return an empty array
2808 2808
 				return array();
2809 2809
 			}
2810 2810
 			$dash_position = strpos( $api_key, '-' );
2811
-			if( $dash_position !== false ) {
2811
+			if ( $dash_position !== false ) {
2812 2812
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
2813 2813
 			}
2814 2814
 			$mailchimp_lists = wp_remote_post( $api_endpoint, array(
@@ -2819,19 +2819,19 @@  discard block
 block discarded – undo
2819 2819
 				'timeout' => 10,
2820 2820
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2821 2821
 			) );
2822
-			if( ! is_wp_error( $mailchimp_lists ) ) {
2822
+			if ( ! is_wp_error( $mailchimp_lists ) ) {
2823 2823
 				$list_data = json_decode( wp_remote_retrieve_body( $mailchimp_lists ), true );
2824
-				if( isset( $list_data['error'] ) ) {
2825
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2824
+				if ( isset( $list_data[ 'error' ] ) ) {
2825
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2826 2826
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2827 2827
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2828
-						$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get List IDs" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Clear API Cache" , 'yikes-inc-easy-mailchimp-extender' ) );
2828
+						$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get List IDs", 'yikes-inc-easy-mailchimp-extender' ), __( "Clear API Cache", 'yikes-inc-easy-mailchimp-extender' ) );
2829 2829
 					}
2830 2830
 				}
2831 2831
 				$mail_chimp_list_ids = array();
2832
-				if( $mailchimp_lists ) {
2833
-					foreach( $list_data as $list ) {
2834
-						$mail_chimp_list_ids[] = $list['id'];
2832
+				if ( $mailchimp_lists ) {
2833
+					foreach ( $list_data as $list ) {
2834
+						$mail_chimp_list_ids[ ] = $list[ 'id' ];
2835 2835
 					}
2836 2836
 					return $mail_chimp_list_ids;
2837 2837
 				} else {
@@ -2847,7 +2847,7 @@  discard block
 block discarded – undo
2847 2847
 		*/
2848 2848
 		public function yikes_mailchimp_load_helper_class() {
2849 2849
 			// check to see if it's already loaded up
2850
-			if( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2850
+			if ( ! class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2851 2851
 				// Include our main helper class file
2852 2852
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' );
2853 2853
 			}
@@ -2864,7 +2864,7 @@  discard block
 block discarded – undo
2864 2864
 			// get the current set color scheme for the logged in user
2865 2865
 			$current_color_scheme = get_user_option( 'admin_color' );
2866 2866
 			// switch over each color scheme, and set our variable
2867
-			switch( $current_color_scheme ) {
2867
+			switch ( $current_color_scheme ) {
2868 2868
 				default:
2869 2869
 				case 'fresh': // default blue (defined by this plugin)
2870 2870
 					$main_color = '#00a0d2';
@@ -2923,7 +2923,7 @@  discard block
 block discarded – undo
2923 2923
 		*	@since 6.0.4
2924 2924
 		*/
2925 2925
 		public function check_yikes_mc_table_version() {
2926
-			if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2926
+			if ( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2927 2927
 				require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php';
2928 2928
 				global $wpdb;
2929 2929
 				Yikes_Inc_Easy_Mailchimp_Extender_Activator::_activate_yikes_easy_mailchimp( $wpdb );
Please login to merge, or discard this patch.
public/partials/shortcodes/process_form_shortcode.php 1 patch
Spacing   +300 added lines, -300 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 			'recaptcha_data_callback' => '', // set a custom js callback function to run after a successful recaptcha response - default none
22 22
 			'recaptcha_expired_callback' => '', // set a custom js callback function to run after the recaptcha has expired - default none
23 23
 			'inline' => '0',
24
-		), $atts , 'yikes-mailchimp' )
24
+		), $atts, 'yikes-mailchimp' )
25 25
 	);
26 26
 
27 27
 	// set globals
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	$form_submitted = isset( $form_submitted ) ? $form_submitted : 0;
32 32
 
33 33
 	/* If the user hasn't authenticated yet, lets kill off */
34
-	if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
35
-		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>';
34
+	if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) {
35
+		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>';
36 36
 	}
37 37
 
38 38
 	// if the user forgot to specify a form ID, lets kill of and warn them.
39
-	if( ! $form ) {
39
+	if ( ! $form ) {
40 40
 		return __( 'Whoops, it looks like you forgot to specify a form to display.', 'yikes-inc-easy-mailchimp-extender' );
41 41
 	}
42 42
 
@@ -45,39 +45,39 @@  discard block
 block discarded – undo
45 45
 	$form_results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms WHERE id = ' . $form . '', ARRAY_A );
46 46
 
47 47
 	// confirm we have some results, or return an error
48
-	if( !$form_results ) {
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' );
48
+	if ( ! $form_results ) {
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
 		// allow users to manually set recaptcha (instead of globally - recaptcha="1"/recaptcha="0" - but still needs to be globally enabled on the settings page)
57
-		if( ! isset( $atts['recaptcha'] ) || ( isset( $atts['recaptcha'] ) && $atts['recaptcha'] == '1' ) ) {
57
+		if ( ! isset( $atts[ 'recaptcha' ] ) || ( isset( $atts[ 'recaptcha' ] ) && $atts[ 'recaptcha' ] == '1' ) ) {
58 58
 			// if either of the Private the Secret key is left blank, we should display an error back to the user
59
-			if( get_option( 'yikes-mc-recaptcha-site-key' , '' ) == '' ) {
60
-				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>';
59
+			if ( get_option( 'yikes-mc-recaptcha-site-key', '' ) == '' ) {
60
+				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 61
 			}
62
-			if( get_option( 'yikes-mc-recaptcha-secret-key' , '' ) == '' ) {
63
-				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>';
62
+			if ( get_option( 'yikes-mc-recaptcha-secret-key', '' ) == '' ) {
63
+				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 64
 			}
65 65
 
66
-			if( ! empty( $atts['recaptcha_type'] ) ) {
67
-				echo $atts['recaptcha_type'];
66
+			if ( ! empty( $atts[ 'recaptcha_type' ] ) ) {
67
+				echo $atts[ 'recaptcha_type' ];
68 68
 			}
69 69
 
70 70
 			// Store the site language (to load recaptcha in a specific language)
71 71
 			$locale = get_locale();
72 72
 			$locale_split = explode( '_', $locale );
73 73
 			// Setup reCAPTCHA parameters
74
-			$lang = ( isset( $locale_split ) ? $locale_split[0] : $locale );
75
-			$lang = ( isset( $atts['recaptcha_lang'] ) ) ? $atts['recaptcha_lang'] : $locale_split[0];
76
-			$type = ( isset( $atts['recaptcha_type'] ) ) ? strtolower( $atts['recaptcha_type'] ) : 'image'; // setup recaptcha type
77
-			$theme= ( isset( $atts['recaptcha_theme'] ) ) ? strtolower( $atts['recaptcha_theme'] ) : 'light'; // setup recaptcha theme
78
-			$size = ( isset( $atts['recaptcha_size'] ) ) ? strtolower( $atts['recaptcha_size'] ) : 'normal'; // setup recaptcha size
79
-			$data_callback = ( isset( $atts['recaptcha_data_callback'] ) ) ? $atts['recaptcha_data_callback'] : false; // setup recaptcha size
80
-			$expired_callback = ( isset( $atts['recaptcha_expired_callback'] ) ) ? $atts['recaptcha_expired_callback'] : false; // setup recaptcha size
74
+			$lang = ( isset( $locale_split ) ? $locale_split[ 0 ] : $locale );
75
+			$lang = ( isset( $atts[ 'recaptcha_lang' ] ) ) ? $atts[ 'recaptcha_lang' ] : $locale_split[ 0 ];
76
+			$type = ( isset( $atts[ 'recaptcha_type' ] ) ) ? strtolower( $atts[ 'recaptcha_type' ] ) : 'image'; // setup recaptcha type
77
+			$theme = ( isset( $atts[ 'recaptcha_theme' ] ) ) ? strtolower( $atts[ 'recaptcha_theme' ] ) : 'light'; // setup recaptcha theme
78
+			$size = ( isset( $atts[ 'recaptcha_size' ] ) ) ? strtolower( $atts[ 'recaptcha_size' ] ) : 'normal'; // setup recaptcha size
79
+			$data_callback = ( isset( $atts[ 'recaptcha_data_callback' ] ) ) ? $atts[ 'recaptcha_data_callback' ] : false; // setup recaptcha size
80
+			$expired_callback = ( isset( $atts[ 'recaptcha_expired_callback' ] ) ) ? $atts[ 'recaptcha_expired_callback' ] : false; // setup recaptcha size
81 81
 			// Pass the shortcode parameters through a filter
82 82
 			$recaptcha_shortcode_params = apply_filters( 'yikes-mailchimp-recaptcha-parameters', array(
83 83
 				'language' => $lang,
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 				'expired_callback' => $expired_callback,
89 89
 			), $form );
90 90
 			// enqueue Google recaptcha JS
91
-			wp_register_script( 'google-recaptcha-js' , 'https://www.google.com/recaptcha/api.js?hl=' . $recaptcha_shortcode_params['language'] . '&onload=renderReCaptchaCallback&render=explicit', array( 'jquery' ) , 'all' );
91
+			wp_register_script( 'google-recaptcha-js', 'https://www.google.com/recaptcha/api.js?hl=' . $recaptcha_shortcode_params[ 'language' ] . '&onload=renderReCaptchaCallback&render=explicit', array( 'jquery' ), 'all' );
92 92
 			wp_enqueue_script( 'google-recaptcha-js' );
93
-			$recaptcha_site_key = get_option( 'yikes-mc-recaptcha-site-key' , '' );
94
-			$recaptcha_box = '<div name="g-recaptcha" class="g-recaptcha" data-sitekey="' . $recaptcha_site_key . '" data-theme="' . $recaptcha_shortcode_params['theme'] . '" data-type="' . $recaptcha_shortcode_params['type'] . '" data-size="' . $recaptcha_shortcode_params['size'] . '" data-callback="' . $recaptcha_shortcode_params['success_callback'] . '" data-expired-callback="' . $recaptcha_shortcode_params['expired_callback'] . '"></div>';
93
+			$recaptcha_site_key = get_option( 'yikes-mc-recaptcha-site-key', '' );
94
+			$recaptcha_box = '<div name="g-recaptcha" class="g-recaptcha" data-sitekey="' . $recaptcha_site_key . '" data-theme="' . $recaptcha_shortcode_params[ 'theme' ] . '" data-type="' . $recaptcha_shortcode_params[ 'type' ] . '" data-size="' . $recaptcha_shortcode_params[ 'size' ] . '" data-callback="' . $recaptcha_shortcode_params[ 'success_callback' ] . '" data-expired-callback="' . $recaptcha_shortcode_params[ 'expired_callback' ] . '"></div>';
95 95
 			?>
96 96
 			<script type="text/javascript">
97 97
 				/* Script Callback to init. multiple recaptchas on a single page */
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 	}
119 119
 
120 120
 	// place our results into a seperate variable for easy looping
121
-	$form_data = $form_results[0];
121
+	$form_data = $form_results[ 0 ];
122 122
 
123 123
 	// store our variables
124
-	$form_id = (int) $form_data['id']; // form id (the id of the form in the database)
124
+	$form_id = (int) $form_data[ 'id' ]; // form id (the id of the form in the database)
125 125
 
126 126
 	/*
127 127
 	*	Get the stored form settings
@@ -130,32 +130,32 @@  discard block
 block discarded – undo
130 130
 	*/
131 131
 	$form_settings = Yikes_Inc_Easy_Mailchimp_Extender_Public::yikes_retrieve_form_settings( $form_id );
132 132
 
133
-	$additional_form_settings = ( isset( $form_data['form_settings'] ) ) ? json_decode( $form_data['form_settings'], true ) : false;
133
+	$additional_form_settings = ( isset( $form_data[ 'form_settings' ] ) ) ? json_decode( $form_data[ 'form_settings' ], true ) : false;
134 134
 	// store our options from the additional form settings array
135
-	$form_classes = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-class-names'] : '';
136
-	$inline_form = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-inline-form'] : '';
137
-	$submit_button_type = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-submit-button-type'] : 'text';
138
-	$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' );
139
-	$submit_button_image = ( $additional_form_settings ) ? esc_url( $additional_form_settings['yikes-easy-mc-submit-button-image'] ) : '';
140
-	$submit_button_classes = ( $additional_form_settings ) ? ' ' . esc_attr( $additional_form_settings['yikes-easy-mc-submit-button-classes'] ) : '';
135
+	$form_classes = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-class-names' ] : '';
136
+	$inline_form = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-inline-form' ] : '';
137
+	$submit_button_type = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-submit-button-type' ] : 'text';
138
+	$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' );
139
+	$submit_button_image = ( $additional_form_settings ) ? esc_url( $additional_form_settings[ 'yikes-easy-mc-submit-button-image' ] ) : '';
140
+	$submit_button_classes = ( $additional_form_settings ) ? ' ' . esc_attr( $additional_form_settings[ 'yikes-easy-mc-submit-button-classes' ] ) : '';
141 141
 	// scheuldes
142
-	$form_schedule_state = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-schedule'] : false;
143
-	$form_schedule_start = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-start'] : '';;
144
-	$form_schedule_end = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-end'] : '';
145
-	$form_pending_message = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-pending-message'] : '';
146
-	$form_expired_message = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-expired-message'] : '';
142
+	$form_schedule_state = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-schedule' ] : false;
143
+	$form_schedule_start = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-start' ] : ''; ;
144
+	$form_schedule_end = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-end' ] : '';
145
+	$form_pending_message = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-pending-message' ] : '';
146
+	$form_expired_message = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-expired-message' ] : '';
147 147
 	// register required
148
-	$form_login_required = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-login-required'] : false;
149
-	$form_login_message = ( $additional_form_settings ) ? $additional_form_settings['yikes-easy-mc-form-restriction-login-message'] : '';
148
+	$form_login_required = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-login-required' ] : false;
149
+	$form_login_message = ( $additional_form_settings ) ? $additional_form_settings[ 'yikes-easy-mc-form-restriction-login-message' ] : '';
150 150
 	// store number of fields
151
-	$field_count = (int) count( $form_settings['fields'] );
151
+	$field_count = (int) count( $form_settings[ 'fields' ] );
152 152
 
153 153
 	// confirm we actually have fields, before looping
154
-	if( isset( $form_data['fields'] ) && ! empty( $form_data['fields'] ) ) {
154
+	if ( isset( $form_data[ 'fields' ] ) && ! empty( $form_data[ 'fields' ] ) ) {
155 155
 		// loop over each field, if it's set to hidden -- subtract it from the field count
156 156
 		// this throws off the layout for inline forms setup below
157
-		foreach( json_decode( $form_data['fields'] ) as $form_field ) {
158
-			if( isset( $form_field->hide ) && $form_field->hide == 1 ) {
157
+		foreach ( json_decode( $form_data[ 'fields' ] ) as $form_field ) {
158
+			if ( isset( $form_field->hide ) && $form_field->hide == 1 ) {
159 159
 				$field_count--;
160 160
 			}
161 161
 		}
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 	*	If login is required, abort
166 166
 	*	@since 6.0.3.8
167 167
 	*/
168
-	if( $form_login_required ) {
169
-		if( apply_filters( 'yikes-mailchimp-required-login-requirement', ! is_user_logged_in() ) ) {
168
+	if ( $form_login_required ) {
169
+		if ( apply_filters( 'yikes-mailchimp-required-login-requirement', ! is_user_logged_in() ) ) {
170 170
 			ob_start();
171 171
 				?>
172 172
 					<div class="yikes-mailchimp-login-required yikes-mailchimp-form-<?php echo $form_id; ?>-login-required">
@@ -182,19 +182,19 @@  discard block
 block discarded – undo
182 182
 	*	Check if schedule is set for this form
183 183
 	*	@since 6.0.3.8
184 184
 	*/
185
-	if( $form_schedule_state ) {
185
+	if ( $form_schedule_state ) {
186 186
 		// store current date
187 187
 		$current_date = strtotime( current_time( 'm/d/Y g:iA' ) );
188 188
 
189 189
 		// the the current date is less than the form scheduled start date
190
-		if( $current_date < $form_schedule_start ) {
190
+		if ( $current_date < $form_schedule_start ) {
191 191
 			echo apply_filters( 'yikes-mailchimp-frontend-content', $form_pending_message );
192 192
 			return;
193 193
 			// abort
194 194
 		}
195 195
 
196 196
 		// The current date is past or equal to the end date, aka form has now expired
197
-		if( $current_date >= $form_schedule_end ) {
197
+		if ( $current_date >= $form_schedule_end ) {
198 198
 			echo apply_filters( 'yikes-mailchimp-frontend-content', $form_expired_message );
199 199
 			return;
200 200
 			// abort
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 
204 204
 	// setup the submit button text
205 205
 	// shortcode parameter takes precedence over option
206
-	if( isset( $atts['submit'] ) ) {
207
-		$submit = $atts['submit'];
206
+	if ( isset( $atts[ 'submit' ] ) ) {
207
+		$submit = $atts[ 'submit' ];
208 208
 	} else {
209 209
 		$submit = $submit_button_text;
210 210
 	}
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	$page_data = $post;
215 215
 
216 216
 	// Remove the post_password from this for security
217
-	if( isset( $page_data->post_password ) ) {
217
+	if ( isset( $page_data->post_password ) ) {
218 218
 		unset( $page_data->post_password );
219 219
 	}
220 220
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	*	to exclude styles from loading, add `define( 'YIKES_MAILCHIMP_EXCLUDE_STYLES', true );` to functions.php
229 229
 	*	@since 6.0.3.8
230 230
 	*/
231
-	if( ! defined( 'YIKES_MAILCHIMP_EXCLUDE_STYLES' ) ) {
231
+	if ( ! defined( 'YIKES_MAILCHIMP_EXCLUDE_STYLES' ) ) {
232 232
 		// enqueue the form styles
233 233
 		wp_enqueue_style( 'yikes-inc-easy-mailchimp-public-styles', YIKES_MC_URL . 'public/css/yikes-inc-easy-mailchimp-extender-public.min.css', array( $last_key ) );
234 234
 	}
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
 	/**
237 237
 	*	Check for form inline parameter
238 238
 	*/
239
-	$form_inline = ( isset( $atts['inline'] ) && ( $atts['inline'] == 1 || $atts['inline'] == 'true' ) ) ? true : false;
239
+	$form_inline = ( isset( $atts[ 'inline' ] ) && ( $atts[ 'inline' ] == 1 || $atts[ 'inline' ] == 'true' ) ) ? true : false;
240 240
 	// recheck from our form options
241
-	if( ! $form_inline ) {
242
-		$form_inline = ( isset( $additional_form_settings['yikes-easy-mc-inline-form'] ) && $additional_form_settings['yikes-easy-mc-inline-form'] == 1 ) ? true : false;
241
+	if ( ! $form_inline ) {
242
+		$form_inline = ( isset( $additional_form_settings[ 'yikes-easy-mc-inline-form' ] ) && $additional_form_settings[ 'yikes-easy-mc-inline-form' ] == 1 ) ? true : false;
243 243
 	}
244
-	if( $form_inline ) {
244
+	if ( $form_inline ) {
245 245
 		$field_width = (float) ( 100 / $field_count );
246 246
 		$submit_button_width = (float) ( 20 / $field_count );
247 247
 		/*
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
 	<?php
271 271
 
272 272
 		/* If the current user is logged in, and an admin...lets display our 'Edit Form' link */
273
-		if( is_user_logged_in() ) {
274
-			if( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
273
+		if ( is_user_logged_in() ) {
274
+			if ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
275 275
 				$edit_form_link = '<span class="edit-link">';
276
-					$edit_form_link .= '<a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form ) ) . '" title="' . __( 'Edit' , 'yikes-inc-easy-mailchimp-extender' ) . ' ' . ucwords( $form_settings['form_name'] ) . '">' . __( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
276
+					$edit_form_link .= '<a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form ) ) . '" title="' . __( 'Edit', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . ucwords( $form_settings[ 'form_name' ] ) . '">' . __( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
277 277
 				$edit_form_link .= '</span>';
278
-				$edit_form_link = apply_filters( 'yikes-mailchimp-front-end-form-action-links', $edit_form_link, $form, ucwords( $form_settings['form_name'] ) );
278
+				$edit_form_link = apply_filters( 'yikes-mailchimp-front-end-form-action-links', $edit_form_link, $form, ucwords( $form_settings[ 'form_name' ] ) );
279 279
 			} else {
280 280
 				$edit_form_link = '';
281 281
 			}
@@ -284,16 +284,16 @@  discard block
 block discarded – undo
284 284
 		// ensure there is an 'email' field the user can fill out
285 285
 		// or else MailChimp throws errors at you
286 286
 			// extract our array keys
287
-			if( isset( $form_settings['fields'] ) && ! empty( $form_settings['fields'] ) ) {
288
-				$array_keys = array_keys( $form_settings['fields'] );
287
+			if ( isset( $form_settings[ 'fields' ] ) && ! empty( $form_settings[ 'fields' ] ) ) {
288
+				$array_keys = array_keys( $form_settings[ 'fields' ] );
289 289
 				// check for EMAIL in that array
290
-				if( !in_array( 'EMAIL', $array_keys ) && !in_array( 'email', $array_keys ) ) {
291
-					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>';
290
+				if ( ! in_array( 'EMAIL', $array_keys ) && ! in_array( 'email', $array_keys ) ) {
291
+					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>';
292 292
 				}
293 293
 			} else {
294
-				$error = '<p>' . __( "Whoops, it looks like you forgot to assign fields to this form." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
295
-				if( is_user_logged_in() ) {
296
-					if( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
294
+				$error = '<p>' . __( "Whoops, it looks like you forgot to assign fields to this form.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
295
+				if ( is_user_logged_in() ) {
296
+					if ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
297 297
 						return $error . $edit_form_link;
298 298
 					}
299 299
 				} else {
@@ -311,13 +311,13 @@  discard block
 block discarded – undo
311 311
 		*	Set a custom title using custom_title="lorem ipsum" parameter in the shortcode
312 312
 		*	- This takes precedence over the title set
313 313
 		*/
314
-		if( ! empty( $title ) && $title == 1 && isset( $atts['custom_title'] ) ) {
315
-			echo '<h3 class="yikes-mailchimp-form-title yikes-mailchimp-form-title-'.$form_id.'">' . apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $atts['custom_title'] ), $form_id ) . '</h3>';
314
+		if ( ! empty( $title ) && $title == 1 && isset( $atts[ 'custom_title' ] ) ) {
315
+			echo '<h3 class="yikes-mailchimp-form-title yikes-mailchimp-form-title-' . $form_id . '">' . apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $atts[ 'custom_title' ] ), $form_id ) . '</h3>';
316 316
 		} else {
317 317
 			// display the form description if the user
318 318
 			// has specified to do so
319
-			if( ! empty( $title ) && $title == 1 ) {
320
-				echo '<h3 class="yikes-mailchimp-form-title yikes-mailchimp-form-title-'.$form_id.'">' . apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $form_settings['form_name'] ), $form_id ) . '</h3>';
319
+			if ( ! empty( $title ) && $title == 1 ) {
320
+				echo '<h3 class="yikes-mailchimp-form-title yikes-mailchimp-form-title-' . $form_id . '">' . apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $form_settings[ 'form_name' ] ), $form_id ) . '</h3>';
321 321
 			}
322 322
 		}
323 323
 
@@ -325,21 +325,21 @@  discard block
 block discarded – undo
325 325
 		*	Allow users to specify a custom description for this form, no html support
326 326
 		*	@since 6.0.3.8
327 327
 		*/
328
-		if( ! empty( $description ) && $description == 1 && isset( $atts['custom_description'] ) ) {
329
-			echo '<section class="yikes-mailchimp-form-description yikes-mailchimp-form-description-'.$form_id.'">' . apply_filters( 'yikes-mailchimp-frontend-content', apply_filters( 'yikes-mailchimp-form-description', $atts['custom_description'], $form_id ) ) . '</section>';
328
+		if ( ! empty( $description ) && $description == 1 && isset( $atts[ 'custom_description' ] ) ) {
329
+			echo '<section class="yikes-mailchimp-form-description yikes-mailchimp-form-description-' . $form_id . '">' . apply_filters( 'yikes-mailchimp-frontend-content', apply_filters( 'yikes-mailchimp-form-description', $atts[ 'custom_description' ], $form_id ) ) . '</section>';
330 330
 		} else {
331 331
 			// display the form description if the user
332 332
 			// has specified to do so
333
-			if( ! empty( $description ) && $description == 1 ) {
334
-				echo '<section class="yikes-mailchimp-form-description yikes-mailchimp-form-description-'.$form_id.'">' . apply_filters( 'yikes-mailchimp-frontend-content', apply_filters( 'yikes-mailchimp-form-description', $form_settings['form_description'], $form_id ) ) . '</section>';
333
+			if ( ! empty( $description ) && $description == 1 ) {
334
+				echo '<section class="yikes-mailchimp-form-description yikes-mailchimp-form-description-' . $form_id . '">' . apply_filters( 'yikes-mailchimp-frontend-content', apply_filters( 'yikes-mailchimp-form-description', $form_settings[ 'form_description' ], $form_id ) ) . '</section>';
335 335
 			}
336 336
 		}
337 337
 
338 338
 		// Check for AJAX
339
-		if( ( ! empty( $atts['ajax'] ) && $atts['ajax'] == 1 ) || $form_settings['submission_settings']['ajax'] == 1 ) {
339
+		if ( ( ! empty( $atts[ 'ajax' ] ) && $atts[ 'ajax' ] == 1 ) || $form_settings[ 'submission_settings' ][ 'ajax' ] == 1 ) {
340 340
 			// enqueue our ajax script
341
-			wp_register_script( 'yikes-easy-mc-ajax' , YIKES_MC_URL . 'public/js/yikes-mc-ajax-forms.min.js' , array( 'jquery' ) , 'yikes-inc-easy-mailchimp-extender', false );
342
-			wp_localize_script( 'yikes-easy-mc-ajax' , 'object' , array(
341
+			wp_register_script( 'yikes-easy-mc-ajax', YIKES_MC_URL . 'public/js/yikes-mc-ajax-forms.min.js', array( 'jquery' ), 'yikes-inc-easy-mailchimp-extender', false );
342
+			wp_localize_script( 'yikes-easy-mc-ajax', 'object', array(
343 343
 				'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
344 344
 				'page_data' => $page_data,
345 345
 				'interest_group_checkbox_error' => apply_filters( 'yikes-mailchimp-interest-group-checkbox-error', __( 'This field is required.', 'yikes-inc-easy-mailchimp-extender' ), $form_id ),
@@ -357,63 +357,63 @@  discard block
 block discarded – undo
357 357
 
358 358
 		// render the form!
359 359
 		?>
360
-			<form id="<?php echo sanitize_title( $form_settings['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_settings['submission_settings']['hide_form_post_signup'] == 1 ) { echo ' yikes-easy-mc-display-none'; } ?>" action="" method="POST" data-attr-form-id="<?php echo $form_id; ?>">
360
+			<form id="<?php echo sanitize_title( $form_settings[ '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_settings[ 'submission_settings' ][ 'hide_form_post_signup' ] == 1 ) { echo ' yikes-easy-mc-display-none'; } ?>" action="" method="POST" data-attr-form-id="<?php echo $form_id; ?>">
361 361
 
362 362
 				<?php
363
-				foreach( $form_settings['fields'] as $field ) {
363
+				foreach ( $form_settings[ 'fields' ] as $field ) {
364 364
 						// input array
365 365
 						$field_array = array();
366 366
 						// label array
367 367
 						$label_array = array();
368 368
 						// label classes array
369 369
 						$label_class_array = array();
370
-						if( $field['additional-classes'] != '' ) {
370
+						if ( $field[ 'additional-classes' ] != '' ) {
371 371
 							// split custom classes at spaces
372
-							$custom_classes = explode( ' ' , $field['additional-classes'] );
372
+							$custom_classes = explode( ' ', $field[ 'additional-classes' ] );
373 373
 							// check our custom class array for field-left/field-right
374 374
 							// if it's set we need to assign it to our label and remove it from the field classes
375 375
 							 // input half left
376
-							if( in_array( 'field-left-half' , $custom_classes ) ) {
376
+							if ( in_array( 'field-left-half', $custom_classes ) ) {
377 377
 								// $label_array['class'] = 'class="field-left-half"';
378
-								$label_class_array[] = 'field-left-half';
379
-								$key = array_search( 'field-left-half' , $custom_classes );
380
-								unset( $custom_classes[$key] );
378
+								$label_class_array[ ] = 'field-left-half';
379
+								$key = array_search( 'field-left-half', $custom_classes );
380
+								unset( $custom_classes[ $key ] );
381 381
 							} // input half right
382
-							if( in_array( 'field-right-half' , $custom_classes ) ) {
382
+							if ( in_array( 'field-right-half', $custom_classes ) ) {
383 383
 								// $label_array['class'] = 'class="field-right-half"';
384
-								$label_class_array[] = 'field-right-half';
385
-								$key = array_search( 'field-right-half' , $custom_classes );
386
-								unset( $custom_classes[$key] );
384
+								$label_class_array[ ] = 'field-right-half';
385
+								$key = array_search( 'field-right-half', $custom_classes );
386
+								unset( $custom_classes[ $key ] );
387 387
 							} // input thirds (1/3 width, floated left)
388
-							if( in_array( 'field-third' , $custom_classes ) ) {
388
+							if ( in_array( 'field-third', $custom_classes ) ) {
389 389
 								// $label_array['class'] = 'class="field-third"';
390
-								$label_class_array[] = 'field-third';
391
-								$key = array_search( 'field-third' , $custom_classes );
392
-								unset( $custom_classes[$key] );
390
+								$label_class_array[ ] = 'field-third';
391
+								$key = array_search( 'field-third', $custom_classes );
392
+								unset( $custom_classes[ $key ] );
393 393
 							} // 2 column radio
394
-							if( in_array( 'option-2-col' , $custom_classes ) ) {
394
+							if ( in_array( 'option-2-col', $custom_classes ) ) {
395 395
 								// $label_array['class'] = 'class="option-2-col"';
396
-								$label_class_array[] = 'option-2-col';
397
-								$key = array_search( 'option-2-col' , $custom_classes );
398
-								unset( $custom_classes[$key] );
396
+								$label_class_array[ ] = 'option-2-col';
397
+								$key = array_search( 'option-2-col', $custom_classes );
398
+								unset( $custom_classes[ $key ] );
399 399
 							} // 3 column radio
400
-							if( in_array( 'option-3-col' , $custom_classes ) ) {
400
+							if ( in_array( 'option-3-col', $custom_classes ) ) {
401 401
 								// $label_array['class'] = 'class="option-3-col"';
402
-								$label_class_array[] = 'option-3-col';
403
-								$key = array_search( 'option-3-col' , $custom_classes );
404
-								unset( $custom_classes[$key] );
402
+								$label_class_array[ ] = 'option-3-col';
403
+								$key = array_search( 'option-3-col', $custom_classes );
404
+								unset( $custom_classes[ $key ] );
405 405
 							} // 4 column radio
406
-							if( in_array( 'option-4-col' , $custom_classes ) ) {
406
+							if ( in_array( 'option-4-col', $custom_classes ) ) {
407 407
 								// $label_array['class'] = 'class="option-4-col"';
408
-								$label_class_array[] = 'option-4-col';
409
-								$key = array_search( 'option-4-col' , $custom_classes );
410
-								unset( $custom_classes[$key] );
408
+								$label_class_array[ ] = 'option-4-col';
409
+								$key = array_search( 'option-4-col', $custom_classes );
410
+								unset( $custom_classes[ $key ] );
411 411
 							} // inline radio & checkboxes etc
412
-							if( in_array( 'option-inline' , $custom_classes ) ) {
412
+							if ( in_array( 'option-inline', $custom_classes ) ) {
413 413
 								// $label_array['class'] = 'class="option-inline"';
414
-								$label_class_array[] = 'option-inline';
415
-								$key = array_search( 'option-inline' , $custom_classes );
416
-								unset( $custom_classes[$key] );
414
+								$label_class_array[ ] = 'option-inline';
415
+								$key = array_search( 'option-inline', $custom_classes );
416
+								unset( $custom_classes[ $key ] );
417 417
 							}
418 418
 						} else {
419 419
 							$custom_classes = array();
@@ -421,67 +421,67 @@  discard block
 block discarded – undo
421 421
 
422 422
 						// if the form is set to inline, add the inline class to our labels
423 423
 						// since @6.0.3.8
424
-						if( $form_inline ) {
425
-							$label_class_array[] = 'label-inline';
424
+						if ( $form_inline ) {
425
+							$label_class_array[ ] = 'label-inline';
426 426
 						}
427 427
 
428
-						if( isset( $field['hide-label'] ) ) {
429
-							if( $field['hide-label'] == 1 ) {
430
-								$custom_classes[] = 'field-no-label';
428
+						if ( isset( $field[ 'hide-label' ] ) ) {
429
+							if ( $field[ 'hide-label' ] == 1 ) {
430
+								$custom_classes[ ] = 'field-no-label';
431 431
 							}
432 432
 						}
433 433
 
434 434
 					/* Store tag variable based on field type */
435
-					if( isset( $field['merge'] ) ) {
435
+					if ( isset( $field[ 'merge' ] ) ) {
436 436
 						$tag = 'merge';
437 437
 					} else {
438 438
 						$tag = 'group_id';
439 439
 					}
440 440
 
441 441
 					// build up our array
442
-					$field_array['id'] = 'id="yikes-easy-mc-form-' . $form_id . '-' . esc_attr( $field[$tag] ) . '" ';
443
-					$field_array['name'] = 'name="' . esc_attr( $field[$tag] ) . '" ';
444
-					$field_array['placeholder'] = isset( $field['placeholder'] ) ? 'placeholder="' . esc_attr( stripslashes( $field['placeholder'] ) ) . '" ' : '';
445
-					$field_array['classes'] = 'class="yikes-easy-mc-'.$field['type'] . ' ' .  esc_attr( trim( implode( ' ' , $custom_classes ) ) ) . '" ';
442
+					$field_array[ 'id' ] = 'id="yikes-easy-mc-form-' . $form_id . '-' . esc_attr( $field[ $tag ] ) . '" ';
443
+					$field_array[ 'name' ] = 'name="' . esc_attr( $field[ $tag ] ) . '" ';
444
+					$field_array[ 'placeholder' ] = isset( $field[ 'placeholder' ] ) ? 'placeholder="' . esc_attr( stripslashes( $field[ 'placeholder' ] ) ) . '" ' : '';
445
+					$field_array[ 'classes' ] = 'class="yikes-easy-mc-' . $field[ 'type' ] . ' ' . esc_attr( trim( implode( ' ', $custom_classes ) ) ) . '" ';
446 446
 
447 447
 					// email must always be required and visible
448
-					if( $field['type'] == 'email' ) {
449
-						$field_array['required'] = 'required="required"';
450
-						$label_array['visible'] = '';
448
+					if ( $field[ 'type' ] == 'email' ) {
449
+						$field_array[ 'required' ] = 'required="required"';
450
+						$label_array[ 'visible' ] = '';
451 451
 						// $label_array['required'] = 'class="' . $field['merge'] . '-label yikes-mailchimp-field-required"';
452
-						$label_class_array[] = $field['merge'] . '-label';
453
-						$label_class_array[] = 'yikes-mailchimp-field-required';
452
+						$label_class_array[ ] = $field[ 'merge' ] . '-label';
453
+						$label_class_array[ ] = 'yikes-mailchimp-field-required';
454 454
 					} else {
455
-						if( $tag == 'merge' ) {
456
-							$field_array['required'] = isset( $field['require'] ) ? 'required="required"' : '';
457
-							$label_array['visible'] = isset( $field['hide'] ) ? 'style="display:none;"' : '';
455
+						if ( $tag == 'merge' ) {
456
+							$field_array[ 'required' ] = isset( $field[ 'require' ] ) ? 'required="required"' : '';
457
+							$label_array[ 'visible' ] = isset( $field[ 'hide' ] ) ? 'style="display:none;"' : '';
458 458
 							// $label_array['required'] = isset( $field['require'] ) ? 'class="' . $field['merge'] . '-label yikes-mailchimp-field-required"' : 'class="' . $field['merge'] . '-label"';
459
-							$label_class_array[] = isset( $field['require'] ) ? $field['merge'] . '-label yikes-mailchimp-field-required' : $field['merge'] . '-label';
459
+							$label_class_array[ ] = isset( $field[ 'require' ] ) ? $field[ 'merge' ] . '-label yikes-mailchimp-field-required' : $field[ 'merge' ] . '-label';
460 460
 						} else {
461
-							$field_array['required'] = isset( $field['require'] ) ? 'required="required"' : '';
462
-							$label_array['visible'] = isset( $field['hide'] ) ? 'style="display:none;"' : '';
461
+							$field_array[ 'required' ] = isset( $field[ 'require' ] ) ? 'required="required"' : '';
462
+							$label_array[ 'visible' ] = isset( $field[ 'hide' ] ) ? 'style="display:none;"' : '';
463 463
 							// $label_array['required'] = isset( $field['require'] ) ? 'class="' . $field['group_id'] . '-label yikes-mailchimp-field-required"' : 'class="' . $field['group_id'] . '-label"';
464
-							$label_class_array[] = isset( $field['require'] ) ? $field['group_id'] . '-label yikes-mailchimp-field-required' : $field['group_id'] . '-label';
464
+							$label_class_array[ ] = isset( $field[ 'require' ] ) ? $field[ 'group_id' ] . '-label yikes-mailchimp-field-required' : $field[ 'group_id' ] . '-label';
465 465
 						}
466 466
 					}
467 467
 
468 468
 					// if both hide label and hide field are checked, we gotta hide the field!
469
-					if( isset( $field['hide' ] ) && $field['hide'] == 1 ) {
470
-						if( isset( $field['hide-label' ] ) && $field['hide-label'] == 1 ) {
471
-							$field_array['visible'] = 'style="display:none;"';
469
+					if ( isset( $field[ 'hide' ] ) && $field[ 'hide' ] == 1 ) {
470
+						if ( isset( $field[ 'hide-label' ] ) && $field[ 'hide-label' ] == 1 ) {
471
+							$field_array[ 'visible' ] = 'style="display:none;"';
472 472
 						}
473 473
 					}
474 474
 
475
-					$label_array['classes'] = 'class="' . implode( ' ', $label_class_array ) . '"';
475
+					$label_array[ 'classes' ] = 'class="' . implode( ' ', $label_class_array ) . '"';
476 476
 
477 477
 					// filter the field array data
478 478
 					$field_array = apply_filters( 'yikes-mailchimp-field-data', $field_array, $field, $form_id );
479 479
 
480 480
 					/* Loop Over Standard Fields (aka merge variables) */
481
-					if( isset( $field['merge'] ) ) {
481
+					if ( isset( $field[ 'merge' ] ) ) {
482 482
 
483 483
 						// loop over our fields by Type
484
-						switch ( $field['type'] ) {
484
+						switch ( $field[ 'type' ] ) {
485 485
 
486 486
 							default:
487 487
 							case 'email':
@@ -489,22 +489,22 @@  discard block
 block discarded – undo
489 489
 							case 'number':
490 490
 
491 491
 								// pass our default value through our filter to parse dynamic data by tag (used solely for 'text' type)
492
-								$default_value = esc_attr( apply_filters( 'yikes-mailchimp-process-default-tag' , $field['default'] ) );
492
+								$default_value = esc_attr( apply_filters( 'yikes-mailchimp-process-default-tag', $field[ 'default' ] ) );
493 493
 
494 494
 									?>
495
-									<label for="<?php echo $field['merge']; ?>" <?php echo implode( ' ' , $label_array ); ?>>
495
+									<label for="<?php echo $field[ 'merge' ]; ?>" <?php echo implode( ' ', $label_array ); ?>>
496 496
 
497 497
 										<!-- dictate label visibility -->
498
-										<?php if( !isset( $field['hide-label'] ) ) { ?>
499
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
500
-												<?php if( ! isset( $field['hide-label'] ) ) { echo apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label' , esc_attr( stripslashes( $field['label'] ) ), $form_id ); } ?>
498
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
499
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
500
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ), $form_id ); } ?>
501 501
 											</span>
502 502
 										<?php } ?>
503 503
 
504
-										<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 $_POST[$field['merge']]; } else { echo esc_attr( $default_value ); } ?>">
504
+										<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 $_POST[ $field[ 'merge' ] ]; } else { echo esc_attr( $default_value ); } ?>">
505 505
 
506 506
 										<!-- description -->
507
-										<?php if( isset( $field['description'] ) ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', esc_attr( stripslashes( $field['description'] ) ), $form_id ); ?></small></p><?php } ?>
507
+										<?php if ( isset( $field[ 'description' ] ) ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', esc_attr( stripslashes( $field[ 'description' ] ) ), $form_id ); ?></small></p><?php } ?>
508 508
 
509 509
 									</label>
510 510
 									<?php
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 
514 514
 							case 'url':
515 515
 							case 'imageurl':
516
-								$default_value = $field['default'];
516
+								$default_value = $field[ 'default' ];
517 517
 									?>
518 518
 
519 519
 									<script type="text/javascript">
@@ -525,19 +525,19 @@  discard block
 block discarded – undo
525 525
 										}
526 526
 									</script>
527 527
 
528
-									<label for="<?php echo $field['merge']; ?>" <?php echo implode( ' ' , $label_array ); ?>>
528
+									<label for="<?php echo $field[ 'merge' ]; ?>" <?php echo implode( ' ', $label_array ); ?>>
529 529
 
530 530
 										<!-- dictate label visibility -->
531
-										<?php if( !isset( $field['hide-label'] ) ) { ?>
532
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
533
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
531
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
532
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
533
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
534 534
 											</span>
535 535
 										<?php } ?>
536 536
 
537
-										<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 $_POST[$field['merge']]; } else { echo esc_attr( $default_value ); } ?>" onblur="properlyFormatURLField(this);return false;">
537
+										<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 $_POST[ $field[ 'merge' ] ]; } else { echo esc_attr( $default_value ); } ?>" onblur="properlyFormatURLField(this);return false;">
538 538
 
539 539
 										<!-- description -->
540
-										<?php if( isset( $field['description'] ) ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', esc_attr( stripslashes( $field['description'] ) ), $form_id ); ?></small></p><?php } ?>
540
+										<?php if ( isset( $field[ 'description' ] ) ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', esc_attr( stripslashes( $field[ 'description' ] ) ), $form_id ); ?></small></p><?php } ?>
541 541
 
542 542
 									</label>
543 543
 									<?php
@@ -545,53 +545,53 @@  discard block
 block discarded – undo
545 545
 							break;
546 546
 
547 547
 							case 'phone':
548
-								$default_value = $field['default'];
549
-								$phone_format = $field['phone_format'];
548
+								$default_value = $field[ 'default' ];
549
+								$phone_format = $field[ 'phone_format' ];
550 550
 								?>
551 551
 									<script type="text/javascript">
552 552
 										/* Replace incorrect values and format it correctly for MailChimp API */
553 553
 										function formatUSPhoneNumber( e ) {
554 554
 											var phone_number = e.value;
555 555
 											var new_phone_number = phone_number.trim().replace( '(' , '' ).replace( ')', '-' ).replace(/(\d\d\d)(\d\d\d)(\d\d\d\d)/, "$1-$2-$3");
556
-											jQuery( '.<?php echo "yikes-easy-mc-".$field['type']; ?>' ).val( new_phone_number );
556
+											jQuery( '.<?php echo "yikes-easy-mc-" . $field[ 'type' ]; ?>' ).val( new_phone_number );
557 557
 										}
558 558
 									</script>
559 559
 
560
-									<label for="<?php echo $field['merge']; ?>" <?php echo implode( ' ' , $label_array ); ?>>
560
+									<label for="<?php echo $field[ 'merge' ]; ?>" <?php echo implode( ' ', $label_array ); ?>>
561 561
 
562 562
 										<!-- dictate label visibility -->
563
-										<?php if( !isset( $field['hide-label'] ) ) { ?>
564
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
565
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
563
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
564
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
565
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
566 566
 											</span>
567 567
 										<?php } ?>
568 568
 
569
-										<input <?php echo implode( ' ' , $field_array ); ?> type="text" <?php if( $phone_format != 'US' ) { ?>  title="<?php _e( 'International Phone number (eg: #-###-###-####)' , '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' ); ?>" pattern="<?php echo apply_filters( 'yikes-mailchimp-us-phone-pattern' , '^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$' ); ?>" onblur="formatUSPhoneNumber(this);"<?php } ?> value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo $_POST[$field['merge']]; } else { echo esc_attr( $default_value ); } ?>">
569
+										<input <?php echo implode( ' ', $field_array ); ?> type="text" <?php if ( $phone_format != 'US' ) { ?>  title="<?php _e( 'International Phone number (eg: #-###-###-####)', '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' ); ?>" pattern="<?php echo apply_filters( 'yikes-mailchimp-us-phone-pattern', '^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$' ); ?>" onblur="formatUSPhoneNumber(this);"<?php } ?> value="<?php if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) { echo $_POST[ $field[ 'merge' ] ]; } else { echo esc_attr( $default_value ); } ?>">
570 570
 
571 571
 										<!-- description -->
572
-										<?php if( isset( $field['description'] ) ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', stripslashes( $field['description'] ), $form_id ); ?></small></p><?php } ?>
572
+										<?php if ( isset( $field[ 'description' ] ) ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', stripslashes( $field[ 'description' ] ), $form_id ); ?></small></p><?php } ?>
573 573
 
574 574
 									</label>
575 575
 									<?php
576 576
 							break;
577 577
 
578 578
 							case 'zip':
579
-								$default_value = $field['default'];
579
+								$default_value = $field[ 'default' ];
580 580
 
581 581
 									?>
582
-									<label for="<?php echo $field['merge']; ?>" <?php echo implode( ' ' , $label_array ); ?>>
582
+									<label for="<?php echo $field[ 'merge' ]; ?>" <?php echo implode( ' ', $label_array ); ?>>
583 583
 
584 584
 									<!-- dictate label visibility -->
585
-									<?php if( ! isset( $field['hide-label'] ) ) { ?>
586
-										<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
587
-											<?php echo apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
585
+									<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
586
+										<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
587
+											<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
588 588
 										</span>
589 589
 									<?php } ?>
590 590
 
591
-									<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 $_POST[$field['merge']]; } else { echo esc_attr( $default_value ); } ?>">
591
+									<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 $_POST[ $field[ 'merge' ] ]; } else { echo esc_attr( $default_value ); } ?>">
592 592
 
593 593
 									<!-- description -->
594
-									<?php if( isset( $field['description'] ) ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', esc_attr( stripslashes( $field['description'] ) ), $form_id ); ?></small></p><?php } ?>
594
+									<?php if ( isset( $field[ 'description' ] ) ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', esc_attr( stripslashes( $field[ 'description' ] ) ), $form_id ); ?></small></p><?php } ?>
595 595
 
596 596
 									</label>
597 597
 									<?php
@@ -600,28 +600,28 @@  discard block
 block discarded – undo
600 600
 
601 601
 							case 'address':
602 602
 								// required fields
603
-								$required_fields = array( 'addr1' => 'address' , 'addr2' => 'address 2', 'city' => 'city', 'state' =>'state', 'zip' =>'zip' , 'country' => 'country' );
603
+								$required_fields = array( 'addr1' => 'address', 'addr2' => 'address 2', 'city' => 'city', 'state' =>'state', 'zip' =>'zip', 'country' => 'country' );
604 604
 
605 605
 								// setup the default country value
606 606
 								$default_country = apply_filters( 'yikes-mailchimp-default-country-value', 'US' );
607 607
 
608 608
 								// store number for looping
609 609
 								$x = 1;
610
-								foreach( $required_fields as $type => $label ) {
610
+								foreach ( $required_fields as $type => $label ) {
611 611
 
612 612
 									// set the field names for the addrress fields
613
-									$field_array['name'] = 'name="'.$field[$tag].'['.$type.']'.'"';
613
+									$field_array[ 'name' ] = 'name="' . $field[ $tag ] . '[' . $type . ']' . '"';
614 614
 
615 615
 									// reset the label classes for left-half/right-half for addresses
616
-									if( isset( $label_array['class'] ) ) {
616
+									if ( isset( $label_array[ 'class' ] ) ) {
617 617
 										if ( $x % 2 == 0 ) {
618
-											$label_array['class'] = str_replace( 'field-left-half', 'field-right-half', $label_array['class'] );
618
+											$label_array[ 'class' ] = str_replace( 'field-left-half', 'field-right-half', $label_array[ 'class' ] );
619 619
 										} else {
620
-											$label_array['class'] = str_replace( 'field-right-half', 'field-left-half', $label_array['class'] );
620
+											$label_array[ 'class' ] = str_replace( 'field-right-half', 'field-left-half', $label_array[ 'class' ] );
621 621
 										}
622 622
 									}
623 623
 
624
-									switch( $type ) {
624
+									switch ( $type ) {
625 625
 
626 626
 										default:
627 627
 										case 'addr1':
@@ -630,17 +630,17 @@  discard block
 block discarded – undo
630 630
 
631 631
 
632 632
 											?>
633
-											<label for="<?php echo $field['merge']; ?>" <?php echo implode( ' ' , $label_array ); ?>>
633
+											<label for="<?php echo $field[ 'merge' ]; ?>" <?php echo implode( ' ', $label_array ); ?>>
634 634
 
635 635
 												<!-- dictate label visibility -->
636
-												<?php if( ! isset( $field['hide-label'] ) ) { ?>
637
-													<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
638
-														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-'.$type.'-label' , esc_attr( $label ) ) ); ?>
636
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
637
+													<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
638
+														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label', esc_attr( $label ) ) ); ?>
639 639
 													</span>
640 640
 												<?php } ?>
641 641
 
642 642
 
643
-												<input <?php echo implode( ' ' , $field_array ); ?> type="text"  value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo $_POST[$field['merge']]; } ?>">
643
+												<input <?php echo implode( ' ', $field_array ); ?> type="text"  value="<?php if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) { echo $_POST[ $field[ 'merge' ] ]; } ?>">
644 644
 
645 645
 											</label>
646 646
 											<?php
@@ -650,16 +650,16 @@  discard block
 block discarded – undo
650 650
 										case 'state':
651 651
 
652 652
 											?>
653
-											<label for="<?php echo $field['merge']; ?>" <?php echo implode( ' ' , $label_array ); ?> data-attr-name="state-dropdown"<?php if( ! in_array( $default_country, array( 'US' ) ) ) { ?> style="display: none;"<?php } ?>>
653
+											<label for="<?php echo $field[ 'merge' ]; ?>" <?php echo implode( ' ', $label_array ); ?> data-attr-name="state-dropdown"<?php if ( ! in_array( $default_country, array( 'US' ) ) ) { ?> style="display: none;"<?php } ?>>
654 654
 
655 655
 												<!-- dictate label visibility -->
656
-												<?php if( ! isset( $field['hide-label'] ) ) { ?>
657
-													<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
658
-														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-'.$type.'-label' , esc_attr( $label ) ) ); ?>
656
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
657
+													<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
658
+														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label', esc_attr( $label ) ) ); ?>
659 659
 													</span>
660 660
 												<?php } ?>
661 661
 
662
-												<select <?php echo implode( ' ' , $field_array ); ?>>
662
+												<select <?php echo implode( ' ', $field_array ); ?>>
663 663
 													<?php include( YIKES_MC_PATH . 'public/partials/shortcodes/templates/state-dropdown.php' ); ?>
664 664
 												</select>
665 665
 
@@ -672,15 +672,15 @@  discard block
 block discarded – undo
672 672
 										case 'zip':
673 673
 
674 674
 											?>
675
-											<label for="<?php echo $field['merge']; ?>" <?php echo implode( ' ' , $label_array ); ?> data-attr-name="zip-input"<?php if( ! in_array( $default_country, array( 'US', 'GB' ) ) ) { ?> style="display: none;"<?php } ?>>
675
+											<label for="<?php echo $field[ 'merge' ]; ?>" <?php echo implode( ' ', $label_array ); ?> data-attr-name="zip-input"<?php if ( ! in_array( $default_country, array( 'US', 'GB' ) ) ) { ?> style="display: none;"<?php } ?>>
676 676
 
677
-												<?php if( ! isset( $field['hide-label'] ) ) { ?>
678
-													<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
679
-														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-'.$type.'-label' , esc_attr( $label ) ) ); ?>
677
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
678
+													<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
679
+														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label', esc_attr( $label ) ) ); ?>
680 680
 													</span>
681 681
 												<?php } ?>
682 682
 
683
-												<input <?php echo implode( ' ' , $field_array ); ?> type="text" pattern="<?php echo apply_filters( 'yikes-mailchimp-zip-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 $_POST[$field['merge']]; } else { echo esc_attr( $default_value ); } ?>">
683
+												<input <?php echo implode( ' ', $field_array ); ?> type="text" pattern="<?php echo apply_filters( 'yikes-mailchimp-zip-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 $_POST[ $field[ 'merge' ] ]; } else { echo esc_attr( $default_value ); } ?>">
684 684
 
685 685
 											</label>
686 686
 											<?php
@@ -718,16 +718,16 @@  discard block
 block discarded – undo
718 718
 												$default_country = apply_filters( 'yikes-mailchimp-default-country-value', 'US' );
719 719
 											?>
720 720
 
721
-											<label for="<?php echo $field['merge']; ?>" <?php echo implode( ' ' , $label_array ); ?>>
721
+											<label for="<?php echo $field[ 'merge' ]; ?>" <?php echo implode( ' ', $label_array ); ?>>
722 722
 
723 723
 												<!-- dictate label visibility -->
724
-												<?php if( !isset( $field['hide-label'] ) ) { ?>
725
-													<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
726
-														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-'.$type.'-label' , esc_attr( $label ) ) ); ?>
724
+												<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
725
+													<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
726
+														<?php echo ucwords( apply_filters( 'yikes-mailchimp-address-' . $type . '-label', esc_attr( $label ) ) ); ?>
727 727
 													</span>
728 728
 												<?php } ?>
729 729
 
730
-												<select <?php echo implode( ' ' , $field_array ); ?> onchange="checkCountry(this);return false;">
730
+												<select <?php echo implode( ' ', $field_array ); ?> onchange="checkCountry(this);return false;">
731 731
 													<?php include( YIKES_MC_PATH . 'public/partials/shortcodes/templates/country-dropdown.php' ); ?>
732 732
 												</select>
733 733
 											</label>
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 								}
739 739
 
740 740
 								// description
741
-								if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', esc_attr( trim( stripslashes( $field['description'] ) ) ), $form_id ); ?></small></p><?php }
741
+								if ( isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) != '' ) { ?><p class="form-field-description"><small><?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', esc_attr( trim( stripslashes( $field[ 'description' ] ) ) ), $form_id ); ?></small></p><?php }
742 742
 
743 743
 								break;
744 744
 
@@ -746,19 +746,19 @@  discard block
 block discarded – undo
746 746
 							case 'birthday':
747 747
 
748 748
 								// bootstrap datepicker requirements
749
-								wp_enqueue_script( 'bootstrap-hover-dropdown' , YIKES_MC_URL . 'public/js/bootstrap-hover-dropdown.min.js' , array( 'jquery' ) );
750
-								wp_enqueue_script( 'bootstrap-datepicker-script' , YIKES_MC_URL . 'public/js/bootstrap-datepicker.min.js' , array( 'jquery' , 'bootstrap-hover-dropdown' ) );
751
-								wp_enqueue_style( 'bootstrap-datepicker-styles' , YIKES_MC_URL . 'public/css/bootstrap-datepicker3.standalone.min.css' );
752
-								wp_enqueue_style( 'override-datepicker-styles' , YIKES_MC_URL . 'public/css/yikes-inc-easy-mailchimp-datepicker-styles.css' , array( 'bootstrap-datepicker-styles' ) );
749
+								wp_enqueue_script( 'bootstrap-hover-dropdown', YIKES_MC_URL . 'public/js/bootstrap-hover-dropdown.min.js', array( 'jquery' ) );
750
+								wp_enqueue_script( 'bootstrap-datepicker-script', YIKES_MC_URL . 'public/js/bootstrap-datepicker.min.js', array( 'jquery', 'bootstrap-hover-dropdown' ) );
751
+								wp_enqueue_style( 'bootstrap-datepicker-styles', YIKES_MC_URL . 'public/css/bootstrap-datepicker3.standalone.min.css' );
752
+								wp_enqueue_style( 'override-datepicker-styles', YIKES_MC_URL . 'public/css/yikes-inc-easy-mailchimp-datepicker-styles.css', array( 'bootstrap-datepicker-styles' ) );
753 753
 
754
-								switch ( $field['type'] ) {
754
+								switch ( $field[ 'type' ] ) {
755 755
 									default:
756 756
 									case 'date':
757
-										$date_format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'mm/dd/yy';
757
+										$date_format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'mm/dd/yy';
758 758
 										break;
759 759
 
760 760
 									case 'birthday':
761
-										$date_format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'mm/dd';
761
+										$date_format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'mm/dd';
762 762
 										break;
763 763
 								}
764 764
 								// initialize the datepicker
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
 											padding: .85em .5em !important;
770 770
 										}
771 771
 										<?php
772
-											if( wp_is_mobile() ) {
772
+											if ( wp_is_mobile() ) {
773 773
 												?>
774 774
 												.datepicker-dropdown {
775 775
 													margin-top: 0px;
@@ -805,10 +805,10 @@  discard block
 block discarded – undo
805 805
 												numberOfMonths: 1,
806 806
 												today: '<?php _e( 'Today', 'yikes-inc-easy-mailchimp-extender' ); ?>'
807 807
 											};
808
-											jQuery('input[data-attr-type="<?php echo $field['type']; ?>"]').datepicker().on( 'show', function( e ) {
809
-												var date_picker_height = jQuery('input[data-attr-type="<?php echo $field['type']; ?>"]').css( 'height' );
808
+											jQuery('input[data-attr-type="<?php echo $field[ 'type' ]; ?>"]').datepicker().on( 'show', function( e ) {
809
+												var date_picker_height = jQuery('input[data-attr-type="<?php echo $field[ 'type' ]; ?>"]').css( 'height' );
810 810
 												date_picker_height = parseInt( date_picker_height.replace( 'px', '' ) ) + parseInt( 15 ) + 'px';
811
-												var date_picker_width = jQuery('input[data-attr-type="<?php echo $field['type']; ?>"]').css( 'width' ).replace( 'px', '' );
811
+												var date_picker_width = jQuery('input[data-attr-type="<?php echo $field[ 'type' ]; ?>"]').css( 'width' ).replace( 'px', '' );
812 812
 												if( date_picker_width > 500 ) {
813 813
 													date_picker_width = 500;
814 814
 												}
@@ -818,27 +818,27 @@  discard block
 block discarded – undo
818 818
 									</script>
819 819
 								<?php
820 820
 
821
-								$default_value = ( isset( $field_default ) ? esc_attr( $field['default'] ) : '' );
821
+								$default_value = ( isset( $field_default ) ? esc_attr( $field[ 'default' ] ) : '' );
822 822
 								// store empty number for looping
823 823
 								$x = 0;
824 824
 
825 825
 								?>
826
-									<label for="<?php echo esc_attr( $field['merge'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
826
+									<label for="<?php echo esc_attr( $field[ 'merge' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
827 827
 
828 828
 										<!-- dictate label visibility -->
829
-										<?php if( !isset( $field['hide-label'] ) ) { ?>
830
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
831
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
829
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
830
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
831
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
832 832
 											</span>
833 833
 										<?php } ?>
834 834
 
835
-										<input <?php echo implode( ' ' , $field_array ); ?> type="text" <?php if( $field['type'] == 'date' ) { ?> data-attr-type="date" <?php } else { ?> data-attr-type="birthday" <?php } ?> placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo $_POST[$field['merge']]; } else { echo esc_attr( $field['default'] ); } ?>">
835
+										<input <?php echo implode( ' ', $field_array ); ?> type="text" <?php if ( $field[ 'type' ] == 'date' ) { ?> data-attr-type="date" <?php } else { ?> data-attr-type="birthday" <?php } ?> placeholder="<?php echo esc_attr( $field[ 'placeholder' ] ); ?>" value="<?php if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) { echo $_POST[ $field[ 'merge' ] ]; } else { echo esc_attr( $field[ 'default' ] ); } ?>">
836 836
 
837 837
 										<!-- description -->
838
-										<?php if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?>
838
+										<?php if ( isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) != '' ) { ?>
839 839
 											<p class="form-field-description">
840 840
 												<small>
841
-													<?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', esc_attr( trim( stripslashes( $field['description'] ) ) ), $form_id ); ?>
841
+													<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', esc_attr( trim( stripslashes( $field[ 'description' ] ) ) ), $form_id ); ?>
842 842
 												</small>
843 843
 											</p>
844 844
 										<?php } ?>
@@ -849,36 +849,36 @@  discard block
 block discarded – undo
849 849
 							break;
850 850
 
851 851
 							case 'dropdown':
852
-								$default_value = $field['default_choice'];
852
+								$default_value = $field[ 'default_choice' ];
853 853
 								// store empty number for looping
854 854
 								$x = 0;
855 855
 								// hidden labels
856 856
 
857 857
 									?>
858
-									<label for="<?php echo esc_attr( $field['merge'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
858
+									<label for="<?php echo esc_attr( $field[ 'merge' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
859 859
 										<!-- dictate label visibility -->
860
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
861
-											<span class="<?php echo esc_attr( $field['merge'] ) . '-label'; ?>">
862
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
860
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
861
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>">
862
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
863 863
 											</span>
864 864
 										<?php } ?>
865 865
 
866
-										<select <?php echo implode( ' ' , $field_array ); ?>>
866
+										<select <?php echo implode( ' ', $field_array ); ?>>
867 867
 											<?php
868 868
 												// decode for looping
869
-												$choices = json_decode( $field['choices'], true );
870
-												foreach( $choices as $choice ) {
871
-													?><option value="<?php echo $choice; ?>" <?php selected( $default_value , $x ); ?>><?php echo esc_attr( stripslashes( $choice ) ); ?></option><?php
869
+												$choices = json_decode( $field[ 'choices' ], true );
870
+												foreach ( $choices as $choice ) {
871
+													?><option value="<?php echo $choice; ?>" <?php selected( $default_value, $x ); ?>><?php echo esc_attr( stripslashes( $choice ) ); ?></option><?php
872 872
 													$x++;
873 873
 												}
874 874
 											?>
875 875
 										</select>
876 876
 
877 877
 										<!-- description -->
878
-										<?php if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?>
878
+										<?php if ( isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) != '' ) { ?>
879 879
 											<p class="form-field-description">
880 880
 												<small>
881
-													<?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', esc_attr( trim( stripslashes( $field['description'] ) ) ), $form_id ); ?>
881
+													<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', esc_attr( trim( stripslashes( $field[ 'description' ] ) ) ), $form_id ); ?>
882 882
 												</small>
883 883
 											</p>
884 884
 										<?php } ?>
@@ -892,13 +892,13 @@  discard block
 block discarded – undo
892 892
 							case 'radio':
893 893
 							case 'checkbox':
894 894
 								// remove the ID (as to not assign the same ID to every radio button)
895
-								unset( $field_array['id'] );
896
-								$choices = json_decode( $field['choices'], true );
895
+								unset( $field_array[ 'id' ] );
896
+								$choices = json_decode( $field[ 'choices' ], true );
897 897
 								// assign a default choice
898
-								$default_value = ( isset( $field['default_choice'] ) && $field['default_choice'] != '' ) ? $field['default_choice'] : $choices[0];
898
+								$default_value = ( isset( $field[ 'default_choice' ] ) && $field[ 'default_choice' ] != '' ) ? $field[ 'default_choice' ] : $choices[ 0 ];
899 899
 								// if the form was submit, but failed, let's reset the post data
900
-								if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) {
901
-									$default_value = $_POST[$field['merge']];
900
+								if ( isset( $_POST[ $field[ 'merge' ] ] ) && $form_submitted != 1 ) {
901
+									$default_value = $_POST[ $field[ 'merge' ] ];
902 902
 								}
903 903
 								$count = count( $choices );
904 904
 								$i = 1;
@@ -907,20 +907,20 @@  discard block
 block discarded – undo
907 907
 								// hidden labels
908 908
 
909 909
 									?>
910
-									<label for="<?php echo esc_attr( $field['merge'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
910
+									<label for="<?php echo esc_attr( $field[ 'merge' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
911 911
 
912 912
 										<!-- dictate label visibility -->
913
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
914
-											<span class="<?php echo esc_attr( $field['merge'] ). '-label'; ?> checkbox-parent-label">
915
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['merge'].'-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
913
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
914
+											<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?> checkbox-parent-label">
915
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
916 916
 											</span>
917 917
 										<?php }
918 918
 
919
-										foreach( $choices as $choice ) {
919
+										foreach ( $choices as $choice ) {
920 920
 											?>
921
-											<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 } ?>" <?php if( $i == 1 ) { echo $field_array['required']; } ?>>
922
-												<input type="<?php echo esc_attr( $field['type'] ); ?>" name="<?php echo $field['merge']; ?>" id="<?php echo $field['merge'] . '-' . $i; ?>" <?php checked( $default_value , $x ); ?> value="<?php echo esc_attr( $choice ); ?>">
923
-												<span class="<?php echo esc_attr( $field['merge'] ). '-label'; ?>"><?php echo stripslashes( $choice ); ?></span>
921
+											<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 } ?>" <?php if ( $i == 1 ) { echo $field_array[ 'required' ]; } ?>>
922
+												<input type="<?php echo esc_attr( $field[ 'type' ] ); ?>" name="<?php echo $field[ 'merge' ]; ?>" id="<?php echo $field[ 'merge' ] . '-' . $i; ?>" <?php checked( $default_value, $x ); ?> value="<?php echo esc_attr( $choice ); ?>">
923
+												<span class="<?php echo esc_attr( $field[ 'merge' ] ) . '-label'; ?>"><?php echo stripslashes( $choice ); ?></span>
924 924
 											</label>
925 925
 											<?php
926 926
 											$i++;
@@ -928,10 +928,10 @@  discard block
 block discarded – undo
928 928
 										}
929 929
 
930 930
 										// description
931
-										if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?>
931
+										if ( isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) != '' ) { ?>
932 932
 											<p class="form-field-description">
933 933
 												<small>
934
-													<?php echo apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-description', esc_attr( trim( stripslashes( $field['description'] ) ) ), $form_id ); ?>
934
+													<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-description', esc_attr( trim( stripslashes( $field[ 'description' ] ) ) ), $form_id ); ?>
935 935
 												</small>
936 936
 											</p>
937 937
 										<?php } ?>
@@ -947,26 +947,26 @@  discard block
 block discarded – undo
947 947
 
948 948
 
949 949
 						// store default choice
950
-						$default_choice = ( isset( $field['default_choice'] ) && ! empty( $field['default_choice'] ) ) ? ( is_array( $field['default_choice'] ) ? $field['default_choice'] : $field['default_choice'] ) : ( isset( $field['default_choice'] ) ? $field['default_choice'] : '' );
950
+						$default_choice = ( isset( $field[ 'default_choice' ] ) && ! empty( $field[ 'default_choice' ] ) ) ? ( is_array( $field[ 'default_choice' ] ) ? $field[ 'default_choice' ] : $field[ 'default_choice' ] ) : ( isset( $field[ 'default_choice' ] ) ? $field[ 'default_choice' ] : '' );
951 951
 
952 952
 						// if the form was submit, but failed, let's reset the post data
953
-						if( isset( $_POST[$field['group_id']] ) && $form_submitted != 1 ) {
954
-							$default_choice = $_POST[$field['group_id']];
953
+						if ( isset( $_POST[ $field[ 'group_id' ] ] ) && $form_submitted != 1 ) {
954
+							$default_choice = $_POST[ $field[ 'group_id' ] ];
955 955
 						}
956 956
 
957 957
 						// get our groups
958
-						$groups = ( isset( $field['groups'] ) && ! empty( $field['groups'] ) ) ? json_decode( $field['groups'], true ) : array();
958
+						$groups = ( isset( $field[ 'groups' ] ) && ! empty( $field[ 'groups' ] ) ) ? json_decode( $field[ 'groups' ], true ) : array();
959 959
 
960 960
 						$count = count( $groups );
961 961
 
962
-						if( $field['type'] == 'checkboxes' ) {
962
+						if ( $field[ 'type' ] == 'checkboxes' ) {
963 963
 							$type = 'checkbox';
964
-						} else if( $field['type'] == 'radio' ) {
964
+						} else if ( $field[ 'type' ] == 'radio' ) {
965 965
 							$type = 'radio';
966 966
 						}
967 967
 
968 968
 						// loop over the interest group field types
969
-						switch ( $field['type'] ) {
969
+						switch ( $field[ 'type' ] ) {
970 970
 
971 971
 							case 'checkboxes':
972 972
 							case 'radio':
@@ -974,18 +974,18 @@  discard block
 block discarded – undo
974 974
 								$x = 1; // used to find the last item of our array
975 975
 
976 976
 									?>
977
-									<label for="<?php echo esc_attr( $field['group_id'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
978
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
977
+									<label for="<?php echo esc_attr( $field[ 'group_id' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
978
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
979 979
 											<!-- dictate label visibility -->
980
-											<span class="<?php echo esc_attr( $field['group_id'] ) . '-label'; ?> checkbox-parent-label">
981
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['group_id'].'-label' , esc_attr( $field['label'] ) ); ?>
980
+											<span class="<?php echo esc_attr( $field[ 'group_id' ] ) . '-label'; ?> checkbox-parent-label">
981
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-label', esc_attr( $field[ 'label' ] ) ); ?>
982 982
 											</span>
983 983
 									<?php
984 984
 										}
985 985
 
986 986
 										// Display Submission Errors
987
-										if( ! empty( $missing_required_checkbox_interest_groups ) ) {
988
-											if( in_array( $field['group_id'], $missing_required_checkbox_interest_groups ) ) {
987
+										if ( ! empty( $missing_required_checkbox_interest_groups ) ) {
988
+											if ( in_array( $field[ 'group_id' ], $missing_required_checkbox_interest_groups ) ) {
989 989
 												?>
990 990
 													<p class="yikes-mailchimp-required-interest-group-error">
991 991
 														<?php echo apply_filters( 'yikes-mailchimp-interest-group-checkbox-error', __( 'This field is required.', 'yikes-inc-easy-mailchimp-extender' ), $form_id ); ?>
@@ -996,19 +996,19 @@  discard block
 block discarded – undo
996 996
 
997 997
 
998 998
 
999
-										foreach( $groups as $group ) {
1000
-											if( $field['type'] == 'checkboxes' ) {
999
+										foreach ( $groups as $group ) {
1000
+											if ( $field[ 'type' ] == 'checkboxes' ) {
1001 1001
 												/* Setup the defaults for this field - varies if the field was previously submitted */
1002
-												if( isset( $_POST[$field['group_id']] ) && $form_submitted != 1 ) {
1003
-													$default_choice = $_POST[$field['group_id']];
1004
-												} elseif( ( ! isset( $_POST['yikes-mailchimp-honeypot'] ) && $form_submitted != 1 ) || ( isset( $_POST['yikes-mailchimp-honeypot'] ) && $form_submitted == 1 ) ) {
1005
-													$default_choice = ( isset( $field['default_choice'] ) && ! empty( $field['default_choice'] ) ) ? ( is_array( $field['default_choice'] ) ? $field['default_choice'] : $field['default_choice'] ) : array();
1002
+												if ( isset( $_POST[ $field[ 'group_id' ] ] ) && $form_submitted != 1 ) {
1003
+													$default_choice = $_POST[ $field[ 'group_id' ] ];
1004
+												} elseif ( ( ! isset( $_POST[ 'yikes-mailchimp-honeypot' ] ) && $form_submitted != 1 ) || ( isset( $_POST[ 'yikes-mailchimp-honeypot' ] ) && $form_submitted == 1 ) ) {
1005
+													$default_choice = ( isset( $field[ 'default_choice' ] ) && ! empty( $field[ 'default_choice' ] ) ) ? ( is_array( $field[ 'default_choice' ] ) ? $field[ 'default_choice' ] : $field[ 'default_choice' ] ) : array();
1006 1006
 												}
1007 1007
 											}
1008 1008
 											?>
1009
-											<label for="<?php echo $field['group_id'] . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if( $x === $count ) { ?> last-selection<?php } ?>">
1010
-												<input <?php if( isset( $field['require'] ) && $field['require'] == 1 ) { ?> class="yikes-interest-group-required" <?php } ?> type="<?php echo $type; ?>" name="<?php echo $field['group_id']; ?>[]" id="<?php echo $field['group_id'] . '-' . $i; ?>" <?php if( $field['type'] == 'checkboxes' ) { if( ( ( isset( $_POST['yikes-mailchimp-honeypot' ] ) && $form_submitted == 1 && in_array( $i , $default_choice )) || ! isset( $_POST['yikes-mailchimp-honeypot' ] ) && $form_submitted != 1 && in_array( $i , $default_choice ) ) || ( ( $form_submitted != 1 && isset( $_POST[$field['group_id']] ) ) && in_array( esc_attr( $group['name'] ), $default_choice ) ) ) { echo 'checked="checked"'; } } else { checked( ( isset( $default_choice ) && is_array( $default_choice ) ) ? $default_choice[0] : $default_choice , $i ); } ?> value="<?php echo esc_attr( $group['name'] ); ?>">
1011
-												<?php echo $group['name']; ?>
1009
+											<label for="<?php echo $field[ 'group_id' ] . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ', $custom_classes ); if ( $x === $count ) { ?> last-selection<?php } ?>">
1010
+												<input <?php if ( isset( $field[ 'require' ] ) && $field[ 'require' ] == 1 ) { ?> class="yikes-interest-group-required" <?php } ?> type="<?php echo $type; ?>" name="<?php echo $field[ 'group_id' ]; ?>[]" id="<?php echo $field[ 'group_id' ] . '-' . $i; ?>" <?php if ( $field[ 'type' ] == 'checkboxes' ) { if ( ( ( isset( $_POST[ 'yikes-mailchimp-honeypot' ] ) && $form_submitted == 1 && in_array( $i, $default_choice ) ) || ! isset( $_POST[ 'yikes-mailchimp-honeypot' ] ) && $form_submitted != 1 && in_array( $i, $default_choice ) ) || ( ( $form_submitted != 1 && isset( $_POST[ $field[ 'group_id' ] ] ) ) && in_array( esc_attr( $group[ 'name' ] ), $default_choice ) ) ) { echo 'checked="checked"'; } } else { checked( ( isset( $default_choice ) && is_array( $default_choice ) ) ? $default_choice[ 0 ] : $default_choice, $i ); } ?> value="<?php echo esc_attr( $group[ 'name' ] ); ?>">
1011
+												<?php echo $group[ 'name' ]; ?>
1012 1012
 											</label>
1013 1013
 											<?php
1014 1014
 											$i++;
@@ -1016,10 +1016,10 @@  discard block
 block discarded – undo
1016 1016
 										}
1017 1017
 
1018 1018
 										// description
1019
-										if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?>
1019
+										if ( isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) != '' ) { ?>
1020 1020
 											<p class="form-field-description">
1021 1021
 												<small>
1022
-													<?php echo apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-description', esc_attr( trim( $field['description'] ) ), $form_id ); ?>
1022
+													<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-description', esc_attr( trim( $field[ 'description' ] ) ), $form_id ); ?>
1023 1023
 												</small>
1024 1024
 											</p>
1025 1025
 										<?php } ?>
@@ -1033,28 +1033,28 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
 									?>
1035 1035
 
1036
-									<label for="<?php echo esc_attr( $field['group_id'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
1036
+									<label for="<?php echo esc_attr( $field[ 'group_id' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
1037 1037
 										<!-- dictate label visibility -->
1038
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
1039
-											<span class="<?php echo esc_attr( $field['group_id'] ) . '-label'; ?>">
1040
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['group_id'].'-label' , esc_attr( $field['label'] ) ); ?>
1038
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
1039
+											<span class="<?php echo esc_attr( $field[ 'group_id' ] ) . '-label'; ?>">
1040
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-label', esc_attr( $field[ 'label' ] ) ); ?>
1041 1041
 											</span>
1042 1042
 										<?php } ?>
1043 1043
 
1044
-										<select <?php echo implode( ' ' , $field_array ); ?>>
1044
+										<select <?php echo implode( ' ', $field_array ); ?>>
1045 1045
 											<?php
1046 1046
 												$i = 0;
1047
-												foreach( $groups as $group ) {
1048
-													?><option <?php selected( $i , $default_choice ); ?> value="<?php echo $group['name']; ?>"><?php echo esc_attr( $group['name'] ); ?></option><?php
1047
+												foreach ( $groups as $group ) {
1048
+													?><option <?php selected( $i, $default_choice ); ?> value="<?php echo $group[ 'name' ]; ?>"><?php echo esc_attr( $group[ 'name' ] ); ?></option><?php
1049 1049
 													$i++;
1050 1050
 												}
1051 1051
 											?>
1052 1052
 										</select>
1053 1053
 
1054
-										<?php if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?>
1054
+										<?php if ( isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) != '' ) { ?>
1055 1055
 											<p class="form-field-description">
1056 1056
 												<small>
1057
-													<?php echo apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-description', esc_attr( trim( $field['description'] ) ), $form_id ); ?>
1057
+													<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-description', esc_attr( trim( $field[ 'description' ] ) ), $form_id ); ?>
1058 1058
 												</small>
1059 1059
 											</p>
1060 1060
 										<?php } ?>
@@ -1071,21 +1071,21 @@  discard block
 block discarded – undo
1071 1071
 
1072 1072
 									?>
1073 1073
 
1074
-									<label for="<?php echo esc_attr( $field['group_id'] ); ?>" <?php echo implode( ' ' , $label_array ); ?>>
1074
+									<label for="<?php echo esc_attr( $field[ 'group_id' ] ); ?>" <?php echo implode( ' ', $label_array ); ?>>
1075 1075
 
1076 1076
 										<!-- dictate label visibility -->
1077
-										<?php if( ! isset( $field['hide-label'] ) ) { ?>
1078
-											<span class="<?php echo esc_attr( $field['group_id'] ) . '-label'; ?> checkbox-parent-label" style="display:none;">
1079
-												<?php echo apply_filters( 'yikes-mailchimp-'.$field['group_id'].'-label' , esc_attr( stripslashes( $field['label'] ) ) ); ?>
1077
+										<?php if ( ! isset( $field[ 'hide-label' ] ) ) { ?>
1078
+											<span class="<?php echo esc_attr( $field[ 'group_id' ] ) . '-label'; ?> checkbox-parent-label" style="display:none;">
1079
+												<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-label', esc_attr( stripslashes( $field[ 'label' ] ) ) ); ?>
1080 1080
 											</span>
1081 1081
 										<?php }
1082 1082
 
1083 1083
 
1084
-										foreach( $groups as $group ) {
1084
+										foreach ( $groups as $group ) {
1085 1085
 											?>
1086
-											<label for="<?php echo $field['group_id'] . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if( $x === $count ) { ?> last-selection<?php } ?>" style="display:none;">
1087
-												<input type="radio" name="<?php echo $field['group_id']; ?>[]" id="<?php echo $field['group_id'] . '-' . $i; ?>" <?php if( $field['type'] == 'checkboxes' ) { if( in_array( $i , $default_choice ) ) { echo 'checked="checked"'; } } else { checked( ( isset( $default_choice ) && is_array( $default_choice ) ) ? $default_choice[0] : $default_choice , $i ); } ?> value="<?php echo esc_attr( $group['name'] ); ?>">
1088
-												<?php echo esc_attr( stripslashes( str_replace( '' , '\'', $group['name'] ) ) ); ?>
1086
+											<label for="<?php echo $field[ 'group_id' ] . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ', $custom_classes ); if ( $x === $count ) { ?> last-selection<?php } ?>" style="display:none;">
1087
+												<input type="radio" name="<?php echo $field[ 'group_id' ]; ?>[]" id="<?php echo $field[ 'group_id' ] . '-' . $i; ?>" <?php if ( $field[ 'type' ] == 'checkboxes' ) { if ( in_array( $i, $default_choice ) ) { echo 'checked="checked"'; } } else { checked( ( isset( $default_choice ) && is_array( $default_choice ) ) ? $default_choice[ 0 ] : $default_choice, $i ); } ?> value="<?php echo esc_attr( $group[ 'name' ] ); ?>">
1088
+												<?php echo esc_attr( stripslashes( str_replace( '', '\'', $group[ 'name' ] ) ) ); ?>
1089 1089
 											</label>
1090 1090
 											<?php
1091 1091
 											$i++;
@@ -1093,10 +1093,10 @@  discard block
 block discarded – undo
1093 1093
 										}
1094 1094
 
1095 1095
 										// description
1096
-										if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?>
1096
+										if ( isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) != '' ) { ?>
1097 1097
 											<p class="form-field-description">
1098 1098
 												<small>
1099
-													<?php echo apply_filters( 'yikes-mailchimp-' . $field['group_id'] . '-description', esc_attr( trim( stripslashes( $field['description'] ) ) ), $form_id ); ?>
1099
+													<?php echo apply_filters( 'yikes-mailchimp-' . $field[ 'group_id' ] . '-description', esc_attr( trim( stripslashes( $field[ 'description' ] ) ) ), $form_id ); ?>
1100 1100
 												</small>
1101 1101
 											</p>
1102 1102
 										<?php }
@@ -1113,11 +1113,11 @@  discard block
 block discarded – undo
1113 1113
 				do_action( 'yikes-mailchimp-additional-form-fields', $form_data );
1114 1114
 
1115 1115
 				/* if we've enabled reCAPTCHA protection */
1116
-				if( isset( $recaptcha_box ) ) {
1116
+				if ( isset( $recaptcha_box ) ) {
1117 1117
 					echo $recaptcha_box;
1118 1118
 				}
1119
-				if( is_user_logged_in() ) {
1120
-					$admin_class = ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) ? ' admin-logged-in' : '';
1119
+				if ( is_user_logged_in() ) {
1120
+					$admin_class = ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) ? ' admin-logged-in' : '';
1121 1121
 				} else {
1122 1122
 					$admin_class = '';
1123 1123
 				}
@@ -1127,23 +1127,23 @@  discard block
 block discarded – undo
1127 1127
 				<input type="hidden" name="yikes-mailchimp-honeypot" id="yikes-mailchimp-honeypot" value="">
1128 1128
 
1129 1129
 				<!-- List ID -->
1130
-				<input type="hidden" name="yikes-mailchimp-associated-list-id" id="yikes-mailchimp-associated-list-id" value="<?php echo $form_settings['list_id']; ?>">
1130
+				<input type="hidden" name="yikes-mailchimp-associated-list-id" id="yikes-mailchimp-associated-list-id" value="<?php echo $form_settings[ 'list_id' ]; ?>">
1131 1131
 
1132 1132
 				<!-- Form that is being submitted! Used to display error/success messages above the correct form -->
1133 1133
 				<input type="hidden" name="yikes-mailchimp-submitted-form" id="yikes-mailchimp-submitted-form" value="<?php echo $form_id; ?>">
1134 1134
 
1135 1135
 				<!-- Submit Button -->
1136 1136
 				<?php
1137
-					if( $form_inline ) {
1137
+					if ( $form_inline ) {
1138 1138
 						echo '<label class="empty-form-inline-label submit-button-inline-label"><span class="empty-label">&nbsp;</span>';
1139 1139
 					}
1140 1140
 					// display the image or text based button
1141
-					if( $submit_button_type == 'text' ) {
1142
-						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'] ) . '">' .  apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data['id'] ) . '</button>', $form_data['id'] );
1141
+					if ( $submit_button_type == 'text' ) {
1142
+						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' ] ) . '">' . apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data[ 'id' ] ) . '</button>', $form_data[ 'id' ] );
1143 1143
 					} else {
1144
-						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'] );
1144
+						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' ] );
1145 1145
 					}
1146
-					if( $form_inline ) {
1146
+					if ( $form_inline ) {
1147 1147
 						echo '</label>';
1148 1148
 					}
1149 1149
 				?>
@@ -1155,8 +1155,8 @@  discard block
 block discarded – undo
1155 1155
 
1156 1156
 		<?php
1157 1157
 			/* If the current user is logged in, and an admin...lets display our 'Edit Form' link */
1158
-			if( is_user_logged_in() ) {
1159
-				if( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
1158
+			if ( is_user_logged_in() ) {
1159
+				if ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
1160 1160
 					echo $edit_form_link;
1161 1161
 				}
1162 1162
 			}
@@ -1171,16 +1171,16 @@  discard block
 block discarded – undo
1171 1171
 		*	Update the impressions count
1172 1172
 		*	for non-admins
1173 1173
 		*/
1174
-		if( !current_user_can( 'manage_options' ) ) {
1175
-			$form_data['impressions']++;
1174
+		if ( ! current_user_can( 'manage_options' ) ) {
1175
+			$form_data[ 'impressions' ]++;
1176 1176
 			$wpdb->update(
1177 1177
 				$wpdb->prefix . 'yikes_easy_mc_forms',
1178 1178
 					array(
1179
-						'impressions' => $form_data['impressions'],
1179
+						'impressions' => $form_data[ 'impressions' ],
1180 1180
 					),
1181 1181
 					array( 'ID' => $form ),
1182 1182
 					array(
1183
-						'%d',	// send welcome email
1183
+						'%d', // send welcome email
1184 1184
 					),
1185 1185
 					array( '%d' )
1186 1186
 				);
Please login to merge, or discard this patch.