Completed
Push — master ( 75f6d6...937118 )
by Evan
05:05
created
yikes-inc-easy-mailchimp-extender.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
  *	@return void
44 44
  */
45 45
 if ( ! defined( 'YIKES_MC_VERSION' ) ) {
46
-	define( 'YIKES_MC_VERSION' , '6.1.4' );
46
+	define( 'YIKES_MC_VERSION', '6.1.4' );
47 47
 }
48 48
 
49 49
 /**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
  *	@return void
54 54
  */
55 55
 if ( ! defined( 'YIKES_MC_PATH' ) ) {
56
-	define( 'YIKES_MC_PATH' , plugin_dir_path( __FILE__ ) );
56
+	define( 'YIKES_MC_PATH', plugin_dir_path( __FILE__ ) );
57 57
 }
58 58
 
59 59
 /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  *	@return void
64 64
  */
65 65
 if ( ! defined( 'YIKES_MC_URL' ) ) {
66
-	define( 'YIKES_MC_URL' , plugin_dir_url( __FILE__ ) );
66
+	define( 'YIKES_MC_URL', plugin_dir_url( __FILE__ ) );
67 67
 }
68 68
 
69 69
 /**
Please login to merge, or discard this patch.
admin/class-yikes-inc-easy-mailchimp-extender-admin.php 1 patch
Spacing   +548 added lines, -548 removed lines patch added patch discarded remove patch
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
 		$this->yikes_inc_easy_mailchimp_extender = $yikes_inc_easy_mailchimp_extender;
39 39
 		$this->version = $version;
40 40
 		// check for old plugin options and migrate if exist
41
-		add_action( 'admin_menu' , array( $this , 'register_admin_pages' ) , 11 );
41
+		add_action( 'admin_menu', array( $this, 'register_admin_pages' ), 11 );
42 42
 		// check for old plugin options and migrate if exist
43
-		add_action( 'admin_init' , array( $this , 'check_for_old_yks_mc_options' ) );
43
+		add_action( 'admin_init', array( $this, 'check_for_old_yks_mc_options' ) );
44 44
 		// Ajax function to update new options...
45
-		add_action( 'wp_ajax_migrate_old_plugin_settings', array( $this , 'migrate_archived_options' ) );
45
+		add_action( 'wp_ajax_migrate_old_plugin_settings', array( $this, 'migrate_archived_options' ) );
46 46
 		// Ajax function to migrate our forms
47
-		add_action( 'wp_ajax_migrate_prevoious_forms', array( $this , 'migrate_previously_setup_forms' ) );
47
+		add_action( 'wp_ajax_migrate_prevoious_forms', array( $this, 'migrate_previously_setup_forms' ) );
48 48
 		// fix menu icon spacing
49
-		add_action( 'admin_head' , array( $this , 'fix_menu_icon_spacing' ) );
49
+		add_action( 'admin_head', array( $this, 'fix_menu_icon_spacing' ) );
50 50
 		// register our plugin settings
51
-		add_action( 'admin_init', array( $this , 'yikes_easy_mc_settings_init' ) );
51
+		add_action( 'admin_init', array( $this, 'yikes_easy_mc_settings_init' ) );
52 52
 		// plugin redirect on activation
53
-		add_action( 'admin_init' , array( $this , 'yikes_easy_mc_activation_redirect' ) );
53
+		add_action( 'admin_init', array( $this, 'yikes_easy_mc_activation_redirect' ) );
54 54
 		// Include Third Party Extensions
55 55
 		include_once( YIKES_MC_PATH . 'includes/third-party-integrations/third-party-init.php' );
56 56
 		// Include our dashboard widget class
@@ -60,111 +60,111 @@  discard block
 block discarded – undo
60 60
 		// Include our ajax processing class
61 61
 		include_once( YIKES_MC_PATH . 'admin/partials/ajax/class.ajax.php' );
62 62
 		// load up our helper class
63
-		add_action( 'admin_init' , array( $this , 'yikes_mailchimp_load_helper_class' ) );
63
+		add_action( 'admin_init', array( $this, 'yikes_mailchimp_load_helper_class' ) );
64 64
 		// process the subscriber count shortcode in form descriptions
65 65
 		add_action( 'yikes-mailchimp-form-description', array( $this, 'process_subscriber_count_shortcode_in_form_descriptions' ), 10, 2 );
66 66
 		/***********************/
67 67
 		/** Create A Form **/
68 68
 		/**********************/
69 69
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-form' ) {
70
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_create_form' ) );
70
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
71 71
 		}
72 72
 		/***********************/
73 73
 		/** Delete A Form **/
74 74
 		/**********************/
75 75
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-delete-form' ) {
76
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_delete_form' ) );
76
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
77 77
 		}
78 78
 		/**********************************/
79 79
 		/** Duplicate/Clone A Form 	**/
80 80
 		/********************************/
81 81
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-duplicate-form' ) {
82
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_duplicate_form' ) );
82
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
83 83
 		}
84 84
 		/*************************************/
85 85
 		/**  Reset Form Impression Stats **/
86 86
 		/***********************************/
87 87
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-reset-stats' ) {
88
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_reset_impression_stats' ) );
88
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
89 89
 		}
90 90
 		/**********************************/
91 91
 		/** 	     Update A Form 		**/
92 92
 		/********************************/
93 93
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-update-form' ) {
94
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_update_form' ) );
94
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
95 95
 		}
96 96
 		/**************************************************/
97 97
 		/** 	 Clear Store MailChimp Transient Data   **/
98 98
 		/*************************************************/
99 99
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-transient-data' ) {
100
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_clear_transient_data' ) );
100
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
101 101
 		}
102 102
 		/*******************************************/
103 103
 		/** Remove a user from a mailing list 	 **/
104 104
 		/*****************************************/
105 105
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-unsubscribe-user' ) {
106
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_unsubscribe_user' ) );
106
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
107 107
 		}
108 108
 		/*******************************************/
109 109
 		/** 	Create misisng error log file  **/
110 110
 		/*****************************************/
111 111
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-error-log' ) {
112
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_create_missing_error_log' ) );
112
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
113 113
 		}
114 114
 		/*******************************************/
115 115
 		/**   TinyMCE Initialization Functions	 **/
116 116
 		/*****************************************/
117
-		add_action( 'admin_head' , array( $this, 'add_tinyMCE_buttons' ) );
117
+		add_action( 'admin_head', array( $this, 'add_tinyMCE_buttons' ) );
118 118
 		// pass our lists data to tinyMCE button for use
119
-		foreach ( array('post.php','post-new.php') as $hook ) {
119
+		foreach ( array( 'post.php', 'post-new.php' ) as $hook ) {
120 120
 			add_action( "admin_head-$hook", array( $this, 'tinymce_yikes_easy_mc' ) );
121 121
 		}
122 122
 		// display an admin notice for users on PHP < 5.3
123
-		if( phpversion() < '5.3' ) {
123
+		if ( phpversion() < '5.3' ) {
124 124
 			add_action( "admin_notices", array( $this, 'display_php_warning' ), 999 );
125 125
 		}
126 126
 		// two week , dismissable notification - check the users plugin installation date
127
-		add_action( 'admin_init', array( $this , 'yikes_easy_mailchimp_check_installation_date' ) );
127
+		add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_check_installation_date' ) );
128 128
 		// dismissable notice admin side
129
-		add_action( 'admin_init', array( $this , 'yikes_easy_mailchimp_stop_bugging_me' ), 5 );
129
+		add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_stop_bugging_me' ), 5 );
130 130
 		/**************************************************/
131 131
 		/** 	 	Clear MailChimp Error Log Data 	    **/
132 132
 		/*************************************************/
133 133
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-error-log' ) {
134
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_clear_error_log' ) );
134
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
135 135
 		}
136 136
 		/*********************************************/
137 137
 		/** 		Export MailChimp Opt-in Forms   **/
138 138
 		/*******************************************/
139 139
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-forms' ) {
140
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_export_forms' ) );
140
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
141 141
 		}
142 142
 		/*********************************************/
143 143
 		/** 				Export Plugin Settings    	   **/
144 144
 		/*******************************************/
145 145
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-settings' ) {
146
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_export_plugin_settings' ) );
146
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
147 147
 		}
148 148
 		/*******************************************/
149 149
 		/** 		Import Class Inclusion	   **/
150 150
 		/*****************************************/
151 151
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) {
152
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_import_forms' ) );
152
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
153 153
 		}
154 154
 		/*******************************************/
155 155
 		/** 	Premium Support Request     **/
156 156
 		/*****************************************/
157 157
 		if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) {
158
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_premium_support_request' ) );
158
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
159 159
 		}
160 160
 		/****************************************/
161 161
 		/**	Dismiss Options Migrations		**/
162 162
 		/****************************************/
163
-		if( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
164
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
163
+		if ( isset( $_REQUEST[ 'dismiss_migration_nonce' ] ) ) {
164
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
165 165
 		}
166 166
 		/** Parse default value into usable dynamic data **/
167
-		add_filter( 'yikes-mailchimp-process-default-tag' , array( $this , 'parse_mailchimp_default_tag' ) );
167
+		add_filter( 'yikes-mailchimp-process-default-tag', array( $this, 'parse_mailchimp_default_tag' ) );
168 168
 		/** Add a disclaimer to ensure that we let people know we are not endorsed/backed by MailChimp at all **/
169 169
 		add_filter( 'admin_footer_text', array( $this, 'yikes_easy_forms_admin_disclaimer' ) );
170 170
 		/** Add custom plugin action links **/
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 		*	@ return	array	$links		New array of plugin actions
185 185
 		*/
186 186
 		public function easy_forms_plugin_action_links( $links ) {
187
-		   $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
188
-		   $links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
187
+		   $links[ ] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) . '">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
188
+		   $links[ ] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
189 189
 		   return $links;
190 190
 		}
191 191
 
@@ -218,29 +218,29 @@  discard block
 block discarded – undo
218 218
 		*	@return	parsed tag content
219 219
 		*/
220 220
 		public function parse_mailchimp_default_tag( $default_tag ) {
221
-			if( ! $default_tag || $default_tag == '' ) {
221
+			if ( ! $default_tag || $default_tag == '' ) {
222 222
 				return $default_tag;
223 223
 			}
224 224
 			global $post;
225 225
 			// page title
226
-			if( $default_tag == '{page_title}' ) {
226
+			if ( $default_tag == '{page_title}' ) {
227 227
 				$default_tag = get_the_title( $post->ID );
228 228
 			}
229 229
 			// page id
230
-			if( $default_tag == '{page_title}' ) {
230
+			if ( $default_tag == '{page_title}' ) {
231 231
 				$default_tag = $post->ID;
232 232
 			}
233 233
 			// page url
234
-			if( $default_tag == '{page_url}' ) {
234
+			if ( $default_tag == '{page_url}' ) {
235 235
 				$default_tag = get_permalink( $post->ID );
236 236
 			}
237 237
 			// blog name
238
-			if( $default_tag == '{blog_name}' ) {
238
+			if ( $default_tag == '{blog_name}' ) {
239 239
 				$default_tag = get_bloginfo( 'name' );
240 240
 			}
241 241
 			// is user logged in
242
-			if( $default_tag == '{user_logged_in}' ) {
243
-				if( is_user_logged_in() ) {
242
+			if ( $default_tag == '{user_logged_in}' ) {
243
+				if ( is_user_logged_in() ) {
244 244
 					$default_tag = 'Registered User';
245 245
 				} else {
246 246
 					$default_tag = 'Guest User';
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
 		*/
259 259
 		public function yikes_easy_mailchimp_clear_error_log() {
260 260
 			// file put contents $returned error + other data
261
-			if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
261
+			if ( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
262 262
 				$clear_log = file_put_contents(
263 263
 					YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php',
264 264
 					''
265 265
 				);
266
-				if( $clear_log === false ) {
266
+				if ( $clear_log === false ) {
267 267
 					// redirect the user to the manage forms page, display error message
268 268
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error-log-cleared=false' ) ) );
269 269
 				} else {
@@ -281,20 +281,20 @@  discard block
 block discarded – undo
281 281
 		*/
282 282
 		public function yikes_easy_mailchimp_export_forms() {
283 283
 			// grab our nonce
284
-			$nonce = $_REQUEST['nonce'];
284
+			$nonce = $_REQUEST[ 'nonce' ];
285 285
 			// grab the forms
286
-			$forms = isset( $_REQUEST['export_forms'] ) ? $_REQUEST['export_forms'] : 'all';
286
+			$forms = isset( $_REQUEST[ 'export_forms' ] ) ? $_REQUEST[ 'export_forms' ] : 'all';
287 287
 			// validate nonce
288
-			if( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
289
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
288
+			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
289
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
290 290
 			}
291 291
 			// include the export class
292
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
292
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
293 293
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-export.class.php' );
294 294
 			}
295 295
 			// run the export function
296 296
 			// parameters: ( $table_name, $form_ids, $file_name )
297
-			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'yikes_easy_mc_forms' , $forms, 'Yikes-Inc-Easy-MailChimp-Forms-Export' );
297
+			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'yikes_easy_mc_forms', $forms, 'Yikes-Inc-Easy-MailChimp-Forms-Export' );
298 298
 			// re-direct the user back to the page
299 299
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) );
300 300
 			die();
@@ -308,13 +308,13 @@  discard block
 block discarded – undo
308 308
 		*/
309 309
 		public function yikes_easy_mailchimp_export_plugin_settings() {
310 310
 			// grab our nonce
311
-			$nonce = $_REQUEST['nonce'];
311
+			$nonce = $_REQUEST[ 'nonce' ];
312 312
 			// validate nonce
313
-			if( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
314
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
313
+			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
314
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
315 315
 			}
316 316
 			// include the export class
317
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
317
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
318 318
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-export.class.php' );
319 319
 			}
320 320
 			// run the export function
@@ -331,13 +331,13 @@  discard block
 block discarded – undo
331 331
 		*/
332 332
 		public function yikes_easy_mailchimp_import_forms() {
333 333
 			// grab our nonce
334
-			$nonce = $_REQUEST['nonce'];
334
+			$nonce = $_REQUEST[ 'nonce' ];
335 335
 			// validate nonce
336
-			if( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
337
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
336
+			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
337
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
338 338
 			}
339 339
 			// include the export class
340
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
340
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
341 341
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-import.class.php' );
342 342
 			}
343 343
 			// run the import function
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 		*/
356 356
 		public function yikes_easy_mailchimp_premium_support_request() {
357 357
 
358
-			if( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
359
-				return __( 'We encountered an error. Please contact the YIKES Inc. support team.' , 'yikes-inc-easy-mailchimp-extender' );
358
+			if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] != 'yikes-support-request' ) {
359
+				return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' );
360 360
 			}
361 361
 
362
-			$license = $_POST['license_key'];
363
-			$user_email = $_POST['user-email'];
364
-			$support_topic = $_POST['support-topic'];
365
-			$support_priority = $_POST['support-priority'];
366
-			$support_content = $_POST['support-content'];
362
+			$license = $_POST[ 'license_key' ];
363
+			$user_email = $_POST[ 'user-email' ];
364
+			$support_topic = $_POST[ 'support-topic' ];
365
+			$support_priority = $_POST[ 'support-priority' ];
366
+			$support_content = $_POST[ 'support-content' ];
367 367
 
368 368
 			// wp_die( print_r( $support_content) );
369 369
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 			) );
388 388
 
389 389
 			// catch the error
390
-			if( is_wp_error( $response ) ) {
390
+			if ( is_wp_error( $response ) ) {
391 391
 				wp_die( $create_ticket_request->getMessage() );
392 392
 				return;
393 393
 			}
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 			$create_ticket_response = wp_remote_retrieve_body( $response );
397 397
 
398 398
 			// display it
399
-			if( $create_ticket_response )
399
+			if ( $create_ticket_response )
400 400
 				echo $create_ticket_response;
401 401
 
402 402
 		}
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 			// delete the options and allow the user to manually updadte things
411 411
 
412 412
 			// Verify the NONCE is valid
413
-			check_admin_referer( 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' );
413
+			check_admin_referer( 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' );
414 414
 
415 415
 			// re-direct the user back to the page
416 416
 			wp_redirect( esc_url_raw( admin_url( 'index.php?yikes-mc-options-migration-dismissed="true"' ) ) );
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 		 * @since 6.0.0
426 426
 		 */
427 427
 		public function load_error_logging_class() {
428
-			if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
428
+			if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
429 429
 				// if error logging is enabled we should include our error logging class
430 430
 				/* Generate oure error logging table */
431 431
 				require_once YIKES_MC_PATH . '/includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
@@ -444,17 +444,17 @@  discard block
 block discarded – undo
444 444
 			// add a new option to store the plugin activation date/time
445 445
 			// @since v6.0.0
446 446
 			// this is used to notify the user that they should review after 2 weeks
447
-			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
447
+			if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
448 448
 				add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) );
449 449
 			}
450 450
 
451 451
 			$stop_bugging_me = get_option( 'yikes_easy_mailchimp_review_stop_bugging_me' );
452 452
 
453
-			if( !$stop_bugging_me ) {
453
+			if ( ! $stop_bugging_me ) {
454 454
 				$install_date = get_option( 'yikes_easy_mailchimp_activation_date' );
455 455
 				$past_date = strtotime( '-14 days' );
456 456
 				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
457
-					add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) );
457
+					add_action( 'admin_notices', array( $this, 'yikes_easy_mailchimp_display_review_us_notice' ) );
458 458
 				}
459 459
 			}
460 460
 
@@ -467,13 +467,13 @@  discard block
 block discarded – undo
467 467
 		*/
468 468
 		public function yikes_easy_mailchimp_display_review_us_notice() {
469 469
 			/* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
470
-			if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
470
+			if ( in_array( get_current_screen()->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base, 'yikes-inc-easy-mailchimp' ) !== false ) {
471 471
 				// Review URL - Change to the URL of your plugin on WordPress.org
472 472
 				$reviewurl = 'https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender';
473 473
 				$addons_url = esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) );
474 474
 				$nobugurl = esc_url_raw( add_query_arg( 'yikes_easy_mc_icons_nobug', '1', admin_url() ) );
475 475
 				$review_message = '<div id="yikes-mailchimp-logo"></div>';
476
-				$review_message .= sprintf( __( "It looks like you've been using %s for 2 weeks now. We hope you're enjoying the features included with the free version. If so, please consider leaving us a review. Reviews only help to catch other users attention as well as provide us with feedback to grow and improve upon. If you're really enjoying the plugin, consider buying an add-on or developer license for some really awesome features and premium support." , 'yikes-inc-easy-mailchimp-extender' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl ) . '';
476
+				$review_message .= sprintf( __( "It looks like you've been using %s for 2 weeks now. We hope you're enjoying the features included with the free version. If so, please consider leaving us a review. Reviews only help to catch other users attention as well as provide us with feedback to grow and improve upon. If you're really enjoying the plugin, consider buying an add-on or developer license for some really awesome features and premium support.", 'yikes-inc-easy-mailchimp-extender' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review", 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons", 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss", 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl ) . '';
477 477
 				?>
478 478
 					<div id="review-yikes-easy-mailchimp-notice">
479 479
 						<?php echo $review_message; ?>
@@ -489,8 +489,8 @@  discard block
 block discarded – undo
489 489
 		*/
490 490
 		public function yikes_easy_mailchimp_stop_bugging_me() {
491 491
 			$nobug = "";
492
-			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) ) {
493
-				$nobug = (int) esc_attr( $_GET['yikes_easy_mc_icons_nobug'] );
492
+			if ( isset( $_GET[ 'yikes_easy_mc_icons_nobug' ] ) ) {
493
+				$nobug = (int) esc_attr( $_GET[ 'yikes_easy_mc_icons_nobug' ] );
494 494
 			}
495 495
 			if ( 1 == $nobug ) {
496 496
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', TRUE );
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 
502 502
 		/* Display a warning users who are using PHP < 5.3 */
503 503
 		public function display_php_warning() {
504
-			$message = __( 'YIKES Inc. Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Reach out to your host provider for assistance.' , 'yikes-inc-easy-mailchimp-extender' );
504
+			$message = __( 'YIKES Inc. Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Reach out to your host provider for assistance.', 'yikes-inc-easy-mailchimp-extender' );
505 505
 			echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>";
506 506
 		}
507 507
 
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 		public function add_tinyMCE_buttons() {
513 513
 			global $typenow;
514 514
 			// only on Post Type: post and page
515
-			if( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
515
+			if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
516 516
 				return;
517 517
 			}
518 518
 			add_filter( 'mce_buttons', array( $this, 'yks_mc_add_tinymce_button' ) );
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 
529 529
 		// inlcude the js for tinymce
530 530
 		public function yks_mc_add_tinymce_plugin( $plugin_array ) {
531
-			$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
531
+			$plugin_array[ 'yks_mc_tinymce_button' ] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
532 532
 			// Print all plugin js path
533 533
 			// var_dump( $plugin_array );
534 534
 			return $plugin_array;
@@ -541,25 +541,25 @@  discard block
 block discarded – undo
541 541
 		*/
542 542
 		public function tinymce_yikes_easy_mc() {
543 543
 			// check capabilities
544
-			if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
544
+			if ( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
545 545
 				return;
546 546
 			}
547 547
 			global $wpdb;
548 548
 			$list_data = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A );
549 549
 			$lists = array();
550 550
 			$i = 0;
551
-			if( !empty( $list_data ) ) {
551
+			if ( ! empty( $list_data ) ) {
552 552
 				// build an array to pass to our javascript
553
-				foreach( $list_data as $form ) {
554
-						$lists[$i] = array(
555
-							'text' => urlencode( $form['form_name'] ),
556
-							'value' => $form['id']
553
+				foreach ( $list_data as $form ) {
554
+						$lists[ $i ] = array(
555
+							'text' => urlencode( $form[ 'form_name' ] ),
556
+							'value' => $form[ 'id' ]
557 557
 						);
558 558
 						$i++;
559 559
 				}
560 560
 			} else {
561
-				$lists[0] = array(
562
-					'text' => __( 'Please Import Some MailChimp Lists' , 'yikes-inc-easy-mailchimp-extender' ),
561
+				$lists[ 0 ] = array(
562
+					'text' => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ),
563 563
 					'value' => '-'
564 564
 				);
565 565
 			}
@@ -572,10 +572,10 @@  discard block
 block discarded – undo
572 572
 				var localized_data = {
573 573
 					'button_title' : '<?php _e( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ); ?>',
574 574
 					'popup_title' : '<?php _e( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ); ?>',
575
-					'list_id_label' : '<?php _e( 'MailChimp Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
576
-					'show_title_label' : '<?php _e( 'Display Form Title' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
577
-					'show_description_label' : '<?php _e( 'Display Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
578
-					'submit_button_text_label' : '<?php _e( 'Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
575
+					'list_id_label' : '<?php _e( 'MailChimp Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ); ?>',
576
+					'show_title_label' : '<?php _e( 'Display Form Title', 'yikes-inc-easy-mailchimp-extender' ); ?>',
577
+					'show_description_label' : '<?php _e( 'Display Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?>',
578
+					'submit_button_text_label' : '<?php _e( 'Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ); ?>',
579 579
 				};
580 580
 				<?php
581 581
 					$link = sprintf( __( 'You need to <a href="%s" title="%s">create a form</a> before you can add one to a page or post.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ) );
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 		if ( get_option( 'yikes_mailchimp_activation_redirect', 'true' ) == 'true' ) {
595 595
 			update_option( 'yikes_mailchimp_activation_redirect', 'false' );
596 596
 			/* If the user had this plugin activated prior to today, redirect to 'Whats New' */
597
-			if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
597
+			if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
598 598
 				wp_redirect( esc_url( admin_url( 'admin.php?page=yikes-mailchimp-welcome' ) ) );
599 599
 			} else {
600 600
 				/* Else redirect the user over to the 'Getting Started' tab */
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 		/**
651 651
 		 * Enqueue our scripts across the dashboard as needed
652 652
 		 */
653
-		wp_register_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery' , 'jquery-ui-sortable' ), $this->version, false );
653
+		wp_register_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery', 'jquery-ui-sortable' ), $this->version, false );
654 654
 		$localized_data = array(
655 655
 			'admin_url' => esc_url_raw( admin_url() ),
656 656
 			'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
@@ -658,19 +658,19 @@  discard block
 block discarded – undo
658 658
 			'search_preloader_url' => YIKES_MC_URL . 'includes/images/search-interest-group-preloader.gif',
659 659
 			'preloader_url' => esc_url_raw( admin_url( '/images/wpspin_light.gif' ) )
660 660
 		);
661
-		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js' , 'object_data' , $localized_data );
661
+		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js', 'object_data', $localized_data );
662 662
 		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js' );
663 663
 
664 664
 
665 665
 		/*
666 666
 		*	Enqueue required scripts for the form editor
667 667
 		*/
668
-		if( get_current_screen()->base == 'admin_page_yikes-mailchimp-edit-form' ) {
668
+		if ( get_current_screen()->base == 'admin_page_yikes-mailchimp-edit-form' ) {
669 669
 			global $wp_locale;
670 670
 			wp_enqueue_style( 'wp-color-picker' );
671 671
 			wp_enqueue_script( 'wp-color-picker' );
672
-			wp_enqueue_script( 'jquery.timepicker.js',YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js' , array( 'jquery' ) , $this->version, false );
673
-			wp_register_script( 'edit-form-js' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js' , array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ) , $this->version, false );
672
+			wp_enqueue_script( 'jquery.timepicker.js', YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ), $this->version, false );
673
+			wp_register_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ), $this->version, false );
674 674
 			$localized_data = array(
675 675
 				'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
676 676
 				'no_fields_assigned' => __( 'No fields assigned to this form. Select some fields to add to this form from the right hand column.', 'yikes-inc-easy-mailchimp-extender' ),
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 				'isRTL'             => $wp_locale->is_rtl(),
692 692
 				'start_date_exceeds_end_date_error' => __( 'Error: The start date and time cannot occur after the end date and time. Chosen date reverted to previous selection.', 'yikes-inc-easy-mailchimp-extender' ),
693 693
 			);
694
-			wp_localize_script( 'edit-form-js' , 'object' , $localized_data );
694
+			wp_localize_script( 'edit-form-js', 'object', $localized_data );
695 695
 			wp_enqueue_script( 'edit-form-js' );
696 696
 		}
697 697
 
@@ -711,8 +711,8 @@  discard block
 block discarded – undo
711 711
 		 * the datepicker wants a numerical index. This function replaces the index with a number
712 712
 		 */
713 713
 		public function yikes_jQuery_datepicker_strip_array_indices( $ArrayToStrip ) {
714
-			foreach( $ArrayToStrip as $objArrayItem) {
715
-				$NewArray[] =  $objArrayItem;
714
+			foreach ( $ArrayToStrip as $objArrayItem ) {
715
+				$NewArray[ ] = $objArrayItem;
716 716
 			}
717 717
 			return( $NewArray );
718 718
 		}
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 		 * Convert the php date format string to a js date format
777 777
 		 */
778 778
 		public function yikes_jQuery_datepicker_date_format( $site_option ) {
779
-			switch( $site_option ) {
779
+			switch ( $site_option ) {
780 780
 				//Predefined WP date formats
781 781
 				default:
782 782
 				case 'F j, Y':
@@ -803,9 +803,9 @@  discard block
 block discarded – undo
803 803
 
804 804
 		/* Top Level Menu 'Easy MailChimp' */
805 805
 		add_menu_page(
806
-			__( 'Easy Forms' , 'yikes-inc-easy-mailchimp-extender' ),
806
+			__( 'Easy Forms', 'yikes-inc-easy-mailchimp-extender' ),
807 807
 			'Easy Forms',
808
-			apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
808
+			apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
809 809
 			'yikes-inc-easy-mailchimp',
810 810
 			'', // no callback,
811 811
 			YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_wink_icon.png'
@@ -819,9 +819,9 @@  discard block
 block discarded – undo
819 819
 				/* YIKES Inc. Easy MailChimp Manage Forms */
820 820
 				add_submenu_page(
821 821
 					'yikes-inc-easy-mailchimp',
822
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
823
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
824
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
822
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
823
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
824
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
825 825
 					'yikes-inc-easy-mailchimp',
826 826
 					array( $this, 'generateManageFormsPage' )
827 827
 				);
@@ -829,9 +829,9 @@  discard block
 block discarded – undo
829 829
 				/* YIKES Inc. Easy MailChimp Manage Lists */
830 830
 				add_submenu_page(
831 831
 					'yikes-inc-easy-mailchimp',
832
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
833
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
834
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
832
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
833
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
834
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
835 835
 					'yikes-inc-easy-mailchimp-lists',
836 836
 					array( $this, 'generateManageListsPage' )
837 837
 				);
@@ -845,13 +845,13 @@  discard block
 block discarded – undo
845 845
 
846 846
 
847 847
 			/* YIKES Inc. Easy MailChimp Account Overview */
848
-			if ( get_option('yikes-mc-api-validation') == 'valid_api_key' ) {
848
+			if ( get_option( 'yikes-mc-api-validation' ) == 'valid_api_key' ) {
849 849
 				/* YIKES Inc. Easy MailChimp Settings */
850 850
 				add_submenu_page(
851 851
 					'yikes-inc-easy-mailchimp',
852
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
853
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
854
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
852
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
853
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
854
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
855 855
 					'yikes-inc-easy-mailchimp-account-overview',
856 856
 					array( $this, 'generateAccountDetailsPage' )
857 857
 				);
@@ -861,9 +861,9 @@  discard block
 block discarded – undo
861 861
 			/* YIKES Inc. Easy MailChimp Settings */
862 862
 			add_submenu_page(
863 863
 				'yikes-inc-easy-mailchimp',
864
-				__( 'Settings.' , 'yikes-inc-easy-mailchimp-extender' ),
865
-				__( 'Settings' , 'yikes-inc-easy-mailchimp-extender' ),
866
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
864
+				__( 'Settings.', 'yikes-inc-easy-mailchimp-extender' ),
865
+				__( 'Settings', 'yikes-inc-easy-mailchimp-extender' ),
866
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
867 867
 				'yikes-inc-easy-mailchimp-settings',
868 868
 				array( $this, 'generatePageOptions' )
869 869
 			);
@@ -871,9 +871,9 @@  discard block
 block discarded – undo
871 871
 			/* Support Page */
872 872
 			add_submenu_page(
873 873
 				'yikes-inc-easy-mailchimp',
874
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
875
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
876
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
874
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
875
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
876
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
877 877
 				'yikes-inc-easy-mailchimp-support',
878 878
 				array( $this, 'generateSupportPage' )
879 879
 			);
@@ -881,11 +881,11 @@  discard block
 block discarded – undo
881 881
 			/* Add-Ons Page */
882 882
 			add_submenu_page(
883 883
 				'yikes-inc-easy-mailchimp',
884
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
885
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
886
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
884
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
885
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
886
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
887 887
 				'yikes-inc-easy-mailchimp-addons',
888
-				array( $this , 'generateAddOnsPage' )
888
+				array( $this, 'generateAddOnsPage' )
889 889
 			);
890 890
 
891 891
 			/** Hidden Pages **/
@@ -893,9 +893,9 @@  discard block
 block discarded – undo
893 893
 				/* Add Hidden Edit Form Page */
894 894
 				add_submenu_page(
895 895
 					'options.php',
896
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
897
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
898
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
896
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
897
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
898
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
899 899
 					'yikes-mailchimp-edit-form',
900 900
 					array( $this, 'generateEditFormPage' )
901 901
 				);
@@ -903,19 +903,19 @@  discard block
 block discarded – undo
903 903
 				/* Add Hidden Migrate Options Page */
904 904
 				add_submenu_page(
905 905
 					'options-writing.php',
906
-					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure' , 'yikes-inc-easy-mailchimp-extender' ),
906
+					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure', 'yikes-inc-easy-mailchimp-extender' ),
907 907
 					'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure',
908 908
 					'manage_options',
909
-					'yikes-inc-easy-mailchimp-update' ,
910
-					array( $this , 'migrate_old_yks_mc_options' )
909
+					'yikes-inc-easy-mailchimp-update',
910
+					array( $this, 'migrate_old_yks_mc_options' )
911 911
 				);
912 912
 
913 913
 				/* Add Hidden Welcome Page */
914 914
 				add_submenu_page(
915 915
 					'options.php',
916
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
917
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
918
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
916
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
917
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
918
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
919 919
 					'yikes-mailchimp-welcome',
920 920
 					array( $this, 'generateWelcomePage' )
921 921
 				);
@@ -923,9 +923,9 @@  discard block
 block discarded – undo
923 923
 				/* Add Hidden 'View List' Page */
924 924
 				add_submenu_page(
925 925
 					'options.php',
926
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
927
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
928
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
926
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
927
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
928
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
929 929
 					'yikes-mailchimp-view-list',
930 930
 					array( $this, 'generateViewListPage' )
931 931
 				);
@@ -933,9 +933,9 @@  discard block
 block discarded – undo
933 933
 				/* Add Hidden View User Page */
934 934
 				add_submenu_page(
935 935
 					'options.php',
936
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
937
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
938
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
936
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
937
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
938
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
939 939
 					'yikes-mailchimp-view-user',
940 940
 					array( $this, 'generateViewUserPage' )
941 941
 				);
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 
1033 1033
 		/* Register General Settings Section */
1034 1034
 
1035
-		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this , 'yikes_mc_validate_api_key' ) );
1035
+		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this, 'yikes_mc_validate_api_key' ) );
1036 1036
 
1037 1037
 		add_settings_section(
1038 1038
 			'yikes_easy_mc_settings_general_section_callback',
@@ -1075,16 +1075,16 @@  discard block
 block discarded – undo
1075 1075
 		add_settings_field(
1076 1076
 			'optin-checkbox-init',
1077 1077
 			__( 'Select Checkboxes to Generate', 'yikes-inc-easy-mailchimp-extender' ),
1078
-			'',  // callback + validation inside of admin/partials/menu/options.php
1078
+			'', // callback + validation inside of admin/partials/menu/options.php
1079 1079
 			'yikes_inc_easy_mc_checkbox_settings'
1080 1080
 		);
1081 1081
 		/* End Checkbox Settings */
1082 1082
 
1083 1083
 		/* reCAPTCHA Settings */
1084 1084
 
1085
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-status' );
1086
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-site-key' );
1087
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-secret-key' );
1085
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-status' );
1086
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-site-key' );
1087
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-secret-key' );
1088 1088
 
1089 1089
 			/* Register reCAPTCHA Settings Section */
1090 1090
 			add_settings_section(
@@ -1097,28 +1097,28 @@  discard block
 block discarded – undo
1097 1097
 			add_settings_field(
1098 1098
 				'yikes-mc-recaptcha-site-key',
1099 1099
 				__( 'Enter reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ),
1100
-				'',  // callback + validation inside of admin/partials/menu/options.php
1100
+				'', // callback + validation inside of admin/partials/menu/options.php
1101 1101
 				'yikes_easy_mc_settings_recpatcha_section'
1102 1102
 			);
1103 1103
 
1104 1104
 			add_settings_field(
1105 1105
 				'yikes-mc-recaptcha-secret-key',
1106 1106
 				__( 'Enter reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ),
1107
-				'',  // callback + validation inside of admin/partials/menu/options.php
1107
+				'', // callback + validation inside of admin/partials/menu/options.php
1108 1108
 				'yikes_easy_mc_settings_recpatcha_section'
1109 1109
 			);
1110 1110
 
1111 1111
 			add_settings_field(
1112 1112
 				'yikes-mc-recaptcha-status',
1113 1113
 				__( 'Enable ReCaptcha', 'yikes-inc-easy-mailchimp-extender' ),
1114
-				'',  // callback + validation inside of admin/partials/menu/options.php
1114
+				'', // callback + validation inside of admin/partials/menu/options.php
1115 1115
 				'yikes_easy_mc_settings_recpatcha_section'
1116 1116
 			);
1117 1117
 
1118 1118
 		/* End reCAPTCHA Settings */
1119 1119
 
1120 1120
 		/* Debug Settings */
1121
-			register_setting( 'yikes_inc_easy_mc_debug_settings_page' , 'yikes-mailchimp-debug-status' );
1121
+			register_setting( 'yikes_inc_easy_mc_debug_settings_page', 'yikes-mailchimp-debug-status' );
1122 1122
 
1123 1123
 			/* Register Debug Settings Section */
1124 1124
 			add_settings_section(
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 			add_settings_field(
1132 1132
 				'yikes-mailchimp-debug-status',
1133 1133
 				__( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ),
1134
-				'',  // callback + validation inside of admin/partials/menu/options.php
1134
+				'', // callback + validation inside of admin/partials/menu/options.php
1135 1135
 				'yikes_easy_mc_settings_debug_section'
1136 1136
 			);
1137 1137
 
@@ -1147,17 +1147,17 @@  discard block
 block discarded – undo
1147 1147
 	*	@since complete re-write
1148 1148
 	**/
1149 1149
 	function yikes_mc_validate_api_key( $input ) {
1150
-		if( $input === '' ) {
1151
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1150
+		if ( $input === '' ) {
1151
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1152 1152
 			return;
1153 1153
 		}
1154 1154
 		$api_key = trim( $input );
1155 1155
 		$dash_position = strpos( trim( $input ), '-' );
1156
-		if( $dash_position !== false ) {
1156
+		if ( $dash_position !== false ) {
1157 1157
 			$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/ping.json';
1158 1158
 		} else {
1159 1159
 			update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) );
1160
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1160
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1161 1161
 			return $api_key;
1162 1162
 		}
1163 1163
 		$request_args = array(
@@ -1168,19 +1168,19 @@  discard block
 block discarded – undo
1168 1168
 			'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
1169 1169
 		);
1170 1170
 		$api_key_response = wp_remote_post( $api_endpoint, $request_args );
1171
-		if( ! is_wp_error( $api_key_response ) ) {
1171
+		if ( ! is_wp_error( $api_key_response ) ) {
1172 1172
 			$body = json_decode( wp_remote_retrieve_body( $api_key_response ), true );
1173
-			if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) {
1174
-				update_option( 'yikes-mc-api-validation' , 'valid_api_key' );
1173
+			if ( isset( $body[ 'msg' ] ) && $body[ 'msg' ] == "Everything's Chimpy!" ) {
1174
+				update_option( 'yikes-mc-api-validation', 'valid_api_key' );
1175 1175
 				// Clear the API key transient data
1176 1176
 				$this->delete_yikes_mailchimp_transients();
1177 1177
 			}
1178
-		}  else {
1178
+		} else {
1179 1179
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
1180 1180
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1181
-			$error_logging->yikes_easy_mailchimp_write_to_error_log( $api_key_response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) );
1182
-			update_option( 'yikes-mc-api-invalid-key-response' , $api_key_response->get_error_message() );
1183
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1181
+			$error_logging->yikes_easy_mailchimp_write_to_error_log( $api_key_response->get_error_message(), __( "Connecting to MailChimp", 'yikes-inc-easy-mailchimp-extender' ), __( "Settings Page/General Settings", 'yikes-inc-easy-mailchimp-extender' ) );
1182
+			update_option( 'yikes-mc-api-invalid-key-response', $api_key_response->get_error_message() );
1183
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1184 1184
 		}
1185 1185
 		// returned the api key
1186 1186
 		return $api_key;
@@ -1201,13 +1201,13 @@  discard block
 block discarded – undo
1201 1201
 	*	to form fields. (input, dropdowns, buttons etc.)
1202 1202
 	* 	@since v5.5 re-write
1203 1203
 	**/
1204
-	public function is_user_mc_api_valid_form( $echo=true ) {
1205
-		if( $echo == true ) {
1206
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1204
+	public function is_user_mc_api_valid_form( $echo = true ) {
1205
+		if ( $echo == true ) {
1206
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1207 1207
 				echo 'disabled="disabled"';
1208 1208
 			}
1209 1209
 		} else {
1210
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1210
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1211 1211
 				return false;
1212 1212
 			} else {
1213 1213
 				return true;
@@ -1227,11 +1227,11 @@  discard block
 block discarded – undo
1227 1227
 	public function check_for_old_yks_mc_options() {
1228 1228
 		$old_plugin_options = get_option( 'ykseme_storage' );
1229 1229
 		// only perform options migrations if the site is not a multi-site setup
1230
-		if ( !is_multisite() ) {
1231
-			if( apply_filters( 'yikes_mc_old_options_filter' , $old_plugin_options ) ) {
1230
+		if ( ! is_multisite() ) {
1231
+			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1232 1232
 				// display a notice to the user that they should 'migrate'
1233 1233
 				// from the old plugin settings to the new ones
1234
-				add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 );
1234
+				add_action( 'admin_notices', array( $this, 'display_options_migrate_notice' ), 11 );
1235 1235
 			}
1236 1236
 		}
1237 1237
 	}
@@ -1264,11 +1264,11 @@  discard block
 block discarded – undo
1264 1264
 
1265 1265
 			// Confirm that the necessary forms table in the database exists, else bail
1266 1266
 			global $wpdb;
1267
-			if( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1267
+			if ( $wpdb->get_var( "show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'" ) != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1268 1268
 				return;
1269 1269
 			}
1270 1270
 
1271
-			if( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1271
+			if ( isset( $_GET[ 'yikes-mc-options-migration-dismissed' ] ) && $_GET[ 'yikes-mc-options-migration-dismissed' ] == 'true' ) {
1272 1272
 					// Delete the options, start a-new! (this will disable the migration notice altogether)
1273 1273
 					delete_option( 'widget_yikes_mc_widget' );
1274 1274
 					delete_option( 'api_validation' );
@@ -1282,18 +1282,18 @@  discard block
 block discarded – undo
1282 1282
 			} else {
1283 1283
 			?>
1284 1284
 				<div class="yikes-easy-mc-updated migrate-options-notice">
1285
-					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list." , 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?></p>
1285
+					<p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?></p>
1286 1286
 					<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>
1287 1287
 					<p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1288 1288
 					<section id="migration-buttons">
1289 1289
 						<!-- migrate button -->
1290 1290
 						<form>
1291 1291
 							<input type="hidden" name="yikes-mc-update-option-structure" value="yikes-mc-update-option-structure" />
1292
-							<a href="<?php echo wp_nonce_url( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-update' ) ), 'yikes-mc-migrate-options' , 'migrate_options_nonce' ); ?>" class="button-secondary"><?php _e( 'Perform Migration' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1292
+							<a href="<?php echo wp_nonce_url( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-update' ) ), 'yikes-mc-migrate-options', 'migrate_options_nonce' ); ?>" class="button-secondary"><?php _e( 'Perform Migration', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1293 1293
 						</form>
1294 1294
 						<!-- dismiss button -->
1295 1295
 						<form>
1296
-							<a href="<?php echo wp_nonce_url( esc_url_raw( admin_url() ), 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' ); ?>" class="button-secondary"><?php _e( 'Dismiss Notice' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1296
+							<a href="<?php echo wp_nonce_url( esc_url_raw( admin_url() ), 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' ); ?>" class="button-secondary"><?php _e( 'Dismiss Notice', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1297 1297
 						</form>
1298 1298
 					</section>
1299 1299
 
@@ -1307,9 +1307,9 @@  discard block
 block discarded – undo
1307 1307
 		*	and return the index ( used to find the list name assigned to a form )
1308 1308
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1309 1309
 		*/
1310
-		function findMCListID($id, $array) {
1311
-		   foreach ($array as $key => $val) {
1312
-			   if ($val['id'] === $id) {
1310
+		function findMCListID( $id, $array ) {
1311
+		   foreach ( $array as $key => $val ) {
1312
+			   if ( $val[ 'id' ] === $id ) {
1313 1313
 				   return $key;
1314 1314
 			   }
1315 1315
 		   }
@@ -1319,9 +1319,9 @@  discard block
 block discarded – undo
1319 1319
 		/* Ajax Migrate Options */
1320 1320
 		function migrate_archived_options() {
1321 1321
 			// all options prefixed with 'yikes-mc-'
1322
-			$option_name = 'yikes-mc-'.$_POST['option_name'];
1323
-			$option_value = $_POST['option_value'];
1324
-			if( json_decode( $option_value ) ) {
1322
+			$option_name = 'yikes-mc-' . $_POST[ 'option_name' ];
1323
+			$option_value = $_POST[ 'option_value' ];
1324
+			if ( json_decode( $option_value ) ) {
1325 1325
 				// decode our lists() array, and store it
1326 1326
 				$opt_value = json_decode( $option_value, true );
1327 1327
 			} else {
@@ -1334,24 +1334,24 @@  discard block
 block discarded – undo
1334 1334
 
1335 1335
 		/* Ajax Migrate Forms */
1336 1336
 		function migrate_previously_setup_forms() {
1337
-			$option_name = $_POST['option_name'];
1338
-			$done = $_POST['done_import'];
1337
+			$option_name = $_POST[ 'option_name' ];
1338
+			$done = $_POST[ 'done_import' ];
1339 1339
 			// Create some starter forms for the user
1340 1340
 			// based on previously imported lists (to our old version)
1341
-			if( $option_name == 'yikes-mc-lists' ) {
1341
+			if ( $option_name == 'yikes-mc-lists' ) {
1342 1342
 				global $wpdb;
1343
-				$option_value = $_POST['option_value'];
1344
-				$new_options = json_decode( stripslashes_deep( $option_value ) , true );
1343
+				$option_value = $_POST[ 'option_value' ];
1344
+				$new_options = json_decode( stripslashes_deep( $option_value ), true );
1345 1345
 
1346
-				$list_id = $new_options['id'];
1347
-				$form_name = $new_options['name'];
1348
-				$fields = $new_options['fields']; // our fields array
1346
+				$list_id = $new_options[ 'id' ];
1347
+				$form_name = $new_options[ 'name' ];
1348
+				$fields = $new_options[ 'fields' ]; // our fields array
1349 1349
 
1350
-				$custom_styles = isset( $new_options['custom_styles'] ) ? json_encode( $new_options['custom_styles'] ) : '0'; // store as an array with all of our styles
1351
-				$custom_template = isset( $new_options['custom_template'] ) ? json_encode( $new_options['custom_template'] ) : '0'; // store template data as an array ( active , template used )
1352
-				$send_welcome_email = isset( $new_options['yks_mailchimp_send_welcome_'.$list_id] ) ? '0' : '1';
1353
-				$redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1354
-				$redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1350
+				$custom_styles = isset( $new_options[ 'custom_styles' ] ) ? json_encode( $new_options[ 'custom_styles' ] ) : '0'; // store as an array with all of our styles
1351
+				$custom_template = isset( $new_options[ 'custom_template' ] ) ? json_encode( $new_options[ 'custom_template' ] ) : '0'; // store template data as an array ( active , template used )
1352
+				$send_welcome_email = isset( $new_options[ 'yks_mailchimp_send_welcome_' . $list_id ] ) ? '0' : '1';
1353
+				$redirect_user_on_submit = isset( $new_options[ 'yks_mailchimp_redirect_' . $list_id ] ) ? '1' : '0';
1354
+				$redirect_page = isset( $new_options[ 'page_id_' . $list_id ] ) ? $new_options[ 'page_id_' . $list_id ] : '';
1355 1355
 
1356 1356
 				/* Insert Forms Function  */
1357 1357
 				$wpdb->insert(
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 					)
1377 1377
 				);
1378 1378
 			}
1379
-			if( $done == 'done' ) {
1379
+			if ( $done == 'done' ) {
1380 1380
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => true ) );
1381 1381
 			} else {
1382 1382
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => false ) );
@@ -1391,35 +1391,35 @@  discard block
 block discarded – undo
1391 1391
 		*	@since v5.6 - complete re-write
1392 1392
 		*/
1393 1393
 		public function generate_options_pages_sidebar_menu() {
1394
-			if( isset( $_REQUEST['section'] ) ) {
1395
-				$selected = $_REQUEST['section'];
1394
+			if ( isset( $_REQUEST[ 'section' ] ) ) {
1395
+				$selected = $_REQUEST[ 'section' ];
1396 1396
 			}
1397
-			$installed_addons = get_option( 'yikes-easy-mc-active-addons' , array() );
1397
+			$installed_addons = get_option( 'yikes-easy-mc-active-addons', array() );
1398 1398
 			// sort our addons array alphabetically so they appear in similar orders across all sites
1399 1399
 			asort( $installed_addons );
1400 1400
 			?>
1401
-				<h3><span><?php _e( 'Additional Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1401
+				<h3><span><?php _e( 'Additional Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1402 1402
 				<div class="inside">
1403 1403
 					<ul id="settings-nav">
1404
-						<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>
1405
-						<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>
1406
-						<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>
1407
-						<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>
1408
-						<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>
1409
-						<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>
1404
+						<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>
1405
+						<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>
1406
+						<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>
1407
+						<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>
1408
+						<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>
1409
+						<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>
1410 1410
 					</ul>
1411 1411
 					<?php
1412 1412
 						// create our add-on settings pages
1413
-						if( !empty( $installed_addons ) ) {
1413
+						if ( ! empty( $installed_addons ) ) {
1414 1414
 							?>
1415 1415
 							<hr class="add-on-settings-divider" />
1416
-							<strong><?php _e( 'Addon Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1416
+							<strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1417 1417
 							<ul id="addon-settings-nav">
1418 1418
 							<?php
1419
-							foreach( $installed_addons as $addon_name ) {
1419
+							foreach ( $installed_addons as $addon_name ) {
1420 1420
 								?>
1421 1421
 									<li>
1422
-										<?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>
1422
+										<?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>
1423 1423
 								<?php
1424 1424
 							}
1425 1425
 							?>
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
 				)
1448 1448
 			);
1449 1449
 			?>
1450
-				<h3><?php _e( 'Create a New Signup Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1450
+				<h3><?php _e( 'Create a New Signup Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1451 1451
 
1452 1452
 				<div class="inside">
1453 1453
 
@@ -1456,31 +1456,31 @@  discard block
 block discarded – undo
1456 1456
 					<form id="import-list-to-site" method="POST" action="<?php echo $url; ?>">
1457 1457
 						<input type="hidden" name="import-list-to-site" value="1" />
1458 1458
 						<!-- Name your new form -->
1459
-						<label for="form-name"><strong><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1460
-							<input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required>
1459
+						<label for="form-name"><strong><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1460
+							<input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required>
1461 1461
 						</label>
1462 1462
 						<!-- Name your new form -->
1463
-						<label for="form-description"><strong><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1464
-							<textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea>
1463
+						<label for="form-description"><strong><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1464
+							<textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea>
1465 1465
 						</label>
1466 1466
 						<!-- Associate this form with a list! -->
1467
-						<label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1468
-							<select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); if( isset( $lists ) && empty( $lists ) ) { echo 'disabled="disabled"'; } ?>>
1467
+						<label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1468
+							<select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); if ( isset( $lists ) && empty( $lists ) ) { echo 'disabled="disabled"'; } ?>>
1469 1469
 								<?php
1470
-									if( isset( $lists ) && !empty( $lists ) ) {
1471
-										foreach( $lists as $mailing_list ) {
1470
+									if ( isset( $lists ) && ! empty( $lists ) ) {
1471
+										foreach ( $lists as $mailing_list ) {
1472 1472
 											?>
1473
-												<option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1473
+												<option value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option>
1474 1474
 											<?php
1475 1475
 										}
1476 1476
 									} else {
1477
-										if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1477
+										if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1478 1478
 											?>
1479
-												<option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1479
+												<option><?php echo __( "Please enter a valid API key.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1480 1480
 											<?php
1481 1481
 										} else {
1482 1482
 											?>
1483
-												<option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1483
+												<option><?php echo __( "No lists were found on the account.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1484 1484
 											<?php
1485 1485
 
1486 1486
 										}
@@ -1489,8 +1489,8 @@  discard block
 block discarded – undo
1489 1489
 							</select>
1490 1490
 
1491 1491
 							<?php
1492
-							if ( isset( $_GET['transient-cleared'] ) ) {
1493
-								if ( 'true' === $_GET['transient-cleared'] ) {
1492
+							if ( isset( $_GET[ 'transient-cleared' ] ) ) {
1493
+								if ( 'true' === $_GET[ 'transient-cleared' ] ) {
1494 1494
 									?>
1495 1495
 									<div class="yikes-list-refreshed-notice">
1496 1496
 										<p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -1499,11 +1499,11 @@  discard block
 block discarded – undo
1499 1499
 								}
1500 1500
 							}
1501 1501
 
1502
-							if( isset( $lists ) && empty( $lists ) ) {
1503
-								if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'invalid_api_key' ) {
1502
+							if ( isset( $lists ) && empty( $lists ) ) {
1503
+								if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1504 1504
 									?>
1505 1505
 										<p class="description">
1506
-											<?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' ) ); ?>
1506
+											<?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' ) ); ?>
1507 1507
 										</p>
1508 1508
 									<?php
1509 1509
 								}
@@ -1511,12 +1511,12 @@  discard block
 block discarded – undo
1511 1511
 							?>
1512 1512
 						</label>
1513 1513
 						<?php
1514
-							if( $this->is_user_mc_api_valid_form( false ) ) {
1515
-								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary' , '' , false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1514
+							if ( $this->is_user_mc_api_valid_form( false ) ) {
1515
+								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ), 'primary', '', false, array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1516 1516
 							} else {
1517
-								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1517
+								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1518 1518
 								?>
1519
-									<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>
1519
+									<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>
1520 1520
 								<?php
1521 1521
 							}
1522 1522
 						?>
@@ -1524,10 +1524,10 @@  discard block
 block discarded – undo
1524 1524
 
1525 1525
 					<!-- Clear API CACHE -->
1526 1526
 					<?php
1527
-					if( isset( $lists ) && ! empty( $lists ) ) {
1527
+					if ( isset( $lists ) && ! empty( $lists ) ) {
1528 1528
 						if ( false !== get_transient( 'yikes-easy-mailchimp-list-data' ) ) { ?>
1529
-							<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data' , 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post">
1530
-								<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1529
+							<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data', 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post">
1530
+								<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists', 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1531 1531
 							</form>
1532 1532
 						<?php }
1533 1533
 					}
@@ -1543,14 +1543,14 @@  discard block
 block discarded – undo
1543 1543
 		public function generate_page_redirect_dropdown( $redirect, $redirect_page, $custom_redirect_url ) {
1544 1544
 				$post_types = get_post_types();
1545 1545
 				?>
1546
-				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1547
-					<?php _e( "Select A Page or Post" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1546
+				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1547
+					<?php _e( "Select A Page or Post", 'yikes-inc-easy-mailchimp-extender' ); ?>
1548 1548
 					<select id="redirect-user-to-selection" name="redirect-user-to-selection" onchange="shouldWeDisplayCustomURL( this );return;">
1549 1549
 				<?php
1550 1550
 					// loop over registered post types, and query!
1551
-						foreach( $post_types as $registered_post_type ) {
1551
+						foreach ( $post_types as $registered_post_type ) {
1552 1552
 							// exclude a few built in custom post types
1553
-							if( ! in_array( $registered_post_type , array( 'attachment' , 'revision' , 'nav_menu_item' ) ) ) {
1553
+							if ( ! in_array( $registered_post_type, array( 'attachment', 'revision', 'nav_menu_item' ) ) ) {
1554 1554
 								// run our query, to retreive the posts
1555 1555
 								$pages = get_posts( array(
1556 1556
 									'order' => 'ASC',
@@ -1560,12 +1560,12 @@  discard block
 block discarded – undo
1560 1560
 									'numberposts' => -1
1561 1561
 								) );
1562 1562
 								// only show cpt's that have posts assigned
1563
-								if( !empty( $pages ) ) {
1563
+								if ( ! empty( $pages ) ) {
1564 1564
 									?>
1565
-									<optgroup label="<?php echo ucwords( str_replace( '_' , ' ' , $registered_post_type ) ); ?>">
1565
+									<optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>">
1566 1566
 									<?php
1567
-										foreach( $pages as $page ) {
1568
-											?><option <?php selected( $redirect_page , $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1567
+										foreach ( $pages as $page ) {
1568
+											?><option <?php selected( $redirect_page, $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1569 1569
 										}
1570 1570
 									?>
1571 1571
 									<option <?php selected( $redirect_page, 'custom_url' ); ?> value="custom_url"><?php echo __( 'Custom URL', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
@@ -1577,8 +1577,8 @@  discard block
 block discarded – undo
1577 1577
 					?>
1578 1578
 					</select>
1579 1579
 
1580
-					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1581
-						<?php _e( "Enter Custom URL" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1580
+					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if ( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1581
+						<?php _e( "Enter Custom URL", 'yikes-inc-easy-mailchimp-extender' ); ?>
1582 1582
 						<input type="text" class="widefat custom-redirect-url" name="custom-redirect-url" value="<?php echo $custom_redirect_url; ?>" />
1583 1583
 					</label>
1584 1584
 
@@ -1595,11 +1595,11 @@  discard block
 block discarded – undo
1595 1595
 		public function generate_show_some_love_container() {
1596 1596
 			// if no active add-ons are installed,
1597 1597
 			// lets display our branding and add-on sidebar
1598
-			if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) {
1598
+			if ( get_option( 'yikes-easy-mc-active-addons', array() ) == array() ) {
1599 1599
 
1600 1600
 				/* On Edit Forms Page Display Upsell to Customizer */
1601 1601
 				$screen = get_current_screen();
1602
-				if( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1602
+				if ( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1603 1603
 				?>
1604 1604
 
1605 1605
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
@@ -1613,11 +1613,11 @@  discard block
 block discarded – undo
1613 1613
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
1614 1614
 
1615 1615
 						<!-- review us container -->
1616
-						<h3 data-alt-text="<?php _e( 'About YIKES Inc.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Show YIKES Inc. Some Love' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1616
+						<h3 data-alt-text="<?php _e( 'About YIKES Inc.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Show YIKES Inc. Some Love', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1617 1617
 						<div id="review-yikes-easy-mc" class="inside">
1618 1618
 
1619 1619
 							<p>
1620
-								<?php _e( 'Leave a review' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1620
+								<?php _e( 'Leave a review', 'yikes-inc-easy-mailchimp-extender' ); ?>
1621 1621
 								<p class="star-container">
1622 1622
 									<a href="https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender" target="_blank">
1623 1623
 										<b class="dashicons dashicons-star-filled"></b>
@@ -1629,21 +1629,21 @@  discard block
 block discarded – undo
1629 1629
 								</p>
1630 1630
 							</p>
1631 1631
 
1632
-							<?php _e( 'Tweet about it' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1632
+							<?php _e( 'Tweet about it', 'yikes-inc-easy-mailchimp-extender' ); ?>
1633 1633
 							<p class="sidebar-container">
1634 1634
 								<a href="https://twitter.com/share" class="twitter-share-button" data-url="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" data-text="I'm using the Easy Forms for MailChimp plugin by @YikesInc to grow my mailing list - it's awesome! -" data-hashtags="MailChimp">Tweet</a>
1635 1635
 								<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
1636 1636
 							</p>
1637 1637
 
1638
-							<?php _e( 'Vote that the plugin works' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1638
+							<?php _e( 'Vote that the plugin works', 'yikes-inc-easy-mailchimp-extender' ); ?>
1639 1639
 							<p class="sidebar-container">
1640 1640
 								<a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">
1641
-									<?php _e( 'Vote for Compatibility' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1641
+									<?php _e( 'Vote for Compatibility', 'yikes-inc-easy-mailchimp-extender' ); ?>
1642 1642
 								</a>
1643 1643
 							</p>
1644 1644
 						</div>
1645 1645
 
1646
-						<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>
1646
+						<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>
1647 1647
 
1648 1648
 						<section id="about-yikes-inc" class="inside">
1649 1649
 							<a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc.">
@@ -1659,10 +1659,10 @@  discard block
 block discarded – undo
1659 1659
 					<div class="postbox yikes-easy-mc-postbox">
1660 1660
 
1661 1661
 						<!-- review us container -->
1662
-						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1662
+						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1663 1663
 						<div id="review-yikes-easy-mc" class="inside">
1664
-							<p><?php _e( "Check out available add-ons for some seriously enhanced features." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1665
-							<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>
1664
+							<p><?php _e( "Check out available add-ons for some seriously enhanced features.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1665
+							<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>
1666 1666
 						</div>
1667 1667
 
1668 1668
 					</div>
@@ -1687,76 +1687,76 @@  discard block
 block discarded – undo
1687 1687
 		public function generate_form_editor( $form_fields, $list_id, $merge_variables, $interest_groups ) {
1688 1688
 
1689 1689
 			// if no list id, die!
1690
-			if( ! $list_id ) {
1691
-				die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) );
1690
+			if ( ! $list_id ) {
1691
+				die( __( "We've encountered an error. No list ID was sent.", 'yikes-inc-easy-mailchimp-extender' ) );
1692 1692
 			}
1693 1693
 
1694
-			if( ! $merge_variables ) {
1695
-				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' ) );
1694
+			if ( ! $merge_variables ) {
1695
+				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' ) );
1696 1696
 			}
1697 1697
 
1698
-			if( ! empty( $form_fields ) ) {
1698
+			if ( ! empty( $form_fields ) ) {
1699 1699
 
1700 1700
 				// find any fields that are assigned to this form, that don't exist in MailChimp
1701 1701
 				// or else were going to run into issues when we submit the form
1702 1702
 				$available_merge_variables = array();
1703 1703
 				$available_interest_groups = array();
1704 1704
 
1705
-				$assigned_fields= array();
1705
+				$assigned_fields = array();
1706 1706
 
1707 1707
 				// loop over merge variables
1708
-				if( ! empty( $merge_variables['data'][0]['merge_vars'] ) ) {
1709
-					foreach( $merge_variables['data'][0]['merge_vars'] as $merge_tag ) {
1710
-						$available_merge_variables[] = $merge_tag['tag'];
1708
+				if ( ! empty( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] ) ) {
1709
+					foreach ( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] as $merge_tag ) {
1710
+						$available_merge_variables[ ] = $merge_tag[ 'tag' ];
1711 1711
 					}
1712 1712
 				}
1713 1713
 
1714 1714
 				// loop over interest groups
1715
-				if( ! empty( $interest_groups ) && ! isset( $interest_groups['error'] ) ) {
1716
-					foreach( $interest_groups as $interest_group ) {
1717
-						$available_interest_groups[] = $interest_group['id'];
1715
+				if ( ! empty( $interest_groups ) && ! isset( $interest_groups[ 'error' ] ) ) {
1716
+					foreach ( $interest_groups as $interest_group ) {
1717
+						$available_interest_groups[ ] = $interest_group[ 'id' ];
1718 1718
 					}
1719 1719
 				}
1720 1720
 
1721 1721
 				// build our assigned fields
1722
-				foreach( $form_fields as $field => $value ) {
1723
-					$assigned_fields[] = $field;
1722
+				foreach ( $form_fields as $field => $value ) {
1723
+					$assigned_fields[ ] = $field;
1724 1724
 				}
1725 1725
 
1726
-				$merged_fields = array_merge( $available_merge_variables , $available_interest_groups );
1727
-				$excluded_fields = array_diff( $assigned_fields , $merged_fields );
1726
+				$merged_fields = array_merge( $available_merge_variables, $available_interest_groups );
1727
+				$excluded_fields = array_diff( $assigned_fields, $merged_fields );
1728 1728
 
1729 1729
 				$i = 1;
1730
-				foreach( $form_fields as $field ) {
1730
+				foreach ( $form_fields as $field ) {
1731 1731
 
1732
-					if( isset( $field['merge'] ) ) {
1732
+					if ( isset( $field[ 'merge' ] ) ) {
1733 1733
 					?>
1734
-						<section class="draggable" id="<?php echo $field['merge']; ?>">
1734
+						<section class="draggable" id="<?php echo $field[ 'merge' ]; ?>">
1735 1735
 							<!-- top -->
1736 1736
 							<a href="#" class="expansion-section-title settings-sidebar">
1737
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
1738
-								<?php if( in_array( $field['merge'] , $excluded_fields ) ) { ?>
1739
-									<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' ); ?>">
1737
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
1738
+								<?php if ( in_array( $field[ 'merge' ], $excluded_fields ) ) { ?>
1739
+									<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' ); ?>">
1740 1740
 								<?php } ?>
1741
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
1741
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
1742 1742
 							</a>
1743 1743
 							<!-- expansion section -->
1744 1744
 							<div class="yikes-mc-settings-expansion-section">
1745 1745
 
1746
-								<?php if( in_array( $field['merge'] , $excluded_fields ) ) { ?>
1747
-									<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>
1746
+								<?php if ( in_array( $field[ 'merge' ], $excluded_fields ) ) { ?>
1747
+									<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>
1748 1748
 								<?php } ?>
1749 1749
 
1750 1750
 								<!-- store the label -->
1751
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][label]" value="<?php echo $field['label']; ?>" />
1752
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][type]" value="<?php echo $field['type']; ?>" />
1753
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" />
1754
-								<input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" />
1751
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
1752
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
1753
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][merge]" value="<?php echo $field[ 'merge' ]; ?>" />
1754
+								<input type="hidden" class="field-<?php echo $field[ 'merge' ]; ?>-position position-input" name="field[<?php echo $field[ 'merge' ]; ?>][position]" value="<?php echo $i++; ?>" />
1755 1755
 
1756
-								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1757
-									$choices = json_decode( $field['choices'], true );
1756
+								<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'dropdown' || $field[ 'type' ] == 'select' ) {
1757
+									$choices = json_decode( $field[ 'choices' ], true );
1758 1758
 								?>
1759
-									<input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1759
+									<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1760 1760
 								<?php } ?>
1761 1761
 
1762 1762
 								<!-- Single or Double Opt-in -->
@@ -1768,16 +1768,16 @@  discard block
 block discarded – undo
1768 1768
 										<tr valign="top">
1769 1769
 											<td scope="row">
1770 1770
 												<label for="merge-tag">
1771
-													<?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1771
+													<?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?>
1772 1772
 												</label>
1773 1773
 											</td>
1774 1774
 											<td>
1775
-												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field['merge']; ?>">
1775
+												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field[ 'merge' ]; ?>">
1776 1776
 											</td>
1777 1777
 										</tr>
1778 1778
 
1779 1779
 										<!-- Placeholder Value -->
1780
-										<?php switch( $field['type'] ) {
1780
+										<?php switch ( $field[ 'type' ] ) {
1781 1781
 
1782 1782
 											case 'text':
1783 1783
 											case 'email':
@@ -1792,12 +1792,12 @@  discard block
 block discarded – undo
1792 1792
 										<tr valign="top">
1793 1793
 											<td scope="row">
1794 1794
 												<label for="placeholder">
1795
-													<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1795
+													<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1796 1796
 												</label>
1797 1797
 											</td>
1798 1798
 											<td>
1799
-												<input type="text" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : '' ; ?>" />
1800
-												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1799
+												<input type="text" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>" />
1800
+												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1801 1801
 											</td>
1802 1802
 										</tr>
1803 1803
 										<?php
@@ -1806,7 +1806,7 @@  discard block
 block discarded – undo
1806 1806
 										?>
1807 1807
 
1808 1808
 										<!-- Default Value -->
1809
-										<?php switch( $field['type'] ) {
1809
+										<?php switch ( $field[ 'type' ] ) {
1810 1810
 											default:
1811 1811
 											case 'text':
1812 1812
 											case 'number':
@@ -1815,17 +1815,17 @@  discard block
 block discarded – undo
1815 1815
 											<tr valign="top">
1816 1816
 												<td scope="row">
1817 1817
 													<label for="placeholder">
1818
-														<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1818
+														<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
1819 1819
 													</label>
1820 1820
 												</td>
1821 1821
 												<td>
1822
-													<input <?php if( $field['type'] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field['merge']; ?>][default]" <?php if( $field['type'] != 'url' ) { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( $field['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field['default'] ) ) ) : ''; ?>" <?php } ?> />
1823
-													<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>
1822
+													<input <?php if ( $field[ 'type' ] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][default]" <?php if ( $field[ 'type' ] != 'url' ) { ?> value="<?php echo isset( $field[ 'default' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'default' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field[ 'default' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field[ 'default' ] ) ) ) : ''; ?>" <?php } ?> />
1823
+													<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>
1824 1824
 													<?php
1825
-													switch( $field['type'] ) {
1825
+													switch ( $field[ 'type' ] ) {
1826 1826
 														case 'text':
1827 1827
 															?>
1828
-																<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>
1828
+																<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>
1829 1829
 															<?php
1830 1830
 														break;
1831 1831
 													} ?>
@@ -1839,18 +1839,18 @@  discard block
 block discarded – undo
1839 1839
 												<tr valign="top">
1840 1840
 													<td scope="row">
1841 1841
 														<label for="placeholder">
1842
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1842
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1843 1843
 														</label>
1844 1844
 													</td>
1845 1845
 													<td>
1846
-														<?php if( ! isset( $field['default_choice'] ) || empty( $field['default_choice'] ) ) { $decode = json_decode( $field['choices'], true ); $field['default_choice'] = $decode[0]; }
1846
+														<?php if ( ! isset( $field[ 'default_choice' ] ) || empty( $field[ 'default_choice' ] ) ) { $decode = json_decode( $field[ 'choices' ], true ); $field[ 'default_choice' ] = $decode[ 0 ]; }
1847 1847
 														$x = 0;
1848
-														foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1849
-															<label for="<?php echo $field['merge'].'-'.$x; ?>">
1850
-																<input id="<?php echo $field['merge'].'-'.$x; ?>" type="radio" name="field[<?php echo $field['merge']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $field['default_choice'], $x ); ?>><?php echo $value; ?>&nbsp;
1848
+														foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1849
+															<label for="<?php echo $field[ 'merge' ] . '-' . $x; ?>">
1850
+																<input id="<?php echo $field[ 'merge' ] . '-' . $x; ?>" type="radio" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $field[ 'default_choice' ], $x ); ?>><?php echo $value; ?>&nbsp;
1851 1851
 															</label>
1852 1852
 														<?php $x++; } ?>
1853
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1853
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1854 1854
 													</td>
1855 1855
 												</tr>
1856 1856
 
@@ -1862,16 +1862,16 @@  discard block
 block discarded – undo
1862 1862
 												<tr valign="top">
1863 1863
 													<td scope="row">
1864 1864
 														<label for="placeholder">
1865
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1865
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1866 1866
 														</label>
1867 1867
 													</td>
1868 1868
 													<td>
1869
-														<select type="default" name="field[<?php echo $field['merge']; ?>][default_choice]">
1870
-															<?php foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1871
-																<option value="<?php echo $choice; ?>" <?php selected( $field['default_choice'] , $choice ); ?>><?php echo $value; ?></option>
1869
+														<select type="default" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]">
1870
+															<?php foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1871
+																<option value="<?php echo $choice; ?>" <?php selected( $field[ 'default_choice' ], $choice ); ?>><?php echo $value; ?></option>
1872 1872
 															<?php } ?>
1873 1873
 														</select>
1874
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1874
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1875 1875
 													</td>
1876 1876
 												</tr>
1877 1877
 
@@ -1891,69 +1891,69 @@  discard block
 block discarded – undo
1891 1891
 										<tr valign="top">
1892 1892
 											<td scope="row">
1893 1893
 												<label for="placeholder">
1894
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1894
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
1895 1895
 												</label>
1896 1896
 											</td>
1897 1897
 											<td>
1898
-												<textarea class="widefat field-description-input" name="field[<?php echo $field['merge']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
1899
-												<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>
1898
+												<textarea class="widefat field-description-input" name="field[<?php echo $field[ 'merge' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
1899
+												<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>
1900 1900
 											</td>
1901 1901
 										</tr>
1902 1902
 										<!-- Additional Classes -->
1903 1903
 										<tr valign="top">
1904 1904
 											<td scope="row">
1905 1905
 												<label for="placeholder">
1906
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1906
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
1907 1907
 												</label>
1908 1908
 											</td>
1909 1909
 											<td>
1910
-												<input type="text" class="widefat" name="field[<?php echo $field['merge']; ?>][additional-classes]" value="<?php echo isset( $field['additional-classes'] ) ? stripslashes( wp_strip_all_tags( $field['additional-classes'] ) ) : '' ; ?>" />
1911
-												<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>
1910
+												<input type="text" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][additional-classes]" value="<?php echo isset( $field[ 'additional-classes' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'additional-classes' ] ) ) : ''; ?>" />
1911
+												<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>
1912 1912
 											</td>
1913 1913
 										</tr>
1914 1914
 										<!-- Required Toggle -->
1915 1915
 										<tr valign="top">
1916 1916
 											<td scope="row">
1917 1917
 												<label for="field-required">
1918
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1918
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
1919 1919
 												</label>
1920 1920
 											</td>
1921 1921
 											<td>
1922
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
1923
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['merge']; ?>][require]" <?php checked( $checked , 1 ); ?> <?php if( $field['merge'] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
1924
-												<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>
1922
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
1923
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'merge' ]; ?>][require]" <?php checked( $checked, 1 ); ?> <?php if ( $field[ 'merge' ] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
1924
+												<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>
1925 1925
 											</td>
1926 1926
 										</tr>
1927 1927
 										<!-- Visible Toggle -->
1928 1928
 										<tr valign="top">
1929 1929
 											<td scope="row">
1930 1930
 												<label for="hide-field">
1931
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1931
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
1932 1932
 												</label>
1933 1933
 											</td>
1934 1934
 											<td>
1935
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
1936
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['merge']; ?>][hide]" <?php checked( $hide , 1 ); ?> <?php if( $field['merge'] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
1937
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1935
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
1936
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'merge' ]; ?>][hide]" <?php checked( $hide, 1 ); ?> <?php if ( $field[ 'merge' ] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
1937
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1938 1938
 											</td>
1939 1939
 										</tr>
1940 1940
 										<!-- Toggle Field Label Visibility -->
1941 1941
 										<tr valign="top">
1942 1942
 											<td scope="row">
1943 1943
 												<label for="placeholder">
1944
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1944
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
1945 1945
 												</label>
1946 1946
 											</td>
1947 1947
 											<td>
1948
-												<?php $hide_label = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
1949
-												<input type="checkbox" name="field[<?php echo $field['merge']; ?>][hide-label]" value="1" <?php checked( $hide_label , 1 ); ?>/>
1950
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1948
+												<?php $hide_label = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
1949
+												<input type="checkbox" name="field[<?php echo $field[ 'merge' ]; ?>][hide-label]" value="1" <?php checked( $hide_label, 1 ); ?>/>
1950
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1951 1951
 											</td>
1952 1952
 										</tr>
1953 1953
 										<!-- Display Phone/Date Formats back to the user -->
1954 1954
 										<!-- Phone Format Initial Load -->
1955 1955
 										<?php
1956
-											switch( $field['type'] ) {
1956
+											switch ( $field[ 'type' ] ) {
1957 1957
 												/* Store the phone format, for properly regex pattern */
1958 1958
 												case 'phone':
1959 1959
 												case 'birthday':
@@ -1963,23 +1963,23 @@  discard block
 block discarded – undo
1963 1963
 															<td scope="row">
1964 1964
 																<label for="placeholder">
1965 1965
 																	<?php
1966
-																		switch( $field['type'] ) {
1966
+																		switch ( $field[ 'type' ] ) {
1967 1967
 																			default:
1968 1968
 																			case 'birthday':
1969
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
1970
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD';
1969
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
1970
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD';
1971 1971
 																				$format_name = 'date_format';
1972 1972
 																				break;
1973 1973
 
1974 1974
 																			case 'date':
1975
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
1976
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD/YYYY';
1975
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
1976
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD/YYYY';
1977 1977
 																				$format_name = 'date_format';
1978 1978
 																				break;
1979 1979
 
1980 1980
 																			case 'phone':
1981
-																				$type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
1982
-																				$format = ( ( $field['phone_format'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $field['phone_format'] . ' - (###) ### - ####' );
1981
+																				$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
1982
+																				$format = ( ( $field[ 'phone_format' ] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $field[ 'phone_format' ] . ' - (###) ### - ####' );
1983 1983
 																				$format_name = 'phone_format';
1984 1984
 																				break;
1985 1985
 																		}
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
 															</td>
1990 1990
 															<td>
1991 1991
 																<strong><?php echo $format; ?></strong>
1992
-																<input type="hidden" name="field[<?php echo $field['merge']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
1992
+																<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
1993 1993
 																<p class="description"><small>
1994 1994
 																	<?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' ) ); ?>
1995 1995
 																</small></p>
@@ -2010,8 +2010,8 @@  discard block
 block discarded – undo
2010 2010
 											</td>
2011 2011
 											<td>
2012 2012
 												<span class="toggle-container">
2013
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2014
-													<a href="#" class="remove-field" alt="<?php echo $field['merge']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2013
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2014
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'merge' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2015 2015
 												</span>
2016 2016
 											</td>
2017 2017
 										</tr>
@@ -2027,35 +2027,35 @@  discard block
 block discarded – undo
2027 2027
 					} else { // THIS IS AN INTEREST GROUP!
2028 2028
 
2029 2029
 						?>
2030
-						<section class="draggable" id="<?php echo $field['group_id']; ?>">
2030
+						<section class="draggable" id="<?php echo $field[ 'group_id' ]; ?>">
2031 2031
 							<!-- top -->
2032 2032
 							<a href="#" class="expansion-section-title settings-sidebar">
2033
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
2034
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2035
-									<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' ); ?>">
2033
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
2034
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2035
+									<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' ); ?>">
2036 2036
 								<?php } ?>
2037
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
2037
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
2038 2038
 							</a>
2039 2039
 							<!-- expansion section -->
2040 2040
 							<div class="yikes-mc-settings-expansion-section">
2041 2041
 
2042 2042
 								<!-- check if this field exists in the available interest group array -->
2043
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2044
-									<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>
2043
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2044
+									<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>
2045 2045
 								<?php } ?>
2046 2046
 
2047 2047
 								<!-- store the label -->
2048
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][label]" value="<?php echo $field['label']; ?>" />
2049
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][type]" value="<?php echo $field['type']; ?>" />
2050
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][group_id]" value="<?php echo $field['group_id']; ?>" />
2051
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field['groups'], true ) ) ); ?>' />
2048
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
2049
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
2050
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][group_id]" value="<?php echo $field[ 'group_id' ]; ?>" />
2051
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field[ 'groups' ], true ) ) ); ?>' />
2052 2052
 
2053 2053
 								<!-- Single or Double Opt-in -->
2054 2054
 								<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
2055 2055
 
2056 2056
 									<table class="form-table form-field-container">
2057 2057
 										<!-- Default Value -->
2058
-										<?php switch( $field['type'] ) {
2058
+										<?php switch ( $field[ 'type' ] ) {
2059 2059
 
2060 2060
 											default:
2061 2061
 											case 'radio':
@@ -2064,26 +2064,26 @@  discard block
 block discarded – undo
2064 2064
 												<tr valign="top">
2065 2065
 													<td scope="row">
2066 2066
 														<label for="placeholder">
2067
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2067
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2068 2068
 														</label>
2069 2069
 													</td>
2070 2070
 													<td>
2071 2071
 														<?php
2072
-															if( $field['type'] != 'checkboxes' ) {
2073
-																if( !isset( $field['default_choice'] ) ) { $field['default_choice'] =  json_decode( stripslashes( $field['groups'] ) , true ); }
2072
+															if ( $field[ 'type' ] != 'checkboxes' ) {
2073
+																if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = json_decode( stripslashes( $field[ 'groups' ] ), true ); }
2074 2074
 															} else {
2075
-																if( !isset( $field['default_choice'] ) ) { $field['default_choice'] = array(); }
2075
+																if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = array(); }
2076 2076
 															}
2077 2077
 														$i = 0;
2078
-														foreach( json_decode( $field['groups'], true ) as $group ) { ?>
2079
-															<label for="<?php echo $field['group_id'].'-'.$i; ?>">
2080
-																<input id="<?php echo $field['group_id'].'-'.$i; ?>" type="<?php if( $field['type'] == 'radio' || $field['type'] == 'hidden' ) { ?>radio<?php } else if( $field['type'] == 'checkboxes' ) { ?>checkbox<?php } ?>" name="field[<?php echo $field['group_id']; ?>][default_choice]<?php if( $field['type'] == 'checkboxes' ) {echo '[]';}?>" value="<?php echo $i; ?>" <?php if( $field['type'] == 'radio' || $field['type'] == 'hidden' ) { checked( $field['default_choice'][0] , $i ); } else if( $field['type'] == 'checkboxes' ) { if( in_array( $i , $field['default_choice'] ) ) { echo 'checked="checked"'; } }?>><?php echo stripslashes( str_replace( '' , '\'' , $group['name'] ) ); ?>&nbsp;
2078
+														foreach ( json_decode( $field[ 'groups' ], true ) as $group ) { ?>
2079
+															<label for="<?php echo $field[ 'group_id' ] . '-' . $i; ?>">
2080
+																<input id="<?php echo $field[ 'group_id' ] . '-' . $i; ?>" type="<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'hidden' ) { ?>radio<?php } else if ( $field[ 'type' ] == 'checkboxes' ) { ?>checkbox<?php } ?>" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]<?php if ( $field[ 'type' ] == 'checkboxes' ) {echo '[]'; }?>" value="<?php echo $i; ?>" <?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'hidden' ) { checked( $field[ 'default_choice' ][ 0 ], $i ); } else if ( $field[ 'type' ] == 'checkboxes' ) { if ( in_array( $i, $field[ 'default_choice' ] ) ) { echo 'checked="checked"'; } }?>><?php echo stripslashes( str_replace( '', '\'', $group[ 'name' ] ) ); ?>&nbsp;
2081 2081
 															</label>
2082 2082
 														<?php
2083 2083
 															$i++;
2084 2084
 															}
2085 2085
 														?>
2086
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2086
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2087 2087
 													</td>
2088 2088
 												</tr>
2089 2089
 
@@ -2095,16 +2095,16 @@  discard block
 block discarded – undo
2095 2095
 												<tr valign="top">
2096 2096
 													<td scope="row">
2097 2097
 														<label for="placeholder">
2098
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2098
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2099 2099
 														</label>
2100 2100
 													</td>
2101 2101
 													<td>
2102
-														<select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2103
-															<?php $i = 0; foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as  $group ) { ?>
2104
-																<option value="<?php echo $i; ?>" <?php selected( $field['default_choice'] , $i ); ?>><?php echo stripslashes( $group['name'] ); ?></option>
2102
+														<select type="default" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]">
2103
+															<?php $i = 0; foreach ( json_decode( stripslashes_deep( $field[ 'groups' ] ), true ) as  $group ) { ?>
2104
+																<option value="<?php echo $i; ?>" <?php selected( $field[ 'default_choice' ], $i ); ?>><?php echo stripslashes( $group[ 'name' ] ); ?></option>
2105 2105
 															<?php $i++; } ?>
2106 2106
 														</select>
2107
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2107
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2108 2108
 													</td>
2109 2109
 												</tr>
2110 2110
 
@@ -2118,12 +2118,12 @@  discard block
 block discarded – undo
2118 2118
 										<tr valign="top">
2119 2119
 											<td scope="row">
2120 2120
 												<label for="placeholder">
2121
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2121
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
2122 2122
 												</label>
2123 2123
 											</td>
2124 2124
 											<td>
2125
-												<textarea class="widefat field-description-input" name="field[<?php echo $field['group_id']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
2126
-												<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>
2125
+												<textarea class="widefat field-description-input" name="field[<?php echo $field[ 'group_id' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
2126
+												<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>
2127 2127
 											</td>
2128 2128
 										</tr>
2129 2129
 
@@ -2131,51 +2131,51 @@  discard block
 block discarded – undo
2131 2131
 										<tr valign="top">
2132 2132
 											<td scope="row">
2133 2133
 												<label for="placeholder">
2134
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2134
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2135 2135
 												</label>
2136 2136
 											</td>
2137 2137
 											<td>
2138
-												<input type="text" class="widefat" name="field[<?php echo $field['group_id']; ?>][additional-classes]" value="<?php echo isset( $field['additional-classes'] ) ? stripslashes( wp_strip_all_tags( $field['additional-classes'] ) ) : '' ; ?>" />
2139
-												<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>
2138
+												<input type="text" class="widefat" name="field[<?php echo $field[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $field[ 'additional-classes' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'additional-classes' ] ) ) : ''; ?>" />
2139
+												<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>
2140 2140
 											</td>
2141 2141
 										</tr>
2142 2142
 										<!-- Required Toggle -->
2143 2143
 										<tr valign="top">
2144 2144
 											<td scope="row">
2145 2145
 												<label for="field-required">
2146
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2146
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2147 2147
 												</label>
2148 2148
 											</td>
2149 2149
 											<td>
2150
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2151
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][require]" <?php checked( $checked , 1 ); ?>>
2152
-												<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>
2150
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2151
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][require]" <?php checked( $checked, 1 ); ?>>
2152
+												<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>
2153 2153
 											</td>
2154 2154
 										</tr>
2155 2155
 										<!-- Visible Toggle -->
2156 2156
 										<tr valign="top">
2157 2157
 											<td scope="row">
2158 2158
 												<label for="hide-field">
2159
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2159
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2160 2160
 												</label>
2161 2161
 											</td>
2162 2162
 											<td>
2163
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2164
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][hide]" <?php checked( $hide , 1 ); ?>>
2165
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2163
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2164
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][hide]" <?php checked( $hide, 1 ); ?>>
2165
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2166 2166
 											</td>
2167 2167
 										</tr>
2168 2168
 										<!-- Toggle Field Label Visibility -->
2169 2169
 										<tr valign="top">
2170 2170
 											<td scope="row">
2171 2171
 												<label for="placeholder">
2172
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2172
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2173 2173
 												</label>
2174 2174
 											</td>
2175 2175
 											<td>
2176
-												<?php $hide = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2177
-												<input type="checkbox" name="field[<?php echo $field['group_id']; ?>][hide-label]" value="1" <?php checked( $hide , 1 ); ?>/>
2178
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2176
+												<?php $hide = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2177
+												<input type="checkbox" name="field[<?php echo $field[ 'group_id' ]; ?>][hide-label]" value="1" <?php checked( $hide, 1 ); ?>/>
2178
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2179 2179
 											</td>
2180 2180
 										</tr>
2181 2181
 										<!-- Toggle Buttons -->
@@ -2185,8 +2185,8 @@  discard block
 block discarded – undo
2185 2185
 											</td>
2186 2186
 											<td>
2187 2187
 												<span class="toggle-container">
2188
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2189
-													<a href="#" class="remove-field" alt="<?php echo $field['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2188
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2189
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2190 2190
 												</span>
2191 2191
 											</td>
2192 2192
 										</tr>
@@ -2200,38 +2200,38 @@  discard block
 block discarded – undo
2200 2200
 				}
2201 2201
 			} else {
2202 2202
 				?>
2203
-					<h4 class="no-fields-assigned-notice non-draggable-yikes"><em><?php _e( 'No fields are assigned to this form. Select fields from the right hand column to add to this form.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></h4>
2203
+					<h4 class="no-fields-assigned-notice non-draggable-yikes"><em><?php _e( 'No fields are assigned to this form. Select fields from the right hand column to add to this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></h4>
2204 2204
 				<?php
2205 2205
 			}
2206 2206
 				/* Pre Defined Merge Tag Container - Always rendered so the modal appears and links are clickable on initial page load */
2207 2207
 				add_thickbox();
2208 2208
 				// enqueue jquery qtip for our tooltip
2209
-				wp_enqueue_script( 'jquery-qtip-tooltip' , YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) );
2210
-				wp_enqueue_style( 'jquery-qtip-style' ,  YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2209
+				wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) );
2210
+				wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2211 2211
 					$available_tags = array(
2212 2212
 						array(
2213 2213
 							'tag' => '{page_title}',
2214
-							'description' => '<h4 class="tooltip-title">' . __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_title}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post title that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ),
2214
+							'description' => '<h4 class="tooltip-title">' . __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_title}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post title that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ),
2215 2215
 							'title' => __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' )
2216 2216
 						),
2217 2217
 						array(
2218 2218
 							'tag' => '{page_id}',
2219
-							'description' => '<h4 class="tooltip-title">' . __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_id}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post ID that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ),
2219
+							'description' => '<h4 class="tooltip-title">' . __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_id}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post ID that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ),
2220 2220
 							'title' => __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' )
2221 2221
 						),
2222 2222
 						array(
2223 2223
 							'tag' => '{page_url}',
2224
-							'description' => '<h4 class="tooltip-title">' . __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_url}</small></h4><hr />' . __( 'Pre-populate the field with the current page URL that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ),
2224
+							'description' => '<h4 class="tooltip-title">' . __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_url}</small></h4><hr />' . __( 'Pre-populate the field with the current page URL that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ),
2225 2225
 							'title' => __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' )
2226 2226
 						),
2227 2227
 						array(
2228 2228
 							'tag' => '{blog_name}',
2229
-							'description' => '<h4 class="tooltip-title">' . __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{blog_name}</small></h4><hr />' . __( 'Pre-populate the field with the current blog name that the user is on when opting in to your mailing list. This is especially helpful for multi-site networks.' , 'yikes-inc-easy-mailchimp-extender' ),
2229
+							'description' => '<h4 class="tooltip-title">' . __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{blog_name}</small></h4><hr />' . __( 'Pre-populate the field with the current blog name that the user is on when opting in to your mailing list. This is especially helpful for multi-site networks.', 'yikes-inc-easy-mailchimp-extender' ),
2230 2230
 							'title' => __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' )
2231 2231
 						),
2232 2232
 						array(
2233 2233
 							'tag' => '{user_logged_in}',
2234
-							'description' => '<h4 class="tooltip-title">' . __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{user_logged_in}</small></h4><hr />' . __( 'Detects if a user is logged in and pre-populates the field with an appropriate value.' , 'yikes-inc-easy-mailchimp-extender' ),
2234
+							'description' => '<h4 class="tooltip-title">' . __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{user_logged_in}</small></h4><hr />' . __( 'Detects if a user is logged in and pre-populates the field with an appropriate value.', 'yikes-inc-easy-mailchimp-extender' ),
2235 2235
 							'title' => __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' )
2236 2236
 						),
2237 2237
 					);
@@ -2259,17 +2259,17 @@  discard block
 block discarded – undo
2259 2259
 				<div id="pre-defined-tag-container">
2260 2260
 					<input type="hidden" value="" class="clicked-input">
2261 2261
 					<div id="pre-defined-tag-interior-container">
2262
-						<h3><?php _e( 'Pre Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2263
-						<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>
2262
+						<h3><?php _e( 'Pre Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2263
+						<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>
2264 2264
 						<ul>
2265
-							<?php foreach( apply_filters( 'yikes-mailchimp-custom-default-value-tags' , $available_tags ) as $tag ) { ?>
2265
+							<?php foreach ( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2266 2266
 								<li class="tooltop-tag">
2267 2267
 									<!-- link/tag -->
2268
-									<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>
2268
+									<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>
2269 2269
 									<!-- help icon -->
2270 2270
 									<span class="dashicons dashicons-editor-help"></span>
2271 2271
 									<!-- tooltip -->
2272
-									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag['description']; ?></div>
2272
+									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag[ 'description' ]; ?></div>
2273 2273
 								</li>
2274 2274
 							<?php } ?>
2275 2275
 						</ul>
@@ -2285,32 +2285,32 @@  discard block
 block discarded – undo
2285 2285
 		*	-
2286 2286
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2287 2287
 		*/
2288
-		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2288
+		public function build_available_merge_vars( $form_fields, $available_merge_variables ) {
2289 2289
 			$fields_assigned_to_form = array();
2290
-			if( !empty( $form_fields ) ) {
2291
-				foreach( $form_fields as $assigned_field ) {
2290
+			if ( ! empty( $form_fields ) ) {
2291
+				foreach ( $form_fields as $assigned_field ) {
2292 2292
 					// print_r( $assigned_field) ;
2293 2293
 					// switch between merge variables and interest groups
2294
-					if( isset( $assigned_field['merge'] ) ) {
2295
-						$fields_assigned_to_form[] = $assigned_field['merge'];
2294
+					if ( isset( $assigned_field[ 'merge' ] ) ) {
2295
+						$fields_assigned_to_form[ ] = $assigned_field[ 'merge' ];
2296 2296
 					}
2297 2297
 				}
2298 2298
 			}
2299
-			if( !empty( $available_merge_variables['data'][0] ) ) {
2299
+			if ( ! empty( $available_merge_variables[ 'data' ][ 0 ] ) ) {
2300 2300
 				?><ul id="available-fields"><?php
2301
-				foreach( $available_merge_variables['data'][0]['merge_vars'] as $merge_var ) {
2302
-					if( in_array( $merge_var['tag'] , $fields_assigned_to_form ) ) {
2301
+				foreach ( $available_merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] as $merge_var ) {
2302
+					if ( in_array( $merge_var[ 'tag' ], $fields_assigned_to_form ) ) {
2303 2303
 						?>
2304
-							<li class="available-form-field not-available" alt="<?php echo $merge_var['tag']; ?>" data-attr-field-type="<?php echo $merge_var['field_type']; ?>" data-attr-field-name="<?php echo $merge_var['name']; ?>" data-attr-form-id="<?php echo $available_merge_variables['data'][0]['id']; ?>" title="<?php _e( 'Already assigned to your form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $merge_var['name'] ); if( $merge_var['req'] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field' , 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var['field_type']; ?></small></li>
2304
+							<li class="available-form-field not-available" alt="<?php echo $merge_var[ 'tag' ]; ?>" data-attr-field-type="<?php echo $merge_var[ 'field_type' ]; ?>" data-attr-field-name="<?php echo $merge_var[ 'name' ]; ?>" data-attr-form-id="<?php echo $available_merge_variables[ 'data' ][ 0 ][ 'id' ]; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $merge_var[ 'name' ] ); if ( $merge_var[ 'req' ] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var[ 'field_type' ]; ?></small></li>
2305 2305
 						<?php
2306 2306
 					} else {
2307 2307
 						?>
2308
-							<li class="available-form-field" alt="<?php echo $merge_var['tag']; ?>" data-attr-field-type="<?php echo $merge_var['field_type']; ?>" data-attr-field-name="<?php echo $merge_var['name']; ?>" data-attr-form-id="<?php echo $available_merge_variables['data'][0]['id']; ?>"><?php echo stripslashes( $merge_var['name'] ); if( $merge_var['req'] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field' , 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var['field_type']; ?></small></li>
2308
+							<li class="available-form-field" alt="<?php echo $merge_var[ 'tag' ]; ?>" data-attr-field-type="<?php echo $merge_var[ 'field_type' ]; ?>" data-attr-field-name="<?php echo $merge_var[ 'name' ]; ?>" data-attr-form-id="<?php echo $available_merge_variables[ 'data' ][ 0 ][ 'id' ]; ?>"><?php echo stripslashes( $merge_var[ 'name' ] ); if ( $merge_var[ 'req' ] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var[ 'field_type' ]; ?></small></li>
2309 2309
 						<?php
2310 2310
 					}
2311 2311
 				}
2312 2312
 				?></ul>
2313
-				<a href="#" class="add-field-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
2313
+				<a href="#" class="add-field-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
2314 2314
 				<?php
2315 2315
 			}
2316 2316
 		}
@@ -2322,30 +2322,30 @@  discard block
 block discarded – undo
2322 2322
 		*	-
2323 2323
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2324 2324
 		*/
2325
-		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2325
+		public function build_available_interest_groups( $form_fields, $available_interest_groups, $list_id ) {
2326 2326
 			$fields_assigned_to_form = array();
2327
-			if( !empty( $form_fields ) ) {
2328
-					foreach( $form_fields as $assigned_interest_group ) {
2329
-					if( isset( $assigned_interest_group['group_id'] ) ) {
2330
-						$fields_assigned_to_form[] = $assigned_interest_group['group_id'];
2327
+			if ( ! empty( $form_fields ) ) {
2328
+					foreach ( $form_fields as $assigned_interest_group ) {
2329
+					if ( isset( $assigned_interest_group[ 'group_id' ] ) ) {
2330
+						$fields_assigned_to_form[ ] = $assigned_interest_group[ 'group_id' ];
2331 2331
 					}
2332 2332
 				}
2333 2333
 			}
2334
-			if( !empty( $available_interest_groups) ) {
2334
+			if ( ! empty( $available_interest_groups ) ) {
2335 2335
 				?><ul id="available-interest-groups"><?php
2336
-				foreach( $available_interest_groups as $interest_group ) {
2337
-					if( in_array( $interest_group['id'] , $fields_assigned_to_form ) ) {
2336
+				foreach ( $available_interest_groups as $interest_group ) {
2337
+					if ( in_array( $interest_group[ 'id' ], $fields_assigned_to_form ) ) {
2338 2338
 						?>
2339
-							<li class="available-interest-group not-available" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['name'] ); ?>" data-attr-field-type="<?php echo $interest_group['form_field']; ?>" data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $interest_group['name'] ); ?> <small class="field-type-text"><?php echo $interest_group['form_field']; ?></small></li>
2339
+							<li class="available-interest-group not-available" alt="<?php echo $interest_group[ 'id' ]; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group[ 'name' ] ); ?>" data-attr-field-type="<?php echo $interest_group[ 'form_field' ]; ?>" data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $interest_group[ 'name' ] ); ?> <small class="field-type-text"><?php echo $interest_group[ 'form_field' ]; ?></small></li>
2340 2340
 						<?php
2341 2341
 					} else {
2342 2342
 						?>
2343
-							<li class="available-interest-group" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['name'] ); ?>" data-attr-field-type="<?php echo $interest_group['form_field']; ?>" data-attr-form-id="<?php echo $list_id; ?>"><?php echo stripslashes( $interest_group['name'] ); ?> <small class="field-type-text"><?php echo $interest_group['form_field']; ?></small></li>
2343
+							<li class="available-interest-group" alt="<?php echo $interest_group[ 'id' ]; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group[ 'name' ] ); ?>" data-attr-field-type="<?php echo $interest_group[ 'form_field' ]; ?>" data-attr-form-id="<?php echo $list_id; ?>"><?php echo stripslashes( $interest_group[ 'name' ] ); ?> <small class="field-type-text"><?php echo $interest_group[ 'form_field' ]; ?></small></li>
2344 2344
 						<?php
2345 2345
 					}
2346 2346
 				}
2347 2347
 				?></ul>
2348
-				<a href="#" class="add-interest-group-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
2348
+				<a href="#" class="add-interest-group-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
2349 2349
 				<?php
2350 2350
 			}
2351 2351
 		}
@@ -2357,9 +2357,9 @@  discard block
 block discarded – undo
2357 2357
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2358 2358
 		*/
2359 2359
 		public function yikes_easy_mailchimp_create_form() {
2360
-			$nonce = $_REQUEST['nonce'];
2361
-			if( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2362
-				die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) );
2360
+			$nonce = $_REQUEST[ 'nonce' ];
2361
+			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2362
+				die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ) );
2363 2363
 			}
2364 2364
 			global $wpdb;
2365 2365
 				/* Default values */
@@ -2382,7 +2382,7 @@  discard block
 block discarded – undo
2382 2382
 					)
2383 2383
 				);
2384 2384
 				// setup our default error message array
2385
-				$error_settings= json_encode(
2385
+				$error_settings = json_encode(
2386 2386
 					array(
2387 2387
 						'success' => '',
2388 2388
 						'general-error' => '',
@@ -2396,9 +2396,9 @@  discard block
 block discarded – undo
2396 2396
 				$wpdb->insert(
2397 2397
 					$wpdb->prefix . 'yikes_easy_mc_forms',
2398 2398
 					array(
2399
-						'list_id' => $_POST['associated-list'],
2400
-						'form_name' => stripslashes( $_POST['form-name'] ),
2401
-						'form_description' => stripslashes( $_POST['form-description'] ),
2399
+						'list_id' => $_POST[ 'associated-list' ],
2400
+						'form_name' => stripslashes( $_POST[ 'form-name' ] ),
2401
+						'form_description' => stripslashes( $_POST[ 'form-description' ] ),
2402 2402
 						'fields' => '',
2403 2403
 						'custom_styles' => 0,
2404 2404
 						'custom_template' => 0,
@@ -2419,33 +2419,33 @@  discard block
 block discarded – undo
2419 2419
 						'%s', // form description
2420 2420
 						'%s', // fields
2421 2421
 						'%s', // custom styles
2422
-						'%d',	// custom template
2423
-						'%d',	// send welcome email
2424
-						'%s',	// redirect user
2425
-						'%s',	// redirect page
2426
-						'%s',	// submission
2427
-						'%s',	// optin
2422
+						'%d', // custom template
2423
+						'%d', // send welcome email
2424
+						'%s', // redirect user
2425
+						'%s', // redirect page
2426
+						'%s', // submission
2427
+						'%s', // optin
2428 2428
 						'%s', // error
2429 2429
 						'%s', // custom notifications
2430
-						'%d',	// impressions #
2431
-						'%d',	// submissions #
2430
+						'%d', // impressions #
2431
+						'%d', // submissions #
2432 2432
 						'%s', // custom fields
2433 2433
 					)
2434 2434
 				);
2435 2435
 
2436 2436
 			// if an error occurs during the form creation process
2437
-			if( $wpdb->insert_id == '0' ) {
2437
+			if ( $wpdb->insert_id == '0' ) {
2438 2438
 				// write it to the error log
2439 2439
 				// if the form was not created successfully
2440
-				if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2440
+				if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2441 2441
 					require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2442 2442
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2443
-					$error_logging->yikes_easy_mailchimp_write_to_error_log( $wpdb->last_error , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2443
+					$error_logging->yikes_easy_mailchimp_write_to_error_log( $wpdb->last_error, __( "Creating a new form", 'yikes-inc-easy-mailchimp-extender' ), __( "Forms", 'yikes-inc-easy-mailchimp-extender' ) );
2444 2444
 				}
2445
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error='.urlencode( $wpdb->last_error ) ) ) );
2445
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( $wpdb->last_error ) ) ) );
2446 2446
 			} else {
2447 2447
 				// redirect the user to the new form edit page
2448
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id='.$wpdb->insert_id ) ) );
2448
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $wpdb->insert_id ) ) );
2449 2449
 			}
2450 2450
 			exit();
2451 2451
 			die();
@@ -2459,11 +2459,11 @@  discard block
 block discarded – undo
2459 2459
 		*/
2460 2460
 		public function yikes_easy_mailchimp_delete_form() {
2461 2461
 			// grab & store our variables ( associated list & form name )
2462
-			$nonce = $_REQUEST['nonce'];
2463
-			$post_id_to_delete = $_REQUEST['mailchimp-form'];
2462
+			$nonce = $_REQUEST[ 'nonce' ];
2463
+			$post_id_to_delete = $_REQUEST[ 'mailchimp-form' ];
2464 2464
 			// verify our nonce
2465
-			if( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2466
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2465
+			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-' . $post_id_to_delete ) ) {
2466
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2467 2467
 			}
2468 2468
 			global $wpdb;
2469 2469
 				/* Working Insert Function */
@@ -2488,39 +2488,39 @@  discard block
 block discarded – undo
2488 2488
 		*/
2489 2489
 		public function yikes_easy_mailchimp_duplicate_form() {
2490 2490
 			// grab & store our variables ( associated list & form name )
2491
-			$nonce = $_REQUEST['nonce'];
2492
-			$post_id_to_clone = $_REQUEST['mailchimp-form'];
2491
+			$nonce = $_REQUEST[ 'nonce' ];
2492
+			$post_id_to_clone = $_REQUEST[ 'mailchimp-form' ];
2493 2493
 			// verify our nonce
2494
-			if( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2495
-				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 ) );
2494
+			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-' . $post_id_to_clone ) ) {
2495
+				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 ) );
2496 2496
 			}
2497 2497
 			global $wpdb;
2498 2498
 				/* Working Insert Function */
2499
-				$form_data = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "yikes_easy_mc_forms WHERE id = ".$post_id_to_clone."");
2499
+				$form_data = $wpdb->get_row( "SELECT * FROM " . $wpdb->prefix . "yikes_easy_mc_forms WHERE id = " . $post_id_to_clone . "" );
2500 2500
 				// create empty array to populate with row data
2501 2501
 				$data = array();
2502 2502
 				// build a data array to duplicate
2503
-				foreach( $form_data as $id => $value ) {
2503
+				foreach ( $form_data as $id => $value ) {
2504 2504
 					// skip the ID field this is unique
2505
-					if( $id != 'id' ) {
2505
+					if ( $id != 'id' ) {
2506 2506
 						// append -Copy- to our new form
2507
-						if( $id == 'form_name' ) {
2507
+						if ( $id == 'form_name' ) {
2508 2508
 							$value = $value . ' - Copy -';
2509 2509
 						}
2510 2510
 						// reset the impressions and submissions back to 0
2511
-						if( $id == 'impressions' || $id == 'submissions' ) {
2511
+						if ( $id == 'impressions' || $id == 'submissions' ) {
2512 2512
 							$value = '0';
2513 2513
 						}
2514 2514
 
2515 2515
 						// add data to our array
2516
-						$data[$id] = $value;
2516
+						$data[ $id ] = $value;
2517 2517
 					}
2518 2518
 				}
2519 2519
 				// insert our new data
2520
-				if( $wpdb->insert(
2520
+				if ( $wpdb->insert(
2521 2521
 					$wpdb->prefix . 'yikes_easy_mc_forms',
2522 2522
 					apply_filters( 'yikes-mailchimp-duplicate-form-data', $data )
2523
-				)  === FALSE ) {
2523
+				) === FALSE ) {
2524 2524
 					// redirect the user to the manage forms page, display error
2525 2525
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp&duplicated-form=false' ) ) );
2526 2526
 				} else {
@@ -2536,15 +2536,15 @@  discard block
 block discarded – undo
2536 2536
 		*/
2537 2537
 		public function yikes_easy_mailchimp_reset_impression_stats() {
2538 2538
 			// grab & store our variables ( associated list & form name )
2539
-			$nonce = $_REQUEST['nonce'];
2540
-			$form_id_to_reset = $_REQUEST['mailchimp-form'];
2539
+			$nonce = $_REQUEST[ 'nonce' ];
2540
+			$form_id_to_reset = $_REQUEST[ 'mailchimp-form' ];
2541 2541
 			// verify our nonce
2542
-			if( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2543
-				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 ) );
2542
+			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-' . $form_id_to_reset ) ) {
2543
+				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 ) );
2544 2544
 			}
2545 2545
 			global $wpdb;
2546 2546
 			/* Update 'Impressions/Submissions' */
2547
-			if( $wpdb->update(
2547
+			if ( $wpdb->update(
2548 2548
 				$wpdb->prefix . 'yikes_easy_mc_forms',
2549 2549
 				array(
2550 2550
 					'impressions' => 0,
@@ -2568,35 +2568,35 @@  discard block
 block discarded – undo
2568 2568
 		*/
2569 2569
 		public function yikes_easy_mailchimp_update_form() {
2570 2570
 			// grab & store our variables ( associated list & form name )
2571
-			$nonce = $_REQUEST['nonce'];
2572
-			$form_id = $_REQUEST['id'];
2571
+			$nonce = $_REQUEST[ 'nonce' ];
2572
+			$form_id = $_REQUEST[ 'id' ];
2573 2573
 
2574 2574
 			// store our values!
2575
-			$list_id = $_POST['associated-list'];
2576
-			$form_name = stripslashes( $_POST['form-name'] );
2577
-			$form_description = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
2578
-			$send_welcome_email = $_POST['send-welcome-email'];
2579
-			$redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2580
-			$redirect_page = $_POST['redirect-user-to-selection'];
2581
-			if( isset( $_POST['custom-styles'] ) ) {
2582
-				$custom_styles = $_POST['custom-styles'];
2575
+			$list_id = $_POST[ 'associated-list' ];
2576
+			$form_name = stripslashes( $_POST[ 'form-name' ] );
2577
+			$form_description = sanitize_text_field( stripslashes( $_POST[ 'form-description' ] ) );
2578
+			$send_welcome_email = $_POST[ 'send-welcome-email' ];
2579
+			$redirect_user_on_submit = $_POST[ 'redirect-user-on-submission' ];
2580
+			$redirect_page = $_POST[ 'redirect-user-to-selection' ];
2581
+			if ( isset( $_POST[ 'custom-styles' ] ) ) {
2582
+				$custom_styles = $_POST[ 'custom-styles' ];
2583 2583
 			}
2584 2584
 
2585 2585
 			// stripslashes_deep on save, to prevent foreign languages from added excessive backslashes
2586
-			$assigned_fields = isset( $_POST['field'] ) ? json_encode( stripslashes_deep( $_POST['field'] ) ) : '';
2586
+			$assigned_fields = isset( $_POST[ 'field' ] ) ? json_encode( stripslashes_deep( $_POST[ 'field' ] ) ) : '';
2587 2587
 
2588 2588
 			// setup our custom styles serialized array
2589
-			if( isset( $custom_styles ) ) {
2589
+			if ( isset( $custom_styles ) ) {
2590 2590
 				$custom_styles = json_encode( array(
2591
-					'active' => $_POST['custom-styles'],
2592
-					'background_color' => $_POST['form-background-color'],
2593
-					'font_color' => $_POST['form-font-color'],
2594
-					'submit_button_color' => $_POST['form-submit-button-color'],
2595
-					'submit_button_text_color' => $_POST['form-submit-button-text-color'],
2596
-					'form_padding' => $_POST['form-padding'],
2597
-					'form_width' => $_POST['form-width'],
2598
-					'form_alignment' => $_POST['form-alignment'],
2599
-					'label_visible' => $_POST['label-visible']
2591
+					'active' => $_POST[ 'custom-styles' ],
2592
+					'background_color' => $_POST[ 'form-background-color' ],
2593
+					'font_color' => $_POST[ 'form-font-color' ],
2594
+					'submit_button_color' => $_POST[ 'form-submit-button-color' ],
2595
+					'submit_button_text_color' => $_POST[ 'form-submit-button-text-color' ],
2596
+					'form_padding' => $_POST[ 'form-padding' ],
2597
+					'form_width' => $_POST[ 'form-width' ],
2598
+					'form_alignment' => $_POST[ 'form-alignment' ],
2599
+					'label_visible' => $_POST[ 'label-visible' ]
2600 2600
 				) );
2601 2601
 			} else {
2602 2602
 				$custom_styles = 0;
@@ -2605,33 +2605,33 @@  discard block
 block discarded – undo
2605 2605
 			// setup our submission settings serialized array
2606 2606
 			$submission_settings = json_encode(
2607 2607
 				array(
2608
-					'ajax' => $_POST['form-ajax-submission'],
2609
-					'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2610
-					'redirect_page' => $_POST['redirect-user-to-selection'],
2611
-					'custom_redirect_url' => esc_url( $_POST['custom-redirect-url'] ),
2612
-					'hide_form_post_signup' => $_POST['hide-form-post-signup'],
2613
-					'replace_interests' => $_POST['replace-interest-groups'],
2608
+					'ajax' => $_POST[ 'form-ajax-submission' ],
2609
+					'redirect_on_submission' => $_POST[ 'redirect-user-on-submission' ],
2610
+					'redirect_page' => $_POST[ 'redirect-user-to-selection' ],
2611
+					'custom_redirect_url' => esc_url( $_POST[ 'custom-redirect-url' ] ),
2612
+					'hide_form_post_signup' => $_POST[ 'hide-form-post-signup' ],
2613
+					'replace_interests' => $_POST[ 'replace-interest-groups' ],
2614 2614
 				)
2615 2615
 			);
2616 2616
 
2617 2617
 			// setup our opt-in settings serialized array
2618 2618
 			$optin_settings = json_encode(
2619 2619
 				array(
2620
-					'optin' => $_POST['single-double-optin'],
2621
-					'update_existing_user' => $_POST['update-existing-user'],
2622
-					'send_update_email' => $_POST['update-existing-email'],
2623
-					'send_welcome_email' => $_POST['send-welcome-email'],
2620
+					'optin' => $_POST[ 'single-double-optin' ],
2621
+					'update_existing_user' => $_POST[ 'update-existing-user' ],
2622
+					'send_update_email' => $_POST[ 'update-existing-email' ],
2623
+					'send_welcome_email' => $_POST[ 'send-welcome-email' ],
2624 2624
 				)
2625 2625
 			);
2626 2626
 
2627 2627
 			// setup our error settings serialized array
2628 2628
 			$error_settings = json_encode(
2629 2629
 				array(
2630
-					'success' => trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2631
-					'general-error' => trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2632
-					'invalid-email' => trim( $_POST['yikes-easy-mc-invalid-email-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-invalid-email-message'] ) ) : '',
2633
-					'already-subscribed' => trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2634
-					'update-link' => trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '',
2630
+					'success' => trim( $_POST[ 'yikes-easy-mc-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-message' ] ) ) : '',
2631
+					'general-error' => trim( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ) : '',
2632
+					'invalid-email' => trim( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ) : '',
2633
+					'already-subscribed' => trim( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ) : '',
2634
+					'update-link' => trim( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ) : '',
2635 2635
 				)
2636 2636
 			);
2637 2637
 
@@ -2640,33 +2640,33 @@  discard block
 block discarded – undo
2640 2640
 			// To Do: Combine date & time so it's a single unix timestamp
2641 2641
 			$form_settings = json_encode(
2642 2642
 				array(
2643
-					'yikes-easy-mc-form-class-names' => trim( $_POST['yikes-easy-mc-form-class-names'] ),
2644
-					'yikes-easy-mc-inline-form' => $_POST['yikes-easy-mc-inline-form'][0],
2645
-					'yikes-easy-mc-submit-button-type' => $_POST['yikes-easy-mc-submit-button-type'][0],
2646
-					'yikes-easy-mc-submit-button-text' => trim( $_POST['yikes-easy-mc-submit-button-text'] ),
2647
-					'yikes-easy-mc-submit-button-image' => esc_url( trim( $_POST['yikes-easy-mc-submit-button-image'] ) ),
2648
-					'yikes-easy-mc-submit-button-classes' => trim( $_POST['yikes-easy-mc-submit-button-classes'] ),
2649
-					'yikes-easy-mc-form-schedule' => ( isset( $_POST['yikes-easy-mc-form-schedule'] ) ) ? '1' : '0',
2650
-					'yikes-easy-mc-form-restriction-start' => strtotime( $_POST['yikes-easy-mc-form-restriction-start-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-start-time'] ),
2651
-					'yikes-easy-mc-form-restriction-end' => strtotime( $_POST['yikes-easy-mc-form-restriction-end-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-end-time'] ),
2652
-					'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST['yikes-easy-mc-form-restriction-pending-message'] ),
2653
-					'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST['yikes-easy-mc-form-restriction-expired-message'] ),
2654
-					'yikes-easy-mc-form-login-required' => ( isset( $_POST['yikes-easy-mc-form-login-required'] ) ) ? '1' : '0',
2655
-					'yikes-easy-mc-form-restriction-login-message' => trim( $_POST['yikes-easy-mc-form-restriction-login-message'] ),
2643
+					'yikes-easy-mc-form-class-names' => trim( $_POST[ 'yikes-easy-mc-form-class-names' ] ),
2644
+					'yikes-easy-mc-inline-form' => $_POST[ 'yikes-easy-mc-inline-form' ][ 0 ],
2645
+					'yikes-easy-mc-submit-button-type' => $_POST[ 'yikes-easy-mc-submit-button-type' ][ 0 ],
2646
+					'yikes-easy-mc-submit-button-text' => trim( $_POST[ 'yikes-easy-mc-submit-button-text' ] ),
2647
+					'yikes-easy-mc-submit-button-image' => esc_url( trim( $_POST[ 'yikes-easy-mc-submit-button-image' ] ) ),
2648
+					'yikes-easy-mc-submit-button-classes' => trim( $_POST[ 'yikes-easy-mc-submit-button-classes' ] ),
2649
+					'yikes-easy-mc-form-schedule' => ( isset( $_POST[ 'yikes-easy-mc-form-schedule' ] ) ) ? '1' : '0',
2650
+					'yikes-easy-mc-form-restriction-start' => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-start-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-start-time' ] ),
2651
+					'yikes-easy-mc-form-restriction-end' => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-end-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-end-time' ] ),
2652
+					'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-pending-message' ] ),
2653
+					'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-expired-message' ] ),
2654
+					'yikes-easy-mc-form-login-required' => ( isset( $_POST[ 'yikes-easy-mc-form-login-required' ] ) ) ? '1' : '0',
2655
+					'yikes-easy-mc-form-restriction-login-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-login-message' ] ),
2656 2656
 				)
2657 2657
 			);
2658 2658
 
2659 2659
 			// setup and store our notification array
2660
-			$custom_notifications = isset( $_POST['custom-notification'] ) ? stripslashes( json_encode( $_POST['custom-notification'] ) ) : '';
2660
+			$custom_notifications = isset( $_POST[ 'custom-notification' ] ) ? stripslashes( json_encode( $_POST[ 'custom-notification' ] ) ) : '';
2661 2661
 
2662 2662
 			// additional custom fields (extensions / user defined fields)
2663
-			if( isset( $_POST['custom-field'] ) ) {
2663
+			if ( isset( $_POST[ 'custom-field' ] ) ) {
2664 2664
 				$custom_field_array = array();
2665
-				foreach( $_POST['custom-field'] as $custom_field => $custom_value ) {
2666
-					if( is_array( $custom_value ) ) {
2667
-						$custom_field_array[$custom_field] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2665
+				foreach ( $_POST[ 'custom-field' ] as $custom_field => $custom_value ) {
2666
+					if ( is_array( $custom_value ) ) {
2667
+						$custom_field_array[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2668 2668
 					} else {
2669
-						$custom_field_array[$custom_field] = stripslashes( $custom_value );
2669
+						$custom_field_array[ $custom_field ] = stripslashes( $custom_value );
2670 2670
 					}
2671 2671
 				}
2672 2672
 				$custom_fields = json_encode( $custom_field_array );
@@ -2675,8 +2675,8 @@  discard block
 block discarded – undo
2675 2675
 			}
2676 2676
 
2677 2677
 			// verify our nonce
2678
-			if( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-'.$form_id ) ) {
2679
-				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 ) );
2678
+			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
2679
+				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 ) );
2680 2680
 			}
2681 2681
 
2682 2682
 				global $wpdb;
@@ -2708,12 +2708,12 @@  discard block
 block discarded – undo
2708 2708
 						'%s', // form description
2709 2709
 						'%s', // fields
2710 2710
 						'%s', // custom styles
2711
-						'%d',	//custom template
2712
-						'%d',	// send welcome email
2713
-						'%s',	// redirect user
2714
-						'%s',	// redirect page
2715
-						'%s',	// submission
2716
-						'%s',	// opt-in
2711
+						'%d', //custom template
2712
+						'%d', // send welcome email
2713
+						'%s', // redirect user
2714
+						'%s', // redirect page
2715
+						'%s', // submission
2716
+						'%s', // opt-in
2717 2717
 						'%s', // error
2718 2718
 						'%s', // custom notifications
2719 2719
 						'%s', // custom fields
@@ -2722,7 +2722,7 @@  discard block
 block discarded – undo
2722 2722
 				);
2723 2723
 
2724 2724
 			/* Custom action hook which allows users to update specific options when a form is updated - used in add ons */
2725
-			do_action( 'yikes-mailchimp-save-form', $form_id,  json_decode( $custom_fields, true ) );
2725
+			do_action( 'yikes-mailchimp-save-form', $form_id, json_decode( $custom_fields, true ) );
2726 2726
 
2727 2727
 			// redirect the user to the manage forms page, display confirmation
2728 2728
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form_id . '&updated-form=true' ) ) );
@@ -2732,18 +2732,18 @@  discard block
 block discarded – undo
2732 2732
 
2733 2733
 		/* Unsubscribe a given user from our list */
2734 2734
 		public function yikes_easy_mailchimp_unsubscribe_user() {
2735
-			$nonce = $_REQUEST['nonce'];
2736
-			$list_id = $_REQUEST['mailchimp-list'];
2737
-			$email_id = $_REQUEST['email_id'];
2735
+			$nonce = $_REQUEST[ 'nonce' ];
2736
+			$list_id = $_REQUEST[ 'mailchimp-list' ];
2737
+			$email_id = $_REQUEST[ 'email_id' ];
2738 2738
 			// verify our nonce
2739
-			if( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2740
-				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 ) );
2739
+			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2740
+				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 ) );
2741 2741
 			}
2742 2742
 			// only re-run the API request if our API key has changed
2743 2743
 			// initialize MailChimp Class
2744 2744
 			$api_key = yikes_get_mc_api_key();
2745 2745
 			$dash_position = strpos( $api_key, '-' );
2746
-			if( $dash_position !== false ) {
2746
+			if ( $dash_position !== false ) {
2747 2747
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/unsubscribe.json';
2748 2748
 			}
2749 2749
 			$response = wp_remote_post( $api_endpoint, array(
@@ -2757,13 +2757,13 @@  discard block
 block discarded – undo
2757 2757
 				'timeout' => 10,
2758 2758
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2759 2759
 			) );
2760
-			if( ! is_wp_error( $response ) ) {
2760
+			if ( ! is_wp_error( $response ) ) {
2761 2761
 				$response_body = json_decode( wp_remote_retrieve_body( $response ), true );
2762
-				if( isset( $response_body['error'] ) ) {
2763
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2762
+				if ( isset( $response_body[ 'error' ] ) ) {
2763
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2764 2764
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2765 2765
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2766
-						$error_logging->yikes_easy_mailchimp_write_to_error_log( $response_body['error'], __( "Unsubscribe User" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Manage List Page" , 'yikes-inc-easy-mailchimp-extender' ) );
2766
+						$error_logging->yikes_easy_mailchimp_write_to_error_log( $response_body[ 'error' ], __( "Unsubscribe User", 'yikes-inc-easy-mailchimp-extender' ), __( "Manage List Page", 'yikes-inc-easy-mailchimp-extender' ) );
2767 2767
 					}
2768 2768
 				}
2769 2769
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id . '&user-unsubscribed=true' ) ) );
@@ -2774,21 +2774,21 @@  discard block
 block discarded – undo
2774 2774
 
2775 2775
 		public function yikes_easy_mailchimp_create_missing_error_log() {
2776 2776
 			// grab our nonnce
2777
-			$nonce = $_REQUEST['nonce'];
2777
+			$nonce = $_REQUEST[ 'nonce' ];
2778 2778
 			// validate nonce
2779
-			if( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2780
-				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 ) );
2779
+			if ( ! wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2780
+				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 ) );
2781 2781
 			}
2782 2782
 			// setup the path to the error log
2783
-			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php' , 'w' );
2783
+			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' );
2784 2784
 			try {
2785 2785
 				// create the file
2786
-				fwrite( $error_log , '' );
2786
+				fwrite( $error_log, '' );
2787 2787
 				// close out
2788 2788
 				fclose( $error_log );
2789 2789
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=true' ) ) );
2790 2790
 			} catch ( Exception $e ) {
2791
-				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() ) ) ) );
2791
+				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() ) ) ) );
2792 2792
 			}
2793 2793
 		}
2794 2794
 
@@ -2799,16 +2799,16 @@  discard block
 block discarded – undo
2799 2799
 		public function yikes_easy_mailchimp_clear_transient_data() {
2800 2800
 			$referer = wp_get_referer();
2801 2801
 			// grab & store our variables ( associated list & form name )
2802
-			$nonce = $_REQUEST['nonce'];
2802
+			$nonce = $_REQUEST[ 'nonce' ];
2803 2803
 			// verify our nonce
2804
-			if( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2805
-				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 ) );
2804
+			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2805
+				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 ) );
2806 2806
 			}
2807 2807
 			// delete all of the integration settings list data in the cache
2808 2808
 			$list_ids = $this->get_mailchimp_list_ids_on_account();
2809 2809
 			// confirm the list IDs was returned and is not empty
2810
-			if( isset( $list_ids ) && ! empty( $list_ids ) ) {
2811
-				foreach( $list_ids as $id ) {
2810
+			if ( isset( $list_ids ) && ! empty( $list_ids ) ) {
2811
+				foreach ( $list_ids as $id ) {
2812 2812
 					// loop over each interest group and delete the transient associated with it
2813 2813
 					// this is created & stored on the integration list page
2814 2814
 					// id = groupID_interest_group
@@ -2841,12 +2841,12 @@  discard block
 block discarded – undo
2841 2841
 		*/
2842 2842
 		public function get_mailchimp_list_ids_on_account() {
2843 2843
 			$api_key = yikes_get_mc_api_key();
2844
-			if( ! $api_key ) {
2844
+			if ( ! $api_key ) {
2845 2845
 				// if no api key is set/site is not connected, return an empty array
2846 2846
 				return array();
2847 2847
 			}
2848 2848
 			$dash_position = strpos( $api_key, '-' );
2849
-			if( $dash_position !== false ) {
2849
+			if ( $dash_position !== false ) {
2850 2850
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
2851 2851
 			}
2852 2852
 			$mailchimp_lists = wp_remote_post( $api_endpoint, array(
@@ -2857,19 +2857,19 @@  discard block
 block discarded – undo
2857 2857
 				'timeout' => 10,
2858 2858
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2859 2859
 			) );
2860
-			if( ! is_wp_error( $mailchimp_lists ) ) {
2860
+			if ( ! is_wp_error( $mailchimp_lists ) ) {
2861 2861
 				$list_data = json_decode( wp_remote_retrieve_body( $mailchimp_lists ), true );
2862
-				if( isset( $list_data['error'] ) ) {
2863
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2862
+				if ( isset( $list_data[ 'error' ] ) ) {
2863
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2864 2864
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2865 2865
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2866
-						$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get List IDs" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Clear API Cache" , 'yikes-inc-easy-mailchimp-extender' ) );
2866
+						$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get List IDs", 'yikes-inc-easy-mailchimp-extender' ), __( "Clear API Cache", 'yikes-inc-easy-mailchimp-extender' ) );
2867 2867
 					}
2868 2868
 				}
2869 2869
 				$mail_chimp_list_ids = array();
2870
-				if( $mailchimp_lists ) {
2871
-					foreach( $list_data as $list ) {
2872
-						$mail_chimp_list_ids[] = $list['id'];
2870
+				if ( $mailchimp_lists ) {
2871
+					foreach ( $list_data as $list ) {
2872
+						$mail_chimp_list_ids[ ] = $list[ 'id' ];
2873 2873
 					}
2874 2874
 					return $mail_chimp_list_ids;
2875 2875
 				} else {
@@ -2885,7 +2885,7 @@  discard block
 block discarded – undo
2885 2885
 		*/
2886 2886
 		public function yikes_mailchimp_load_helper_class() {
2887 2887
 			// check to see if it's already loaded up
2888
-			if( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2888
+			if ( ! class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2889 2889
 				// Include our main helper class file
2890 2890
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' );
2891 2891
 			}
@@ -2962,7 +2962,7 @@  discard block
 block discarded – undo
2962 2962
 		*	@since 6.0.4
2963 2963
 		*/
2964 2964
 		public function check_yikes_mc_table_version() {
2965
-			if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2965
+			if ( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2966 2966
 				require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php';
2967 2967
 				global $wpdb;
2968 2968
 				Yikes_Inc_Easy_Mailchimp_Extender_Activator::_activate_yikes_easy_mailchimp( $wpdb );
Please login to merge, or discard this patch.