Completed
Push — staging ( a0e6e2...8ad0d3 )
by
unknown
05:05
created
admin/class-yikes-inc-easy-mailchimp-extender-admin.php 1 patch
Spacing   +362 added lines, -362 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		/***********************/
102 102
 		/** Create A Form **/
103 103
 		/**********************/
104
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) {
104
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-form' ) {
105 105
 
106 106
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
107 107
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		/***********************/
111 111
 		/** Delete A Form **/
112 112
 		/**********************/
113
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) {
113
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-delete-form' ) {
114 114
 
115 115
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
116 116
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		/**********************************/
120 120
 		/** Duplicate/Clone A Form    **/
121 121
 		/********************************/
122
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) {
122
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-duplicate-form' ) {
123 123
 
124 124
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
125 125
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		/*************************************/
129 129
 		/**  Reset Form Impression Stats **/
130 130
 		/***********************************/
131
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) {
131
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-reset-stats' ) {
132 132
 
133 133
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
134 134
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		/**********************************/
138 138
 		/**         Update A Form        **/
139 139
 		/********************************/
140
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) {
140
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-update-form' ) {
141 141
 
142 142
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
143 143
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		/**************************************************/
147 147
 		/**     Clear Store MailChimp Transient Data   **/
148 148
 		/*************************************************/
149
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) {
149
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-transient-data' ) {
150 150
 
151 151
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
152 152
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		/*******************************************/
156 156
 		/** Remove a user from a mailing list     **/
157 157
 		/*****************************************/
158
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) {
158
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-unsubscribe-user' ) {
159 159
 
160 160
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
161 161
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		/*******************************************/
165 165
 		/**    Create misisng error log file  **/
166 166
 		/*****************************************/
167
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) {
167
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-error-log' ) {
168 168
 
169 169
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
170 170
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		/**************************************************/
197 197
 		/**        Clear MailChimp Error Log Data        **/
198 198
 		/*************************************************/
199
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) {
199
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-error-log' ) {
200 200
 
201 201
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
202 202
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		/*********************************************/
206 206
 		/**        Export MailChimp Opt-in Forms   **/
207 207
 		/*******************************************/
208
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) {
208
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-forms' ) {
209 209
 
210 210
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
211 211
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		/*********************************************/
215 215
 		/**                Export Plugin Settings           **/
216 216
 		/*******************************************/
217
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) {
217
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-settings' ) {
218 218
 
219 219
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
220 220
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		/*******************************************/
224 224
 		/**        Import Class Inclusion       **/
225 225
 		/*****************************************/
226
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) {
226
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) {
227 227
 
228 228
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
229 229
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		/*******************************************/
233 233
 		/**    Premium Support Request     **/
234 234
 		/*****************************************/
235
-		if ( isset( $_POST['submit-premium-support-request'] ) ) {
235
+		if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) {
236 236
 
237 237
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
238 238
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		/****************************************/
242 242
 		/**    Dismiss Options Migrations        **/
243 243
 		/****************************************/
244
-		if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
244
+		if ( isset( $_REQUEST[ 'dismiss_migration_nonce' ] ) ) {
245 245
 
246 246
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
247 247
 
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
 		 * @ return array  $links  New array of plugin actions
278 278
 		 */
279 279
 		public function easy_forms_plugin_action_links( $links ) {
280
-			$links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
281
-			$links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES, Inc.', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
280
+			$links[ ] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) . '">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
281
+			$links[ ] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES, Inc.', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
282 282
 			return $links;
283 283
 		}
284 284
 
@@ -379,17 +379,17 @@  discard block
 block discarded – undo
379 379
 		*/
380 380
 		public function yikes_easy_mailchimp_export_forms() {
381 381
 			// grab our nonce.
382
-			$nonce = $_REQUEST['nonce'];
382
+			$nonce = $_REQUEST[ 'nonce' ];
383 383
 			// grab the forms.
384
-			$forms = isset( $_REQUEST['yikes_export_forms'] ) ? $_REQUEST['yikes_export_forms'] : array();
384
+			$forms = isset( $_REQUEST[ 'yikes_export_forms' ] ) ? $_REQUEST[ 'yikes_export_forms' ] : array();
385 385
 			// validate nonce.
386 386
 			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
387
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
387
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
388 388
 			}
389 389
 
390 390
 			// run the export function.
391 391
 			// parameters: ( $table_name, $form_ids, $file_name ).
392
-			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export('Yikes-Inc-Easy-MailChimp-Forms-Export', $forms );
392
+			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'Yikes-Inc-Easy-MailChimp-Forms-Export', $forms );
393 393
 			// re-direct the user back to the page.
394 394
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) );
395 395
 			die();
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 		*/
404 404
 		public function yikes_easy_mailchimp_export_plugin_settings() {
405 405
 			// grab our nonce
406
-			$nonce = $_REQUEST['nonce'];
406
+			$nonce = $_REQUEST[ 'nonce' ];
407 407
 			// validate nonce.
408 408
 			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
409
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
409
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
410 410
 			}
411 411
 
412 412
 			// run the export function.
@@ -423,10 +423,10 @@  discard block
 block discarded – undo
423 423
 		*/
424 424
 		public function yikes_easy_mailchimp_import_forms() {
425 425
 			// grab our nonce.
426
-			$nonce = $_REQUEST['nonce'];
426
+			$nonce = $_REQUEST[ 'nonce' ];
427 427
 			// validate nonce.
428 428
 			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
429
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
429
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
430 430
 			}
431 431
 			// include the export class.
432 432
 			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
@@ -447,18 +447,18 @@  discard block
 block discarded – undo
447 447
 		*/
448 448
 		public function yikes_easy_mailchimp_premium_support_request() {
449 449
 
450
-			if ( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
450
+			if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] != 'yikes-support-request' ) {
451 451
 				return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' );
452 452
 			}
453 453
 
454
-			$email       = isset( $_POST['user-email'] ) ? $_POST['user-email'] : '';
455
-			$topic       = isset( $_POST['support-topic'] ) ? $_POST['support-topic'] : '';
456
-			$issue       = isset( $_POST['support-content'] ) ? $_POST['support-content'] : '';
457
-			$priority    = isset( $_POST['support-priority'] ) ? $_POST['support-priority'] : 1;
458
-			$license     = isset( $_POST['license_key'] ) ? $_POST['license_key'] : '';
459
-			$plugin_name = isset( $_POST['plugin-name'] ) ? $_POST['plugin-name'] : '';
460
-			$plugin_slug = isset( $_POST['plugin-slug'] ) ? $_POST['plugin-slug'] : '';
461
-			$name        = isset( $_POST['user-name'] ) ? $_POST['user-name'] : 'MailChimp Support';
454
+			$email       = isset( $_POST[ 'user-email' ] ) ? $_POST[ 'user-email' ] : '';
455
+			$topic       = isset( $_POST[ 'support-topic' ] ) ? $_POST[ 'support-topic' ] : '';
456
+			$issue       = isset( $_POST[ 'support-content' ] ) ? $_POST[ 'support-content' ] : '';
457
+			$priority    = isset( $_POST[ 'support-priority' ] ) ? $_POST[ 'support-priority' ] : 1;
458
+			$license     = isset( $_POST[ 'license_key' ] ) ? $_POST[ 'license_key' ] : '';
459
+			$plugin_name = isset( $_POST[ 'plugin-name' ] ) ? $_POST[ 'plugin-name' ] : '';
460
+			$plugin_slug = isset( $_POST[ 'plugin-slug' ] ) ? $_POST[ 'plugin-slug' ] : '';
461
+			$name        = isset( $_POST[ 'user-name' ] ) ? $_POST[ 'user-name' ] : 'MailChimp Support';
462 462
 
463 463
 			$edd_item_id = $this->get_premium_license( $plugin_slug );
464 464
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 
494 494
 		public function get_premium_license( $plugin_slug ) {
495 495
 
496
-			switch( $plugin_slug ) {
496
+			switch ( $plugin_slug ) {
497 497
 
498 498
 				case 'form-customizer':
499 499
 					return defined( 'YIKES_CUSTOMIZER_EDD_ITEM_ID' ) ? YIKES_CUSTOMIZER_EDD_ITEM_ID : '';
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 			// add a new option to store the plugin activation date/time.
554 554
 			// @since v6.0.0.
555 555
 			// this is used to notify the user that they should review after 2 weeks.
556
-			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
556
+			if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
557 557
 				add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) );
558 558
 			}
559 559
 
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 				$install_date = get_option( 'yikes_easy_mailchimp_activation_date' );
564 564
 				$past_date = strtotime( '-14 days' );
565 565
 				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
566
-					add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) );
566
+					add_action( 'admin_notices', array( $this, 'yikes_easy_mailchimp_display_review_us_notice' ) );
567 567
 				}
568 568
 			}
569 569
 
@@ -576,13 +576,13 @@  discard block
 block discarded – undo
576 576
 		*/
577 577
 		public function yikes_easy_mailchimp_display_review_us_notice() {
578 578
 			/* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
579
-			if ( in_array( get_current_screen()->base , array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
579
+			if ( in_array( get_current_screen()->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base, 'yikes-inc-easy-mailchimp' ) !== false ) {
580 580
 
581 581
 				// The URL of the page the user is currently on 
582
-				$current_uri  	  = isset( $_SERVER['REQUEST_URI'] ) && ! empty( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : false;
583
-				$current_host	  = isset( $_SERVER['HTTP_HOST'] ) && ! empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : false;
582
+				$current_uri = isset( $_SERVER[ 'REQUEST_URI' ] ) && ! empty( $_SERVER[ 'REQUEST_URI' ] ) ? $_SERVER[ 'REQUEST_URI' ] : false;
583
+				$current_host = isset( $_SERVER[ 'HTTP_HOST' ] ) && ! empty( $_SERVER[ 'HTTP_HOST' ] ) ? $_SERVER[ 'HTTP_HOST' ] : false;
584 584
 				$current_protocol = is_ssl() === true ? 'https://' : 'http://';
585
-				$current_url	  = ( $current_uri !== false && $current_host !== false ) ? $current_protocol . $current_host . $current_uri : admin_url();
585
+				$current_url = ( $current_uri !== false && $current_host !== false ) ? $current_protocol . $current_host . $current_uri : admin_url();
586 586
 
587 587
 				$plugin_name = '<strong>Easy Forms for MailChimp</strong>';
588 588
 				// Review URL - Change to the URL of your plugin on WordPress.org.
@@ -593,17 +593,17 @@  discard block
 block discarded – undo
593 593
 				// Make sure all of our variables have values.
594 594
 				$reviewurl  = ( ! empty( $reviewurl ) ) ? $reviewurl : '';
595 595
 				$addons_url = ( ! empty( $addons_url ) ) ? $addons_url : '';
596
-				$nobugurl	= ( ! empty( $nobugurl ) ) ? $nobugurl : '';
596
+				$nobugurl = ( ! empty( $nobugurl ) ) ? $nobugurl : '';
597 597
 
598 598
 				$review_message = '<div id="yikes-mailchimp-logo"></div>';
599 599
 				$review_message .= sprintf( 
600 600
 					__( 'It looks like you\'ve been using %1$s for 2 weeks now. We hope you\'re enjoying the features included with the free version. If so, please consider leaving us a review. Reviews only help to catch other users attention as well as provide us with feedback to grow and improve upon. If you\'re really enjoying the plugin, consider buying an add-on or developer license for some really awesome features and premium support.', 'yikes-inc-easy-mailchimp-extender' ) 
601 601
 					. '<span class="button-container"> <a href="%2$s" target="_blank" class="button-secondary"><span class="dashicons dashicons-star-filled"></span>'
602
-						. __( "Leave A Review" , 'yikes-inc-easy-mailchimp-extender' ) 
602
+						. __( "Leave A Review", 'yikes-inc-easy-mailchimp-extender' ) 
603 603
 					. '</a> <a href="%3$s" class="button-secondary"><span class="dashicons dashicons-upload"></span>'
604
-						. __( "View Addons" , 'yikes-inc-easy-mailchimp-extender' ) 
604
+						. __( "View Addons", 'yikes-inc-easy-mailchimp-extender' ) 
605 605
 					. '</a> <a href="%4$s" class="button-secondary"><span class="dashicons dashicons-no-alt"></span>'
606
-						. __( "Dismiss" , 'yikes-inc-easy-mailchimp-extender' ) 
606
+						. __( "Dismiss", 'yikes-inc-easy-mailchimp-extender' ) 
607 607
 					. "</a> </span>", 
608 608
 				$plugin_name, $reviewurl, $addons_url, $nobugurl );
609 609
 				?>
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 			@since v3.1.1
621 621
 		*/
622 622
 		public function yikes_easy_mailchimp_stop_bugging_me() {
623
-			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) && (int) filter_var( $_GET['yikes_easy_mc_icons_nobug'], FILTER_SANITIZE_NUMBER_INT ) === 1 ) {
623
+			if ( isset( $_GET[ 'yikes_easy_mc_icons_nobug' ] ) && (int) filter_var( $_GET[ 'yikes_easy_mc_icons_nobug' ], FILTER_SANITIZE_NUMBER_INT ) === 1 ) {
624 624
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', true );
625 625
 			}
626 626
 		}
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 	// inlcude the js for tinymce.
659 659
 	public function yks_mc_add_tinymce_plugin( $plugin_array ) {
660 660
 
661
-		$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
661
+		$plugin_array[ 'yks_mc_tinymce_button' ] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
662 662
 
663 663
 		return $plugin_array;
664 664
 	}
@@ -679,13 +679,13 @@  discard block
 block discarded – undo
679 679
 		if ( ! empty( $list_data ) ) {
680 680
 			// build an array to pass to our javascript.
681 681
 			foreach ( $list_data as $id => $form ) {
682
-				$lists[] = array(
683
-					'text'  => urlencode( $form['form_name'] ),
682
+				$lists[ ] = array(
683
+					'text'  => urlencode( $form[ 'form_name' ] ),
684 684
 					'value' => $id,
685 685
 				);
686 686
 			}
687 687
 		} else {
688
-			$lists[0] = array(
688
+			$lists[ 0 ] = array(
689 689
 				'text'  => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ),
690 690
 				'value' => '-',
691 691
 			);
@@ -773,8 +773,8 @@  discard block
 block discarded – undo
773 773
 
774 774
 		wp_enqueue_style( 'wp-color-picker' );
775 775
 		wp_enqueue_script( 'wp-color-picker' );
776
-		wp_enqueue_script( 'jquery.timepicker.js',YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ) , $this->version, false );
777
-		wp_enqueue_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ) , $this->version, false );
776
+		wp_enqueue_script( 'jquery.timepicker.js', YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ), $this->version, false );
777
+		wp_enqueue_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ), $this->version, false );
778 778
 
779 779
 		$localized_data = array(
780 780
 			'ajax_url'                          => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 	 * Convert the php date format string to a js date format
869 869
 	 */
870 870
 	public function yikes_jQuery_datepicker_date_format( $site_option ) {
871
-		switch( $site_option ) {
871
+		switch ( $site_option ) {
872 872
 			//Predefined WP date formats
873 873
 			default:
874 874
 			case 'F j, Y':
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
 
1081 1081
 		/* Register General Settings Section */
1082 1082
 
1083
-		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this , 'yikes_mc_validate_api_key' ) );
1083
+		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this, 'yikes_mc_validate_api_key' ) );
1084 1084
 
1085 1085
 		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mailchimp-use-nonce' );
1086 1086
 
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 		add_settings_field(
1126 1126
 			'optin-checkbox-init',
1127 1127
 			__( 'Select Checkboxes to Generate', 'yikes-inc-easy-mailchimp-extender' ),
1128
-			'',  // callback + validation inside of admin/partials/menu/options.php
1128
+			'', // callback + validation inside of admin/partials/menu/options.php
1129 1129
 			'yikes_inc_easy_mc_checkbox_settings'
1130 1130
 		);
1131 1131
 		/* End Checkbox Settings */
@@ -1147,21 +1147,21 @@  discard block
 block discarded – undo
1147 1147
 			add_settings_field(
1148 1148
 				'yikes-mc-recaptcha-site-key',
1149 1149
 				__( 'Enter reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ),
1150
-				'',  // callback + validation inside of admin/partials/menu/options.php
1150
+				'', // callback + validation inside of admin/partials/menu/options.php
1151 1151
 				'yikes_easy_mc_settings_recpatcha_section'
1152 1152
 			);
1153 1153
 
1154 1154
 			add_settings_field(
1155 1155
 				'yikes-mc-recaptcha-secret-key',
1156 1156
 				__( 'Enter reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ),
1157
-				'',  // callback + validation inside of admin/partials/menu/options.php
1157
+				'', // callback + validation inside of admin/partials/menu/options.php
1158 1158
 				'yikes_easy_mc_settings_recpatcha_section'
1159 1159
 			);
1160 1160
 
1161 1161
 			add_settings_field(
1162 1162
 				'yikes-mc-recaptcha-status',
1163 1163
 				__( 'Enable ReCaptcha', 'yikes-inc-easy-mailchimp-extender' ),
1164
-				'',  // callback + validation inside of admin/partials/menu/options.php
1164
+				'', // callback + validation inside of admin/partials/menu/options.php
1165 1165
 				'yikes_easy_mc_settings_recpatcha_section'
1166 1166
 			);
1167 1167
 
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
 			add_settings_field(
1182 1182
 				'yikes-mailchimp-debug-status',
1183 1183
 				__( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ),
1184
-				'',  // callback + validation inside of admin/partials/menu/options.php
1184
+				'', // callback + validation inside of admin/partials/menu/options.php
1185 1185
 				'yikes_easy_mc_settings_debug_section'
1186 1186
 			);
1187 1187
 
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1202 1202
 			return '';
1203 1203
 		}
1204
-		$api_key = strip_tags ( trim( $input ) );
1204
+		$api_key = strip_tags( trim( $input ) );
1205 1205
 		$dash_position = strpos( trim( $input ), '-' );
1206 1206
 		if ( $dash_position !== false ) {
1207 1207
 			$manager = new Yikes_Inc_Easy_MailChimp_API_Manager( $api_key );
@@ -1216,9 +1216,9 @@  discard block
 block discarded – undo
1216 1216
 			update_option( 'yikes-mc-api-validation', 'valid_api_key' );
1217 1217
 				// Clear the API key transient data
1218 1218
 			$this->delete_yikes_mailchimp_transients();
1219
-		}  else {
1219
+		} else {
1220 1220
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1221
-			$error_logging->yikes_easy_mailchimp_write_to_error_log( $response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) );
1221
+			$error_logging->yikes_easy_mailchimp_write_to_error_log( $response->get_error_message(), __( "Connecting to MailChimp", 'yikes-inc-easy-mailchimp-extender' ), __( "Settings Page/General Settings", 'yikes-inc-easy-mailchimp-extender' ) );
1222 1222
 			update_option( 'yikes-mc-api-invalid-key-response', $response->get_error_message() );
1223 1223
 			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1224 1224
 		}
@@ -1267,11 +1267,11 @@  discard block
 block discarded – undo
1267 1267
 	public function check_for_old_yks_mc_options() {
1268 1268
 		$old_plugin_options = get_option( 'ykseme_storage' );
1269 1269
 		// only perform options migrations if the site is not a multi-site setup
1270
-		if ( !is_multisite() ) {
1270
+		if ( ! is_multisite() ) {
1271 1271
 			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1272 1272
 				// display a notice to the user that they should 'migrate'
1273 1273
 				// from the old plugin settings to the new ones
1274
-				add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 );
1274
+				add_action( 'admin_notices', array( $this, 'display_options_migrate_notice' ), 11 );
1275 1275
 			}
1276 1276
 		}
1277 1277
 	}
@@ -1304,11 +1304,11 @@  discard block
 block discarded – undo
1304 1304
 
1305 1305
 			// Confirm that the necessary forms table in the database exists, else bail
1306 1306
 			global $wpdb;
1307
-			if ( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1307
+			if ( $wpdb->get_var( "show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'" ) != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1308 1308
 				return;
1309 1309
 			}
1310 1310
 
1311
-			if ( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1311
+			if ( isset( $_GET[ 'yikes-mc-options-migration-dismissed' ] ) && $_GET[ 'yikes-mc-options-migration-dismissed' ] == 'true' ) {
1312 1312
 					// Delete the options, start a-new! (this will disable the migration notice altogether)
1313 1313
 					delete_option( 'widget_yikes_mc_widget' );
1314 1314
 					delete_option( 'api_validation' );
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
 			} else {
1323 1323
 			?>
1324 1324
 				<div class="yikes-easy-mc-updated migrate-options-notice">
1325
-					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list." , 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?></p>
1325
+					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?></p>
1326 1326
 					<p><?php _e( "Before you continue, it's strongly recommended you the perform the migration to ensure the plugin continues to function properly.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1327 1327
 					<p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1328 1328
 					<section id="migration-buttons">
@@ -1347,9 +1347,9 @@  discard block
 block discarded – undo
1347 1347
 		*	and return the index ( used to find the list name assigned to a form )
1348 1348
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1349 1349
 		*/
1350
-		function findMCListID($id, $array) {
1351
-		   foreach ($array as $key => $val) {
1352
-			   if ($val['id'] === $id) {
1350
+		function findMCListID( $id, $array ) {
1351
+		   foreach ( $array as $key => $val ) {
1352
+			   if ( $val[ 'id' ] === $id ) {
1353 1353
 				   return $key;
1354 1354
 			   }
1355 1355
 		   }
@@ -1359,8 +1359,8 @@  discard block
 block discarded – undo
1359 1359
 		/* Ajax Migrate Options */
1360 1360
 		function migrate_archived_options() {
1361 1361
 			// all options prefixed with 'yikes-mc-'
1362
-			$option_name = 'yikes-mc-'.$_POST['option_name'];
1363
-			$option_value = $_POST['option_value'];
1362
+			$option_name = 'yikes-mc-' . $_POST[ 'option_name' ];
1363
+			$option_value = $_POST[ 'option_value' ];
1364 1364
 			if ( json_decode( $option_value ) ) {
1365 1365
 				// decode our lists() array, and store it
1366 1366
 				$opt_value = json_decode( $option_value, true );
@@ -1374,22 +1374,22 @@  discard block
 block discarded – undo
1374 1374
 
1375 1375
 		/* Ajax Migrate Forms */
1376 1376
 		function migrate_previously_setup_forms() {
1377
-			$option_name = $_POST['option_name'];
1378
-			$done = $_POST['done_import'];
1377
+			$option_name = $_POST[ 'option_name' ];
1378
+			$done = $_POST[ 'done_import' ];
1379 1379
 			// Create some starter forms for the user
1380 1380
 			// based on previously imported lists (to our old version)
1381 1381
 			if ( $option_name == 'yikes-mc-lists' ) {
1382
-				$option_value = $_POST['option_value'];
1383
-				$new_options = json_decode( stripslashes_deep( $option_value ) , true );
1382
+				$option_value = $_POST[ 'option_value' ];
1383
+				$new_options = json_decode( stripslashes_deep( $option_value ), true );
1384 1384
 
1385
-				$list_id = $new_options['id'];
1386
-				$form_name = $new_options['name'];
1387
-				$fields = $new_options['fields']; // our fields array
1385
+				$list_id = $new_options[ 'id' ];
1386
+				$form_name = $new_options[ 'name' ];
1387
+				$fields = $new_options[ 'fields' ]; // our fields array
1388 1388
 
1389
-				$custom_styles = isset( $new_options['custom_styles'] ) ? $new_options['custom_styles']: '0'; // store as an array with all of our styles
1390
-				$custom_template = isset( $new_options['custom_template'] ) ? $new_options['custom_template'] : '0'; // store template data as an array ( active , template used )
1391
-				$redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1392
-				$redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1389
+				$custom_styles = isset( $new_options[ 'custom_styles' ] ) ? $new_options[ 'custom_styles' ] : '0'; // store as an array with all of our styles
1390
+				$custom_template = isset( $new_options[ 'custom_template' ] ) ? $new_options[ 'custom_template' ] : '0'; // store template data as an array ( active , template used )
1391
+				$redirect_user_on_submit = isset( $new_options[ 'yks_mailchimp_redirect_' . $list_id ] ) ? '1' : '0';
1392
+				$redirect_page = isset( $new_options[ 'page_id_' . $list_id ] ) ? $new_options[ 'page_id_' . $list_id ] : '';
1393 1393
 
1394 1394
 				/* Insert Forms Function  */
1395 1395
 				$this->form_interface->create_form( array(
@@ -1425,8 +1425,8 @@  discard block
 block discarded – undo
1425 1425
 		*	@since v5.6 - complete re-write
1426 1426
 		*/
1427 1427
 		public function generate_options_pages_sidebar_menu() {
1428
-			if ( isset( $_REQUEST['section'] ) ) {
1429
-				$selected = $_REQUEST['section'];
1428
+			if ( isset( $_REQUEST[ 'section' ] ) ) {
1429
+				$selected = $_REQUEST[ 'section' ];
1430 1430
 			}
1431 1431
 			$installed_addons = get_option( 'yikes-easy-mc-active-addons', array() );
1432 1432
 
@@ -1443,25 +1443,25 @@  discard block
 block discarded – undo
1443 1443
 				<h3><span><?php _e( 'Additional Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1444 1444
 				<div class="inside">
1445 1445
 					<ul id="settings-nav">
1446
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'general-settings' || !isset( $_REQUEST['section'] ) ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'general-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) ); ?>"><?php _e( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1447
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'integration-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'integration-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=integration-settings' ) ) ); ?>"><?php _e( 'Integration Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1448
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'recaptcha-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'recaptcha-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) ); ?>"><?php _e( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1449
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'api-cache-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'api-cache-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings' ) ) ); ?>"><?php _e( 'API Cache Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1450
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] ==  'debug-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'debug-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings' ) ) ); ?>"><?php _e( 'Debug Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1451
-						<li><?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] ==  'import-export-forms' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'import-export-forms' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) ); ?>"><?php _e( 'Import/Export', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1446
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'general-settings' || ! isset( $_REQUEST[ 'section' ] ) ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'general-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) ); ?>"><?php _e( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1447
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'integration-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'integration-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=integration-settings' ) ) ); ?>"><?php _e( 'Integration Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1448
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'recaptcha-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'recaptcha-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) ); ?>"><?php _e( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1449
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'api-cache-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'api-cache-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings' ) ) ); ?>"><?php _e( 'API Cache Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1450
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'debug-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'debug-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings' ) ) ); ?>"><?php _e( 'Debug Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1451
+						<li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'import-export-forms' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'import-export-forms' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) ); ?>"><?php _e( 'Import/Export', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
1452 1452
 					</ul>
1453 1453
 					<?php
1454 1454
 						// create our add-on settings pages
1455
-						if ( !empty( $installed_addons ) ) {
1455
+						if ( ! empty( $installed_addons ) ) {
1456 1456
 							?>
1457 1457
 							<hr class="add-on-settings-divider" />
1458 1458
 							<strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1459 1459
 							<ul id="addon-settings-nav">
1460 1460
 							<?php
1461
-							foreach( $installed_addons as $addon_name ) {
1461
+							foreach ( $installed_addons as $addon_name ) {
1462 1462
 								?>
1463 1463
 									<li>
1464
-										<?php if ( isset( $_REQUEST['section'] ) && $_REQUEST['section'] ==  $addon_name ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => $addon_name, 'addon' => 'true' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section='.$addon_name ) ) ); ?>"><?php echo ucwords( str_replace( '-', ' ', $addon_name ) ); ?></a></li>
1464
+										<?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == $addon_name ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => $addon_name, 'addon' => 'true' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=' . $addon_name ) ) ); ?>"><?php echo ucwords( str_replace( '-', ' ', $addon_name ) ); ?></a></li>
1465 1465
 								<?php
1466 1466
 							}
1467 1467
 							?>
@@ -1510,19 +1510,19 @@  discard block
 block discarded – undo
1510 1510
 						<select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); disabled( true, empty( $lists ) ); ?>>
1511 1511
 							<?php
1512 1512
 							if ( ! empty( $lists ) ) {
1513
-								foreach( $lists as $mailing_list ) {
1513
+								foreach ( $lists as $mailing_list ) {
1514 1514
 									?>
1515
-									<option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1515
+									<option value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option>
1516 1516
 									<?php
1517 1517
 								}
1518 1518
 							} else {
1519 1519
 								if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1520 1520
 									?>
1521
-									<option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1521
+									<option><?php echo __( "Please enter a valid API key.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1522 1522
 									<?php
1523 1523
 								} else {
1524 1524
 									?>
1525
-									<option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1525
+									<option><?php echo __( "No lists were found on the account.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1526 1526
 									<?php
1527 1527
 
1528 1528
 								}
@@ -1531,8 +1531,8 @@  discard block
 block discarded – undo
1531 1531
 						</select>
1532 1532
 
1533 1533
 						<?php
1534
-						if ( isset( $_GET['transient-cleared'] ) ) {
1535
-							if ( 'true' === $_GET['transient-cleared'] ) {
1534
+						if ( isset( $_GET[ 'transient-cleared' ] ) ) {
1535
+							if ( 'true' === $_GET[ 'transient-cleared' ] ) {
1536 1536
 								?>
1537 1537
 								<div class="yikes-list-refreshed-notice">
1538 1538
 									<p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -1545,7 +1545,7 @@  discard block
 block discarded – undo
1545 1545
 							if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1546 1546
 								?>
1547 1547
 									<p class="description">
1548
-										<?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ) , __( 'Create a list', 'yikes-inc-easy-mailchimp-extender' ) ); ?>
1548
+										<?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ), __( 'Create a list', 'yikes-inc-easy-mailchimp-extender' ) ); ?>
1549 1549
 									</p>
1550 1550
 								<?php
1551 1551
 							}
@@ -1554,9 +1554,9 @@  discard block
 block discarded – undo
1554 1554
 					</label>
1555 1555
 					<?php
1556 1556
 						if ( $this->is_user_mc_api_valid_form( false ) ) {
1557
-							echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary', '', false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1557
+							echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ), 'primary', '', false, array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1558 1558
 						} else {
1559
-							echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1559
+							echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1560 1560
 							?>
1561 1561
 								<a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&settings-updated=true' ) ); ?>"><?php _e( 'general settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1562 1562
 							<?php
@@ -1586,7 +1586,7 @@  discard block
 block discarded – undo
1586 1586
 				$post_types = get_post_types();
1587 1587
 				?>
1588 1588
 				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1589
-					<?php _e( "Select A Page or Post" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1589
+					<?php _e( "Select A Page or Post", 'yikes-inc-easy-mailchimp-extender' ); ?>
1590 1590
 					<select id="redirect-user-to-selection" name="redirect-user-to-selection" onchange="shouldWeDisplayCustomURL( this );return;">
1591 1591
 				<?php
1592 1592
 
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
 					$excluded_post_types = apply_filters( 'yikes-mailchimp-excluded-redirect-post-types', $excluded_post_types );
1603 1603
 
1604 1604
 						// loop over registered post types, and query!
1605
-						foreach( $post_types as $registered_post_type ) {
1605
+						foreach ( $post_types as $registered_post_type ) {
1606 1606
 
1607 1607
 							// exclude a few built in custom post types and any defined by the filter
1608 1608
 							if ( ! in_array( $registered_post_type, $excluded_post_types ) ) {
@@ -1624,8 +1624,8 @@  discard block
 block discarded – undo
1624 1624
 									?>
1625 1625
 										<optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>">
1626 1626
 									<?php
1627
-											foreach( $post_ids as $post_id ) {
1628
-												?><option <?php selected( $redirect_page , $post_id ); ?> value="<?php echo $post_id; ?>"><?php echo get_the_title( $post_id ) ?></option><?php
1627
+											foreach ( $post_ids as $post_id ) {
1628
+												?><option <?php selected( $redirect_page, $post_id ); ?> value="<?php echo $post_id; ?>"><?php echo get_the_title( $post_id ) ?></option><?php
1629 1629
 											}
1630 1630
 									?>
1631 1631
 										</optgroup>
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 					</select>
1642 1642
 
1643 1643
 					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if ( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1644
-						<?php _e( "Enter Custom URL" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1644
+						<?php _e( "Enter Custom URL", 'yikes-inc-easy-mailchimp-extender' ); ?>
1645 1645
 						<input type="text" class="widefat custom-redirect-url" name="custom-redirect-url" value="<?php echo $custom_redirect_url; ?>" />
1646 1646
 					</label>
1647 1647
 
@@ -1700,7 +1700,7 @@  discard block
 block discarded – undo
1700 1700
 							</p>
1701 1701
 						</div>
1702 1702
 
1703
-						<p class="description sidebar-footer-text"><?php printf( __( "This plugin made with %s by %s" , 'yikes-inc-easy-mailchimp-extender' ), '<span class="dashicons dashicons-heart yikes-love"></span>', '<a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>' ); ?> </p>
1703
+						<p class="description sidebar-footer-text"><?php printf( __( "This plugin made with %s by %s", 'yikes-inc-easy-mailchimp-extender' ), '<span class="dashicons dashicons-heart yikes-love"></span>', '<a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>' ); ?> </p>
1704 1704
 
1705 1705
 						<section id="about-yikes-inc" class="inside">
1706 1706
 							<a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc.">
@@ -1718,7 +1718,7 @@  discard block
 block discarded – undo
1718 1718
 						<!-- review us container -->
1719 1719
 						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1720 1720
 						<div id="review-yikes-easy-mc" class="inside">
1721
-							<p><?php _e( "Check out available add-ons for some seriously enhanced features." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1721
+							<p><?php _e( "Check out available add-ons for some seriously enhanced features.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1722 1722
 							<p><a class="button-secondary" href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) ); ?>" title="<?php _e( 'View Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'View Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
1723 1723
 						</div>
1724 1724
 
@@ -1745,11 +1745,11 @@  discard block
 block discarded – undo
1745 1745
 
1746 1746
 			// if no list id, die!
1747 1747
 			if ( ! $list_id ) {
1748
-				wp_die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) );
1748
+				wp_die( __( "We've encountered an error. No list ID was sent.", 'yikes-inc-easy-mailchimp-extender' ) );
1749 1749
 			}
1750 1750
 
1751 1751
 			if ( ! $merge_variables ) {
1752
-				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support." , 'yikes-inc-easy-mailchimp-extender' ) );
1752
+				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support.", 'yikes-inc-easy-mailchimp-extender' ) );
1753 1753
 			}
1754 1754
 
1755 1755
 			if ( ! empty( $form_fields ) ) {
@@ -1760,17 +1760,17 @@  discard block
 block discarded – undo
1760 1760
 				$available_interest_groups	= array();
1761 1761
 
1762 1762
 				// Default variables as arrays - these are used for holding the MailChimp merge field ID
1763
-				$merge_field_ids			= array();
1764
-				$mailchimp_merge_field_ids	= array();
1763
+				$merge_field_ids = array();
1764
+				$mailchimp_merge_field_ids = array();
1765 1765
 
1766 1766
 				// loop over merge variables
1767
-				if ( ! empty( $merge_variables['merge_fields'] ) ) {
1768
-					$available_merge_variables = wp_list_pluck( $merge_variables['merge_fields'], 'tag' );
1769
-					$mailchimp_merge_field_ids = wp_list_pluck( $merge_variables['merge_fields'], 'merge_id' );
1767
+				if ( ! empty( $merge_variables[ 'merge_fields' ] ) ) {
1768
+					$available_merge_variables = wp_list_pluck( $merge_variables[ 'merge_fields' ], 'tag' );
1769
+					$mailchimp_merge_field_ids = wp_list_pluck( $merge_variables[ 'merge_fields' ], 'merge_id' );
1770 1770
 					
1771 1771
 					// Array will look like $merge_tag => $merge_id
1772
-					foreach( $available_merge_variables as $index => $merge_tag ) { 
1773
-						$merge_field_ids[$merge_tag] = $mailchimp_merge_field_ids[$index];
1772
+					foreach ( $available_merge_variables as $index => $merge_tag ) { 
1773
+						$merge_field_ids[ $merge_tag ] = $mailchimp_merge_field_ids[ $index ];
1774 1774
 					}
1775 1775
 				}
1776 1776
 
@@ -1785,46 +1785,46 @@  discard block
 block discarded – undo
1785 1785
 				$excluded_fields = array_diff( $assigned_fields, $merged_fields );
1786 1786
 
1787 1787
 				$i = 1;
1788
-				foreach( $form_fields as $field ) {
1788
+				foreach ( $form_fields as $field ) {
1789 1789
 
1790
-					if ( isset( $field['merge'] ) ) {
1790
+					if ( isset( $field[ 'merge' ] ) ) {
1791 1791
 						// @todo: don't use in_array()
1792
-						$excluded_field = in_array( $field['merge'], $excluded_fields, true );
1792
+						$excluded_field = in_array( $field[ 'merge' ], $excluded_fields, true );
1793 1793
 						?>
1794
-						<section class="draggable" id="<?php echo $field['merge']; ?>">
1794
+						<section class="draggable" id="<?php echo $field[ 'merge' ]; ?>">
1795 1795
 							<!-- top -->
1796 1796
 							<a class="expansion-section-title settings-sidebar">
1797 1797
 								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span>
1798
-								<span class="yikes-mc-expansion-section-field-label"> <?php echo stripslashes( $field['label'] ); ?> </span>
1798
+								<span class="yikes-mc-expansion-section-field-label"> <?php echo stripslashes( $field[ 'label' ] ); ?> </span>
1799 1799
 								<?php if ( $excluded_field ) { ?>
1800 1800
 									<img src="<?php echo YIKES_MC_URL . 'includes/images/warning.svg'; ?>" class="field-doesnt-exist-notice" title="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>" alt="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>">
1801 1801
 								<?php } ?>
1802
-								<input maxlength="50" type="text" class="yikes-mc-edit-field-label-input" value="<?php echo stripslashes( $field['label'] ); ?>" />
1802
+								<input maxlength="50" type="text" class="yikes-mc-edit-field-label-input" value="<?php echo stripslashes( $field[ 'label' ] ); ?>" />
1803 1803
 								<span class="dashicons dashicons-yes yikes-mc-save-field-label-edits-icon" title="<?php _e( 'Click to save changes.', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
1804 1804
 								<span class="dashicons dashicons-edit yikes-mc-edit-field-label-icon" title="<?php _e( 'Click to edit the label', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
1805 1805
 								<span class="yikes-mc-edit-field-label-message"></span>
1806
-								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
1806
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
1807 1807
 							</a>
1808 1808
 							<!-- expansion section -->
1809 1809
 							<div class="yikes-mc-settings-expansion-section">
1810 1810
 
1811 1811
 								<?php if ( $excluded_field ) { ?>
1812
-									<p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on your website." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1812
+									<p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on your website.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1813 1813
 								<?php } ?>
1814 1814
 
1815 1815
 								<!-- store field data -->
1816
-								<input type="hidden" class="yikes-mc-merge-field-label" name="field[<?php echo $field['merge']; ?>][label]" value="<?php echo htmlspecialchars( $field['label'] ); ?>" />
1817
-								<input type="hidden" class="yikes-mc-merge-field-type" name="field[<?php echo $field['merge']; ?>][type]" value="<?php echo $field['type']; ?>" />
1818
-								<input type="hidden" class="yikes-mc-merge-field-tag" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" />
1819
-								<input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" />
1820
-								<?php if ( isset( $merge_field_ids[ $field['merge'] ] ) && is_int( $merge_field_ids[ $field['merge'] ] ) ) { ?> 
1821
-									<input type="hidden" class="yikes-mc-merge-field-id" name="field[<?php echo $field['merge']; ?>][id]" value="<?php echo $merge_field_ids[ $field['merge'] ] ?>" />  
1816
+								<input type="hidden" class="yikes-mc-merge-field-label" name="field[<?php echo $field[ 'merge' ]; ?>][label]" value="<?php echo htmlspecialchars( $field[ 'label' ] ); ?>" />
1817
+								<input type="hidden" class="yikes-mc-merge-field-type" name="field[<?php echo $field[ 'merge' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
1818
+								<input type="hidden" class="yikes-mc-merge-field-tag" name="field[<?php echo $field[ 'merge' ]; ?>][merge]" value="<?php echo $field[ 'merge' ]; ?>" />
1819
+								<input type="hidden" class="field-<?php echo $field[ 'merge' ]; ?>-position position-input" name="field[<?php echo $field[ 'merge' ]; ?>][position]" value="<?php echo $i++; ?>" />
1820
+								<?php if ( isset( $merge_field_ids[ $field[ 'merge' ] ] ) && is_int( $merge_field_ids[ $field[ 'merge' ] ] ) ) { ?> 
1821
+									<input type="hidden" class="yikes-mc-merge-field-id" name="field[<?php echo $field[ 'merge' ]; ?>][id]" value="<?php echo $merge_field_ids[ $field[ 'merge' ] ] ?>" />  
1822 1822
 								<?php } ?>
1823 1823
 
1824
-								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1825
-									$choices = json_decode( $field['choices'], true );
1824
+								<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'dropdown' || $field[ 'type' ] == 'select' ) {
1825
+									$choices = json_decode( $field[ 'choices' ], true );
1826 1826
 								?>
1827
-									<input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1827
+									<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1828 1828
 								<?php } ?>
1829 1829
 
1830 1830
 								<!-- Single or Double Opt-in -->
@@ -1840,12 +1840,12 @@  discard block
 block discarded – undo
1840 1840
 												</label>
1841 1841
 											</td>
1842 1842
 											<td>
1843
-												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field['merge']; ?>">
1843
+												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field[ 'merge' ]; ?>">
1844 1844
 											</td>
1845 1845
 										</tr>
1846 1846
 
1847 1847
 										<!-- Placeholder Value -->
1848
-										<?php switch( $field['type'] ) {
1848
+										<?php switch ( $field[ 'type' ] ) {
1849 1849
 
1850 1850
 											case 'text':
1851 1851
 											case 'email':
@@ -1859,13 +1859,13 @@  discard block
 block discarded – undo
1859 1859
 										<!-- Placeholder -->
1860 1860
 										<tr valign="top">
1861 1861
 											<td scope="row">
1862
-												<label for="placeholder_<?php echo esc_attr( $field['merge'] ); ?>">
1862
+												<label for="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
1863 1863
 													<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1864 1864
 												</label>
1865 1865
 											</td>
1866 1866
 											<td>
1867
-												<input type="text" id="placeholder_<?php echo esc_attr( $field['merge'] ); ?>" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : '' ; ?>" />
1868
-												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1867
+												<input type="text" id="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>" />
1868
+												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1869 1869
 											</td>
1870 1870
 										</tr>
1871 1871
 										<?php
@@ -1876,13 +1876,13 @@  discard block
 block discarded – undo
1876 1876
 											?>
1877 1877
 												<tr valign="top">
1878 1878
 													<td scope="row">
1879
-														<label for="placeholder_<?php echo esc_attr( $field['merge'] ); ?>">
1879
+														<label for="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
1880 1880
 															<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1881 1881
 														</label>
1882 1882
 													</td>
1883 1883
 													<td>
1884
-														<input type="checkbox" id="placeholder_<?php echo esc_attr( $field['merge'] ); ?>" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="1" <?php echo isset( $field['placeholder'] ) && ! empty( $field['placeholder'] ) ? 'checked="checked"' : '' ; ?> />
1885
-														<span class="description"><small><?php _e( "Use placeholders for this field (these will be automatically filled in with field names).", 'yikes-inc-easy-mailchimp-extender' );?></small></span>
1884
+														<input type="checkbox" id="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="1" <?php echo isset( $field[ 'placeholder' ] ) && ! empty( $field[ 'placeholder' ] ) ? 'checked="checked"' : ''; ?> />
1885
+														<span class="description"><small><?php _e( "Use placeholders for this field (these will be automatically filled in with field names).", 'yikes-inc-easy-mailchimp-extender' ); ?></small></span>
1886 1886
 													</td>
1887 1887
 												</tr>
1888 1888
 											<?php
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
 										?>
1893 1893
 
1894 1894
 										<!-- Default Value -->
1895
-										<?php switch( $field['type'] ) {
1895
+										<?php switch ( $field[ 'type' ] ) {
1896 1896
 											default:
1897 1897
 											case 'text':
1898 1898
 											case 'number':
@@ -1900,15 +1900,15 @@  discard block
 block discarded – undo
1900 1900
 										?>
1901 1901
 											<tr valign="top">
1902 1902
 												<td scope="row">
1903
-													<label for="default_value_<?php echo esc_attr( $field['merge'] ); ?>">
1903
+													<label for="default_value_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
1904 1904
 														<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
1905 1905
 													</label>
1906 1906
 												</td>
1907 1907
 												<td>
1908
-													<input id="default_value_<?php echo esc_attr( $field['merge'] ); ?>" <?php if ( $field['type'] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field['merge']; ?>][default]" <?php if ( $field['type'] != 'url' ) { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( $field['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field['default'] ) ) ) : ''; ?>" <?php } ?> />
1909
-													<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1908
+													<input id="default_value_<?php echo esc_attr( $field[ 'merge' ] ); ?>" <?php if ( $field[ 'type' ] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][default]" <?php if ( $field[ 'type' ] != 'url' ) { ?> value="<?php echo isset( $field[ 'default' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'default' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field[ 'default' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field[ 'default' ] ) ) ) : ''; ?>" <?php } ?> />
1909
+													<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1910 1910
 													<?php
1911
-													switch( $field['type'] ) {
1911
+													switch ( $field[ 'type' ] ) {
1912 1912
 														case 'text':
1913 1913
 															?>
1914 1914
 																<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" onclick="storeGlobalClicked( jQuery( this ) );" class="thickbox"><?php _e( 'View Pre-Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
@@ -1930,28 +1930,28 @@  discard block
 block discarded – undo
1930 1930
 													</td>
1931 1931
 													<td>
1932 1932
 														<?php
1933
-															$field['default_choice'] = ! isset( $field['default_choice'] ) ? 'no-default' : $field['default_choice'];
1933
+															$field[ 'default_choice' ] = ! isset( $field[ 'default_choice' ] ) ? 'no-default' : $field[ 'default_choice' ];
1934 1934
 															$x = 0;
1935 1935
 														?>
1936
-														<label for="<?php echo $field['merge'] . '-no-default'; ?>">
1937
-															<input id="<?php echo $field['merge'] . '-no-default'; ?>"
1936
+														<label for="<?php echo $field[ 'merge' ] . '-no-default'; ?>">
1937
+															<input id="<?php echo $field[ 'merge' ] . '-no-default'; ?>"
1938 1938
 															       type="radio"
1939
-															       name="field[<?php echo $field['merge']; ?>][default_choice]"
1940
-															       value="no-default" <?php checked( $field['default_choice'], 'no-default' ); ?>
1939
+															       name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]"
1940
+															       value="no-default" <?php checked( $field[ 'default_choice' ], 'no-default' ); ?>
1941 1941
 															>
1942 1942
 															No Default&nbsp;
1943 1943
 														</label>
1944 1944
 														<?php
1945 1945
 														foreach ( $choices as $choice => $value ) { ?>
1946
-															<label for="<?php echo $field['merge'].'-'.$x; ?>">
1947
-																<input id="<?php echo $field['merge'].'-'.$x; ?>"
1946
+															<label for="<?php echo $field[ 'merge' ] . '-' . $x; ?>">
1947
+																<input id="<?php echo $field[ 'merge' ] . '-' . $x; ?>"
1948 1948
 																       type="radio"
1949
-																       name="field[<?php echo $field['merge']; ?>][default_choice]"
1950
-																       value="<?php echo $x; ?>" <?php checked( $field['default_choice'], $x ); ?>>
1949
+																       name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]"
1950
+																       value="<?php echo $x; ?>" <?php checked( $field[ 'default_choice' ], $x ); ?>>
1951 1951
 																<?php echo $value; ?>&nbsp;
1952 1952
 															</label>
1953 1953
 														<?php $x++; } ?>
1954
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1954
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1955 1955
 													</td>
1956 1956
 												</tr>
1957 1957
 
@@ -1967,13 +1967,13 @@  discard block
 block discarded – undo
1967 1967
 														</label>
1968 1968
 													</td>
1969 1969
 													<td>
1970
-														<select type="default" name="field[<?php echo $field['merge']; ?>][default_choice]">
1971
-															<option value="no-default" <?php selected( $field['default_choice'] , 'no-default' ); ?>>No Default</option>
1972
-															<?php foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1973
-																<option value="<?php echo $choice; ?>" <?php selected( $field['default_choice'] , $choice ); ?>><?php echo $value; ?></option>
1970
+														<select type="default" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]">
1971
+															<option value="no-default" <?php selected( $field[ 'default_choice' ], 'no-default' ); ?>>No Default</option>
1972
+															<?php foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1973
+																<option value="<?php echo $choice; ?>" <?php selected( $field[ 'default_choice' ], $choice ); ?>><?php echo $value; ?></option>
1974 1974
 															<?php } ?>
1975 1975
 														</select>
1976
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1976
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1977 1977
 													</td>
1978 1978
 												</tr>
1979 1979
 
@@ -1990,82 +1990,82 @@  discard block
 block discarded – undo
1990 1990
 										<!-- Field Description -->
1991 1991
 										<tr valign="top">
1992 1992
 											<td scope="row">
1993
-												<label for="description_<?php echo esc_attr( $field['merge'] ); ?>">
1993
+												<label for="description_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
1994 1994
 													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
1995 1995
 												</label>
1996 1996
 											</td>
1997 1997
 											<td>
1998
-												<textarea class="widefat field-description-input" id="description_<?php echo esc_attr( $field['merge'] ); ?>" name="field[<?php echo $field['merge']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
1999
-												<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and will provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1998
+												<textarea class="widefat field-description-input" id="description_<?php echo esc_attr( $field[ 'merge' ] ); ?>" name="field[<?php echo $field[ 'merge' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
1999
+												<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and will provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2000 2000
 											</td>
2001 2001
 										</tr>
2002 2002
 										<!-- Description Above Field -->
2003 2003
 										<tr valign="top" class="yikes-checkbox-container">
2004 2004
 											<td scope="row">
2005
-												<label for="description_above_<?php echo esc_attr( $field['merge'] ); ?>">
2005
+												<label for="description_above_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2006 2006
 													<?php _e( 'Description Above Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2007 2007
 												</label>
2008 2008
 											</td>
2009 2009
 											<td>
2010
-												<input type="checkbox" id="description_above_<?php echo esc_attr( $field['merge'] ); ?>" class="widefat field-description-input" name="field[<?php echo $field['merge']; ?>][description_above]" value="1" <?php echo isset( $field['description_above'] ) && $field['description_above'] === '1' ? 'checked="checked"' : ''; ?> />
2011
-												<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2010
+												<input type="checkbox" id="description_above_<?php echo esc_attr( $field[ 'merge' ] ); ?>" class="widefat field-description-input" name="field[<?php echo $field[ 'merge' ]; ?>][description_above]" value="1" <?php echo isset( $field[ 'description_above' ] ) && $field[ 'description_above' ] === '1' ? 'checked="checked"' : ''; ?> />
2011
+												<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2012 2012
 											</td>
2013 2013
 										</tr>
2014 2014
 										<!-- Additional Classes -->
2015 2015
 										<tr valign="top">
2016 2016
 											<td scope="row">
2017
-												<label for="classes_<?php echo esc_attr( $field['merge'] ); ?>">
2017
+												<label for="classes_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2018 2018
 													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2019 2019
 												</label>
2020 2020
 											</td>
2021 2021
 											<td>
2022
-												<input type="text" id="classes_<?php echo esc_attr( $field['merge'] ); ?>" class="widefat" name="field[<?php echo $field['merge']; ?>][additional-classes]" value="<?php echo isset( $field['additional-classes'] ) ? stripslashes( wp_strip_all_tags( $field['additional-classes'] ) ) : '' ; ?>" />
2023
-												<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
2022
+												<input type="text" id="classes_<?php echo esc_attr( $field[ 'merge' ] ); ?>" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][additional-classes]" value="<?php echo isset( $field[ 'additional-classes' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'additional-classes' ] ) ) : ''; ?>" />
2023
+												<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
2024 2024
 											</td>
2025 2025
 										</tr>
2026 2026
 										<!-- Required Toggle -->
2027 2027
 										<tr valign="top" class="yikes-checkbox-container yikes-checkbox-container-first">
2028 2028
 											<td scope="row">
2029
-												<label for="field-required-<?php echo esc_attr( $field['merge'] ); ?>">
2029
+												<label for="field-required-<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2030 2030
 													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2031 2031
 												</label>
2032 2032
 											</td>
2033 2033
 											<td>
2034
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2035
-												<input id="field-required-<?php echo esc_attr( $field['merge'] ); ?>" type="checkbox" class="widefat" value="1" name="field[<?php echo $field['merge']; ?>][require]" <?php checked( $checked , 1 ); ?> <?php if ( $field['merge'] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
2036
-												<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2034
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2035
+												<input id="field-required-<?php echo esc_attr( $field[ 'merge' ] ); ?>" type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'merge' ]; ?>][require]" <?php checked( $checked, 1 ); ?> <?php if ( $field[ 'merge' ] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
2036
+												<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2037 2037
 											</td>
2038 2038
 										</tr>
2039 2039
 										<!-- Visible Toggle -->
2040 2040
 										<tr valign="top" class="yikes-checkbox-container">
2041 2041
 											<td scope="row">
2042
-												<label for="hide-field-<?php echo esc_attr( $field['merge'] ); ?>">
2042
+												<label for="hide-field-<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2043 2043
 													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2044 2044
 												</label>
2045 2045
 											</td>
2046 2046
 											<td>
2047
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2048
-												<input id="hide-field-<?php echo esc_attr( $field['merge'] ); ?>" type="checkbox" class="widefat" value="1" name="field[<?php echo $field['merge']; ?>][hide]" <?php checked( $hide , 1 ); ?> <?php if ( $field['merge'] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
2049
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2047
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2048
+												<input id="hide-field-<?php echo esc_attr( $field[ 'merge' ] ); ?>" type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'merge' ]; ?>][hide]" <?php checked( $hide, 1 ); ?> <?php if ( $field[ 'merge' ] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
2049
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2050 2050
 											</td>
2051 2051
 										</tr>
2052 2052
 										<!-- Toggle Field Label Visibility -->
2053 2053
 										<tr valign="top" class="yikes-checkbox-container">
2054 2054
 											<td scope="row">
2055
-												<label for="hide-label-<?php echo esc_attr( $field['merge'] ); ?>">
2055
+												<label for="hide-label-<?php echo esc_attr( $field[ 'merge' ] ); ?>">
2056 2056
 													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2057 2057
 												</label>
2058 2058
 											</td>
2059 2059
 											<td>
2060
-												<?php $hide_label = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2061
-												<input id="hide-label-<?php echo esc_attr( $field['merge'] ); ?>" type="checkbox" name="field[<?php echo $field['merge']; ?>][hide-label]" value="1" <?php checked( $hide_label , 1 ); ?>/>
2062
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2060
+												<?php $hide_label = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2061
+												<input id="hide-label-<?php echo esc_attr( $field[ 'merge' ] ); ?>" type="checkbox" name="field[<?php echo $field[ 'merge' ]; ?>][hide-label]" value="1" <?php checked( $hide_label, 1 ); ?>/>
2062
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2063 2063
 											</td>
2064 2064
 										</tr>
2065 2065
 										<!-- Display Phone/Date Formats back to the user -->
2066 2066
 										<!-- Phone Format Initial Load -->
2067 2067
 										<?php
2068
-											switch( $field['type'] ) {
2068
+											switch ( $field[ 'type' ] ) {
2069 2069
 												/* Store the phone format, for properly regex pattern */
2070 2070
 												case 'phone':
2071 2071
 												case 'birthday':
@@ -2075,23 +2075,23 @@  discard block
 block discarded – undo
2075 2075
 															<td scope="row">
2076 2076
 																<label for="placeholder">
2077 2077
 																	<?php
2078
-																		switch( $field['type'] ) {
2078
+																		switch ( $field[ 'type' ] ) {
2079 2079
 																			default:
2080 2080
 																			case 'birthday':
2081 2081
 																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
2082
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD';
2082
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD';
2083 2083
 																				$format_name = 'date_format';
2084 2084
 																				break;
2085 2085
 
2086 2086
 																			case 'date':
2087 2087
 																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
2088
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD/YYYY';
2088
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD/YYYY';
2089 2089
 																				$format_name = 'date_format';
2090 2090
 																				break;
2091 2091
 
2092 2092
 																			case 'phone':
2093 2093
 																				$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
2094
-																				$format = isset( $field['phone_format'] ) && ! empty( $field['phone_format'] ) ? $field['phone_format'] : __( 'International', 'yikes-inc-easy-mailchimp-extender' );
2094
+																				$format = isset( $field[ 'phone_format' ] ) && ! empty( $field[ 'phone_format' ] ) ? $field[ 'phone_format' ] : __( 'International', 'yikes-inc-easy-mailchimp-extender' );
2095 2095
 																				$format_name = 'phone_format';
2096 2096
 																				break;
2097 2097
 																		}
@@ -2101,7 +2101,7 @@  discard block
 block discarded – undo
2101 2101
 															</td>
2102 2102
 															<td>
2103 2103
 																<strong><?php echo $format; ?></strong>
2104
-																<input type="hidden" name="field[<?php echo $field['merge']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
2104
+																<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
2105 2105
 																<p class="description"><small>
2106 2106
 																	<?php printf( __( 'To change the %s please head over to <a href="%s" title="MailChimp" target="_blank">MailChimp</a>. If you alter the format, you should re-import this field.', 'yikes-inc-easy-mailchimp-extender' ), strtolower( $type ), esc_url( 'http://www.mailchimp.com' ) ); ?>
2107 2107
 																</small></p>
@@ -2122,8 +2122,8 @@  discard block
 block discarded – undo
2122 2122
 											</td>
2123 2123
 											<td>
2124 2124
 												<span class="toggle-container">
2125
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2126
-													<a href="#" class="remove-field" alt="<?php echo $field['merge']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2125
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2126
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'merge' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2127 2127
 												</span>
2128 2128
 											</td>
2129 2129
 										</tr>
@@ -2141,35 +2141,35 @@  discard block
 block discarded – undo
2141 2141
 						/**** Interest Group ****/
2142 2142
 
2143 2143
 						?>
2144
-						<section class="draggable" id="<?php echo $field['group_id']; ?>">
2144
+						<section class="draggable" id="<?php echo $field[ 'group_id' ]; ?>">
2145 2145
 							<!-- top -->
2146 2146
 							<a href="#" class="expansion-section-title settings-sidebar">
2147
-								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php echo stripslashes( $field['label'] ); ?>
2148
-								<?php if ( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2147
+								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
2148
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2149 2149
 									<img src="<?php echo YIKES_MC_URL . 'includes/images/warning.svg'; ?>" class="field-no-longer-exists-warning" title="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>" alt="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>">
2150 2150
 								<?php } ?>
2151
-								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
2151
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
2152 2152
 							</a>
2153 2153
 							<!-- expansion section -->
2154 2154
 							<div class="yikes-mc-settings-expansion-section">
2155 2155
 
2156 2156
 								<!-- check if this field exists in the available interest group array -->
2157
-								<?php if ( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2158
-									<p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on the front end." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
2157
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2158
+									<p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
2159 2159
 								<?php } ?>
2160 2160
 
2161 2161
 								<!-- store the label -->
2162
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][label]" value="<?php echo htmlspecialchars( $field['label'] ); ?>" />
2163
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][type]" value="<?php echo $field['type']; ?>" />
2164
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][group_id]" value="<?php echo $field['group_id']; ?>" />
2165
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field['groups'], true ) ) ); ?>' />
2162
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][label]" value="<?php echo htmlspecialchars( $field[ 'label' ] ); ?>" />
2163
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
2164
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][group_id]" value="<?php echo $field[ 'group_id' ]; ?>" />
2165
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field[ 'groups' ], true ) ) ); ?>' />
2166 2166
 
2167 2167
 								<!-- Single or Double Opt-in -->
2168 2168
 								<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
2169 2169
 
2170 2170
 									<table class="form-table form-field-container">
2171 2171
 										<!-- Default Value -->
2172
-										<?php switch( $field['type'] ) {
2172
+										<?php switch ( $field[ 'type' ] ) {
2173 2173
 											default:
2174 2174
 											case 'radio':
2175 2175
 											case 'checkboxes':
@@ -2182,15 +2182,15 @@  discard block
 block discarded – undo
2182 2182
 													</td>
2183 2183
 													<td>
2184 2184
 														<?php
2185
-														$field['default_choice'] = isset( $field['default_choice'] ) ? $field['default_choice'] : '';
2185
+														$field[ 'default_choice' ] = isset( $field[ 'default_choice' ] ) ? $field[ 'default_choice' ] : '';
2186 2186
 
2187 2187
 														$default_shown = false;
2188 2188
 
2189
-														foreach ( json_decode( $field['groups'], true ) as $id => $group ) {
2190
-															$field_id   = "{$field['group_id']}-{$id}";
2191
-															$field_type = 'hidden' == $field['type'] ? 'checkbox' : $field['type'];
2189
+														foreach ( json_decode( $field[ 'groups' ], true ) as $id => $group ) {
2190
+															$field_id   = "{$field[ 'group_id' ]}-{$id}";
2191
+															$field_type = 'hidden' == $field[ 'type' ] ? 'checkbox' : $field[ 'type' ];
2192 2192
 															$field_type = 'checkboxes' == $field_type ? 'checkbox' : $field_type;
2193
-															$field_name = "field[{$field['group_id']}][default_choice]";
2193
+															$field_name = "field[{$field[ 'group_id' ]}][default_choice]";
2194 2194
 															$field_name = 'checkbox' == $field_type ? $field_name . '[]' : $field_name;
2195 2195
 
2196 2196
 															// Determine if the current group is checked.
@@ -2198,13 +2198,13 @@  discard block
 block discarded – undo
2198 2198
 															switch ( $field_type ) {
2199 2199
 																case 'radio':
2200 2200
 																default:
2201
-																	$default = is_array( $field['default_choice'] ) ? current( $field['default_choice'] ) : $field['default_choice'];
2202
-																	$checked = is_array( $field['default_choice'] ) ? checked( current( $field['default_choice'] ), $id, false ) : checked( $field['default_choice'], $id, false );
2201
+																	$default = is_array( $field[ 'default_choice' ] ) ? current( $field[ 'default_choice' ] ) : $field[ 'default_choice' ];
2202
+																	$checked = is_array( $field[ 'default_choice' ] ) ? checked( current( $field[ 'default_choice' ] ), $id, false ) : checked( $field[ 'default_choice' ], $id, false );
2203 2203
 																break;
2204 2204
 
2205 2205
 																case 'checkbox':
2206 2206
 																case 'hidden':
2207
-																	if ( is_array( $field['default_choice'] ) && in_array( $id, $field['default_choice'] ) ) {
2207
+																	if ( is_array( $field[ 'default_choice' ] ) && in_array( $id, $field[ 'default_choice' ] ) ) {
2208 2208
 																		$checked = checked( true, true, false );
2209 2209
 																	}
2210 2210
 																break;
@@ -2219,7 +2219,7 @@  discard block
 block discarded – undo
2219 2219
 																	    type="<?php echo $field_type; ?>"
2220 2220
 																	    name="<?php echo $field_name; ?>"
2221 2221
 																	    value="no-default" 
2222
-																	    <?php is_array( $field['default_choice'] ) ? checked( current( $field['default_choice'] ), 'no-default' ) : checked( $field['default_choice'], 'no-default' ); ?>>
2222
+																	    <?php is_array( $field[ 'default_choice' ] ) ? checked( current( $field[ 'default_choice' ] ), 'no-default' ) : checked( $field[ 'default_choice' ], 'no-default' ); ?>>
2223 2223
 																	No Default&nbsp;
2224 2224
 																</label>
2225 2225
 																<?php
@@ -2235,7 +2235,7 @@  discard block
 block discarded – undo
2235 2235
 															</label>
2236 2236
 															<?php
2237 2237
 														} ?>
2238
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2238
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2239 2239
 													</td>
2240 2240
 												</tr>
2241 2241
 
@@ -2251,13 +2251,13 @@  discard block
 block discarded – undo
2251 2251
 														</label>
2252 2252
 													</td>
2253 2253
 													<td>
2254
-														<select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2254
+														<select type="default" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]">
2255 2255
 															<option value="no-default">No Default</option>
2256
-															<?php foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as $id => $group ) { ?>
2257
-																<option value="<?php echo $id; ?>" <?php selected( $field['default_choice'] , $id ); ?>><?php echo stripslashes( $group ); ?></option>
2256
+															<?php foreach ( json_decode( stripslashes_deep( $field[ 'groups' ] ), true ) as $id => $group ) { ?>
2257
+																<option value="<?php echo $id; ?>" <?php selected( $field[ 'default_choice' ], $id ); ?>><?php echo stripslashes( $group ); ?></option>
2258 2258
 															<?php } ?>
2259 2259
 														</select>
2260
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2260
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2261 2261
 													</td>
2262 2262
 												</tr>
2263 2263
 
@@ -2270,78 +2270,78 @@  discard block
 block discarded – undo
2270 2270
 										<!-- Field Description -->
2271 2271
 										<tr valign="top">
2272 2272
 											<td scope="row">
2273
-												<label for="description_<?php echo esc_attr( $field['group_id'] ); ?>">
2273
+												<label for="description_<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2274 2274
 													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
2275 2275
 												</label>
2276 2276
 											</td>
2277 2277
 											<td>
2278
-												<textarea id="description_<?php echo esc_attr( $field['group_id'] ); ?>" class="widefat field-description-input" name="field[<?php echo $field['group_id']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
2279
-												<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2278
+												<textarea id="description_<?php echo esc_attr( $field[ 'group_id' ] ); ?>" class="widefat field-description-input" name="field[<?php echo $field[ 'group_id' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
2279
+												<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2280 2280
 											</td>
2281 2281
 										</tr>
2282 2282
 
2283 2283
 										<!-- Description Above Field -->
2284 2284
 										<tr valign="top" class="yikes-checkbox-container">
2285 2285
 											<td scope="row">
2286
-												<label for="description_above_<?php echo $field['group_id']; ?>">
2286
+												<label for="description_above_<?php echo $field[ 'group_id' ]; ?>">
2287 2287
 													<?php _e( 'Description Above Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2288 2288
 												</label>
2289 2289
 											</td>
2290 2290
 											<td>
2291
-												<input type="checkbox" id="description_above_<?php echo $field['group_id']; ?>" class="widefat field-description-input" name="field[<?php echo $field['group_id']; ?>][description_above]" value="1" <?php echo isset( $field['description_above'] ) && $field['description_above'] === '1' ? 'checked="checked"' : ''; ?> />
2292
-												<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2291
+												<input type="checkbox" id="description_above_<?php echo $field[ 'group_id' ]; ?>" class="widefat field-description-input" name="field[<?php echo $field[ 'group_id' ]; ?>][description_above]" value="1" <?php echo isset( $field[ 'description_above' ] ) && $field[ 'description_above' ] === '1' ? 'checked="checked"' : ''; ?> />
2292
+												<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2293 2293
 											</td>
2294 2294
 										</tr>
2295 2295
 
2296 2296
 										<!-- Additional Classes -->
2297 2297
 										<tr valign="top">
2298 2298
 											<td scope="row">
2299
-												<label for="classes_<?php echo esc_attr( $field['group_id'] ); ?>">
2299
+												<label for="classes_<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2300 2300
 													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2301 2301
 												</label>
2302 2302
 											</td>
2303 2303
 											<td>
2304
-												<input type="text" id="classes_<?php echo esc_attr( $field['group_id'] ); ?>" class="widefat" name="field[<?php echo $field['group_id']; ?>][additional-classes]" value="<?php echo isset( $field['additional-classes'] ) ? stripslashes( wp_strip_all_tags( $field['additional-classes'] ) ) : '' ; ?>" />
2305
-												<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
2304
+												<input type="text" id="classes_<?php echo esc_attr( $field[ 'group_id' ] ); ?>" class="widefat" name="field[<?php echo $field[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $field[ 'additional-classes' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'additional-classes' ] ) ) : ''; ?>" />
2305
+												<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
2306 2306
 											</td>
2307 2307
 										</tr>
2308 2308
 										<!-- Required Toggle -->
2309 2309
 										<tr valign="top" class="yikes-checkbox-container">
2310 2310
 											<td scope="row">
2311
-												<label for="field-required-<?php echo esc_attr( $field['group_id'] ); ?>">
2311
+												<label for="field-required-<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2312 2312
 													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2313 2313
 												</label>
2314 2314
 											</td>
2315 2315
 											<td>
2316
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2317
-												<input type="checkbox" id="field-required-<?php echo esc_attr( $field['group_id'] ); ?>" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][require]" <?php checked( $checked , 1 ); ?>>
2318
-												<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2316
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2317
+												<input type="checkbox" id="field-required-<?php echo esc_attr( $field[ 'group_id' ] ); ?>" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][require]" <?php checked( $checked, 1 ); ?>>
2318
+												<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2319 2319
 											</td>
2320 2320
 										</tr>
2321 2321
 										<!-- Visible Toggle -->
2322 2322
 										<tr valign="top" class="yikes-checkbox-container">
2323 2323
 											<td scope="row">
2324
-												<label for="hide-field-<?php echo esc_attr( $field['group_id'] ); ?>">
2324
+												<label for="hide-field-<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2325 2325
 													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2326 2326
 												</label>
2327 2327
 											</td>
2328 2328
 											<td>
2329
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2330
-												<input type="checkbox" id="hide-field-<?php echo esc_attr( $field['group_id'] ); ?>" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][hide]" <?php checked( $hide , 1 ); ?>>
2331
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2329
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2330
+												<input type="checkbox" id="hide-field-<?php echo esc_attr( $field[ 'group_id' ] ); ?>" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][hide]" <?php checked( $hide, 1 ); ?>>
2331
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2332 2332
 											</td>
2333 2333
 										</tr>
2334 2334
 										<!-- Toggle Field Label Visibility -->
2335 2335
 										<tr valign="top" class="yikes-checkbox-container">
2336 2336
 											<td scope="row">
2337
-												<label for="hide-label-<?php echo esc_attr( $field['group_id'] ); ?>">
2337
+												<label for="hide-label-<?php echo esc_attr( $field[ 'group_id' ] ); ?>">
2338 2338
 													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2339 2339
 												</label>
2340 2340
 											</td>
2341 2341
 											<td>
2342
-												<?php $hide = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2343
-												<input type="checkbox" id="hide-label-<?php echo esc_attr( $field['group_id'] ); ?>" name="field[<?php echo $field['group_id']; ?>][hide-label]" value="1" <?php checked( $hide , 1 ); ?>/>
2344
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2342
+												<?php $hide = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2343
+												<input type="checkbox" id="hide-label-<?php echo esc_attr( $field[ 'group_id' ] ); ?>" name="field[<?php echo $field[ 'group_id' ]; ?>][hide-label]" value="1" <?php checked( $hide, 1 ); ?>/>
2344
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2345 2345
 											</td>
2346 2346
 										</tr>
2347 2347
 										<!-- Toggle Buttons -->
@@ -2351,8 +2351,8 @@  discard block
 block discarded – undo
2351 2351
 											</td>
2352 2352
 											<td>
2353 2353
 												<span class="toggle-container">
2354
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2355
-													<a href="#" class="remove-field" alt="<?php echo $field['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2354
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2355
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2356 2356
 												</span>
2357 2357
 											</td>
2358 2358
 										</tr>
@@ -2373,7 +2373,7 @@  discard block
 block discarded – undo
2373 2373
 				add_thickbox();
2374 2374
 				// enqueue jquery qtip for our tooltip
2375 2375
 				wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) );
2376
-				wp_enqueue_style( 'jquery-qtip-style',  YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2376
+				wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2377 2377
 					$available_tags = array(
2378 2378
 						array(
2379 2379
 							'tag' => '{page_title}',
@@ -2428,14 +2428,14 @@  discard block
 block discarded – undo
2428 2428
 						<h3><?php _e( 'Pre Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2429 2429
 						<p class="description"><?php _e( 'You can use any of the following tags to populate a MailChimp text field with dynamic content. This can be used to determine which page the user signed up on, if the user was logged in and more.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
2430 2430
 						<ul>
2431
-							<?php foreach( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2431
+							<?php foreach ( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2432 2432
 								<li class="tooltop-tag">
2433 2433
 									<!-- link/tag -->
2434
-									<a href="#" onclick="populateDefaultValue( '<?php echo $tag['tag']; ?>' );return false;" data-attr-tag="<?php echo $tag['tag']; ?>" title="<?php echo $tag['title']; ?>"><?php echo $tag['title']; ?></a>
2434
+									<a href="#" onclick="populateDefaultValue( '<?php echo $tag[ 'tag' ]; ?>' );return false;" data-attr-tag="<?php echo $tag[ 'tag' ]; ?>" title="<?php echo $tag[ 'title' ]; ?>"><?php echo $tag[ 'title' ]; ?></a>
2435 2435
 									<!-- help icon -->
2436 2436
 									<span class="dashicons dashicons-editor-help"></span>
2437 2437
 									<!-- tooltip -->
2438
-									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag['description']; ?></div>
2438
+									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag[ 'description' ]; ?></div>
2439 2439
 								</li>
2440 2440
 							<?php } ?>
2441 2441
 						</ul>
@@ -2451,46 +2451,46 @@  discard block
 block discarded – undo
2451 2451
 		*	-
2452 2452
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2453 2453
 		*/
2454
-		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2454
+		public function build_available_merge_vars( $form_fields, $available_merge_variables ) {
2455 2455
 			$fields_assigned_to_form = array();
2456 2456
 			foreach ( $form_fields as $field ) {
2457
-				if ( isset( $field['merge'] ) ) {
2458
-					$fields_assigned_to_form[ $field['merge'] ] = true;
2457
+				if ( isset( $field[ 'merge' ] ) ) {
2458
+					$fields_assigned_to_form[ $field[ 'merge' ] ] = true;
2459 2459
 				}
2460 2460
 			}
2461 2461
 
2462
-			if ( ! empty( $available_merge_variables['merge_fields'] ) ) {
2462
+			if ( ! empty( $available_merge_variables[ 'merge_fields' ] ) ) {
2463 2463
 				?>
2464 2464
 				<ul id="available-fields"><?php
2465
-				foreach ( $available_merge_variables['merge_fields'] as $merge_var ) {
2466
-					if ( isset( $fields_assigned_to_form[ $merge_var['tag'] ] ) ) {
2465
+				foreach ( $available_merge_variables[ 'merge_fields' ] as $merge_var ) {
2466
+					if ( isset( $fields_assigned_to_form[ $merge_var[ 'tag' ] ] ) ) {
2467 2467
 						?>
2468 2468
 						<li class="available-form-field not-available"
2469
-						    alt="<?php echo $merge_var['tag']; ?>"
2470
-						    data-attr-field-type="<?php echo esc_attr( $merge_var['type'] ); ?>"
2471
-						    data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>"
2472
-						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>"
2469
+						    alt="<?php echo $merge_var[ 'tag' ]; ?>"
2470
+						    data-attr-field-type="<?php echo esc_attr( $merge_var[ 'type' ] ); ?>"
2471
+						    data-attr-field-name="<?php echo esc_attr( $merge_var[ 'name' ] ); ?>"
2472
+						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables[ 'list_id' ] ); ?>"
2473 2473
 						    title="<?php esc_attr_e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>"
2474 2474
 						    disabled="disabled">
2475
-							<?php echo stripslashes( $merge_var['name'] );
2476
-							if ( $merge_var['required'] ) {
2475
+							<?php echo stripslashes( $merge_var[ 'name' ] );
2476
+							if ( $merge_var[ 'required' ] ) {
2477 2477
 								echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>';
2478 2478
 							} ?>
2479
-							<small class="field-type-text"><?php echo $merge_var['type']; ?></small>
2479
+							<small class="field-type-text"><?php echo $merge_var[ 'type' ]; ?></small>
2480 2480
 						</li>
2481 2481
 						<?php
2482 2482
 					} else {
2483 2483
 						?>
2484 2484
 						<li class="available-form-field"
2485
-						    alt="<?php echo $merge_var['tag']; ?>"
2486
-						    data-attr-field-type="<?php echo esc_attr( $merge_var['type'] ); ?>"
2487
-						    data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>"
2488
-						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>">
2489
-							<?php echo stripslashes( $merge_var['name'] );
2490
-							if ( $merge_var['required'] ) {
2485
+						    alt="<?php echo $merge_var[ 'tag' ]; ?>"
2486
+						    data-attr-field-type="<?php echo esc_attr( $merge_var[ 'type' ] ); ?>"
2487
+						    data-attr-field-name="<?php echo esc_attr( $merge_var[ 'name' ] ); ?>"
2488
+						    data-attr-form-id="<?php echo esc_attr( $available_merge_variables[ 'list_id' ] ); ?>">
2489
+							<?php echo stripslashes( $merge_var[ 'name' ] );
2490
+							if ( $merge_var[ 'required' ] ) {
2491 2491
 								echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>';
2492 2492
 							} ?>
2493
-							<small class="field-type-text"><?php echo $merge_var['type']; ?></small>
2493
+							<small class="field-type-text"><?php echo $merge_var[ 'type' ]; ?></small>
2494 2494
 						</li>
2495 2495
 						<?php
2496 2496
 					}
@@ -2512,12 +2512,12 @@  discard block
 block discarded – undo
2512 2512
 		*	-
2513 2513
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2514 2514
 		*/
2515
-		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2515
+		public function build_available_interest_groups( $form_fields, $available_interest_groups, $list_id ) {
2516 2516
 			$fields_assigned_to_form = array();
2517 2517
 			if ( ! empty( $form_fields ) ) {
2518 2518
 				foreach ( $form_fields as $field ) {
2519
-					if ( isset( $field['group_id'] ) ) {
2520
-						$fields_assigned_to_form[ $field['group_id'] ] = true;
2519
+					if ( isset( $field[ 'group_id' ] ) ) {
2520
+						$fields_assigned_to_form[ $field[ 'group_id' ] ] = true;
2521 2521
 					}
2522 2522
 				}
2523 2523
 			}
@@ -2526,29 +2526,29 @@  discard block
 block discarded – undo
2526 2526
 				?>
2527 2527
 				<ul id="available-interest-groups"><?php
2528 2528
 				foreach ( $available_interest_groups as $interest_group ) {
2529
-					if ( isset( $fields_assigned_to_form[ $interest_group['id'] ] ) ) {
2529
+					if ( isset( $fields_assigned_to_form[ $interest_group[ 'id' ] ] ) ) {
2530 2530
 						?>
2531 2531
 						<li class="available-interest-group not-available" 
2532
-							alt="<?php echo $interest_group['id']; ?>" 
2533
-							data-attr-field-name="<?php echo htmlspecialchars( $interest_group['title'] ); ?>" 
2534
-							data-attr-field-type="<?php echo $interest_group['type']; ?>" 
2532
+							alt="<?php echo $interest_group[ 'id' ]; ?>" 
2533
+							data-attr-field-name="<?php echo htmlspecialchars( $interest_group[ 'title' ] ); ?>" 
2534
+							data-attr-field-type="<?php echo $interest_group[ 'type' ]; ?>" 
2535 2535
 							data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" 
2536 2536
 							disabled="disabled"
2537 2537
 						>
2538
-							<?php echo stripslashes( $interest_group['title'] ); ?>
2539
-							<small class="field-type-text"><?php echo $interest_group['type']; ?></small>
2538
+							<?php echo stripslashes( $interest_group[ 'title' ] ); ?>
2539
+							<small class="field-type-text"><?php echo $interest_group[ 'type' ]; ?></small>
2540 2540
 						</li>
2541 2541
 						<?php
2542 2542
 					} else {
2543 2543
 						?>
2544 2544
 						<li class="available-interest-group" 
2545
-							alt="<?php echo $interest_group['id']; ?>" 
2546
-							data-attr-field-name="<?php echo htmlspecialchars( $interest_group['title'] ); ?>" 
2547
-							data-attr-field-type="<?php echo $interest_group['type']; ?>" 
2545
+							alt="<?php echo $interest_group[ 'id' ]; ?>" 
2546
+							data-attr-field-name="<?php echo htmlspecialchars( $interest_group[ 'title' ] ); ?>" 
2547
+							data-attr-field-type="<?php echo $interest_group[ 'type' ]; ?>" 
2548 2548
 							data-attr-form-id="<?php echo $list_id; ?>"
2549 2549
 						>
2550
-							<?php echo stripslashes( $interest_group['title'] ); ?>
2551
-							<small class="field-type-text"><?php echo $interest_group['type']; ?></small>
2550
+							<?php echo stripslashes( $interest_group[ 'title' ] ); ?>
2551
+							<small class="field-type-text"><?php echo $interest_group[ 'type' ]; ?></small>
2552 2552
 						</li>
2553 2553
 						<?php
2554 2554
 					}
@@ -2570,15 +2570,15 @@  discard block
 block discarded – undo
2570 2570
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2571 2571
 		*/
2572 2572
 		public function yikes_easy_mailchimp_create_form() {
2573
-			$nonce = $_REQUEST['nonce'];
2573
+			$nonce = $_REQUEST[ 'nonce' ];
2574 2574
 			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2575
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) );
2575
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ) );
2576 2576
 			}
2577 2577
 
2578 2578
 			$result = $this->form_interface->create_form( array(
2579
-				'list_id'          => sanitize_key( $_POST['associated-list'] ),
2580
-				'form_name'        => stripslashes( $_POST['form-name'] ),
2581
-				'form_description' => stripslashes( $_POST['form-description'] ),
2579
+				'list_id'          => sanitize_key( $_POST[ 'associated-list' ] ),
2580
+				'form_name'        => stripslashes( $_POST[ 'form-name' ] ),
2581
+				'form_description' => stripslashes( $_POST[ 'form-description' ] ),
2582 2582
 			) );
2583 2583
 
2584 2584
 			// if an error occurs during the form creation process
@@ -2586,11 +2586,11 @@  discard block
 block discarded – undo
2586 2586
 				// write it to the error log
2587 2587
 				// if the form was not created successfully
2588 2588
 				$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2589
-				$error_logging->maybe_write_to_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender') , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2589
+				$error_logging->maybe_write_to_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ), __( "Creating a new form", 'yikes-inc-easy-mailchimp-extender' ), __( "Forms", 'yikes-inc-easy-mailchimp-extender' ) );
2590 2590
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ) ) ) ) );
2591 2591
 			} else {
2592 2592
 				// redirect the user to the new form edit page
2593
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result) ) );
2593
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result ) ) );
2594 2594
 			}
2595 2595
 			exit();
2596 2596
 		}
@@ -2603,11 +2603,11 @@  discard block
 block discarded – undo
2603 2603
 		*/
2604 2604
 		public function yikes_easy_mailchimp_delete_form() {
2605 2605
 			// grab & store our variables ( associated list & form name )
2606
-			$nonce = $_REQUEST['nonce'];
2607
-			$post_id_to_delete = $_REQUEST['mailchimp-form'];
2606
+			$nonce = $_REQUEST[ 'nonce' ];
2607
+			$post_id_to_delete = $_REQUEST[ 'mailchimp-form' ];
2608 2608
 			// verify our nonce
2609
-			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2610
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2609
+			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-' . $post_id_to_delete ) ) {
2610
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2611 2611
 			}
2612 2612
 
2613 2613
 			$this->form_interface->delete_form( $post_id_to_delete );
@@ -2623,19 +2623,19 @@  discard block
 block discarded – undo
2623 2623
 		*/
2624 2624
 		public function yikes_easy_mailchimp_duplicate_form() {
2625 2625
 			// grab & store our variables ( associated list & form name )
2626
-			$nonce = $_REQUEST['nonce'];
2627
-			$post_id_to_clone = $_REQUEST['mailchimp-form'];
2626
+			$nonce = $_REQUEST[ 'nonce' ];
2627
+			$post_id_to_clone = $_REQUEST[ 'mailchimp-form' ];
2628 2628
 			// verify our nonce
2629
-			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2630
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2629
+			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-' . $post_id_to_clone ) ) {
2630
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2631 2631
 			}
2632 2632
 
2633 2633
 			// Get the current form data.
2634 2634
 			$form_data = $this->form_interface->get_form( $post_id_to_clone );
2635 2635
 
2636 2636
 			// Update some of the data before duplication
2637
-			$form_data['form_name'] .= ' - Copy';
2638
-			$form_data['impressions'] = $form_data['submissions'] = 0;
2637
+			$form_data[ 'form_name' ] .= ' - Copy';
2638
+			$form_data[ 'impressions' ] = $form_data[ 'submissions' ] = 0;
2639 2639
 
2640 2640
 			// Create the new form, and handle the result.
2641 2641
 			$result = $this->form_interface->create_form( $form_data );
@@ -2666,11 +2666,11 @@  discard block
 block discarded – undo
2666 2666
 		*/
2667 2667
 		public function yikes_easy_mailchimp_reset_impression_stats() {
2668 2668
 			// grab & store our variables ( associated list & form name )
2669
-			$nonce = $_REQUEST['nonce'];
2670
-			$form_id_to_reset = $_REQUEST['mailchimp-form'];
2669
+			$nonce = $_REQUEST[ 'nonce' ];
2670
+			$form_id_to_reset = $_REQUEST[ 'mailchimp-form' ];
2671 2671
 			// verify our nonce
2672
-			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2673
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2672
+			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-' . $form_id_to_reset ) ) {
2673
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2674 2674
 			}
2675 2675
 
2676 2676
 			$result = $this->form_interface->update_form(
@@ -2698,8 +2698,8 @@  discard block
 block discarded – undo
2698 2698
 		*/
2699 2699
 		public function yikes_easy_mailchimp_update_form() {
2700 2700
 
2701
-			$nonce   = $_REQUEST['nonce'];
2702
-			$form_id = $_REQUEST['id'];
2701
+			$nonce   = $_REQUEST[ 'nonce' ];
2702
+			$form_id = $_REQUEST[ 'id' ];
2703 2703
 
2704 2704
 			// verify our nonce
2705 2705
 			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
@@ -2713,70 +2713,70 @@  discard block
 block discarded – undo
2713 2713
 			}
2714 2714
 
2715 2715
 			// Store our values!
2716
-			$list_id                 = $_POST['associated-list'];
2717
-			$form_name               = stripslashes( $_POST['form-name'] );
2718
-			$form_description        = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
2719
-			$redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2720
-			$redirect_page           = $_POST['redirect-user-to-selection'];
2716
+			$list_id                 = $_POST[ 'associated-list' ];
2717
+			$form_name               = stripslashes( $_POST[ 'form-name' ] );
2718
+			$form_description        = sanitize_text_field( stripslashes( $_POST[ 'form-description' ] ) );
2719
+			$redirect_user_on_submit = $_POST[ 'redirect-user-on-submission' ];
2720
+			$redirect_page           = $_POST[ 'redirect-user-to-selection' ];
2721 2721
 
2722 2722
 			// stripslashes_deep on save, to prevent foreign languages from added excessive backslashes
2723
-			$assigned_fields = isset( $_POST['field'] ) ? stripslashes_deep( $_POST['field'] ): array();
2723
+			$assigned_fields = isset( $_POST[ 'field' ] ) ? stripslashes_deep( $_POST[ 'field' ] ) : array();
2724 2724
 
2725 2725
 			// setup our submission settings serialized array
2726 2726
 			$submission_settings = array(
2727
-				'ajax'                   => $_POST['form-ajax-submission'],
2728
-				'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2729
-				'redirect_page'          => $_POST['redirect-user-to-selection'],
2730
-				'custom_redirect_url'    => esc_url( $_POST['custom-redirect-url'] ),
2731
-				'redirect_new_window'	 => $_POST['redirect_new_window'],
2732
-				'hide_form_post_signup'  => $_POST['hide-form-post-signup'],
2733
-				'replace_interests'      => $_POST['replace-interest-groups'],
2727
+				'ajax'                   => $_POST[ 'form-ajax-submission' ],
2728
+				'redirect_on_submission' => $_POST[ 'redirect-user-on-submission' ],
2729
+				'redirect_page'          => $_POST[ 'redirect-user-to-selection' ],
2730
+				'custom_redirect_url'    => esc_url( $_POST[ 'custom-redirect-url' ] ),
2731
+				'redirect_new_window'	 => $_POST[ 'redirect_new_window' ],
2732
+				'hide_form_post_signup'  => $_POST[ 'hide-form-post-signup' ],
2733
+				'replace_interests'      => $_POST[ 'replace-interest-groups' ],
2734 2734
 			);
2735 2735
 
2736 2736
 			// setup our opt-in settings serialized array
2737 2737
 			$optin_settings = array(
2738
-				'optin'                => $_POST['single-double-optin'],
2739
-				'update_existing_user' => $_POST['update-existing-user'],
2740
-				'send_update_email'    => $_POST['update-existing-email'],
2738
+				'optin'                => $_POST[ 'single-double-optin' ],
2739
+				'update_existing_user' => $_POST[ 'update-existing-user' ],
2740
+				'send_update_email'    => $_POST[ 'update-existing-email' ],
2741 2741
 			);
2742 2742
 
2743 2743
 			// Setup our error settings serialized array
2744 2744
 			$error_settings = array(
2745
-				'success'				=> trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2746
-				'success-single-optin'	=> trim( $_POST['yikes-easy-mc-success-single-optin-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-single-optin-message'] ) ) : '',
2747
-				'success-resubscribed'	=> trim( $_POST['yikes-easy-mc-user-resubscribed-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-resubscribed-success-message'] ) ) : '',
2748
-				'general-error'			=> trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2749
-				'already-subscribed'	=> trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2750
-				'update-link'			=> trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '',
2751
-				'email-subject'			=> trim( $_POST['yikes-easy-mc-user-email-subject'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-email-subject'] ) ) : '',
2752
-				'email-body'			=> trim( $_POST['yikes-easy-mc-user-email-body'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-email-body'] ) ) : '',
2753
-				'update-email-success'  => trim( $_POST['yikes-easy-mc-update-email-successful'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-update-email-successful'] ) ) : '',
2754
-				'update-email-failure'  => trim( $_POST['yikes-easy-mc-update-email-failure'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-update-email-failure'] ) ) : '',
2745
+				'success'				=> trim( $_POST[ 'yikes-easy-mc-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-message' ] ) ) : '',
2746
+				'success-single-optin'	=> trim( $_POST[ 'yikes-easy-mc-success-single-optin-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-single-optin-message' ] ) ) : '',
2747
+				'success-resubscribed'	=> trim( $_POST[ 'yikes-easy-mc-user-resubscribed-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-resubscribed-success-message' ] ) ) : '',
2748
+				'general-error'			=> trim( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ) : '',
2749
+				'already-subscribed'	=> trim( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ) : '',
2750
+				'update-link'			=> trim( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ) : '',
2751
+				'email-subject'			=> trim( $_POST[ 'yikes-easy-mc-user-email-subject' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-email-subject' ] ) ) : '',
2752
+				'email-body'			=> trim( $_POST[ 'yikes-easy-mc-user-email-body' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-email-body' ] ) ) : '',
2753
+				'update-email-success'  => trim( $_POST[ 'yikes-easy-mc-update-email-successful' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-update-email-successful' ] ) ) : '',
2754
+				'update-email-failure'  => trim( $_POST[ 'yikes-easy-mc-update-email-failure' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-update-email-failure' ] ) ) : '',
2755 2755
 			);
2756 2756
 
2757 2757
 			// Setup the new form settings array
2758 2758
 			// @since 6.0.3.8
2759 2759
 			// To Do: Combine date & time so it's a single unix timestamp
2760 2760
 			$form_settings = array(
2761
-				'yikes-easy-mc-form-class-names'                 => trim( $_POST['yikes-easy-mc-form-class-names'] ),
2762
-				'yikes-easy-mc-inline-form'                      => $_POST['yikes-easy-mc-inline-form'][0],
2763
-				'yikes-easy-mc-submit-button-type'               => $_POST['yikes-easy-mc-submit-button-type'][0],
2764
-				'yikes-easy-mc-submit-button-text'               => trim( $_POST['yikes-easy-mc-submit-button-text'] ),
2765
-				'yikes-easy-mc-submit-button-image'              => esc_url( trim( $_POST['yikes-easy-mc-submit-button-image'] ) ),
2766
-				'yikes-easy-mc-submit-button-classes'            => trim( $_POST['yikes-easy-mc-submit-button-classes'] ),
2767
-				'yikes-easy-mc-form-schedule'                    => ( isset( $_POST['yikes-easy-mc-form-schedule'] ) ) ? '1' : '0',
2768
-				'yikes-easy-mc-form-restriction-start'           => strtotime( $_POST['yikes-easy-mc-form-restriction-start-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-start-time'] ),
2769
-				'yikes-easy-mc-form-restriction-end'             => strtotime( $_POST['yikes-easy-mc-form-restriction-end-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-end-time'] ),
2770
-				'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST['yikes-easy-mc-form-restriction-pending-message'] ),
2771
-				'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST['yikes-easy-mc-form-restriction-expired-message'] ),
2772
-				'yikes-easy-mc-form-login-required'              => ( isset( $_POST['yikes-easy-mc-form-login-required'] ) ) ? '1' : '0',
2773
-				'yikes-easy-mc-form-restriction-login-message'   => trim( $_POST['yikes-easy-mc-form-restriction-login-message'] ),
2761
+				'yikes-easy-mc-form-class-names'                 => trim( $_POST[ 'yikes-easy-mc-form-class-names' ] ),
2762
+				'yikes-easy-mc-inline-form'                      => $_POST[ 'yikes-easy-mc-inline-form' ][ 0 ],
2763
+				'yikes-easy-mc-submit-button-type'               => $_POST[ 'yikes-easy-mc-submit-button-type' ][ 0 ],
2764
+				'yikes-easy-mc-submit-button-text'               => trim( $_POST[ 'yikes-easy-mc-submit-button-text' ] ),
2765
+				'yikes-easy-mc-submit-button-image'              => esc_url( trim( $_POST[ 'yikes-easy-mc-submit-button-image' ] ) ),
2766
+				'yikes-easy-mc-submit-button-classes'            => trim( $_POST[ 'yikes-easy-mc-submit-button-classes' ] ),
2767
+				'yikes-easy-mc-form-schedule'                    => ( isset( $_POST[ 'yikes-easy-mc-form-schedule' ] ) ) ? '1' : '0',
2768
+				'yikes-easy-mc-form-restriction-start'           => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-start-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-start-time' ] ),
2769
+				'yikes-easy-mc-form-restriction-end'             => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-end-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-end-time' ] ),
2770
+				'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-pending-message' ] ),
2771
+				'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-expired-message' ] ),
2772
+				'yikes-easy-mc-form-login-required'              => ( isset( $_POST[ 'yikes-easy-mc-form-login-required' ] ) ) ? '1' : '0',
2773
+				'yikes-easy-mc-form-restriction-login-message'   => trim( $_POST[ 'yikes-easy-mc-form-restriction-login-message' ] ),
2774 2774
 			);
2775 2775
 
2776 2776
 			// additional custom fields (extensions / user defined fields)
2777 2777
 			$custom_fields = array();
2778
-			if ( isset( $_POST['custom-field'] ) ) {
2779
-				foreach ( $_POST['custom-field'] as $custom_field => $custom_value ) {
2778
+			if ( isset( $_POST[ 'custom-field' ] ) ) {
2779
+				foreach ( $_POST[ 'custom-field' ] as $custom_field => $custom_value ) {
2780 2780
 					if ( is_array( $custom_value ) ) {
2781 2781
 						$custom_fields[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2782 2782
 					} else {
@@ -2808,7 +2808,7 @@  discard block
 block discarded – undo
2808 2808
 			$this->form_interface->update_form( $form_id, $form_updates );
2809 2809
 
2810 2810
 			/* Custom action hook which allows users to update specific options when a form is updated - used in add ons */
2811
-			do_action( 'yikes-mailchimp-save-form', $form_id,  $custom_fields );
2811
+			do_action( 'yikes-mailchimp-save-form', $form_id, $custom_fields );
2812 2812
 
2813 2813
 			// redirect the user to the manage forms page, display confirmation
2814 2814
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form_id . '&updated-form=true' ) ) );
@@ -2819,11 +2819,11 @@  discard block
 block discarded – undo
2819 2819
 			$email_body  = '<p>' . __( 'Greetings,', 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; 
2820 2820
 
2821 2821
 			$email_body .= '<p>';
2822
-			$email_body .= 	__( 'A request has been made to update your MailChimp account profile information.', 'yikes-inc-easy-mailchimp-extender' );
2823
-			$email_body .=	__( ' To do so please use the following link: ', 'yikes-inc-easy-mailchimp-extender' );
2824
-			$email_body .=	'[link]';
2825
-			$email_body .=		__( 'Update MailChimp Profile Info', 'yikes-inc-easy-mailchimp-extender' );
2826
-			$email_body .= 	'[/link]';
2822
+			$email_body .= __( 'A request has been made to update your MailChimp account profile information.', 'yikes-inc-easy-mailchimp-extender' );
2823
+			$email_body .= __( ' To do so please use the following link: ', 'yikes-inc-easy-mailchimp-extender' );
2824
+			$email_body .= '[link]';
2825
+			$email_body .= __( 'Update MailChimp Profile Info', 'yikes-inc-easy-mailchimp-extender' );
2826
+			$email_body .= '[/link]';
2827 2827
 			$email_body .= '</p>';
2828 2828
 
2829 2829
 			$email_body .= '<p>' . __( 'If you did not request this update, please disregard this email.', 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
@@ -2839,13 +2839,13 @@  discard block
 block discarded – undo
2839 2839
 
2840 2840
 		/* Unsubscribe a given user from our list */
2841 2841
 		public function yikes_easy_mailchimp_unsubscribe_user() {
2842
-			$nonce    = $_REQUEST['nonce'];
2843
-			$list_id  = $_REQUEST['mailchimp-list'];
2844
-			$email_id = $_REQUEST['email_id'];
2842
+			$nonce    = $_REQUEST[ 'nonce' ];
2843
+			$list_id  = $_REQUEST[ 'mailchimp-list' ];
2844
+			$email_id = $_REQUEST[ 'email_id' ];
2845 2845
 
2846 2846
 			// verify our nonce
2847 2847
 			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2848
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2848
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2849 2849
 			}
2850 2850
 
2851 2851
 			$response = yikes_get_mc_api_manager()->get_list_handler()->member_unsubscribe( $list_id, $email_id );
@@ -2864,21 +2864,21 @@  discard block
 block discarded – undo
2864 2864
 
2865 2865
 		public function yikes_easy_mailchimp_create_missing_error_log() {
2866 2866
 			// grab our nonnce
2867
-			$nonce = $_REQUEST['nonce'];
2867
+			$nonce = $_REQUEST[ 'nonce' ];
2868 2868
 			// validate nonce
2869
-			if ( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2870
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2869
+			if ( ! wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2870
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2871 2871
 			}
2872 2872
 			// setup the path to the error log
2873 2873
 			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' );
2874 2874
 			try {
2875 2875
 				// create the file
2876
-				fwrite( $error_log , '' );
2876
+				fwrite( $error_log, '' );
2877 2877
 				// close out
2878 2878
 				fclose( $error_log );
2879 2879
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=true' ) ) );
2880 2880
 			} catch ( Exception $e ) {
2881
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=false&error_message='.urlencode( $e->getMessage() ) ) ) );
2881
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=false&error_message=' . urlencode( $e->getMessage() ) ) ) );
2882 2882
 			}
2883 2883
 		}
2884 2884
 
@@ -2889,9 +2889,9 @@  discard block
 block discarded – undo
2889 2889
 		public function yikes_easy_mailchimp_clear_transient_data() {
2890 2890
 
2891 2891
 			// verify our nonce
2892
-			$nonce = $_REQUEST['nonce'];
2892
+			$nonce = $_REQUEST[ 'nonce' ];
2893 2893
 			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2894
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2894
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2895 2895
 			}
2896 2896
 
2897 2897
 			$this->delete_yikes_mailchimp_transients();
@@ -2900,10 +2900,10 @@  discard block
 block discarded – undo
2900 2900
 			$referer = wp_get_referer();
2901 2901
 			if ( $referer && ( strpos( $referer, 'yikes-inc-easy-mailchimp-settings' ) > 0 ) ) {
2902 2902
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings&transient-cleared=true' ) ) );
2903
-			} elseif ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] === 'yikes-mailchimp-edit-form' && isset( $_REQUEST['id'] ) && ! empty( $_REQUEST['id'] ) ) {
2903
+			} elseif ( isset( $_REQUEST[ 'page' ] ) && $_REQUEST[ 'page' ] === 'yikes-mailchimp-edit-form' && isset( $_REQUEST[ 'id' ] ) && ! empty( $_REQUEST[ 'id' ] ) ) {
2904 2904
 
2905 2905
 				// else check if we were editing a form.
2906
-				$id = filter_var( $_REQUEST['id'], FILTER_SANITIZE_NUMBER_INT );
2906
+				$id = filter_var( $_REQUEST[ 'id' ], FILTER_SANITIZE_NUMBER_INT );
2907 2907
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $id ) ) );
2908 2908
 			} else {
2909 2909
 				// else redirect to the manage forms page.
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
 		 */
2948 2948
 		public function yikes_mailchimp_load_helper_class() {
2949 2949
 			// check to see if it's already loaded up.
2950
-			if ( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2950
+			if ( ! class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2951 2951
 				// Include our main helper class file
2952 2952
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' );
2953 2953
 			}
Please login to merge, or discard this patch.
admin/partials/ajax/add_interest_group_to_form.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
 $error = 0;
6 6
 
7 7
 // Get our $_POST variables
8
-$list_id = isset( $_POST['list_id'] ) ? $_POST['list_id'] : '';
9
-$interest_groups = isset( $_POST['interest_groups'] ) ? $_POST['interest_groups'] : array();
8
+$list_id = isset( $_POST[ 'list_id' ] ) ? $_POST[ 'list_id' ] : '';
9
+$interest_groups = isset( $_POST[ 'interest_groups' ] ) ? $_POST[ 'interest_groups' ] : array();
10 10
 
11 11
 // Make sure our $_POST variables aren't empty
12 12
 if ( empty( $list_id ) ) {
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
 
50 50
 
51 51
 // Loop through the interest groups data (group_id, field_name, field_type) and add the fields to the form
52
-foreach( $interest_groups as $group ) {
52
+foreach ( $interest_groups as $group ) {
53 53
 
54 54
 	// find and return the location of this merge field in the array
55
-	$index      = $this->findMCListIndex( $group['group_id'], $interest_groupings, 'id' );
55
+	$index      = $this->findMCListIndex( $group[ 'group_id' ], $interest_groupings, 'id' );
56 56
 	$field_data = $interest_groupings[ $index ];
57
-	$groups     = wp_list_pluck( $field_data['items'], 'name' );
57
+	$groups     = wp_list_pluck( $field_data[ 'items' ], 'name' );
58 58
 
59 59
 	?>
60
-	<section class="draggable" id="<?php echo $group['group_id']; ?>">
60
+	<section class="draggable" id="<?php echo $group[ 'group_id' ]; ?>">
61 61
 		<!-- top -->
62 62
 		<a href="#" class="expansion-section-title settings-sidebar">
63
-			<span class="dashicons dashicons-plus yikes-mc-expansion-toggle" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
64
-			<?php echo stripslashes( $group['field_name'] ); ?>
65
-			<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $group['field_type']; ?></small></span>
63
+			<span class="dashicons dashicons-plus yikes-mc-expansion-toggle" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
64
+			<?php echo stripslashes( $group[ 'field_name' ] ); ?>
65
+			<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $group[ 'field_type' ]; ?></small></span>
66 66
 		</a>
67 67
 		<!-- expansion section -->
68 68
 		<div class="yikes-mc-settings-expansion-section">
@@ -70,37 +70,37 @@  discard block
 block discarded – undo
70 70
 			<!-- Single or Double Opt-in -->
71 71
 			<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
72 72
 				<!-- store the label -->
73
-				<input type="hidden" name="field[<?php echo $group['group_id']; ?>][label]" value="<?php echo htmlspecialchars( $group['field_name'] ); ?>" />
74
-				<input type="hidden" name="field[<?php echo $group['group_id']; ?>][type]" value="<?php echo $group['field_type']; ?>" />
75
-				<input type="hidden" name="field[<?php echo $group['group_id']; ?>][group_id]" value="<?php echo $group['group_id']; ?>" />
76
-				<input type="hidden" name="field[<?php echo $group['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( $groups, true ) ); ?>' />
73
+				<input type="hidden" name="field[<?php echo $group[ 'group_id' ]; ?>][label]" value="<?php echo htmlspecialchars( $group[ 'field_name' ] ); ?>" />
74
+				<input type="hidden" name="field[<?php echo $group[ 'group_id' ]; ?>][type]" value="<?php echo $group[ 'field_type' ]; ?>" />
75
+				<input type="hidden" name="field[<?php echo $group[ 'group_id' ]; ?>][group_id]" value="<?php echo $group[ 'group_id' ]; ?>" />
76
+				<input type="hidden" name="field[<?php echo $group[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( $groups, true ) ); ?>' />
77 77
 
78 78
 
79 79
 				<table class="form-table form-field-container">
80 80
 
81 81
 					<!-- Default Value -->
82
-					<?php switch( $group['field_type'] ) {
82
+					<?php switch ( $group[ 'field_type' ] ) {
83 83
 
84 84
 						case 'radio':
85 85
 						?>
86 86
 							<tr valign="top">
87 87
 								<td scope="row">
88 88
 									<label for="placeholder">
89
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
89
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
90 90
 									</label>
91 91
 								</td>
92 92
 								<td>
93 93
 
94
-									<?php $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : 'no-default'; ?>
94
+									<?php $pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : 'no-default'; ?>
95 95
 
96 96
 									<!-- No Default option for radio buttons -->
97
-									<input type="radio" name="field[<?php echo $group['group_id']; ?>][default_choice][]" value="no-default" <?php checked( $pre_selected, 'no-default' ); ?>>No Default
97
+									<input type="radio" name="field[<?php echo $group[ 'group_id' ]; ?>][default_choice][]" value="no-default" <?php checked( $pre_selected, 'no-default' ); ?>>No Default
98 98
 
99
-									<?php foreach ( $field_data['items'] as $id => $interest_group ) { ?>
100
-										<input type="radio" name="field[<?php echo $group['group_id']; ?>][default_choice][]" value="<?php echo esc_attr( $id ); ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group['name'] );
99
+									<?php foreach ( $field_data[ 'items' ] as $id => $interest_group ) { ?>
100
+										<input type="radio" name="field[<?php echo $group[ 'group_id' ]; ?>][default_choice][]" value="<?php echo esc_attr( $id ); ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group[ 'name' ] );
101 101
 									} ?>
102 102
 
103
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
103
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
104 104
 								</td>
105 105
 							</tr>
106 106
 
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
 							<tr valign="top" class="yikes-checkbox-container">
115 115
 								<td scope="row">
116 116
 									<label for="placeholder">
117
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
117
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
118 118
 									</label>
119 119
 								</td>
120 120
 								<td>
121 121
 									<?php
122
-									foreach ( $field_data['items'] as $id => $interest_group ) {
123
-										$pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : '0';
122
+									foreach ( $field_data[ 'items' ] as $id => $interest_group ) {
123
+										$pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : '0';
124 124
 										?>
125
-										<input type="checkbox" name="field[<?php echo $group['group_id']; ?>][default_choice][]" value="<?php echo $id; ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
125
+										<input type="checkbox" name="field[<?php echo $group[ 'group_id' ]; ?>][default_choice][]" value="<?php echo $id; ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group[ 'name' ] ); ?>
126 126
 										<?php
127 127
 									}
128 128
 									?>
129
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
129
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
130 130
 								</td>
131 131
 							</tr>
132 132
 
@@ -138,18 +138,18 @@  discard block
 block discarded – undo
138 138
 							<tr valign="top">
139 139
 								<td scope="row">
140 140
 									<label for="placeholder">
141
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
141
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
142 142
 									</label>
143 143
 								</td>
144 144
 								<td>
145
-									<select type="default" name="field[<?php echo $group['group_id']; ?>][default_choice]">
146
-										<?php $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : 'no-default'; ?>
145
+									<select type="default" name="field[<?php echo $group[ 'group_id' ]; ?>][default_choice]">
146
+										<?php $pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : 'no-default'; ?>
147 147
 										<option value="no-default">No Default</option>
148
-										<?php foreach ( $field_data['items'] as $id => $interest_group ) { ?>
149
-											<option value="<?php echo $id; ?>" <?php selected( $pre_selected, $id ); ?>><?php echo $interest_group['name']; ?></option>
148
+										<?php foreach ( $field_data[ 'items' ] as $id => $interest_group ) { ?>
149
+											<option value="<?php echo $id; ?>" <?php selected( $pre_selected, $id ); ?>><?php echo $interest_group[ 'name' ]; ?></option>
150 150
 										<?php } ?>
151 151
 									</select>
152
-									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
152
+									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
153 153
 								</td>
154 154
 							</tr>
155 155
 
@@ -161,25 +161,25 @@  discard block
 block discarded – undo
161 161
 					<tr valign="top">
162 162
 						<td scope="row">
163 163
 							<label for="placeholder">
164
-								<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
164
+								<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
165 165
 							</label>
166 166
 						</td>
167 167
 						<td>
168
-							<textarea class="widefat field-description-input" name="field[<?php echo $group['group_id']; ?>][description]"></textarea>
169
-							<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>
168
+							<textarea class="widefat field-description-input" name="field[<?php echo $group[ 'group_id' ]; ?>][description]"></textarea>
169
+							<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>
170 170
 						</td>
171 171
 					</tr>
172 172
 
173 173
 					<!-- Description Above Field -->
174 174
 					<tr valign="top" class="yikes-checkbox-container">
175 175
 						<td scope="row">
176
-							<label for="description_above_<?php echo esc_attr( $group['group_id'] ); ?>">
177
-								<?php _e( 'Description Above Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
176
+							<label for="description_above_<?php echo esc_attr( $group[ 'group_id' ] ); ?>">
177
+								<?php _e( 'Description Above Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
178 178
 							</label>
179 179
 						</td>
180 180
 						<td>
181
-							<input type="checkbox" id="description_above_<?php echo esc_attr( $group['group_id'] ); ?>" class="widefat field-description-input" name="field[<?php echo $group['group_id']; ?>][description_above]" value="1" />
182
-							<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
181
+							<input type="checkbox" id="description_above_<?php echo esc_attr( $group[ 'group_id' ] ); ?>" class="widefat field-description-input" name="field[<?php echo $group[ 'group_id' ]; ?>][description_above]" value="1" />
182
+							<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
183 183
 						</td>
184 184
 					</tr>
185 185
 
@@ -187,48 +187,48 @@  discard block
 block discarded – undo
187 187
 					<tr valign="top">
188 188
 						<td scope="row">
189 189
 							<label for="placeholder">
190
-								<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
190
+								<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
191 191
 							</label>
192 192
 						</td>
193 193
 						<td>
194
-							<input type="text" class="widefat" name="field[<?php echo $group['group_id']; ?>][additional-classes]" value="<?php echo isset( $group['classes'] ) ? stripslashes( wp_strip_all_tags( $group['classes'] ) ) : '' ; ?>" />
195
-							<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>
194
+							<input type="text" class="widefat" name="field[<?php echo $group[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $group[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $group[ 'classes' ] ) ) : ''; ?>" />
195
+							<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>
196 196
 						</td>
197 197
 						</tr>
198 198
 						<!-- Required Toggle -->
199 199
 						<tr valign="top" class="yikes-checkbox-container">
200 200
 							<td scope="row">
201 201
 								<label for="field-required">
202
-									<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
202
+									<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
203 203
 								</label>
204 204
 							</td>
205 205
 							<td>
206
-								<input type="checkbox" class="widefat" value="1" name="field[<?php echo $group['group_id']; ?>][require]">
207
-								<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>
206
+								<input type="checkbox" class="widefat" value="1" name="field[<?php echo $group[ 'group_id' ]; ?>][require]">
207
+								<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>
208 208
 							</td>
209 209
 						</tr>
210 210
 						<!-- Visible Toggle -->
211 211
 						<tr valign="top" class="yikes-checkbox-container">
212 212
 							<td scope="row">
213 213
 								<label for="hide-field">
214
-									<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
214
+									<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
215 215
 								</label>
216 216
 							</td>
217 217
 							<td>
218
-								<input type="checkbox" class="widefat" value="1" name="field[<?php echo $group['group_id']; ?>][hide]">
219
-								<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
218
+								<input type="checkbox" class="widefat" value="1" name="field[<?php echo $group[ 'group_id' ]; ?>][hide]">
219
+								<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
220 220
 							</td>
221 221
 						</tr>
222 222
 						<!-- Toggle Field Label Visibility -->
223 223
 						<tr valign="top" class="yikes-checkbox-container">
224 224
 							<td scope="row">
225 225
 								<label for="placeholder">
226
-									<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
226
+									<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
227 227
 								</label>
228 228
 							</td>
229 229
 							<td>
230
-								<input type="checkbox" name="field[<?php echo $group['group_id']; ?>][hide-label]" value="1" />
231
-								<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
230
+								<input type="checkbox" name="field[<?php echo $group[ 'group_id' ]; ?>][hide-label]" value="1" />
231
+								<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
232 232
 							</td>
233 233
 						</tr>
234 234
 						<!-- Toggle Buttons -->
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 							</td>
239 239
 							<td>
240 240
 								<span class="toggle-container">
241
-									<a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
242
-									<a href="#" class="remove-field" alt="<?php echo $group['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
241
+									<a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
242
+									<a href="#" class="remove-field" alt="<?php echo $group[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
243 243
 								</span>
244 244
 							</td>
245 245
 						</tr>
Please login to merge, or discard this patch.
admin/partials/ajax/add_field_to_form.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $form_data = array(
3
-	'field_name' => $_POST['field_name'],
4
-	'merge_tag'  => $_POST['merge_tag'],
5
-	'field_type' => $_POST['field_type'],
6
-	'list_id'    => $_POST['list_id'],
3
+	'field_name' => $_POST[ 'field_name' ],
4
+	'merge_tag'  => $_POST[ 'merge_tag' ],
5
+	'field_type' => $_POST[ 'field_type' ],
6
+	'list_id'    => $_POST[ 'list_id' ],
7 7
 );
8 8
 
9 9
 // Grab our list handler.
10 10
 $list_handler = yikes_get_mc_api_manager()->get_list_handler();
11 11
 
12
-$available_merge_variables = $list_handler->get_merge_fields( $form_data['list_id'] );
12
+$available_merge_variables = $list_handler->get_merge_fields( $form_data[ 'list_id' ] );
13 13
 if ( is_wp_error( $available_merge_variables ) ) {
14 14
 	$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
15 15
 	$error_logging->maybe_write_to_log(
@@ -28,17 +28,17 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 // find and return the location of this merge field in the array
31
-$index = $this->findMCListIndex( $form_data['merge_tag'], $available_merge_variables['merge_fields'], 'tag' );
31
+$index = $this->findMCListIndex( $form_data[ 'merge_tag' ], $available_merge_variables[ 'merge_fields' ], 'tag' );
32 32
 
33 33
 // store it and use it to pre-populate field data (only on initial add to form)
34
-$merge_field_data = $available_merge_variables['merge_fields'][ $index ];
34
+$merge_field_data = $available_merge_variables[ 'merge_fields' ][ $index ];
35 35
 ?>
36
-<section class="draggable" id="<?php echo $form_data['field_name']; ?>">
36
+<section class="draggable" id="<?php echo $form_data[ 'field_name' ]; ?>">
37 37
 	<!-- top -->
38 38
 	<a href="#" class="expansion-section-title settings-sidebar">
39
-		<span class="dashicons dashicons-plus yikes-mc-expansion-toggle" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
40
-		<?php echo stripslashes( $form_data['field_name'] ); ?>
41
-		<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data['field_type']; ?></small></span>
39
+		<span class="dashicons dashicons-plus yikes-mc-expansion-toggle" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
40
+		<?php echo stripslashes( $form_data[ 'field_name' ] ); ?>
41
+		<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data[ 'field_type' ]; ?></small></span>
42 42
 	</a>
43 43
 	<!-- expansion section -->
44 44
 	<div class="yikes-mc-settings-expansion-section">
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 		<!-- Single or Double Opt-in -->
47 47
 		<p class="type-container form-field-container"><!-- necessary to prevent skipping on slideToggle(); -->
48 48
 			<!-- store the label -->
49
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][label]" value="<?php echo htmlspecialchars( $form_data['field_name'] ); ?>" />
50
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][type]" value="<?php echo $form_data['field_type']; ?>" />
51
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][merge]" value="<?php echo $merge_field_data['tag']; ?>" />
52
-			<input type="hidden" class="field-<?php echo $merge_field_data['tag']; ?>-position position-input" name="field[<?php echo $merge_field_data['tag']; ?>][position]" value="" />
49
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][label]" value="<?php echo htmlspecialchars( $form_data[ 'field_name' ] ); ?>" />
50
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][type]" value="<?php echo $form_data[ 'field_type' ]; ?>" />
51
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][merge]" value="<?php echo $merge_field_data[ 'tag' ]; ?>" />
52
+			<input type="hidden" class="field-<?php echo $merge_field_data[ 'tag' ]; ?>-position position-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][position]" value="" />
53 53
 
54
-			<?php if ( $form_data['field_type'] == 'radio' || $form_data['field_type'] == 'dropdown' ) { ?>
55
-				<?php $choices = ( isset( $merge_field_data['options']['choices'] ) ) ? esc_attr( json_encode( $merge_field_data['options']['choices'] ) ) : ''; ?>
56
-				<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][choices]" value='<?php echo $choices; ?>' />
54
+			<?php if ( $form_data[ 'field_type' ] == 'radio' || $form_data[ 'field_type' ] == 'dropdown' ) { ?>
55
+				<?php $choices = ( isset( $merge_field_data[ 'options' ][ 'choices' ] ) ) ? esc_attr( json_encode( $merge_field_data[ 'options' ][ 'choices' ] ) ) : ''; ?>
56
+				<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][choices]" value='<?php echo $choices; ?>' />
57 57
 			<?php } ?>
58 58
 
59 59
 			<table class="form-table form-field-container">
@@ -62,15 +62,15 @@  discard block
 block discarded – undo
62 62
 					<tr valign="top">
63 63
 						<td scope="row">
64 64
 							<label for="merge-tag">
65
-								<?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?>
65
+								<?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?>
66 66
 							</label>
67 67
 						</td>
68 68
 						<td>
69
-							<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $merge_field_data['tag']; ?>">
69
+							<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $merge_field_data[ 'tag' ]; ?>">
70 70
 						</td>
71 71
 					</tr>
72 72
 
73
-			<?php switch( $form_data['field_type'] ) {
73
+			<?php switch ( $form_data[ 'field_type' ] ) {
74 74
 
75 75
 					default:
76 76
 						break;
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 					<tr valign="top">
88 88
 						<td scope="row">
89 89
 							<label for="placeholder">
90
-								<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
90
+								<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
91 91
 							</label>
92 92
 						</td>
93 93
 						<td>
94
-						<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][placeholder]" value="<?php echo isset( $merge_field_data['placeholder'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['placeholder'] ) ): '' ; ?>" />
95
-							<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
94
+						<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][placeholder]" value="<?php echo isset( $merge_field_data[ 'placeholder' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'placeholder' ] ) ) : ''; ?>" />
95
+							<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
96 96
 						</td>
97 97
 					</tr>
98 98
 
@@ -101,27 +101,27 @@  discard block
 block discarded – undo
101 101
 					*	Loop over field types and store necessary formats
102 102
 					*	( date, birthday - dateformat ; phone - phoneformat )
103 103
 					*/
104
-					switch( $form_data['field_type'] ) {
104
+					switch ( $form_data[ 'field_type' ] ) {
105 105
 
106 106
 						/* Store the date format, for properly rendering dates on the front end */
107 107
 						case 'date':
108
-							$date_format = isset( $merge_field_data['options']['dateformat'] ) ? $merge_field_data['options']['dateformat'] : 'MM/DD/YYYY';
108
+							$date_format = isset( $merge_field_data[ 'options' ][ 'dateformat' ] ) ? $merge_field_data[ 'options' ][ 'dateformat' ] : 'MM/DD/YYYY';
109 109
 							?>
110
-							<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
110
+							<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
111 111
 							<?php
112 112
 						break;
113 113
 
114 114
 						case 'birthday':
115
-							$date_format = isset( $merge_field_data['options']['dateformat'] ) ? $merge_field_data['options']['dateformat'] : 'MM/DD';
115
+							$date_format = isset( $merge_field_data[ 'options' ][ 'dateformat' ] ) ? $merge_field_data[ 'options' ][ 'dateformat' ] : 'MM/DD';
116 116
 							?>
117
-							<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
117
+							<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
118 118
 							<?php
119 119
 						break;
120 120
 
121 121
 						/* Store the phone format, for properly regex pattern */
122 122
 						case 'phone':
123 123
 							?>
124
-							<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][phone_format]" value="<?php echo $merge_field_data['options']['phone_format']; ?>" />
124
+							<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][phone_format]" value="<?php echo $merge_field_data[ 'options' ][ 'phone_format' ]; ?>" />
125 125
 							<?php
126 126
 						break;
127 127
 					}
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 						?>
133 133
 							<tr valign="top">
134 134
 								<td scope="row">
135
-									<label for="placeholder_<?php echo esc_attr( $field['merge'] ); ?>">
136
-										<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
135
+									<label for="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
136
+										<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
137 137
 									</label>
138 138
 								</td>
139 139
 								<td>
140
-									<input type="checkbox" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][placeholder]" value="1" />
141
-									<span class="description"><small><?php _e( "Use placeholders for this field (these will be automatically filled in with field names).", 'yikes-inc-easy-mailchimp-extender' );?></small></span>
140
+									<input type="checkbox" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][placeholder]" value="1" />
141
+									<span class="description"><small><?php _e( "Use placeholders for this field (these will be automatically filled in with field names).", 'yikes-inc-easy-mailchimp-extender' ); ?></small></span>
142 142
 								</td>
143 143
 							</tr>
144 144
 						<?php
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 			?>
149 149
 
150 150
 				<!-- Default Value -->
151
-				<?php switch( $form_data['field_type'] ) {
151
+				<?php switch ( $form_data[ 'field_type' ] ) {
152 152
 
153 153
 					default:
154 154
 					case 'text':
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 						<tr valign="top">
157 157
 							<td scope="row">
158 158
 								<label for="placeholder">
159
-									<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
159
+									<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
160 160
 								</label>
161 161
 							</td>
162 162
 							<td>
163
-								<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default_value'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default_value'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default_value'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default_value'] ) ) ) : ''; } ?>" />
164
-								<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>
163
+								<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default]" <?php if ( $form_data[ 'field_type' ] != 'url' ) { ?> value="<?php echo isset( $merge_field_data[ 'default_value' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'default_value' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data[ 'default_value' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data[ 'default_value' ] ) ) ) : ''; } ?>" />
164
+								<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>
165 165
 								<?php
166
-								switch ( $form_data['field_type'] ) {
166
+								switch ( $form_data[ 'field_type' ] ) {
167 167
 									case 'text':
168 168
 										?>
169
-										<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
169
+										<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
170 170
 										<?php
171 171
 									break;
172 172
 								} ?>
@@ -180,28 +180,28 @@  discard block
 block discarded – undo
180 180
 							<tr valign="top">
181 181
 								<td scope="row">
182 182
 									<label for="placeholder">
183
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
183
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
184 184
 									</label>
185 185
 								</td>
186 186
 								<td>
187
-									<?php $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : 'no-default'; ?>
188
-									<label for="<?php echo $merge_field_data['tag'] . '-no-default'; ?>">
189
-										<input id="<?php echo $merge_field_data['tag'] . '-no-default'; ?>"
187
+									<?php $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : 'no-default'; ?>
188
+									<label for="<?php echo $merge_field_data[ 'tag' ] . '-no-default'; ?>">
189
+										<input id="<?php echo $merge_field_data[ 'tag' ] . '-no-default'; ?>"
190 190
 										       type="radio"
191
-										       name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]"
191
+										       name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]"
192 192
 										       value="no-default" <?php checked( $pre_selected, 'no-default' ); ?>
193 193
 										>
194 194
 										No Default&nbsp;
195 195
 									</label>
196 196
 									<?php
197 197
 									$x = 0;
198
-									foreach ( $merge_field_data['options']['choices'] as $choice => $value ) { ?>
198
+									foreach ( $merge_field_data[ 'options' ][ 'choices' ] as $choice => $value ) { ?>
199 199
 										<label>
200
-											<input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo $value; ?>
200
+											<input type="radio" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo $value; ?>
201 201
 										</label>
202 202
 										<?php $x++;
203 203
 									} ?>
204
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
204
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
205 205
 								</td>
206 206
 							</tr>
207 207
 
@@ -213,18 +213,18 @@  discard block
 block discarded – undo
213 213
 							<tr valign="top">
214 214
 								<td scope="row">
215 215
 									<label for="placeholder">
216
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
216
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
217 217
 									</label>
218 218
 								</td>
219 219
 								<td>
220
-									<select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
221
-										<?php $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : 'no-default'; ?>
220
+									<select type="default" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]">
221
+										<?php $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : 'no-default'; ?>
222 222
 										<option value="no-default" <?php selected( $pre_selected, $choice ); ?>>No Default</option>
223
-										<?php foreach ( $merge_field_data['options']['choices'] as $choice => $value ) { ?>
223
+										<?php foreach ( $merge_field_data[ 'options' ][ 'choices' ] as $choice => $value ) { ?>
224 224
 											<option value="<?php echo $choice; ?>" <?php selected( $pre_selected, $choice ); ?>><?php echo stripslashes( $value ); ?></option>
225 225
 										<?php } ?>
226 226
 									</select>
227
-									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
227
+									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
228 228
 								</td>
229 229
 							</tr>
230 230
 
@@ -237,77 +237,77 @@  discard block
 block discarded – undo
237 237
 				<tr valign="top">
238 238
 					<td scope="row">
239 239
 						<label for="placeholder">
240
-							<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
240
+							<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
241 241
 						</label>
242 242
 					</td>
243 243
 					<td>
244
-						<textarea class="widefat field-description-input" name="field[<?php echo $merge_field_data['tag']; ?>][description]"></textarea>
245
-						<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>
244
+						<textarea class="widefat field-description-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][description]"></textarea>
245
+						<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>
246 246
 					</td>
247 247
 				</tr>
248 248
 				<!-- Description Above Field -->
249 249
 				<tr valign="top" class="yikes-checkbox-container">
250 250
 					<td scope="row">
251
-						<label for="description_above_<?php echo esc_attr( $merge_field_data['tag'] ); ?>">
252
-							<?php _e( 'Description Above Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
251
+						<label for="description_above_<?php echo esc_attr( $merge_field_data[ 'tag' ] ); ?>">
252
+							<?php _e( 'Description Above Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
253 253
 						</label>
254 254
 					</td>
255 255
 					<td>
256
-						<input type="checkbox" id="description_above_<?php echo esc_attr( $merge_field_data['tag'] ); ?>" class="widefat field-description-input" name="field[<?php echo $merge_field_data['tag']; ?>][description_above]" value="1" />
257
-						<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
256
+						<input type="checkbox" id="description_above_<?php echo esc_attr( $merge_field_data[ 'tag' ] ); ?>" class="widefat field-description-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][description_above]" value="1" />
257
+						<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
258 258
 					</td>
259 259
 				</tr>
260 260
 				<!-- Additional Classes -->
261 261
 				<tr valign="top">
262 262
 					<td scope="row">
263 263
 						<label for="placeholder">
264
-							<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
264
+							<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
265 265
 						</label>
266 266
 					</td>
267 267
 					<td>
268
-						<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][additional-classes]" value="<?php echo isset( $form_data['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data['classes'] ) ) : '' ; ?>" />
269
-						<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>
268
+						<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][additional-classes]" value="<?php echo isset( $form_data[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $form_data[ 'classes' ] ) ) : ''; ?>" />
269
+						<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>
270 270
 					</td>
271 271
 				</tr>
272 272
 					<!-- Required Toggle -->
273 273
 					<tr valign="top" class="yikes-checkbox-container">
274 274
 						<td scope="row">
275 275
 							<label for="field-required">
276
-								<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
276
+								<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
277 277
 							</label>
278 278
 						</td>
279 279
 						<td>
280
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][require]" <?php checked( $merge_field_data['required'], 1 ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
281
-							<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>
280
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][require]" <?php checked( $merge_field_data[ 'required' ], 1 ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
281
+							<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>
282 282
 						</td>
283 283
 					</tr>
284 284
 					<!-- Visible Toggle -->
285 285
 					<tr valign="top" class="yikes-checkbox-container">
286 286
 						<td scope="row">
287 287
 							<label for="hide-field">
288
-								<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
288
+								<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
289 289
 							</label>
290 290
 						</td>
291 291
 						<td>
292
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][hide]" <?php checked( $merge_field_data['public'], '' ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
293
-							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
292
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide]" <?php checked( $merge_field_data[ 'public' ], '' ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
293
+							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
294 294
 						</td>
295 295
 					</tr>
296 296
 					<!-- Toggle Field Label Visibility -->
297 297
 					<tr valign="top" class="yikes-checkbox-container">
298 298
 						<td scope="row">
299 299
 							<label for="placeholder">
300
-								<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
300
+								<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
301 301
 							</label>
302 302
 						</td>
303 303
 						<td>
304
-							<input type="checkbox" name="field[<?php echo $merge_field_data['tag']; ?>][hide-label]" value="1" />
305
-							<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
304
+							<input type="checkbox" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide-label]" value="1" />
305
+							<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
306 306
 						</td>
307 307
 					</tr>
308 308
 					<!-- Display Phone/Date Formats back to the user -->
309 309
 					<?php
310
-						switch( $form_data['field_type'] ) {
310
+						switch ( $form_data[ 'field_type' ] ) {
311 311
 
312 312
 							/* Store the phone format, for properly regex pattern */
313 313
 							case 'phone':
@@ -318,23 +318,23 @@  discard block
 block discarded – undo
318 318
 									<td scope="row">
319 319
 										<label for="placeholder">
320 320
 										<?php
321
-											switch( $form_data['field_type'] ) {
321
+											switch ( $form_data[ 'field_type' ] ) {
322 322
 												default:
323 323
 												case 'birthday':
324
-													$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
325
-													$format = $merge_field_data['options']['date_format'];
324
+													$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
325
+													$format = $merge_field_data[ 'options' ][ 'date_format' ];
326 326
 													$format_name = 'date_format';
327 327
 													break;
328 328
 
329 329
 												case 'date':
330
-													$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
331
-													$format = $merge_field_data['options']['date_format'];
330
+													$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
331
+													$format = $merge_field_data[ 'options' ][ 'date_format' ];
332 332
 													$format_name = 'date_format';
333 333
 													break;
334 334
 
335 335
 												case 'phone':
336
-													$type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
337
-													$format = ( ( $merge_field_data['options']['phone_format'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data['options']['phone_format'] );
336
+													$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
337
+													$format = ( ( $merge_field_data[ 'options' ][ 'phone_format' ] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data[ 'options' ][ 'phone_format' ] );
338 338
 													$format_name = 'phone_format';
339 339
 													break;
340 340
 											}
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 									</td>
345 345
 									<td>
346 346
 										<strong><?php echo $format; ?></strong>
347
-										<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
347
+										<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
348 348
 										<p class="description"><small>
349 349
 											<?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' ) ); ?>
350 350
 										</small></p>
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 						</td>
366 366
 						<td>
367 367
 							<span class="toggle-container">
368
-								<a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
369
-								<a href="#" class="remove-field" alt="<?php echo $merge_field_data['tag']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
368
+								<a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
369
+								<a href="#" class="remove-field" alt="<?php echo $merge_field_data[ 'tag' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
370 370
 							</span>
371 371
 						</td>
372 372
 					</tr>
Please login to merge, or discard this patch.