Completed
Push — staging ( 57798f...9e32c1 )
by Evan
20:30
created
admin/class-yikes-inc-easy-mailchimp-extender-admin.php 1 patch
Spacing   +483 added lines, -483 removed lines patch added patch discarded remove patch
@@ -95,49 +95,49 @@  discard block
 block discarded – undo
95 95
 		/***********************/
96 96
 		/** Create A Form **/
97 97
 		/**********************/
98
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) {
98
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-form' ) {
99 99
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
100 100
 		}
101 101
 		/***********************/
102 102
 		/** Delete A Form **/
103 103
 		/**********************/
104
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) {
104
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-delete-form' ) {
105 105
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
106 106
 		}
107 107
 		/**********************************/
108 108
 		/** Duplicate/Clone A Form    **/
109 109
 		/********************************/
110
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) {
110
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-duplicate-form' ) {
111 111
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
112 112
 		}
113 113
 		/*************************************/
114 114
 		/**  Reset Form Impression Stats **/
115 115
 		/***********************************/
116
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) {
116
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-reset-stats' ) {
117 117
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
118 118
 		}
119 119
 		/**********************************/
120 120
 		/**         Update A Form        **/
121 121
 		/********************************/
122
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) {
122
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-update-form' ) {
123 123
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
124 124
 		}
125 125
 		/**************************************************/
126 126
 		/**     Clear Store MailChimp Transient Data   **/
127 127
 		/*************************************************/
128
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) {
128
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-transient-data' ) {
129 129
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
130 130
 		}
131 131
 		/*******************************************/
132 132
 		/** Remove a user from a mailing list     **/
133 133
 		/*****************************************/
134
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) {
134
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-unsubscribe-user' ) {
135 135
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
136 136
 		}
137 137
 		/*******************************************/
138 138
 		/**    Create misisng error log file  **/
139 139
 		/*****************************************/
140
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) {
140
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-error-log' ) {
141 141
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
142 142
 		}
143 143
 		/*******************************************/
@@ -160,37 +160,37 @@  discard block
 block discarded – undo
160 160
 		/**************************************************/
161 161
 		/**        Clear MailChimp Error Log Data        **/
162 162
 		/*************************************************/
163
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) {
163
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-error-log' ) {
164 164
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
165 165
 		}
166 166
 		/*********************************************/
167 167
 		/**        Export MailChimp Opt-in Forms   **/
168 168
 		/*******************************************/
169
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) {
169
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-forms' ) {
170 170
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
171 171
 		}
172 172
 		/*********************************************/
173 173
 		/**                Export Plugin Settings           **/
174 174
 		/*******************************************/
175
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) {
175
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-settings' ) {
176 176
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
177 177
 		}
178 178
 		/*******************************************/
179 179
 		/**        Import Class Inclusion       **/
180 180
 		/*****************************************/
181
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) {
181
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) {
182 182
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
183 183
 		}
184 184
 		/*******************************************/
185 185
 		/**    Premium Support Request     **/
186 186
 		/*****************************************/
187
-		if ( isset( $_POST['submit-premium-support-request'] ) ) {
187
+		if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) {
188 188
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
189 189
 		}
190 190
 		/****************************************/
191 191
 		/**    Dismiss Options Migrations        **/
192 192
 		/****************************************/
193
-		if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
193
+		if ( isset( $_REQUEST[ 'dismiss_migration_nonce' ] ) ) {
194 194
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
195 195
 		}
196 196
 		/** Parse default value into usable dynamic data **/
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
 		*	@ return	array	$links		New array of plugin actions
218 218
 		*/
219 219
 		public function easy_forms_plugin_action_links( $links ) {
220
-		   $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
221
-		   $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>';
220
+		   $links[ ] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) . '">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
221
+		   $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>';
222 222
 		   return $links;
223 223
 		}
224 224
 
@@ -251,29 +251,29 @@  discard block
 block discarded – undo
251 251
 		*	@return	parsed tag content
252 252
 		*/
253 253
 		public function parse_mailchimp_default_tag( $default_tag ) {
254
-			if( ! $default_tag || $default_tag == '' ) {
254
+			if ( ! $default_tag || $default_tag == '' ) {
255 255
 				return $default_tag;
256 256
 			}
257 257
 			global $post;
258 258
 			// page title
259
-			if( $default_tag == '{page_title}' ) {
259
+			if ( $default_tag == '{page_title}' ) {
260 260
 				$default_tag = get_the_title( $post->ID );
261 261
 			}
262 262
 			// page id
263
-			if( $default_tag == '{page_title}' ) {
263
+			if ( $default_tag == '{page_title}' ) {
264 264
 				$default_tag = $post->ID;
265 265
 			}
266 266
 			// page url
267
-			if( $default_tag == '{page_url}' ) {
267
+			if ( $default_tag == '{page_url}' ) {
268 268
 				$default_tag = get_permalink( $post->ID );
269 269
 			}
270 270
 			// blog name
271
-			if( $default_tag == '{blog_name}' ) {
271
+			if ( $default_tag == '{blog_name}' ) {
272 272
 				$default_tag = get_bloginfo( 'name' );
273 273
 			}
274 274
 			// is user logged in
275
-			if( $default_tag == '{user_logged_in}' ) {
276
-				if( is_user_logged_in() ) {
275
+			if ( $default_tag == '{user_logged_in}' ) {
276
+				if ( is_user_logged_in() ) {
277 277
 					$default_tag = 'Registered User';
278 278
 				} else {
279 279
 					$default_tag = 'Guest User';
@@ -291,12 +291,12 @@  discard block
 block discarded – undo
291 291
 		*/
292 292
 		public function yikes_easy_mailchimp_clear_error_log() {
293 293
 			// file put contents $returned error + other data
294
-			if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
294
+			if ( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
295 295
 				$clear_log = file_put_contents(
296 296
 					YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php',
297 297
 					''
298 298
 				);
299
-				if( $clear_log === false ) {
299
+				if ( $clear_log === false ) {
300 300
 					// redirect the user to the manage forms page, display error message
301 301
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error-log-cleared=false' ) ) );
302 302
 				} else {
@@ -314,17 +314,17 @@  discard block
 block discarded – undo
314 314
 		*/
315 315
 		public function yikes_easy_mailchimp_export_forms() {
316 316
 			// grab our nonce
317
-			$nonce = $_REQUEST['nonce'];
317
+			$nonce = $_REQUEST[ 'nonce' ];
318 318
 			// grab the forms
319
-			$forms = isset( $_REQUEST['export_forms'] ) ? $_REQUEST['export_forms'] : array();
319
+			$forms = isset( $_REQUEST[ 'export_forms' ] ) ? $_REQUEST[ 'export_forms' ] : array();
320 320
 			// validate nonce
321
-			if( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
322
-				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 ) );
321
+			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
322
+				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 ) );
323 323
 			}
324 324
 
325 325
 			// run the export function
326 326
 			// parameters: ( $table_name, $form_ids, $file_name )
327
-			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export('Yikes-Inc-Easy-MailChimp-Forms-Export', $forms );
327
+			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'Yikes-Inc-Easy-MailChimp-Forms-Export', $forms );
328 328
 			// re-direct the user back to the page
329 329
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) );
330 330
 			die();
@@ -338,10 +338,10 @@  discard block
 block discarded – undo
338 338
 		*/
339 339
 		public function yikes_easy_mailchimp_export_plugin_settings() {
340 340
 			// grab our nonce
341
-			$nonce = $_REQUEST['nonce'];
341
+			$nonce = $_REQUEST[ 'nonce' ];
342 342
 			// validate nonce
343
-			if( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
344
-				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 ) );
343
+			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
344
+				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 ) );
345 345
 			}
346 346
 
347 347
 			// run the export function
@@ -358,13 +358,13 @@  discard block
 block discarded – undo
358 358
 		*/
359 359
 		public function yikes_easy_mailchimp_import_forms() {
360 360
 			// grab our nonce
361
-			$nonce = $_REQUEST['nonce'];
361
+			$nonce = $_REQUEST[ 'nonce' ];
362 362
 			// validate nonce
363
-			if( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
364
-				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 ) );
363
+			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
364
+				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 ) );
365 365
 			}
366 366
 			// include the export class
367
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
367
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
368 368
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-import.class.php' );
369 369
 			}
370 370
 			// run the import function
@@ -382,15 +382,15 @@  discard block
 block discarded – undo
382 382
 		*/
383 383
 		public function yikes_easy_mailchimp_premium_support_request() {
384 384
 
385
-			if( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
386
-				return __( 'We encountered an error. Please contact the YIKES Inc. support team.' , 'yikes-inc-easy-mailchimp-extender' );
385
+			if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] != 'yikes-support-request' ) {
386
+				return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' );
387 387
 			}
388 388
 
389
-			$license = $_POST['license_key'];
390
-			$user_email = $_POST['user-email'];
391
-			$support_topic = $_POST['support-topic'];
392
-			$support_priority = $_POST['support-priority'];
393
-			$support_content = $_POST['support-content'];
389
+			$license = $_POST[ 'license_key' ];
390
+			$user_email = $_POST[ 'user-email' ];
391
+			$support_topic = $_POST[ 'support-topic' ];
392
+			$support_priority = $_POST[ 'support-priority' ];
393
+			$support_content = $_POST[ 'support-content' ];
394 394
 
395 395
 			// wp_die( print_r( $support_content) );
396 396
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 			) );
415 415
 
416 416
 			// catch the error
417
-			if( is_wp_error( $response ) ) {
417
+			if ( is_wp_error( $response ) ) {
418 418
 				wp_die( $response->getMessage() );
419 419
 				return;
420 420
 			}
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 			$create_ticket_response = wp_remote_retrieve_body( $response );
424 424
 
425 425
 			// display it
426
-			if( $create_ticket_response )
426
+			if ( $create_ticket_response )
427 427
 				echo $create_ticket_response;
428 428
 
429 429
 		}
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 			// delete the options and allow the user to manually updadte things
438 438
 
439 439
 			// Verify the NONCE is valid
440
-			check_admin_referer( 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' );
440
+			check_admin_referer( 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' );
441 441
 
442 442
 			// re-direct the user back to the page
443 443
 			wp_redirect( esc_url_raw( admin_url( 'index.php?yikes-mc-options-migration-dismissed="true"' ) ) );
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 		 * @since 6.0.0
453 453
 		 */
454 454
 		public function load_error_logging_class() {
455
-			if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
455
+			if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
456 456
 				// if error logging is enabled we should include our error logging class
457 457
 				/* Generate oure error logging table */
458 458
 				require_once YIKES_MC_PATH . '/includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
@@ -471,17 +471,17 @@  discard block
 block discarded – undo
471 471
 			// add a new option to store the plugin activation date/time
472 472
 			// @since v6.0.0
473 473
 			// this is used to notify the user that they should review after 2 weeks
474
-			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
474
+			if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
475 475
 				add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) );
476 476
 			}
477 477
 
478 478
 			$stop_bugging_me = get_option( 'yikes_easy_mailchimp_review_stop_bugging_me' );
479 479
 
480
-			if( !$stop_bugging_me ) {
480
+			if ( ! $stop_bugging_me ) {
481 481
 				$install_date = get_option( 'yikes_easy_mailchimp_activation_date' );
482 482
 				$past_date = strtotime( '-14 days' );
483 483
 				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
484
-					add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) );
484
+					add_action( 'admin_notices', array( $this, 'yikes_easy_mailchimp_display_review_us_notice' ) );
485 485
 				}
486 486
 			}
487 487
 
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
 		*/
495 495
 		public function yikes_easy_mailchimp_display_review_us_notice() {
496 496
 			/* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
497
-			if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
497
+			if ( in_array( get_current_screen()->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base, 'yikes-inc-easy-mailchimp' ) !== false ) {
498 498
 				// Review URL - Change to the URL of your plugin on WordPress.org
499 499
 				$reviewurl = 'https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender';
500 500
 				$addons_url = esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) );
501 501
 				$nobugurl = esc_url_raw( add_query_arg( 'yikes_easy_mc_icons_nobug', '1', admin_url() ) );
502 502
 				$review_message = '<div id="yikes-mailchimp-logo"></div>';
503
-				$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 ) . '';
503
+				$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 ) . '';
504 504
 				?>
505 505
 					<div id="review-yikes-easy-mailchimp-notice">
506 506
 						<?php echo $review_message; ?>
@@ -516,8 +516,8 @@  discard block
 block discarded – undo
516 516
 		*/
517 517
 		public function yikes_easy_mailchimp_stop_bugging_me() {
518 518
 			$nobug = "";
519
-			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) ) {
520
-				$nobug = (int) esc_attr( $_GET['yikes_easy_mc_icons_nobug'] );
519
+			if ( isset( $_GET[ 'yikes_easy_mc_icons_nobug' ] ) ) {
520
+				$nobug = (int) esc_attr( $_GET[ 'yikes_easy_mc_icons_nobug' ] );
521 521
 			}
522 522
 			if ( 1 == $nobug ) {
523 523
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', TRUE );
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 
529 529
 		/* Display a warning users who are using PHP < 5.3 */
530 530
 		public function display_php_warning() {
531
-			$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' );
531
+			$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' );
532 532
 			echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>";
533 533
 		}
534 534
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 		public function add_tinyMCE_buttons() {
540 540
 			global $typenow;
541 541
 			// only on Post Type: post and page
542
-			if( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
542
+			if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
543 543
 				return;
544 544
 			}
545 545
 			add_filter( 'mce_buttons', array( $this, 'yks_mc_add_tinymce_button' ) );
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 		public function yks_mc_add_tinymce_plugin( $plugin_array ) {
558 558
 			// wp_enqueue_script( 'tinymce_yikes', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', array( 'jquery', 'tiny_mce' ), $this->version, true );
559 559
 
560
-			$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
560
+			$plugin_array[ 'yks_mc_tinymce_button' ] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
561 561
 
562 562
 			return $plugin_array;
563 563
 
@@ -570,23 +570,23 @@  discard block
 block discarded – undo
570 570
 		*/
571 571
 		public function tinymce_yikes_easy_mc() {
572 572
 			// check capabilities
573
-			if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
573
+			if ( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
574 574
 				return;
575 575
 			}
576 576
 
577 577
 			$list_data = $this->form_interface->get_all_forms();
578 578
 			$lists = array();
579
-			if( !empty( $list_data ) ) {
579
+			if ( ! empty( $list_data ) ) {
580 580
 				// build an array to pass to our javascript
581
-				foreach( $list_data as $id => $form ) {
582
-					$lists[] = array(
583
-						'text'  => urlencode( $form['form_name'] ),
581
+				foreach ( $list_data as $id => $form ) {
582
+					$lists[ ] = array(
583
+						'text'  => urlencode( $form[ 'form_name' ] ),
584 584
 						'value' => $id,
585 585
 					);
586 586
 				}
587 587
 			} else {
588
-				$lists[0] = array(
589
-					'text' => __( 'Please Import Some MailChimp Lists' , 'yikes-inc-easy-mailchimp-extender' ),
588
+				$lists[ 0 ] = array(
589
+					'text' => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ),
590 590
 					'value' => '-'
591 591
 				);
592 592
 			}
@@ -596,10 +596,10 @@  discard block
 block discarded – undo
596 596
 				'forms' => json_encode( $lists ),
597 597
 				'button_title' => __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ),
598 598
 				'popup_title' => __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ),
599
-				'list_id_label' => __( 'MailChimp Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ),
600
-				'show_title_label' => __( 'Display Form Title' , 'yikes-inc-easy-mailchimp-extender' ),
601
-				'show_description_label' => __( 'Display Form Description' , 'yikes-inc-easy-mailchimp-extender' ),
602
-				'submit_button_text_label' => __( 'Custom Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ),
599
+				'list_id_label' => __( 'MailChimp Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ),
600
+				'show_title_label' => __( 'Display Form Title', 'yikes-inc-easy-mailchimp-extender' ),
601
+				'show_description_label' => __( 'Display Form Description', 'yikes-inc-easy-mailchimp-extender' ),
602
+				'submit_button_text_label' => __( 'Custom Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ),
603 603
 				'submit_button_message' => '<em>' . __( 'If left empty, the button will use the default submit button text .', 'yikes-inc-easy-mailchimp-extender' ) . '</em>',
604 604
 				'alert_translated' => 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' ) ),
605 605
 			) );
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 		if ( get_option( 'yikes_mailchimp_activation_redirect', 'true' ) == 'true' ) {
616 616
 			update_option( 'yikes_mailchimp_activation_redirect', 'false' );
617 617
 			/* If the user had this plugin activated prior to today, redirect to 'Whats New' */
618
-			if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
618
+			if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
619 619
 				wp_redirect( esc_url( admin_url( 'admin.php?page=yikes-mailchimp-welcome' ) ) );
620 620
 			} else {
621 621
 				/* Else redirect the user over to the 'Getting Started' tab */
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 	 * @since    6.0.0
668 668
 	 */
669 669
 	public function enqueue_scripts() {
670
-		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery' , 'jquery-ui-sortable' ), $this->version, false );
670
+		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery', 'jquery-ui-sortable' ), $this->version, false );
671 671
 
672 672
 		$localized_data = array(
673 673
 			'admin_url'                => esc_url_raw( admin_url() ),
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 			'preloader_url'            => esc_url_raw( admin_url( '/images/wpspin_light.gif' ) ),
678 678
 		);
679 679
 
680
-		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js' , 'object_data' , $localized_data );
680
+		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js', 'object_data', $localized_data );
681 681
 
682 682
 		// Enqueue required scripts for the form editor
683 683
 		$screen = get_current_screen();
@@ -690,8 +690,8 @@  discard block
 block discarded – undo
690 690
 
691 691
 		wp_enqueue_style( 'wp-color-picker' );
692 692
 		wp_enqueue_script( 'wp-color-picker' );
693
-		wp_enqueue_script( 'jquery.timepicker.js',YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js' , array( 'jquery' ) , $this->version, false );
694
-		wp_enqueue_script( 'edit-form-js' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js' , array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ) , $this->version, false );
693
+		wp_enqueue_script( 'jquery.timepicker.js', YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ), $this->version, false );
694
+		wp_enqueue_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ), $this->version, false );
695 695
 
696 696
 		$localized_data = array(
697 697
 			'ajax_url'                          => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 			'isRTL'                             => $wp_locale->is_rtl(),
717 717
 			'start_date_exceeds_end_date_error' => __( 'Error: The start date and time cannot occur after the end date and time. Chosen date reverted to previous selection.', 'yikes-inc-easy-mailchimp-extender' ),
718 718
 		);
719
-		wp_localize_script( 'edit-form-js' , 'yikes_mailchimp_edit_form' , $localized_data );
719
+		wp_localize_script( 'edit-form-js', 'yikes_mailchimp_edit_form', $localized_data );
720 720
 	}
721 721
 
722 722
 	/**
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 	 * Convert the php date format string to a js date format
779 779
 	 */
780 780
 	public function yikes_jQuery_datepicker_date_format( $site_option ) {
781
-		switch( $site_option ) {
781
+		switch ( $site_option ) {
782 782
 			//Predefined WP date formats
783 783
 			default:
784 784
 			case 'F j, Y':
@@ -802,9 +802,9 @@  discard block
 block discarded – undo
802 802
 
803 803
 		/* Top Level Menu 'Easy MailChimp' */
804 804
 		add_menu_page(
805
-			__( 'Easy Forms' , 'yikes-inc-easy-mailchimp-extender' ),
805
+			__( 'Easy Forms', 'yikes-inc-easy-mailchimp-extender' ),
806 806
 			'Easy Forms',
807
-			apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
807
+			apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
808 808
 			'yikes-inc-easy-mailchimp',
809 809
 			'', // no callback,
810 810
 			YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_wink_icon.png'
@@ -818,9 +818,9 @@  discard block
 block discarded – undo
818 818
 				/* YIKES Inc. Easy MailChimp Manage Forms */
819 819
 				add_submenu_page(
820 820
 					'yikes-inc-easy-mailchimp',
821
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
822
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
823
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
821
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
822
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
823
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
824 824
 					'yikes-inc-easy-mailchimp',
825 825
 					array( $this, 'generateManageFormsPage' )
826 826
 				);
@@ -828,9 +828,9 @@  discard block
 block discarded – undo
828 828
 				/* YIKES Inc. Easy MailChimp Manage Lists */
829 829
 				add_submenu_page(
830 830
 					'yikes-inc-easy-mailchimp',
831
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
832
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
833
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
831
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
832
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
833
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
834 834
 					'yikes-inc-easy-mailchimp-lists',
835 835
 					array( $this, 'generateManageListsPage' )
836 836
 				);
@@ -844,13 +844,13 @@  discard block
 block discarded – undo
844 844
 
845 845
 
846 846
 			/* YIKES Inc. Easy MailChimp Account Overview */
847
-			if ( get_option('yikes-mc-api-validation') == 'valid_api_key' ) {
847
+			if ( get_option( 'yikes-mc-api-validation' ) == 'valid_api_key' ) {
848 848
 				/* YIKES Inc. Easy MailChimp Settings */
849 849
 				add_submenu_page(
850 850
 					'yikes-inc-easy-mailchimp',
851
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
852
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
853
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
851
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
852
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
853
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
854 854
 					'yikes-inc-easy-mailchimp-account-overview',
855 855
 					array( $this, 'generateAccountDetailsPage' )
856 856
 				);
@@ -860,9 +860,9 @@  discard block
 block discarded – undo
860 860
 			/* YIKES Inc. Easy MailChimp Settings */
861 861
 			add_submenu_page(
862 862
 				'yikes-inc-easy-mailchimp',
863
-				__( 'Settings.' , 'yikes-inc-easy-mailchimp-extender' ),
864
-				__( 'Settings' , 'yikes-inc-easy-mailchimp-extender' ),
865
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
863
+				__( 'Settings.', 'yikes-inc-easy-mailchimp-extender' ),
864
+				__( 'Settings', 'yikes-inc-easy-mailchimp-extender' ),
865
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
866 866
 				'yikes-inc-easy-mailchimp-settings',
867 867
 				array( $this, 'generatePageOptions' )
868 868
 			);
@@ -870,9 +870,9 @@  discard block
 block discarded – undo
870 870
 			/* Support Page */
871 871
 			add_submenu_page(
872 872
 				'yikes-inc-easy-mailchimp',
873
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
874
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
875
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
873
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
874
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
875
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
876 876
 				'yikes-inc-easy-mailchimp-support',
877 877
 				array( $this, 'generateSupportPage' )
878 878
 			);
@@ -880,11 +880,11 @@  discard block
 block discarded – undo
880 880
 			/* Add-Ons Page */
881 881
 			add_submenu_page(
882 882
 				'yikes-inc-easy-mailchimp',
883
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
884
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
885
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
883
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
884
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
885
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
886 886
 				'yikes-inc-easy-mailchimp-addons',
887
-				array( $this , 'generateAddOnsPage' )
887
+				array( $this, 'generateAddOnsPage' )
888 888
 			);
889 889
 
890 890
 			/** Hidden Pages **/
@@ -892,9 +892,9 @@  discard block
 block discarded – undo
892 892
 				/* Add Hidden Edit Form Page */
893 893
 				add_submenu_page(
894 894
 					'options.php',
895
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
896
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
897
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
895
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
896
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
897
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
898 898
 					'yikes-mailchimp-edit-form',
899 899
 					array( $this, 'generateEditFormPage' )
900 900
 				);
@@ -902,19 +902,19 @@  discard block
 block discarded – undo
902 902
 				/* Add Hidden Migrate Options Page */
903 903
 				add_submenu_page(
904 904
 					'options-writing.php',
905
-					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure' , 'yikes-inc-easy-mailchimp-extender' ),
905
+					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure', 'yikes-inc-easy-mailchimp-extender' ),
906 906
 					'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure',
907 907
 					'manage_options',
908
-					'yikes-inc-easy-mailchimp-update' ,
909
-					array( $this , 'migrate_old_yks_mc_options' )
908
+					'yikes-inc-easy-mailchimp-update',
909
+					array( $this, 'migrate_old_yks_mc_options' )
910 910
 				);
911 911
 
912 912
 				/* Add Hidden Welcome Page */
913 913
 				add_submenu_page(
914 914
 					'options.php',
915
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
916
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
917
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
915
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
916
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
917
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
918 918
 					'yikes-mailchimp-welcome',
919 919
 					array( $this, 'generateWelcomePage' )
920 920
 				);
@@ -922,9 +922,9 @@  discard block
 block discarded – undo
922 922
 				/* Add Hidden 'View List' Page */
923 923
 				add_submenu_page(
924 924
 					'options.php',
925
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
926
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
927
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
925
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
926
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
927
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
928 928
 					'yikes-mailchimp-view-list',
929 929
 					array( $this, 'generateViewListPage' )
930 930
 				);
@@ -932,9 +932,9 @@  discard block
 block discarded – undo
932 932
 				/* Add Hidden View User Page */
933 933
 				add_submenu_page(
934 934
 					'options.php',
935
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
936
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
937
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
935
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
936
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
937
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
938 938
 					'yikes-mailchimp-view-user',
939 939
 					array( $this, 'generateViewUserPage' )
940 940
 				);
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
 		/* Register General Settings Section */
1033 1033
 
1034
-		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this , 'yikes_mc_validate_api_key' ) );
1034
+		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this, 'yikes_mc_validate_api_key' ) );
1035 1035
 
1036 1036
 		add_settings_section(
1037 1037
 			'yikes_easy_mc_settings_general_section_callback',
@@ -1074,16 +1074,16 @@  discard block
 block discarded – undo
1074 1074
 		add_settings_field(
1075 1075
 			'optin-checkbox-init',
1076 1076
 			__( 'Select Checkboxes to Generate', 'yikes-inc-easy-mailchimp-extender' ),
1077
-			'',  // callback + validation inside of admin/partials/menu/options.php
1077
+			'', // callback + validation inside of admin/partials/menu/options.php
1078 1078
 			'yikes_inc_easy_mc_checkbox_settings'
1079 1079
 		);
1080 1080
 		/* End Checkbox Settings */
1081 1081
 
1082 1082
 		/* reCAPTCHA Settings */
1083 1083
 
1084
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-status' );
1085
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-site-key' );
1086
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-secret-key' );
1084
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-status' );
1085
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-site-key' );
1086
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-secret-key' );
1087 1087
 
1088 1088
 			/* Register reCAPTCHA Settings Section */
1089 1089
 			add_settings_section(
@@ -1096,28 +1096,28 @@  discard block
 block discarded – undo
1096 1096
 			add_settings_field(
1097 1097
 				'yikes-mc-recaptcha-site-key',
1098 1098
 				__( 'Enter reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ),
1099
-				'',  // callback + validation inside of admin/partials/menu/options.php
1099
+				'', // callback + validation inside of admin/partials/menu/options.php
1100 1100
 				'yikes_easy_mc_settings_recpatcha_section'
1101 1101
 			);
1102 1102
 
1103 1103
 			add_settings_field(
1104 1104
 				'yikes-mc-recaptcha-secret-key',
1105 1105
 				__( 'Enter reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ),
1106
-				'',  // callback + validation inside of admin/partials/menu/options.php
1106
+				'', // callback + validation inside of admin/partials/menu/options.php
1107 1107
 				'yikes_easy_mc_settings_recpatcha_section'
1108 1108
 			);
1109 1109
 
1110 1110
 			add_settings_field(
1111 1111
 				'yikes-mc-recaptcha-status',
1112 1112
 				__( 'Enable ReCaptcha', 'yikes-inc-easy-mailchimp-extender' ),
1113
-				'',  // callback + validation inside of admin/partials/menu/options.php
1113
+				'', // callback + validation inside of admin/partials/menu/options.php
1114 1114
 				'yikes_easy_mc_settings_recpatcha_section'
1115 1115
 			);
1116 1116
 
1117 1117
 		/* End reCAPTCHA Settings */
1118 1118
 
1119 1119
 		/* Debug Settings */
1120
-			register_setting( 'yikes_inc_easy_mc_debug_settings_page' , 'yikes-mailchimp-debug-status' );
1120
+			register_setting( 'yikes_inc_easy_mc_debug_settings_page', 'yikes-mailchimp-debug-status' );
1121 1121
 
1122 1122
 			/* Register Debug Settings Section */
1123 1123
 			add_settings_section(
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 			add_settings_field(
1131 1131
 				'yikes-mailchimp-debug-status',
1132 1132
 				__( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ),
1133
-				'',  // callback + validation inside of admin/partials/menu/options.php
1133
+				'', // callback + validation inside of admin/partials/menu/options.php
1134 1134
 				'yikes_easy_mc_settings_debug_section'
1135 1135
 			);
1136 1136
 
@@ -1146,17 +1146,17 @@  discard block
 block discarded – undo
1146 1146
 	*	@since complete re-write
1147 1147
 	**/
1148 1148
 	function yikes_mc_validate_api_key( $input ) {
1149
-		if( $input === '' ) {
1150
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1149
+		if ( $input === '' ) {
1150
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1151 1151
 			return;
1152 1152
 		}
1153
-		$api_key = strip_tags ( trim( $input ) );
1153
+		$api_key = strip_tags( trim( $input ) );
1154 1154
 		$dash_position = strpos( trim( $input ), '-' );
1155
-		if( $dash_position !== false ) {
1155
+		if ( $dash_position !== false ) {
1156 1156
 			$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/ping.json';
1157 1157
 		} else {
1158 1158
 			update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) );
1159
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1159
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1160 1160
 			return $api_key;
1161 1161
 		}
1162 1162
 		$request_args = array(
@@ -1167,19 +1167,19 @@  discard block
 block discarded – undo
1167 1167
 			'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
1168 1168
 		);
1169 1169
 		$api_key_response = wp_remote_post( $api_endpoint, $request_args );
1170
-		if( ! is_wp_error( $api_key_response ) ) {
1170
+		if ( ! is_wp_error( $api_key_response ) ) {
1171 1171
 			$body = json_decode( wp_remote_retrieve_body( $api_key_response ), true );
1172
-			if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) {
1173
-				update_option( 'yikes-mc-api-validation' , 'valid_api_key' );
1172
+			if ( isset( $body[ 'msg' ] ) && $body[ 'msg' ] == "Everything's Chimpy!" ) {
1173
+				update_option( 'yikes-mc-api-validation', 'valid_api_key' );
1174 1174
 				// Clear the API key transient data
1175 1175
 				$this->delete_yikes_mailchimp_transients();
1176 1176
 			}
1177
-		}  else {
1177
+		} else {
1178 1178
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
1179 1179
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1180
-			$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' ) );
1181
-			update_option( 'yikes-mc-api-invalid-key-response' , $api_key_response->get_error_message() );
1182
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1180
+			$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' ) );
1181
+			update_option( 'yikes-mc-api-invalid-key-response', $api_key_response->get_error_message() );
1182
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1183 1183
 		}
1184 1184
 		// returned the api key
1185 1185
 		return $api_key;
@@ -1200,13 +1200,13 @@  discard block
 block discarded – undo
1200 1200
 	*	to form fields. (input, dropdowns, buttons etc.)
1201 1201
 	* 	@since v5.5 re-write
1202 1202
 	**/
1203
-	public function is_user_mc_api_valid_form( $echo=true ) {
1204
-		if( $echo == true ) {
1205
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1203
+	public function is_user_mc_api_valid_form( $echo = true ) {
1204
+		if ( $echo == true ) {
1205
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1206 1206
 				echo 'disabled="disabled"';
1207 1207
 			}
1208 1208
 		} else {
1209
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1209
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1210 1210
 				return false;
1211 1211
 			} else {
1212 1212
 				return true;
@@ -1226,11 +1226,11 @@  discard block
 block discarded – undo
1226 1226
 	public function check_for_old_yks_mc_options() {
1227 1227
 		$old_plugin_options = get_option( 'ykseme_storage' );
1228 1228
 		// only perform options migrations if the site is not a multi-site setup
1229
-		if ( !is_multisite() ) {
1230
-			if( apply_filters( 'yikes_mc_old_options_filter' , $old_plugin_options ) ) {
1229
+		if ( ! is_multisite() ) {
1230
+			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1231 1231
 				// display a notice to the user that they should 'migrate'
1232 1232
 				// from the old plugin settings to the new ones
1233
-				add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 );
1233
+				add_action( 'admin_notices', array( $this, 'display_options_migrate_notice' ), 11 );
1234 1234
 			}
1235 1235
 		}
1236 1236
 	}
@@ -1263,11 +1263,11 @@  discard block
 block discarded – undo
1263 1263
 
1264 1264
 			// Confirm that the necessary forms table in the database exists, else bail
1265 1265
 			global $wpdb;
1266
-			if( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1266
+			if ( $wpdb->get_var( "show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'" ) != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1267 1267
 				return;
1268 1268
 			}
1269 1269
 
1270
-			if( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1270
+			if ( isset( $_GET[ 'yikes-mc-options-migration-dismissed' ] ) && $_GET[ 'yikes-mc-options-migration-dismissed' ] == 'true' ) {
1271 1271
 					// Delete the options, start a-new! (this will disable the migration notice altogether)
1272 1272
 					delete_option( 'widget_yikes_mc_widget' );
1273 1273
 					delete_option( 'api_validation' );
@@ -1281,18 +1281,18 @@  discard block
 block discarded – undo
1281 1281
 			} else {
1282 1282
 			?>
1283 1283
 				<div class="yikes-easy-mc-updated migrate-options-notice">
1284
-					<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>
1284
+					<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 1285
 					<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>
1286 1286
 					<p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1287 1287
 					<section id="migration-buttons">
1288 1288
 						<!-- migrate button -->
1289 1289
 						<form>
1290 1290
 							<input type="hidden" name="yikes-mc-update-option-structure" value="yikes-mc-update-option-structure" />
1291
-							<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>
1291
+							<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 1292
 						</form>
1293 1293
 						<!-- dismiss button -->
1294 1294
 						<form>
1295
-							<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>
1295
+							<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 1296
 						</form>
1297 1297
 					</section>
1298 1298
 
@@ -1306,9 +1306,9 @@  discard block
 block discarded – undo
1306 1306
 		*	and return the index ( used to find the list name assigned to a form )
1307 1307
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1308 1308
 		*/
1309
-		function findMCListID($id, $array) {
1310
-		   foreach ($array as $key => $val) {
1311
-			   if ($val['id'] === $id) {
1309
+		function findMCListID( $id, $array ) {
1310
+		   foreach ( $array as $key => $val ) {
1311
+			   if ( $val[ 'id' ] === $id ) {
1312 1312
 				   return $key;
1313 1313
 			   }
1314 1314
 		   }
@@ -1318,9 +1318,9 @@  discard block
 block discarded – undo
1318 1318
 		/* Ajax Migrate Options */
1319 1319
 		function migrate_archived_options() {
1320 1320
 			// all options prefixed with 'yikes-mc-'
1321
-			$option_name = 'yikes-mc-'.$_POST['option_name'];
1322
-			$option_value = $_POST['option_value'];
1323
-			if( json_decode( $option_value ) ) {
1321
+			$option_name = 'yikes-mc-' . $_POST[ 'option_name' ];
1322
+			$option_value = $_POST[ 'option_value' ];
1323
+			if ( json_decode( $option_value ) ) {
1324 1324
 				// decode our lists() array, and store it
1325 1325
 				$opt_value = json_decode( $option_value, true );
1326 1326
 			} else {
@@ -1333,23 +1333,23 @@  discard block
 block discarded – undo
1333 1333
 
1334 1334
 		/* Ajax Migrate Forms */
1335 1335
 		function migrate_previously_setup_forms() {
1336
-			$option_name = $_POST['option_name'];
1337
-			$done = $_POST['done_import'];
1336
+			$option_name = $_POST[ 'option_name' ];
1337
+			$done = $_POST[ 'done_import' ];
1338 1338
 			// Create some starter forms for the user
1339 1339
 			// based on previously imported lists (to our old version)
1340
-			if( $option_name == 'yikes-mc-lists' ) {
1341
-				$option_value = $_POST['option_value'];
1342
-				$new_options = json_decode( stripslashes_deep( $option_value ) , true );
1340
+			if ( $option_name == 'yikes-mc-lists' ) {
1341
+				$option_value = $_POST[ 'option_value' ];
1342
+				$new_options = json_decode( stripslashes_deep( $option_value ), true );
1343 1343
 
1344
-				$list_id = $new_options['id'];
1345
-				$form_name = $new_options['name'];
1346
-				$fields = $new_options['fields']; // our fields array
1344
+				$list_id = $new_options[ 'id' ];
1345
+				$form_name = $new_options[ 'name' ];
1346
+				$fields = $new_options[ 'fields' ]; // our fields array
1347 1347
 
1348
-				$custom_styles = isset( $new_options['custom_styles'] ) ? $new_options['custom_styles']: '0'; // store as an array with all of our styles
1349
-				$custom_template = isset( $new_options['custom_template'] ) ? $new_options['custom_template'] : '0'; // store template data as an array ( active , template used )
1350
-				$send_welcome_email = isset( $new_options['yks_mailchimp_send_welcome_'.$list_id] ) ? '0' : '1';
1351
-				$redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1352
-				$redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1348
+				$custom_styles = isset( $new_options[ 'custom_styles' ] ) ? $new_options[ 'custom_styles' ] : '0'; // store as an array with all of our styles
1349
+				$custom_template = isset( $new_options[ 'custom_template' ] ) ? $new_options[ 'custom_template' ] : '0'; // store template data as an array ( active , template used )
1350
+				$send_welcome_email = isset( $new_options[ 'yks_mailchimp_send_welcome_' . $list_id ] ) ? '0' : '1';
1351
+				$redirect_user_on_submit = isset( $new_options[ 'yks_mailchimp_redirect_' . $list_id ] ) ? '1' : '0';
1352
+				$redirect_page = isset( $new_options[ 'page_id_' . $list_id ] ) ? $new_options[ 'page_id_' . $list_id ] : '';
1353 1353
 
1354 1354
 				/* Insert Forms Function  */
1355 1355
 				$this->form_interface->create_form( array(
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
 					'custom_fields'           => '',
1372 1372
 				) );
1373 1373
 			}
1374
-			if( $done == 'done' ) {
1374
+			if ( $done == 'done' ) {
1375 1375
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => true ) );
1376 1376
 			} else {
1377 1377
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => false ) );
@@ -1386,35 +1386,35 @@  discard block
 block discarded – undo
1386 1386
 		*	@since v5.6 - complete re-write
1387 1387
 		*/
1388 1388
 		public function generate_options_pages_sidebar_menu() {
1389
-			if( isset( $_REQUEST['section'] ) ) {
1390
-				$selected = $_REQUEST['section'];
1389
+			if ( isset( $_REQUEST[ 'section' ] ) ) {
1390
+				$selected = $_REQUEST[ 'section' ];
1391 1391
 			}
1392
-			$installed_addons = get_option( 'yikes-easy-mc-active-addons' , array() );
1392
+			$installed_addons = get_option( 'yikes-easy-mc-active-addons', array() );
1393 1393
 			// sort our addons array alphabetically so they appear in similar orders across all sites
1394 1394
 			asort( $installed_addons );
1395 1395
 			?>
1396
-				<h3><span><?php _e( 'Additional Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1396
+				<h3><span><?php _e( 'Additional Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1397 1397
 				<div class="inside">
1398 1398
 					<ul id="settings-nav">
1399
-						<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>
1400
-						<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>
1401
-						<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>
1402
-						<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>
1403
-						<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>
1404
-						<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>
1399
+						<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>
1400
+						<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>
1401
+						<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>
1402
+						<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>
1403
+						<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>
1404
+						<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>
1405 1405
 					</ul>
1406 1406
 					<?php
1407 1407
 						// create our add-on settings pages
1408
-						if( !empty( $installed_addons ) ) {
1408
+						if ( ! empty( $installed_addons ) ) {
1409 1409
 							?>
1410 1410
 							<hr class="add-on-settings-divider" />
1411
-							<strong><?php _e( 'Addon Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1411
+							<strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1412 1412
 							<ul id="addon-settings-nav">
1413 1413
 							<?php
1414
-							foreach( $installed_addons as $addon_name ) {
1414
+							foreach ( $installed_addons as $addon_name ) {
1415 1415
 								?>
1416 1416
 									<li>
1417
-										<?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>
1417
+										<?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>
1418 1418
 								<?php
1419 1419
 							}
1420 1420
 							?>
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 				)
1443 1443
 			);
1444 1444
 			?>
1445
-				<h3><?php _e( 'Create a New Signup Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1445
+				<h3><?php _e( 'Create a New Signup Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1446 1446
 
1447 1447
 				<div class="inside">
1448 1448
 
@@ -1451,31 +1451,31 @@  discard block
 block discarded – undo
1451 1451
 					<form id="import-list-to-site" method="POST" action="<?php echo $url; ?>">
1452 1452
 						<input type="hidden" name="import-list-to-site" value="1" />
1453 1453
 						<!-- Name your new form -->
1454
-						<label for="form-name"><strong><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1455
-							<input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required>
1454
+						<label for="form-name"><strong><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1455
+							<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>
1456 1456
 						</label>
1457 1457
 						<!-- Name your new form -->
1458
-						<label for="form-description"><strong><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1459
-							<textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea>
1458
+						<label for="form-description"><strong><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1459
+							<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>
1460 1460
 						</label>
1461 1461
 						<!-- Associate this form with a list! -->
1462
-						<label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1463
-							<select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); if( isset( $lists ) && empty( $lists ) ) { echo 'disabled="disabled"'; } ?>>
1462
+						<label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1463
+							<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"'; } ?>>
1464 1464
 								<?php
1465
-									if( isset( $lists ) && !empty( $lists ) ) {
1466
-										foreach( $lists as $mailing_list ) {
1465
+									if ( isset( $lists ) && ! empty( $lists ) ) {
1466
+										foreach ( $lists as $mailing_list ) {
1467 1467
 											?>
1468
-												<option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1468
+												<option value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option>
1469 1469
 											<?php
1470 1470
 										}
1471 1471
 									} else {
1472
-										if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1472
+										if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1473 1473
 											?>
1474
-												<option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1474
+												<option><?php echo __( "Please enter a valid API key.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1475 1475
 											<?php
1476 1476
 										} else {
1477 1477
 											?>
1478
-												<option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1478
+												<option><?php echo __( "No lists were found on the account.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1479 1479
 											<?php
1480 1480
 
1481 1481
 										}
@@ -1484,8 +1484,8 @@  discard block
 block discarded – undo
1484 1484
 							</select>
1485 1485
 
1486 1486
 							<?php
1487
-							if ( isset( $_GET['transient-cleared'] ) ) {
1488
-								if ( 'true' === $_GET['transient-cleared'] ) {
1487
+							if ( isset( $_GET[ 'transient-cleared' ] ) ) {
1488
+								if ( 'true' === $_GET[ 'transient-cleared' ] ) {
1489 1489
 									?>
1490 1490
 									<div class="yikes-list-refreshed-notice">
1491 1491
 										<p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -1494,11 +1494,11 @@  discard block
 block discarded – undo
1494 1494
 								}
1495 1495
 							}
1496 1496
 
1497
-							if( isset( $lists ) && empty( $lists ) ) {
1498
-								if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'invalid_api_key' ) {
1497
+							if ( isset( $lists ) && empty( $lists ) ) {
1498
+								if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1499 1499
 									?>
1500 1500
 										<p class="description">
1501
-											<?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' ) ); ?>
1501
+											<?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' ) ); ?>
1502 1502
 										</p>
1503 1503
 									<?php
1504 1504
 								}
@@ -1506,12 +1506,12 @@  discard block
 block discarded – undo
1506 1506
 							?>
1507 1507
 						</label>
1508 1508
 						<?php
1509
-							if( $this->is_user_mc_api_valid_form( false ) ) {
1510
-								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary' , '' , false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1509
+							if ( $this->is_user_mc_api_valid_form( false ) ) {
1510
+								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ), 'primary', '', false, array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1511 1511
 							} else {
1512
-								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1512
+								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1513 1513
 								?>
1514
-									<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>
1514
+									<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>
1515 1515
 								<?php
1516 1516
 							}
1517 1517
 						?>
@@ -1519,10 +1519,10 @@  discard block
 block discarded – undo
1519 1519
 
1520 1520
 					<!-- Clear API CACHE -->
1521 1521
 					<?php
1522
-					if( isset( $lists ) && ! empty( $lists ) ) {
1522
+					if ( isset( $lists ) && ! empty( $lists ) ) {
1523 1523
 						if ( false !== get_transient( 'yikes-easy-mailchimp-list-data' ) ) { ?>
1524
-							<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">
1525
-								<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1524
+							<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">
1525
+								<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists', 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1526 1526
 							</form>
1527 1527
 						<?php }
1528 1528
 					}
@@ -1538,14 +1538,14 @@  discard block
 block discarded – undo
1538 1538
 		public function generate_page_redirect_dropdown( $redirect, $redirect_page, $custom_redirect_url ) {
1539 1539
 				$post_types = get_post_types();
1540 1540
 				?>
1541
-				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1542
-					<?php _e( "Select A Page or Post" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1541
+				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1542
+					<?php _e( "Select A Page or Post", 'yikes-inc-easy-mailchimp-extender' ); ?>
1543 1543
 					<select id="redirect-user-to-selection" name="redirect-user-to-selection" onchange="shouldWeDisplayCustomURL( this );return;">
1544 1544
 				<?php
1545 1545
 					// loop over registered post types, and query!
1546
-						foreach( $post_types as $registered_post_type ) {
1546
+						foreach ( $post_types as $registered_post_type ) {
1547 1547
 							// exclude a few built in custom post types
1548
-							if( ! in_array( $registered_post_type , array( 'attachment' , 'revision' , 'nav_menu_item' ) ) ) {
1548
+							if ( ! in_array( $registered_post_type, array( 'attachment', 'revision', 'nav_menu_item' ) ) ) {
1549 1549
 								// run our query, to retreive the posts
1550 1550
 								$pages = get_posts( array(
1551 1551
 									'order' => 'ASC',
@@ -1555,12 +1555,12 @@  discard block
 block discarded – undo
1555 1555
 									'numberposts' => -1
1556 1556
 								) );
1557 1557
 								// only show cpt's that have posts assigned
1558
-								if( !empty( $pages ) ) {
1558
+								if ( ! empty( $pages ) ) {
1559 1559
 									?>
1560
-									<optgroup label="<?php echo ucwords( str_replace( '_' , ' ' , $registered_post_type ) ); ?>">
1560
+									<optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>">
1561 1561
 									<?php
1562
-										foreach( $pages as $page ) {
1563
-											?><option <?php selected( $redirect_page , $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1562
+										foreach ( $pages as $page ) {
1563
+											?><option <?php selected( $redirect_page, $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1564 1564
 										}
1565 1565
 									?>
1566 1566
 									<option <?php selected( $redirect_page, 'custom_url' ); ?> value="custom_url"><?php echo __( 'Custom URL', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
@@ -1572,8 +1572,8 @@  discard block
 block discarded – undo
1572 1572
 					?>
1573 1573
 					</select>
1574 1574
 
1575
-					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1576
-						<?php _e( "Enter Custom URL" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1575
+					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if ( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1576
+						<?php _e( "Enter Custom URL", 'yikes-inc-easy-mailchimp-extender' ); ?>
1577 1577
 						<input type="text" class="widefat custom-redirect-url" name="custom-redirect-url" value="<?php echo $custom_redirect_url; ?>" />
1578 1578
 					</label>
1579 1579
 
@@ -1590,11 +1590,11 @@  discard block
 block discarded – undo
1590 1590
 		public function generate_show_some_love_container() {
1591 1591
 			// if no active add-ons are installed,
1592 1592
 			// lets display our branding and add-on sidebar
1593
-			if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) {
1593
+			if ( get_option( 'yikes-easy-mc-active-addons', array() ) == array() ) {
1594 1594
 
1595 1595
 				/* On Edit Forms Page Display Upsell to Customizer */
1596 1596
 				$screen = get_current_screen();
1597
-				if( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1597
+				if ( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1598 1598
 				?>
1599 1599
 
1600 1600
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
@@ -1608,11 +1608,11 @@  discard block
 block discarded – undo
1608 1608
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
1609 1609
 
1610 1610
 						<!-- review us container -->
1611
-						<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>
1611
+						<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>
1612 1612
 						<div id="review-yikes-easy-mc" class="inside">
1613 1613
 
1614 1614
 							<p>
1615
-								<?php _e( 'Leave a review' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1615
+								<?php _e( 'Leave a review', 'yikes-inc-easy-mailchimp-extender' ); ?>
1616 1616
 								<p class="star-container">
1617 1617
 									<a href="https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender" target="_blank">
1618 1618
 										<b class="dashicons dashicons-star-filled"></b>
@@ -1624,21 +1624,21 @@  discard block
 block discarded – undo
1624 1624
 								</p>
1625 1625
 							</p>
1626 1626
 
1627
-							<?php _e( 'Tweet about it' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1627
+							<?php _e( 'Tweet about it', 'yikes-inc-easy-mailchimp-extender' ); ?>
1628 1628
 							<p class="sidebar-container">
1629 1629
 								<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>
1630 1630
 								<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>
1631 1631
 							</p>
1632 1632
 
1633
-							<?php _e( 'Vote that the plugin works' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1633
+							<?php _e( 'Vote that the plugin works', 'yikes-inc-easy-mailchimp-extender' ); ?>
1634 1634
 							<p class="sidebar-container">
1635 1635
 								<a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">
1636
-									<?php _e( 'Vote for Compatibility' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1636
+									<?php _e( 'Vote for Compatibility', 'yikes-inc-easy-mailchimp-extender' ); ?>
1637 1637
 								</a>
1638 1638
 							</p>
1639 1639
 						</div>
1640 1640
 
1641
-						<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>
1641
+						<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>
1642 1642
 
1643 1643
 						<section id="about-yikes-inc" class="inside">
1644 1644
 							<a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc.">
@@ -1654,10 +1654,10 @@  discard block
 block discarded – undo
1654 1654
 					<div class="postbox yikes-easy-mc-postbox">
1655 1655
 
1656 1656
 						<!-- review us container -->
1657
-						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1657
+						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1658 1658
 						<div id="review-yikes-easy-mc" class="inside">
1659
-							<p><?php _e( "Check out available add-ons for some seriously enhanced features." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1660
-							<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>
1659
+							<p><?php _e( "Check out available add-ons for some seriously enhanced features.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1660
+							<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>
1661 1661
 						</div>
1662 1662
 
1663 1663
 					</div>
@@ -1682,15 +1682,15 @@  discard block
 block discarded – undo
1682 1682
 		public function generate_form_editor( $form_fields, $list_id, $merge_variables, $interest_groups ) {
1683 1683
 
1684 1684
 			// if no list id, die!
1685
-			if( ! $list_id ) {
1686
-				wp_die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) );
1685
+			if ( ! $list_id ) {
1686
+				wp_die( __( "We've encountered an error. No list ID was sent.", 'yikes-inc-easy-mailchimp-extender' ) );
1687 1687
 			}
1688 1688
 
1689
-			if( ! $merge_variables ) {
1690
-				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support." , 'yikes-inc-easy-mailchimp-extender' ) );
1689
+			if ( ! $merge_variables ) {
1690
+				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support.", 'yikes-inc-easy-mailchimp-extender' ) );
1691 1691
 			}
1692 1692
 
1693
-			if( ! empty( $form_fields ) ) {
1693
+			if ( ! empty( $form_fields ) ) {
1694 1694
 
1695 1695
 				// find any fields that are assigned to this form, that don't exist in MailChimp
1696 1696
 				// or else were going to run into issues when we submit the form
@@ -1698,12 +1698,12 @@  discard block
 block discarded – undo
1698 1698
 				$available_interest_groups = array();
1699 1699
 
1700 1700
 				// loop over merge variables
1701
-				if ( ! empty( $merge_variables['data'][0]['merge_vars'] ) ) {
1702
-					$available_merge_variables = wp_list_pluck( $merge_variables['data'][0]['merge_vars'], 'tag' );
1701
+				if ( ! empty( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] ) ) {
1702
+					$available_merge_variables = wp_list_pluck( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ], 'tag' );
1703 1703
 				}
1704 1704
 
1705 1705
 				// loop over interest groups
1706
-				if ( ! empty( $interest_groups ) && ! isset( $interest_groups['error'] ) ) {
1706
+				if ( ! empty( $interest_groups ) && ! isset( $interest_groups[ 'error' ] ) ) {
1707 1707
 					$available_interest_groups = wp_list_pluck( $interest_groups, 'id' );
1708 1708
 				}
1709 1709
 
@@ -1713,38 +1713,38 @@  discard block
 block discarded – undo
1713 1713
 				$excluded_fields = array_diff( $assigned_fields, $merged_fields );
1714 1714
 
1715 1715
 				$i = 1;
1716
-				foreach( $form_fields as $field ) {
1716
+				foreach ( $form_fields as $field ) {
1717 1717
 
1718
-					if ( isset( $field['merge'] ) ) {
1718
+					if ( isset( $field[ 'merge' ] ) ) {
1719 1719
 						// @todo: don't use in_array()
1720
-						$excluded_field = in_array( $field['merge'], $excluded_fields, true );
1720
+						$excluded_field = in_array( $field[ 'merge' ], $excluded_fields, true );
1721 1721
 						?>
1722
-						<section class="draggable" id="<?php echo $field['merge']; ?>">
1722
+						<section class="draggable" id="<?php echo $field[ 'merge' ]; ?>">
1723 1723
 							<!-- top -->
1724 1724
 							<a href="#" class="expansion-section-title settings-sidebar">
1725
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
1725
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
1726 1726
 								<?php if ( $excluded_field ) { ?>
1727
-									<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' ); ?>">
1727
+									<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' ); ?>">
1728 1728
 								<?php } ?>
1729
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
1729
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
1730 1730
 							</a>
1731 1731
 							<!-- expansion section -->
1732 1732
 							<div class="yikes-mc-settings-expansion-section">
1733 1733
 
1734 1734
 								<?php if ( $excluded_field ) { ?>
1735
-									<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>
1735
+									<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>
1736 1736
 								<?php } ?>
1737 1737
 
1738 1738
 								<!-- store the label -->
1739
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][label]" value="<?php echo $field['label']; ?>" />
1740
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][type]" value="<?php echo $field['type']; ?>" />
1741
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" />
1742
-								<input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" />
1739
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
1740
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
1741
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][merge]" value="<?php echo $field[ 'merge' ]; ?>" />
1742
+								<input type="hidden" class="field-<?php echo $field[ 'merge' ]; ?>-position position-input" name="field[<?php echo $field[ 'merge' ]; ?>][position]" value="<?php echo $i++; ?>" />
1743 1743
 
1744
-								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1745
-									$choices = json_decode( $field['choices'], true );
1744
+								<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'dropdown' || $field[ 'type' ] == 'select' ) {
1745
+									$choices = json_decode( $field[ 'choices' ], true );
1746 1746
 								?>
1747
-									<input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1747
+									<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1748 1748
 								<?php } ?>
1749 1749
 
1750 1750
 								<!-- Single or Double Opt-in -->
@@ -1756,16 +1756,16 @@  discard block
 block discarded – undo
1756 1756
 										<tr valign="top">
1757 1757
 											<td scope="row">
1758 1758
 												<label for="merge-tag">
1759
-													<?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1759
+													<?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?>
1760 1760
 												</label>
1761 1761
 											</td>
1762 1762
 											<td>
1763
-												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field['merge']; ?>">
1763
+												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field[ 'merge' ]; ?>">
1764 1764
 											</td>
1765 1765
 										</tr>
1766 1766
 
1767 1767
 										<!-- Placeholder Value -->
1768
-										<?php switch( $field['type'] ) {
1768
+										<?php switch ( $field[ 'type' ] ) {
1769 1769
 
1770 1770
 											case 'text':
1771 1771
 											case 'email':
@@ -1780,12 +1780,12 @@  discard block
 block discarded – undo
1780 1780
 										<tr valign="top">
1781 1781
 											<td scope="row">
1782 1782
 												<label for="placeholder">
1783
-													<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1783
+													<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1784 1784
 												</label>
1785 1785
 											</td>
1786 1786
 											<td>
1787
-												<input type="text" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : '' ; ?>" />
1788
-												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1787
+												<input type="text" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>" />
1788
+												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1789 1789
 											</td>
1790 1790
 										</tr>
1791 1791
 										<?php
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
 										?>
1795 1795
 
1796 1796
 										<!-- Default Value -->
1797
-										<?php switch( $field['type'] ) {
1797
+										<?php switch ( $field[ 'type' ] ) {
1798 1798
 											default:
1799 1799
 											case 'text':
1800 1800
 											case 'number':
@@ -1803,17 +1803,17 @@  discard block
 block discarded – undo
1803 1803
 											<tr valign="top">
1804 1804
 												<td scope="row">
1805 1805
 													<label for="placeholder">
1806
-														<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1806
+														<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
1807 1807
 													</label>
1808 1808
 												</td>
1809 1809
 												<td>
1810
-													<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 } ?> />
1811
-													<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>
1810
+													<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 } ?> />
1811
+													<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>
1812 1812
 													<?php
1813
-													switch( $field['type'] ) {
1813
+													switch ( $field[ 'type' ] ) {
1814 1814
 														case 'text':
1815 1815
 															?>
1816
-																<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>
1816
+																<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>
1817 1817
 															<?php
1818 1818
 														break;
1819 1819
 													} ?>
@@ -1827,25 +1827,25 @@  discard block
 block discarded – undo
1827 1827
 												<tr valign="top">
1828 1828
 													<td scope="row">
1829 1829
 														<label for="placeholder">
1830
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1830
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1831 1831
 														</label>
1832 1832
 													</td>
1833 1833
 													<td>
1834 1834
 														<?php
1835
-														if ( ! isset( $field['default_choice'] ) ) {
1836
-															$field['default_choice'] = 0;
1835
+														if ( ! isset( $field[ 'default_choice' ] ) ) {
1836
+															$field[ 'default_choice' ] = 0;
1837 1837
 														}
1838 1838
 														$x = 0;
1839 1839
 														foreach ( $choices as $choice => $value ) { ?>
1840
-															<label for="<?php echo $field['merge'].'-'.$x; ?>">
1841
-																<input id="<?php echo $field['merge'].'-'.$x; ?>"
1840
+															<label for="<?php echo $field[ 'merge' ] . '-' . $x; ?>">
1841
+																<input id="<?php echo $field[ 'merge' ] . '-' . $x; ?>"
1842 1842
 																       type="radio"
1843
-																       name="field[<?php echo $field['merge']; ?>][default_choice]"
1844
-																       value="<?php echo $x; ?>" <?php checked( $field['default_choice'], $x ); ?>>
1843
+																       name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]"
1844
+																       value="<?php echo $x; ?>" <?php checked( $field[ 'default_choice' ], $x ); ?>>
1845 1845
 																<?php echo $value; ?>&nbsp;
1846 1846
 															</label>
1847 1847
 														<?php $x++; } ?>
1848
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1848
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1849 1849
 													</td>
1850 1850
 												</tr>
1851 1851
 
@@ -1857,16 +1857,16 @@  discard block
 block discarded – undo
1857 1857
 												<tr valign="top">
1858 1858
 													<td scope="row">
1859 1859
 														<label for="placeholder">
1860
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1860
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1861 1861
 														</label>
1862 1862
 													</td>
1863 1863
 													<td>
1864
-														<select type="default" name="field[<?php echo $field['merge']; ?>][default_choice]">
1865
-															<?php foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1866
-																<option value="<?php echo $choice; ?>" <?php selected( $field['default_choice'] , $choice ); ?>><?php echo $value; ?></option>
1864
+														<select type="default" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]">
1865
+															<?php foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1866
+																<option value="<?php echo $choice; ?>" <?php selected( $field[ 'default_choice' ], $choice ); ?>><?php echo $value; ?></option>
1867 1867
 															<?php } ?>
1868 1868
 														</select>
1869
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1869
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1870 1870
 													</td>
1871 1871
 												</tr>
1872 1872
 
@@ -1886,69 +1886,69 @@  discard block
 block discarded – undo
1886 1886
 										<tr valign="top">
1887 1887
 											<td scope="row">
1888 1888
 												<label for="placeholder">
1889
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1889
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
1890 1890
 												</label>
1891 1891
 											</td>
1892 1892
 											<td>
1893
-												<textarea class="widefat field-description-input" name="field[<?php echo $field['merge']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
1894
-												<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>
1893
+												<textarea class="widefat field-description-input" name="field[<?php echo $field[ 'merge' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
1894
+												<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>
1895 1895
 											</td>
1896 1896
 										</tr>
1897 1897
 										<!-- Additional Classes -->
1898 1898
 										<tr valign="top">
1899 1899
 											<td scope="row">
1900 1900
 												<label for="placeholder">
1901
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1901
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
1902 1902
 												</label>
1903 1903
 											</td>
1904 1904
 											<td>
1905
-												<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'] ) ) : '' ; ?>" />
1906
-												<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>
1905
+												<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' ] ) ) : ''; ?>" />
1906
+												<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>
1907 1907
 											</td>
1908 1908
 										</tr>
1909 1909
 										<!-- Required Toggle -->
1910 1910
 										<tr valign="top">
1911 1911
 											<td scope="row">
1912 1912
 												<label for="field-required">
1913
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1913
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
1914 1914
 												</label>
1915 1915
 											</td>
1916 1916
 											<td>
1917
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
1918
-												<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' ); } ?>">
1919
-												<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>
1917
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
1918
+												<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' ); } ?>">
1919
+												<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>
1920 1920
 											</td>
1921 1921
 										</tr>
1922 1922
 										<!-- Visible Toggle -->
1923 1923
 										<tr valign="top">
1924 1924
 											<td scope="row">
1925 1925
 												<label for="hide-field">
1926
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1926
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
1927 1927
 												</label>
1928 1928
 											</td>
1929 1929
 											<td>
1930
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
1931
-												<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' ); } ?>">
1932
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1930
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
1931
+												<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' ); } ?>">
1932
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1933 1933
 											</td>
1934 1934
 										</tr>
1935 1935
 										<!-- Toggle Field Label Visibility -->
1936 1936
 										<tr valign="top">
1937 1937
 											<td scope="row">
1938 1938
 												<label for="placeholder">
1939
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1939
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
1940 1940
 												</label>
1941 1941
 											</td>
1942 1942
 											<td>
1943
-												<?php $hide_label = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
1944
-												<input type="checkbox" name="field[<?php echo $field['merge']; ?>][hide-label]" value="1" <?php checked( $hide_label , 1 ); ?>/>
1945
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1943
+												<?php $hide_label = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
1944
+												<input type="checkbox" name="field[<?php echo $field[ 'merge' ]; ?>][hide-label]" value="1" <?php checked( $hide_label, 1 ); ?>/>
1945
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1946 1946
 											</td>
1947 1947
 										</tr>
1948 1948
 										<!-- Display Phone/Date Formats back to the user -->
1949 1949
 										<!-- Phone Format Initial Load -->
1950 1950
 										<?php
1951
-											switch( $field['type'] ) {
1951
+											switch ( $field[ 'type' ] ) {
1952 1952
 												/* Store the phone format, for properly regex pattern */
1953 1953
 												case 'phone':
1954 1954
 												case 'birthday':
@@ -1958,23 +1958,23 @@  discard block
 block discarded – undo
1958 1958
 															<td scope="row">
1959 1959
 																<label for="placeholder">
1960 1960
 																	<?php
1961
-																		switch( $field['type'] ) {
1961
+																		switch ( $field[ 'type' ] ) {
1962 1962
 																			default:
1963 1963
 																			case 'birthday':
1964
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
1965
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD';
1964
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
1965
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD';
1966 1966
 																				$format_name = 'date_format';
1967 1967
 																				break;
1968 1968
 
1969 1969
 																			case 'date':
1970
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
1971
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD/YYYY';
1970
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
1971
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD/YYYY';
1972 1972
 																				$format_name = 'date_format';
1973 1973
 																				break;
1974 1974
 
1975 1975
 																			case 'phone':
1976
-																				$type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
1977
-																				$format = isset( $field['phone_format'] ) && ! empty( $field['phone_format'] ) ? $field['phone_format'] : __( 'International', 'yikes-inc-easy-mailchimp-extender' );
1976
+																				$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
1977
+																				$format = isset( $field[ 'phone_format' ] ) && ! empty( $field[ 'phone_format' ] ) ? $field[ 'phone_format' ] : __( 'International', 'yikes-inc-easy-mailchimp-extender' );
1978 1978
 																				$format_name = 'phone_format';
1979 1979
 																				break;
1980 1980
 																		}
@@ -1984,7 +1984,7 @@  discard block
 block discarded – undo
1984 1984
 															</td>
1985 1985
 															<td>
1986 1986
 																<strong><?php echo $format; ?></strong>
1987
-																<input type="hidden" name="field[<?php echo $field['merge']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
1987
+																<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
1988 1988
 																<p class="description"><small>
1989 1989
 																	<?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' ) ); ?>
1990 1990
 																</small></p>
@@ -2005,8 +2005,8 @@  discard block
 block discarded – undo
2005 2005
 											</td>
2006 2006
 											<td>
2007 2007
 												<span class="toggle-container">
2008
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2009
-													<a href="#" class="remove-field" alt="<?php echo $field['merge']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2008
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2009
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'merge' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2010 2010
 												</span>
2011 2011
 											</td>
2012 2012
 										</tr>
@@ -2022,35 +2022,35 @@  discard block
 block discarded – undo
2022 2022
 					} else { // THIS IS AN INTEREST GROUP!
2023 2023
 
2024 2024
 						?>
2025
-						<section class="draggable" id="<?php echo $field['group_id']; ?>">
2025
+						<section class="draggable" id="<?php echo $field[ 'group_id' ]; ?>">
2026 2026
 							<!-- top -->
2027 2027
 							<a href="#" class="expansion-section-title settings-sidebar">
2028
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
2029
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2030
-									<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' ); ?>">
2028
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
2029
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2030
+									<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' ); ?>">
2031 2031
 								<?php } ?>
2032
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
2032
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
2033 2033
 							</a>
2034 2034
 							<!-- expansion section -->
2035 2035
 							<div class="yikes-mc-settings-expansion-section">
2036 2036
 
2037 2037
 								<!-- check if this field exists in the available interest group array -->
2038
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2039
-									<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>
2038
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2039
+									<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>
2040 2040
 								<?php } ?>
2041 2041
 
2042 2042
 								<!-- store the label -->
2043
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][label]" value="<?php echo $field['label']; ?>" />
2044
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][type]" value="<?php echo $field['type']; ?>" />
2045
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][group_id]" value="<?php echo $field['group_id']; ?>" />
2046
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field['groups'], true ) ) ); ?>' />
2043
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
2044
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
2045
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][group_id]" value="<?php echo $field[ 'group_id' ]; ?>" />
2046
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field[ 'groups' ], true ) ) ); ?>' />
2047 2047
 
2048 2048
 								<!-- Single or Double Opt-in -->
2049 2049
 								<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
2050 2050
 
2051 2051
 									<table class="form-table form-field-container">
2052 2052
 										<!-- Default Value -->
2053
-										<?php switch( $field['type'] ) {
2053
+										<?php switch ( $field[ 'type' ] ) {
2054 2054
 
2055 2055
 											default:
2056 2056
 											case 'radio':
@@ -2059,22 +2059,22 @@  discard block
 block discarded – undo
2059 2059
 												<tr valign="top">
2060 2060
 													<td scope="row">
2061 2061
 														<label for="placeholder">
2062
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2062
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2063 2063
 														</label>
2064 2064
 													</td>
2065 2065
 													<td>
2066 2066
 														<?php
2067
-														if( $field['type'] != 'checkboxes' ) {
2068
-															if( ! isset( $field['default_choice'] ) ) { $field['default_choice'] =  json_decode( stripslashes( $field['groups'] ) , true ); }
2067
+														if ( $field[ 'type' ] != 'checkboxes' ) {
2068
+															if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = json_decode( stripslashes( $field[ 'groups' ] ), true ); }
2069 2069
 														} else {
2070
-															if ( ! isset( $field['default_choice'] ) ) { $field['default_choice'] = array(); }
2070
+															if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = array(); }
2071 2071
 														}
2072 2072
 														$i = 0;
2073
-														foreach( json_decode( $field['groups'], true ) as $group ) {
2074
-															$field_id   = "{$field['group_id']}-{$i}";
2075
-															$field_type = 'hidden' == $field['type'] ? 'radio' : $field['type'];
2073
+														foreach ( json_decode( $field[ 'groups' ], true ) as $group ) {
2074
+															$field_id   = "{$field[ 'group_id' ]}-{$i}";
2075
+															$field_type = 'hidden' == $field[ 'type' ] ? 'radio' : $field[ 'type' ];
2076 2076
 															$field_type = 'checkboxes' == $field_type ? 'checkbox' : $field_type;
2077
-															$field_name = "field[{$field['group_id']}][default_choice]";
2077
+															$field_name = "field[{$field[ 'group_id' ]}][default_choice]";
2078 2078
 															$field_name = 'checkbox' == $field_type ? $field_name . '[]' : $field_name;
2079 2079
 
2080 2080
 															// Determine if the current group is checked.
@@ -2083,11 +2083,11 @@  discard block
 block discarded – undo
2083 2083
 																case 'radio':
2084 2084
 																case 'hidden':
2085 2085
 																default:
2086
-																	$checked = checked( $field['default_choice'], $i, false );
2086
+																	$checked = checked( $field[ 'default_choice' ], $i, false );
2087 2087
 																	break;
2088 2088
 
2089 2089
 																case 'checkbox':
2090
-																	if ( in_array( $i, (array) $field['default_choice'] ) ) {
2090
+																	if ( in_array( $i, (array) $field[ 'default_choice' ] ) ) {
2091 2091
 																		$checked = checked( true, true, false );
2092 2092
 																	}
2093 2093
 															}
@@ -2098,12 +2098,12 @@  discard block
 block discarded – undo
2098 2098
 																       type="<?php echo $field_type; ?>"
2099 2099
 																       name="<?php echo $field_name; ?>"
2100 2100
 																       value="<?php echo $i; ?>" <?php echo $checked; ?>>
2101
-																<?php echo stripslashes( str_replace( '\'' , '' , $group['name'] ) ); ?>&nbsp;
2101
+																<?php echo stripslashes( str_replace( '\'', '', $group[ 'name' ] ) ); ?>&nbsp;
2102 2102
 															</label>
2103 2103
 															<?php
2104 2104
 															$i++;
2105 2105
 														} ?>
2106
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2106
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2107 2107
 													</td>
2108 2108
 												</tr>
2109 2109
 
@@ -2115,16 +2115,16 @@  discard block
 block discarded – undo
2115 2115
 												<tr valign="top">
2116 2116
 													<td scope="row">
2117 2117
 														<label for="placeholder">
2118
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2118
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2119 2119
 														</label>
2120 2120
 													</td>
2121 2121
 													<td>
2122
-														<select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2123
-															<?php $i = 0; foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as  $group ) { ?>
2124
-																<option value="<?php echo $i; ?>" <?php selected( $field['default_choice'] , $i ); ?>><?php echo stripslashes( $group['name'] ); ?></option>
2122
+														<select type="default" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]">
2123
+															<?php $i = 0; foreach ( json_decode( stripslashes_deep( $field[ 'groups' ] ), true ) as  $group ) { ?>
2124
+																<option value="<?php echo $i; ?>" <?php selected( $field[ 'default_choice' ], $i ); ?>><?php echo stripslashes( $group[ 'name' ] ); ?></option>
2125 2125
 															<?php $i++; } ?>
2126 2126
 														</select>
2127
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2127
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2128 2128
 													</td>
2129 2129
 												</tr>
2130 2130
 
@@ -2138,12 +2138,12 @@  discard block
 block discarded – undo
2138 2138
 										<tr valign="top">
2139 2139
 											<td scope="row">
2140 2140
 												<label for="placeholder">
2141
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2141
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
2142 2142
 												</label>
2143 2143
 											</td>
2144 2144
 											<td>
2145
-												<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>
2146
-												<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>
2145
+												<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>
2146
+												<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>
2147 2147
 											</td>
2148 2148
 										</tr>
2149 2149
 
@@ -2151,51 +2151,51 @@  discard block
 block discarded – undo
2151 2151
 										<tr valign="top">
2152 2152
 											<td scope="row">
2153 2153
 												<label for="placeholder">
2154
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2154
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2155 2155
 												</label>
2156 2156
 											</td>
2157 2157
 											<td>
2158
-												<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'] ) ) : '' ; ?>" />
2159
-												<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>
2158
+												<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' ] ) ) : ''; ?>" />
2159
+												<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>
2160 2160
 											</td>
2161 2161
 										</tr>
2162 2162
 										<!-- Required Toggle -->
2163 2163
 										<tr valign="top">
2164 2164
 											<td scope="row">
2165 2165
 												<label for="field-required">
2166
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2166
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2167 2167
 												</label>
2168 2168
 											</td>
2169 2169
 											<td>
2170
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2171
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][require]" <?php checked( $checked , 1 ); ?>>
2172
-												<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>
2170
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2171
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][require]" <?php checked( $checked, 1 ); ?>>
2172
+												<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>
2173 2173
 											</td>
2174 2174
 										</tr>
2175 2175
 										<!-- Visible Toggle -->
2176 2176
 										<tr valign="top">
2177 2177
 											<td scope="row">
2178 2178
 												<label for="hide-field">
2179
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2179
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2180 2180
 												</label>
2181 2181
 											</td>
2182 2182
 											<td>
2183
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2184
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][hide]" <?php checked( $hide , 1 ); ?>>
2185
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2183
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2184
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][hide]" <?php checked( $hide, 1 ); ?>>
2185
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2186 2186
 											</td>
2187 2187
 										</tr>
2188 2188
 										<!-- Toggle Field Label Visibility -->
2189 2189
 										<tr valign="top">
2190 2190
 											<td scope="row">
2191 2191
 												<label for="placeholder">
2192
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2192
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2193 2193
 												</label>
2194 2194
 											</td>
2195 2195
 											<td>
2196
-												<?php $hide = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2197
-												<input type="checkbox" name="field[<?php echo $field['group_id']; ?>][hide-label]" value="1" <?php checked( $hide , 1 ); ?>/>
2198
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2196
+												<?php $hide = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2197
+												<input type="checkbox" name="field[<?php echo $field[ 'group_id' ]; ?>][hide-label]" value="1" <?php checked( $hide, 1 ); ?>/>
2198
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2199 2199
 											</td>
2200 2200
 										</tr>
2201 2201
 										<!-- Toggle Buttons -->
@@ -2205,8 +2205,8 @@  discard block
 block discarded – undo
2205 2205
 											</td>
2206 2206
 											<td>
2207 2207
 												<span class="toggle-container">
2208
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2209
-													<a href="#" class="remove-field" alt="<?php echo $field['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2208
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2209
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2210 2210
 												</span>
2211 2211
 											</td>
2212 2212
 										</tr>
@@ -2220,38 +2220,38 @@  discard block
 block discarded – undo
2220 2220
 				}
2221 2221
 			} else {
2222 2222
 				?>
2223
-					<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>
2223
+					<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>
2224 2224
 				<?php
2225 2225
 			}
2226 2226
 				/* Pre Defined Merge Tag Container - Always rendered so the modal appears and links are clickable on initial page load */
2227 2227
 				add_thickbox();
2228 2228
 				// enqueue jquery qtip for our tooltip
2229
-				wp_enqueue_script( 'jquery-qtip-tooltip' , YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) );
2230
-				wp_enqueue_style( 'jquery-qtip-style' ,  YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2229
+				wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) );
2230
+				wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2231 2231
 					$available_tags = array(
2232 2232
 						array(
2233 2233
 							'tag' => '{page_title}',
2234
-							'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' ),
2234
+							'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' ),
2235 2235
 							'title' => __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' )
2236 2236
 						),
2237 2237
 						array(
2238 2238
 							'tag' => '{page_id}',
2239
-							'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' ),
2239
+							'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' ),
2240 2240
 							'title' => __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' )
2241 2241
 						),
2242 2242
 						array(
2243 2243
 							'tag' => '{page_url}',
2244
-							'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' ),
2244
+							'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' ),
2245 2245
 							'title' => __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' )
2246 2246
 						),
2247 2247
 						array(
2248 2248
 							'tag' => '{blog_name}',
2249
-							'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' ),
2249
+							'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' ),
2250 2250
 							'title' => __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' )
2251 2251
 						),
2252 2252
 						array(
2253 2253
 							'tag' => '{user_logged_in}',
2254
-							'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' ),
2254
+							'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' ),
2255 2255
 							'title' => __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' )
2256 2256
 						),
2257 2257
 					);
@@ -2279,17 +2279,17 @@  discard block
 block discarded – undo
2279 2279
 				<div id="pre-defined-tag-container">
2280 2280
 					<input type="hidden" value="" class="clicked-input">
2281 2281
 					<div id="pre-defined-tag-interior-container">
2282
-						<h3><?php _e( 'Pre Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2283
-						<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>
2282
+						<h3><?php _e( 'Pre Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2283
+						<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>
2284 2284
 						<ul>
2285
-							<?php foreach( apply_filters( 'yikes-mailchimp-custom-default-value-tags' , $available_tags ) as $tag ) { ?>
2285
+							<?php foreach ( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2286 2286
 								<li class="tooltop-tag">
2287 2287
 									<!-- link/tag -->
2288
-									<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>
2288
+									<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>
2289 2289
 									<!-- help icon -->
2290 2290
 									<span class="dashicons dashicons-editor-help"></span>
2291 2291
 									<!-- tooltip -->
2292
-									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag['description']; ?></div>
2292
+									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag[ 'description' ]; ?></div>
2293 2293
 								</li>
2294 2294
 							<?php } ?>
2295 2295
 						</ul>
@@ -2305,32 +2305,32 @@  discard block
 block discarded – undo
2305 2305
 		*	-
2306 2306
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2307 2307
 		*/
2308
-		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2308
+		public function build_available_merge_vars( $form_fields, $available_merge_variables ) {
2309 2309
 			$fields_assigned_to_form = array();
2310
-			if( !empty( $form_fields ) ) {
2311
-				foreach( $form_fields as $assigned_field ) {
2310
+			if ( ! empty( $form_fields ) ) {
2311
+				foreach ( $form_fields as $assigned_field ) {
2312 2312
 					// print_r( $assigned_field) ;
2313 2313
 					// switch between merge variables and interest groups
2314
-					if( isset( $assigned_field['merge'] ) ) {
2315
-						$fields_assigned_to_form[] = $assigned_field['merge'];
2314
+					if ( isset( $assigned_field[ 'merge' ] ) ) {
2315
+						$fields_assigned_to_form[ ] = $assigned_field[ 'merge' ];
2316 2316
 					}
2317 2317
 				}
2318 2318
 			}
2319
-			if( !empty( $available_merge_variables['data'][0] ) ) {
2319
+			if ( ! empty( $available_merge_variables[ 'data' ][ 0 ] ) ) {
2320 2320
 				?><ul id="available-fields"><?php
2321
-				foreach( $available_merge_variables['data'][0]['merge_vars'] as $merge_var ) {
2322
-					if( in_array( $merge_var['tag'] , $fields_assigned_to_form ) ) {
2321
+				foreach ( $available_merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] as $merge_var ) {
2322
+					if ( in_array( $merge_var[ 'tag' ], $fields_assigned_to_form ) ) {
2323 2323
 						?>
2324
-							<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>
2324
+							<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>
2325 2325
 						<?php
2326 2326
 					} else {
2327 2327
 						?>
2328
-							<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>
2328
+							<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>
2329 2329
 						<?php
2330 2330
 					}
2331 2331
 				}
2332 2332
 				?></ul>
2333
-				<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>
2333
+				<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>
2334 2334
 				<?php
2335 2335
 			}
2336 2336
 		}
@@ -2342,30 +2342,30 @@  discard block
 block discarded – undo
2342 2342
 		*	-
2343 2343
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2344 2344
 		*/
2345
-		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2345
+		public function build_available_interest_groups( $form_fields, $available_interest_groups, $list_id ) {
2346 2346
 			$fields_assigned_to_form = array();
2347
-			if( !empty( $form_fields ) ) {
2348
-					foreach( $form_fields as $assigned_interest_group ) {
2349
-					if( isset( $assigned_interest_group['group_id'] ) ) {
2350
-						$fields_assigned_to_form[] = $assigned_interest_group['group_id'];
2347
+			if ( ! empty( $form_fields ) ) {
2348
+					foreach ( $form_fields as $assigned_interest_group ) {
2349
+					if ( isset( $assigned_interest_group[ 'group_id' ] ) ) {
2350
+						$fields_assigned_to_form[ ] = $assigned_interest_group[ 'group_id' ];
2351 2351
 					}
2352 2352
 				}
2353 2353
 			}
2354
-			if( !empty( $available_interest_groups) ) {
2354
+			if ( ! empty( $available_interest_groups ) ) {
2355 2355
 				?><ul id="available-interest-groups"><?php
2356
-				foreach( $available_interest_groups as $interest_group ) {
2357
-					if( in_array( $interest_group['id'] , $fields_assigned_to_form ) ) {
2356
+				foreach ( $available_interest_groups as $interest_group ) {
2357
+					if ( in_array( $interest_group[ 'id' ], $fields_assigned_to_form ) ) {
2358 2358
 						?>
2359
-							<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>
2359
+							<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>
2360 2360
 						<?php
2361 2361
 					} else {
2362 2362
 						?>
2363
-							<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>
2363
+							<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>
2364 2364
 						<?php
2365 2365
 					}
2366 2366
 				}
2367 2367
 				?></ul>
2368
-				<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>
2368
+				<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>
2369 2369
 				<?php
2370 2370
 			}
2371 2371
 		}
@@ -2377,29 +2377,29 @@  discard block
 block discarded – undo
2377 2377
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2378 2378
 		*/
2379 2379
 		public function yikes_easy_mailchimp_create_form() {
2380
-			$nonce = $_REQUEST['nonce'];
2381
-			if( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2382
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) );
2380
+			$nonce = $_REQUEST[ 'nonce' ];
2381
+			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2382
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ) );
2383 2383
 			}
2384 2384
 
2385 2385
 			$result = $this->form_interface->create_form( array(
2386
-				'list_id'          => sanitize_key( $_POST['associated-list'] ),
2387
-				'form_name'        => stripslashes( $_POST['form-name'] ),
2388
-				'form_description' => stripslashes( $_POST['form-description'] ),
2386
+				'list_id'          => sanitize_key( $_POST[ 'associated-list' ] ),
2387
+				'form_name'        => stripslashes( $_POST[ 'form-name' ] ),
2388
+				'form_description' => stripslashes( $_POST[ 'form-description' ] ),
2389 2389
 			) );
2390 2390
 
2391 2391
 			// if an error occurs during the form creation process
2392 2392
 			if ( false == $result ) {
2393 2393
 				// write it to the error log
2394 2394
 				// if the form was not created successfully
2395
-				if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2395
+				if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2396 2396
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2397
-					$error_logging->yikes_easy_mailchimp_write_to_error_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender') , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2397
+					$error_logging->yikes_easy_mailchimp_write_to_error_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ), __( "Creating a new form", 'yikes-inc-easy-mailchimp-extender' ), __( "Forms", 'yikes-inc-easy-mailchimp-extender' ) );
2398 2398
 				}
2399 2399
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ) ) ) ) );
2400 2400
 			} else {
2401 2401
 				// redirect the user to the new form edit page
2402
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result) ) );
2402
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result ) ) );
2403 2403
 			}
2404 2404
 			exit();
2405 2405
 		}
@@ -2412,11 +2412,11 @@  discard block
 block discarded – undo
2412 2412
 		*/
2413 2413
 		public function yikes_easy_mailchimp_delete_form() {
2414 2414
 			// grab & store our variables ( associated list & form name )
2415
-			$nonce = $_REQUEST['nonce'];
2416
-			$post_id_to_delete = $_REQUEST['mailchimp-form'];
2415
+			$nonce = $_REQUEST[ 'nonce' ];
2416
+			$post_id_to_delete = $_REQUEST[ 'mailchimp-form' ];
2417 2417
 			// verify our nonce
2418
-			if( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2419
-				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 ) );
2418
+			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-' . $post_id_to_delete ) ) {
2419
+				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 ) );
2420 2420
 			}
2421 2421
 
2422 2422
 			$this->form_interface->delete_form( $post_id_to_delete );
@@ -2432,19 +2432,19 @@  discard block
 block discarded – undo
2432 2432
 		*/
2433 2433
 		public function yikes_easy_mailchimp_duplicate_form() {
2434 2434
 			// grab & store our variables ( associated list & form name )
2435
-			$nonce = $_REQUEST['nonce'];
2436
-			$post_id_to_clone = $_REQUEST['mailchimp-form'];
2435
+			$nonce = $_REQUEST[ 'nonce' ];
2436
+			$post_id_to_clone = $_REQUEST[ 'mailchimp-form' ];
2437 2437
 			// verify our nonce
2438
-			if( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2439
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2438
+			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-' . $post_id_to_clone ) ) {
2439
+				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 ) );
2440 2440
 			}
2441 2441
 
2442 2442
 			// Get the current form data.
2443 2443
 			$form_data = $this->form_interface->get_form( $post_id_to_clone );
2444 2444
 
2445 2445
 			// Update some of the data before duplication
2446
-			$form_data['form_name'] .= ' - Copy - ';
2447
-			$form_data['impressions'] = $form_data['submissions'] = 0;
2446
+			$form_data[ 'form_name' ] .= ' - Copy - ';
2447
+			$form_data[ 'impressions' ] = $form_data[ 'submissions' ] = 0;
2448 2448
 
2449 2449
 			// Create the new form, and handle the result.
2450 2450
 			$result = $this->form_interface->create_form( $form_data );
@@ -2465,11 +2465,11 @@  discard block
 block discarded – undo
2465 2465
 		*/
2466 2466
 		public function yikes_easy_mailchimp_reset_impression_stats() {
2467 2467
 			// grab & store our variables ( associated list & form name )
2468
-			$nonce = $_REQUEST['nonce'];
2469
-			$form_id_to_reset = $_REQUEST['mailchimp-form'];
2468
+			$nonce = $_REQUEST[ 'nonce' ];
2469
+			$form_id_to_reset = $_REQUEST[ 'mailchimp-form' ];
2470 2470
 			// verify our nonce
2471
-			if( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2472
-				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 ) );
2471
+			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-' . $form_id_to_reset ) ) {
2472
+				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 ) );
2473 2473
 			}
2474 2474
 
2475 2475
 			$result = $this->form_interface->update_form(
@@ -2497,8 +2497,8 @@  discard block
 block discarded – undo
2497 2497
 		*/
2498 2498
 		public function yikes_easy_mailchimp_update_form() {
2499 2499
 			// grab & store our variables ( associated list & form name )
2500
-			$nonce = $_REQUEST['nonce'];
2501
-			$form_id = $_REQUEST['id'];
2500
+			$nonce = $_REQUEST[ 'nonce' ];
2501
+			$form_id = $_REQUEST[ 'id' ];
2502 2502
 
2503 2503
 			// verify our nonce
2504 2504
 			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
@@ -2512,66 +2512,66 @@  discard block
 block discarded – undo
2512 2512
 			}
2513 2513
 
2514 2514
 			// store our values!
2515
-			$list_id                 = $_POST['associated-list'];
2516
-			$form_name               = stripslashes( $_POST['form-name'] );
2517
-			$form_description        = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
2518
-			$send_welcome_email      = $_POST['send-welcome-email'];
2519
-			$redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2520
-			$redirect_page           = $_POST['redirect-user-to-selection'];
2515
+			$list_id                 = $_POST[ 'associated-list' ];
2516
+			$form_name               = stripslashes( $_POST[ 'form-name' ] );
2517
+			$form_description        = sanitize_text_field( stripslashes( $_POST[ 'form-description' ] ) );
2518
+			$send_welcome_email      = $_POST[ 'send-welcome-email' ];
2519
+			$redirect_user_on_submit = $_POST[ 'redirect-user-on-submission' ];
2520
+			$redirect_page           = $_POST[ 'redirect-user-to-selection' ];
2521 2521
 
2522 2522
 			// stripslashes_deep on save, to prevent foreign languages from added excessive backslashes
2523
-			$assigned_fields = isset( $_POST['field'] ) ? stripslashes_deep( $_POST['field'] ): array();
2523
+			$assigned_fields = isset( $_POST[ 'field' ] ) ? stripslashes_deep( $_POST[ 'field' ] ) : array();
2524 2524
 
2525 2525
 			// setup our submission settings serialized array
2526 2526
 			$submission_settings = array(
2527
-				'ajax'                   => $_POST['form-ajax-submission'],
2528
-				'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2529
-				'redirect_page'          => $_POST['redirect-user-to-selection'],
2530
-				'custom_redirect_url'    => esc_url( $_POST['custom-redirect-url'] ),
2531
-				'hide_form_post_signup'  => $_POST['hide-form-post-signup'],
2532
-				'replace_interests'      => $_POST['replace-interest-groups'],
2527
+				'ajax'                   => $_POST[ 'form-ajax-submission' ],
2528
+				'redirect_on_submission' => $_POST[ 'redirect-user-on-submission' ],
2529
+				'redirect_page'          => $_POST[ 'redirect-user-to-selection' ],
2530
+				'custom_redirect_url'    => esc_url( $_POST[ 'custom-redirect-url' ] ),
2531
+				'hide_form_post_signup'  => $_POST[ 'hide-form-post-signup' ],
2532
+				'replace_interests'      => $_POST[ 'replace-interest-groups' ],
2533 2533
 			);
2534 2534
 
2535 2535
 			// setup our opt-in settings serialized array
2536 2536
 			$optin_settings = array(
2537
-				'optin'                => $_POST['single-double-optin'],
2538
-				'update_existing_user' => $_POST['update-existing-user'],
2539
-				'send_update_email'    => $_POST['update-existing-email'],
2540
-				'send_welcome_email'   => $_POST['send-welcome-email'],
2537
+				'optin'                => $_POST[ 'single-double-optin' ],
2538
+				'update_existing_user' => $_POST[ 'update-existing-user' ],
2539
+				'send_update_email'    => $_POST[ 'update-existing-email' ],
2540
+				'send_welcome_email'   => $_POST[ 'send-welcome-email' ],
2541 2541
 			);
2542 2542
 
2543 2543
 			// setup our error settings serialized array
2544 2544
 			$error_settings = array(
2545
-				'success'            => trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2546
-				'general-error'      => trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2547
-				'invalid-email'      => trim( $_POST['yikes-easy-mc-invalid-email-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-invalid-email-message'] ) ) : '',
2548
-				'already-subscribed' => trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2549
-				'update-link'        => trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '',
2545
+				'success'            => trim( $_POST[ 'yikes-easy-mc-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-message' ] ) ) : '',
2546
+				'general-error'      => trim( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ) : '',
2547
+				'invalid-email'      => trim( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ) : '',
2548
+				'already-subscribed' => trim( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ) : '',
2549
+				'update-link'        => trim( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ) : '',
2550 2550
 			);
2551 2551
 
2552 2552
 			// Setup the new form settings array
2553 2553
 			// @since 6.0.3.8
2554 2554
 			// To Do: Combine date & time so it's a single unix timestamp
2555 2555
 			$form_settings = array(
2556
-				'yikes-easy-mc-form-class-names'                 => trim( $_POST['yikes-easy-mc-form-class-names'] ),
2557
-				'yikes-easy-mc-inline-form'                      => $_POST['yikes-easy-mc-inline-form'][0],
2558
-				'yikes-easy-mc-submit-button-type'               => $_POST['yikes-easy-mc-submit-button-type'][0],
2559
-				'yikes-easy-mc-submit-button-text'               => trim( $_POST['yikes-easy-mc-submit-button-text'] ),
2560
-				'yikes-easy-mc-submit-button-image'              => esc_url( trim( $_POST['yikes-easy-mc-submit-button-image'] ) ),
2561
-				'yikes-easy-mc-submit-button-classes'            => trim( $_POST['yikes-easy-mc-submit-button-classes'] ),
2562
-				'yikes-easy-mc-form-schedule'                    => ( isset( $_POST['yikes-easy-mc-form-schedule'] ) ) ? '1' : '0',
2563
-				'yikes-easy-mc-form-restriction-start'           => strtotime( $_POST['yikes-easy-mc-form-restriction-start-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-start-time'] ),
2564
-				'yikes-easy-mc-form-restriction-end'             => strtotime( $_POST['yikes-easy-mc-form-restriction-end-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-end-time'] ),
2565
-				'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST['yikes-easy-mc-form-restriction-pending-message'] ),
2566
-				'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST['yikes-easy-mc-form-restriction-expired-message'] ),
2567
-				'yikes-easy-mc-form-login-required'              => ( isset( $_POST['yikes-easy-mc-form-login-required'] ) ) ? '1' : '0',
2568
-				'yikes-easy-mc-form-restriction-login-message'   => trim( $_POST['yikes-easy-mc-form-restriction-login-message'] ),
2556
+				'yikes-easy-mc-form-class-names'                 => trim( $_POST[ 'yikes-easy-mc-form-class-names' ] ),
2557
+				'yikes-easy-mc-inline-form'                      => $_POST[ 'yikes-easy-mc-inline-form' ][ 0 ],
2558
+				'yikes-easy-mc-submit-button-type'               => $_POST[ 'yikes-easy-mc-submit-button-type' ][ 0 ],
2559
+				'yikes-easy-mc-submit-button-text'               => trim( $_POST[ 'yikes-easy-mc-submit-button-text' ] ),
2560
+				'yikes-easy-mc-submit-button-image'              => esc_url( trim( $_POST[ 'yikes-easy-mc-submit-button-image' ] ) ),
2561
+				'yikes-easy-mc-submit-button-classes'            => trim( $_POST[ 'yikes-easy-mc-submit-button-classes' ] ),
2562
+				'yikes-easy-mc-form-schedule'                    => ( isset( $_POST[ 'yikes-easy-mc-form-schedule' ] ) ) ? '1' : '0',
2563
+				'yikes-easy-mc-form-restriction-start'           => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-start-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-start-time' ] ),
2564
+				'yikes-easy-mc-form-restriction-end'             => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-end-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-end-time' ] ),
2565
+				'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-pending-message' ] ),
2566
+				'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-expired-message' ] ),
2567
+				'yikes-easy-mc-form-login-required'              => ( isset( $_POST[ 'yikes-easy-mc-form-login-required' ] ) ) ? '1' : '0',
2568
+				'yikes-easy-mc-form-restriction-login-message'   => trim( $_POST[ 'yikes-easy-mc-form-restriction-login-message' ] ),
2569 2569
 			);
2570 2570
 
2571 2571
 			// additional custom fields (extensions / user defined fields)
2572 2572
 			$custom_fields = array();
2573
-			if ( isset( $_POST['custom-field'] ) ) {
2574
-				foreach ( $_POST['custom-field'] as $custom_field => $custom_value ) {
2573
+			if ( isset( $_POST[ 'custom-field' ] ) ) {
2574
+				foreach ( $_POST[ 'custom-field' ] as $custom_field => $custom_value ) {
2575 2575
 					if ( is_array( $custom_value ) ) {
2576 2576
 						$custom_fields[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2577 2577
 					} else {
@@ -2602,7 +2602,7 @@  discard block
 block discarded – undo
2602 2602
 			$this->form_interface->update_form( $form_id, $form_updates );
2603 2603
 
2604 2604
 			/* Custom action hook which allows users to update specific options when a form is updated - used in add ons */
2605
-			do_action( 'yikes-mailchimp-save-form', $form_id,  $custom_fields );
2605
+			do_action( 'yikes-mailchimp-save-form', $form_id, $custom_fields );
2606 2606
 
2607 2607
 			// redirect the user to the manage forms page, display confirmation
2608 2608
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form_id . '&updated-form=true' ) ) );
@@ -2611,18 +2611,18 @@  discard block
 block discarded – undo
2611 2611
 
2612 2612
 		/* Unsubscribe a given user from our list */
2613 2613
 		public function yikes_easy_mailchimp_unsubscribe_user() {
2614
-			$nonce = $_REQUEST['nonce'];
2615
-			$list_id = $_REQUEST['mailchimp-list'];
2616
-			$email_id = $_REQUEST['email_id'];
2614
+			$nonce = $_REQUEST[ 'nonce' ];
2615
+			$list_id = $_REQUEST[ 'mailchimp-list' ];
2616
+			$email_id = $_REQUEST[ 'email_id' ];
2617 2617
 			// verify our nonce
2618
-			if( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2619
-				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 ) );
2618
+			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2619
+				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 ) );
2620 2620
 			}
2621 2621
 			// only re-run the API request if our API key has changed
2622 2622
 			// initialize MailChimp Class
2623 2623
 			$api_key = yikes_get_mc_api_key();
2624 2624
 			$dash_position = strpos( $api_key, '-' );
2625
-			if( $dash_position !== false ) {
2625
+			if ( $dash_position !== false ) {
2626 2626
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/unsubscribe.json';
2627 2627
 			}
2628 2628
 			$response = wp_remote_post( $api_endpoint, array(
@@ -2636,13 +2636,13 @@  discard block
 block discarded – undo
2636 2636
 				'timeout' => 10,
2637 2637
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2638 2638
 			) );
2639
-			if( ! is_wp_error( $response ) ) {
2639
+			if ( ! is_wp_error( $response ) ) {
2640 2640
 				$response_body = json_decode( wp_remote_retrieve_body( $response ), true );
2641
-				if( isset( $response_body['error'] ) ) {
2642
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2641
+				if ( isset( $response_body[ 'error' ] ) ) {
2642
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2643 2643
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2644 2644
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2645
-						$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' ) );
2645
+						$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' ) );
2646 2646
 					}
2647 2647
 				}
2648 2648
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id . '&user-unsubscribed=true' ) ) );
@@ -2652,21 +2652,21 @@  discard block
 block discarded – undo
2652 2652
 
2653 2653
 		public function yikes_easy_mailchimp_create_missing_error_log() {
2654 2654
 			// grab our nonnce
2655
-			$nonce = $_REQUEST['nonce'];
2655
+			$nonce = $_REQUEST[ 'nonce' ];
2656 2656
 			// validate nonce
2657
-			if( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2658
-				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 ) );
2657
+			if ( ! wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2658
+				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 ) );
2659 2659
 			}
2660 2660
 			// setup the path to the error log
2661
-			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php' , 'w' );
2661
+			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' );
2662 2662
 			try {
2663 2663
 				// create the file
2664
-				fwrite( $error_log , '' );
2664
+				fwrite( $error_log, '' );
2665 2665
 				// close out
2666 2666
 				fclose( $error_log );
2667 2667
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=true' ) ) );
2668 2668
 			} catch ( Exception $e ) {
2669
-				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() ) ) ) );
2669
+				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() ) ) ) );
2670 2670
 			}
2671 2671
 		}
2672 2672
 
@@ -2677,16 +2677,16 @@  discard block
 block discarded – undo
2677 2677
 		public function yikes_easy_mailchimp_clear_transient_data() {
2678 2678
 			$referer = wp_get_referer();
2679 2679
 			// grab & store our variables ( associated list & form name )
2680
-			$nonce = $_REQUEST['nonce'];
2680
+			$nonce = $_REQUEST[ 'nonce' ];
2681 2681
 			// verify our nonce
2682
-			if( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2683
-				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 ) );
2682
+			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2683
+				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 ) );
2684 2684
 			}
2685 2685
 			// delete all of the integration settings list data in the cache
2686 2686
 			$list_ids = $this->get_mailchimp_list_ids_on_account();
2687 2687
 			// confirm the list IDs was returned and is not empty
2688
-			if( isset( $list_ids ) && ! empty( $list_ids ) ) {
2689
-				foreach( $list_ids as $id ) {
2688
+			if ( isset( $list_ids ) && ! empty( $list_ids ) ) {
2689
+				foreach ( $list_ids as $id ) {
2690 2690
 					// loop over each interest group and delete the transient associated with it
2691 2691
 					// this is created & stored on the integration list page
2692 2692
 					// id = groupID_interest_group
@@ -2719,12 +2719,12 @@  discard block
 block discarded – undo
2719 2719
 		*/
2720 2720
 		public function get_mailchimp_list_ids_on_account() {
2721 2721
 			$api_key = yikes_get_mc_api_key();
2722
-			if( ! $api_key ) {
2722
+			if ( ! $api_key ) {
2723 2723
 				// if no api key is set/site is not connected, return an empty array
2724 2724
 				return array();
2725 2725
 			}
2726 2726
 			$dash_position = strpos( $api_key, '-' );
2727
-			if( $dash_position !== false ) {
2727
+			if ( $dash_position !== false ) {
2728 2728
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
2729 2729
 			}
2730 2730
 			$mailchimp_lists = wp_remote_post( $api_endpoint, array(
@@ -2735,19 +2735,19 @@  discard block
 block discarded – undo
2735 2735
 				'timeout' => 10,
2736 2736
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2737 2737
 			) );
2738
-			if( ! is_wp_error( $mailchimp_lists ) ) {
2738
+			if ( ! is_wp_error( $mailchimp_lists ) ) {
2739 2739
 				$list_data = json_decode( wp_remote_retrieve_body( $mailchimp_lists ), true );
2740
-				if( isset( $list_data['error'] ) ) {
2741
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2740
+				if ( isset( $list_data[ 'error' ] ) ) {
2741
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2742 2742
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2743 2743
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2744
-						$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' ) );
2744
+						$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' ) );
2745 2745
 					}
2746 2746
 				}
2747 2747
 				$mail_chimp_list_ids = array();
2748
-				if( isset( $list_data['data'] ) ) {
2749
-					foreach( $list_data['data'] as $list ) {
2750
-						$mail_chimp_list_ids[] = $list['id'];
2748
+				if ( isset( $list_data[ 'data' ] ) ) {
2749
+					foreach ( $list_data[ 'data' ] as $list ) {
2750
+						$mail_chimp_list_ids[ ] = $list[ 'id' ];
2751 2751
 					}
2752 2752
 					return $mail_chimp_list_ids;
2753 2753
 				} else {
@@ -2763,7 +2763,7 @@  discard block
 block discarded – undo
2763 2763
 		*/
2764 2764
 		public function yikes_mailchimp_load_helper_class() {
2765 2765
 			// check to see if it's already loaded up
2766
-			if( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2766
+			if ( ! class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2767 2767
 				// Include our main helper class file
2768 2768
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' );
2769 2769
 			}
@@ -2840,7 +2840,7 @@  discard block
 block discarded – undo
2840 2840
 		*	@since 6.0.4
2841 2841
 		*/
2842 2842
 		public function check_yikes_mc_table_version() {
2843
-			if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2843
+			if ( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2844 2844
 				require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php';
2845 2845
 				global $wpdb;
2846 2846
 				Yikes_Inc_Easy_Mailchimp_Extender_Activator::_activate_yikes_easy_mailchimp( $wpdb );
Please login to merge, or discard this patch.
admin/partials/menu/manage-lists.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 	// lets confirm the user has a valid API key stored
3
-	if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
3
+	if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
4 4
 		/// Check for a transient, if not - set one up for one hour
5 5
 		if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) {
6 6
 			$api_key = yikes_get_mc_api_key();
7 7
 			$dash_position = strpos( $api_key, '-' );
8
-			if( $dash_position !== false ) {
8
+			if ( $dash_position !== false ) {
9 9
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
10 10
 			}
11 11
 			$list_data = wp_remote_post( $api_endpoint, array(
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
18 18
 			) );
19 19
 			$list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
20
-			if( isset( $list_data['error'] ) ) {
21
-				if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
20
+			if ( isset( $list_data[ 'error' ] ) ) {
21
+				if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
22 22
 					require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
23 23
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
24
-					$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Manage Lists Page" );
24
+					$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Manage Lists Page" );
25 25
 				}
26 26
 			} else {
27 27
 				// set our transient
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 ?>
33 33
 <div class="wrap">
34 34
 	<!-- Freddie Logo -->
35
-	<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
35
+	<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
36 36
 
37
-	<h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
37
+	<h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
38 38
 
39 39
 	<!-- Settings Page Description -->
40
-	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your MailChimp lists on the following page. Select a list to make edits to it.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
40
+	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your MailChimp lists on the following page. Select a list to make edits to it.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
41 41
 
42 42
 	<?php
43 43
 		/* If the user hasn't authenticated yet, lets kill off */
44
-		if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
44
+		if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) {
45 45
 
46 46
 			$error_string = sprintf(
47 47
 				esc_html__( 'You need to connect to MailChimp before you can start creating forms. Head over to the %s and enter your API key.', 'yikes-inc-easy-mailchimp-extender' ),
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 									<!-- TABLE HEAD -->
78 78
 									<thead>
79 79
 										<tr>
80
-											<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
81
-											<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
80
+											<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
81
+											<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
82 82
 										</tr>
83 83
 									</thead>
84 84
 									<!-- end header -->
@@ -86,25 +86,25 @@  discard block
 block discarded – undo
86 86
 									<!-- FOOTER -->
87 87
 									<tfoot>
88 88
 										<tr>
89
-											<th class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
90
-											<th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
89
+											<th class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
90
+											<th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
91 91
 										</tr>
92 92
 									</tfoot>
93 93
 									<!-- end footer -->
94 94
 
95 95
 									<!-- TABLE BODY -->
96 96
 									<tbody>
97
-										<?php if( $list_data['total'] > 0 ) {
97
+										<?php if ( $list_data[ 'total' ] > 0 ) {
98 98
 												$i = 1;
99
-												foreach( $list_data['data'] as $list ) {
99
+												foreach ( $list_data[ 'data' ] as $list ) {
100 100
 										?>
101
-											<tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>">
101
+											<tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>">
102 102
 												<td class="column-columnname">
103
-													<a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>" class="row-title">
104
-														<?php echo stripslashes( $list['name'] ); ?>
103
+													<a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list[ 'id' ] ), admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>" class="row-title">
104
+														<?php echo stripslashes( $list[ 'name' ] ); ?>
105 105
 													</a>
106 106
 													<div class="row-actions">
107
-														<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View" , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span>
107
+														<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list[ 'id' ] ), admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View", 'yikes-inc-easy-mailchimp-extender' ); ?></a></span>
108 108
 														<?php
109 109
 															/*
110 110
 															*	Custom action to allow users to add additional action links
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
 														?>
115 115
 													</div>
116 116
 												</td>
117
-												<td class="column-columnname num"><?php echo $list['stats']['member_count']; ?></td>
117
+												<td class="column-columnname num"><?php echo $list[ 'stats' ][ 'member_count' ]; ?></td>
118 118
 											</tr>
119 119
 										<?php
120 120
 												$i++;
121 121
 												}
122 122
 											} else { ?>
123 123
 											<tr class="no-items">
124
-												<td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php printf( __( 'No MailChimp lists found. Head over to <a href="%s" title="MailChimp.com">MailChimp.com</a> to setup your first mailing list. Once thats done you can head back here to customize it!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://mailchimp.com/' ) ); ?></em></td>
124
+												<td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php printf( __( 'No MailChimp lists found. Head over to <a href="%s" title="MailChimp.com">MailChimp.com</a> to setup your first mailing list. Once thats done you can head back here to customize it!', 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://mailchimp.com/' ) ); ?></em></td>
125 125
 											</tr>
126 126
 										<?php } ?>
127 127
 									</tbody>
Please login to merge, or discard this patch.
admin/partials/menu/manage-forms.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 $all_forms = $form_interface->get_all_forms();
7 7
 
8 8
 /* Store Data if User is Authorized */
9
-if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
9
+if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
10 10
 	/// Check for a transient, if not - set one up for one hour
11 11
 	if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) {
12 12
 		$api_key = yikes_get_mc_api_key();
13 13
 		$dash_position = strpos( $api_key, '-' );
14
-		if( $dash_position !== false ) {
14
+		if ( $dash_position !== false ) {
15 15
 			$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
16 16
 		}
17 17
 		$list_data = wp_remote_post( $api_endpoint, array(
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 			'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
24 24
 		) );
25 25
 		$list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
26
-		if( isset( $list_data['error'] ) ) {
27
-			if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
26
+		if ( isset( $list_data[ 'error' ] ) ) {
27
+			if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
28 28
 				$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
29
-				$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Manage Forms Page" );
29
+				$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Manage Forms Page" );
30 30
 			}
31 31
 		} else {
32 32
 			// set our transient
@@ -39,18 +39,18 @@  discard block
 block discarded – undo
39 39
 ?>
40 40
 <div class="wrap">
41 41
 	<!-- Freddie Logo -->
42
-	<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
42
+	<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
43 43
 
44
-	<h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ) ?></h1>
44
+	<h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Forms', 'yikes-inc-easy-mailchimp-extender' ) ?></h1>
45 45
 
46 46
 	<!-- Settings Page Description -->
47
-	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Create and manage your MailChimp opt-in forms on the following page. Select a form to make edits to it.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
47
+	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Create and manage your MailChimp opt-in forms on the following page. Select a form to make edits to it.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
48 48
 
49 49
 	<!-- Action Notices -->
50 50
 	<?php
51 51
 
52 52
 	/* If the user hasn't authenticated yet, lets kill off */
53
-	if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
53
+	if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) {
54 54
 
55 55
 		$error_string = sprintf(
56 56
 			esc_html__( 'You need to connect to MailChimp before you can start creating forms. Head over to the %s and enter your API key.', 'yikes-inc-easy-mailchimp-extender' ),
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
 	/* Display our admin notices here */
72 72
 	// delete form success
73
-	if( isset( $_REQUEST['deleted-form'] ) && $_REQUEST['deleted-form'] == 'true' ) {
73
+	if ( isset( $_REQUEST[ 'deleted-form' ] ) && $_REQUEST[ 'deleted-form' ] == 'true' ) {
74 74
 		?>
75 75
 		<div class="updated manage-form-admin-notice">
76 76
 			<p><?php _e( 'Opt-in form successfully deleted.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		<?php
79 79
 	}
80 80
 	// duplicate form success
81
-	if( isset( $_REQUEST['duplicated-form'] ) && $_REQUEST['duplicated-form'] == 'true' ) {
81
+	if ( isset( $_REQUEST[ 'duplicated-form' ] ) && $_REQUEST[ 'duplicated-form' ] == 'true' ) {
82 82
 		?>
83 83
 		<div class="updated manage-form-admin-notice">
84 84
 			<p><?php _e( 'MailChimp Form successfully cloned.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		<?php
87 87
 	}
88 88
 	// duplicate form error
89
-	if( isset( $_REQUEST['duplicated-form'] ) && $_REQUEST['duplicated-form'] == 'false' ) {
89
+	if ( isset( $_REQUEST[ 'duplicated-form' ] ) && $_REQUEST[ 'duplicated-form' ] == 'false' ) {
90 90
 		?>
91 91
 		<div class="error manage-form-admin-notice">
92 92
 			<p><?php _e( 'There was an error trying to clone your form. Please try again. If this error persists, please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		<?php
95 95
 	}
96 96
 	// reset form submission stats success
97
-	if( isset( $_REQUEST['reset-stats'] ) && $_REQUEST['reset-stats'] == 'true' ) {
97
+	if ( isset( $_REQUEST[ 'reset-stats' ] ) && $_REQUEST[ 'reset-stats' ] == 'true' ) {
98 98
 		?>
99 99
 		<div class="updated manage-form-admin-notice">
100 100
 			<p><?php _e( 'Form submission stats/rates successfully reset.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		<?php
103 103
 	}
104 104
 	// reset form submission stats error
105
-	if( isset( $_REQUEST['reset-stats'] ) && $_REQUEST['reset-stats'] == 'false' ) {
105
+	if ( isset( $_REQUEST[ 'reset-stats' ] ) && $_REQUEST[ 'reset-stats' ] == 'false' ) {
106 106
 		?>
107 107
 		<div class="error manage-form-admin-notice">
108 108
 			<p><?php _e( 'There was an error trying to reset the form submission stats/rates. Please try again. If this error persists, please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 								<thead>
130 130
 									<tr>
131 131
 										<th id="cb" class="manage-column column-cb check-column num" scope="col"><input type="checkbox" /></th>
132
-										<th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
133
-										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
134
-										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
135
-										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
136
-										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
137
-										<th id="columnname" class="manage-column column-columnname num" scope="col" ><?php _e( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
138
-										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
132
+										<th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
133
+										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
134
+										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
135
+										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
136
+										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
137
+										<th id="columnname" class="manage-column column-columnname num" scope="col" ><?php _e( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
138
+										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
139 139
 									</tr>
140 140
 								</thead>
141 141
 								<!-- end header -->
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
 								<tfoot>
145 145
 									<tr>
146 146
 										<th class="manage-column column-cb check-column num" scope="col"><input type="checkbox" /></th>
147
-										<th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
148
-										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
149
-										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
150
-										<th class="manage-column column-columnname" scope="col"><?php _e( 'List' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
151
-										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
152
-										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
153
-										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
147
+										<th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
148
+										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
149
+										<th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
150
+										<th class="manage-column column-columnname" scope="col"><?php _e( 'List', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
151
+										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
152
+										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
153
+										<th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th>
154 154
 									</tr>
155 155
 								</tfoot>
156 156
 								<!-- end footer -->
@@ -160,57 +160,57 @@  discard block
 block discarded – undo
160 160
 									<?php
161 161
 									if ( count( $all_forms ) > 0 ) {
162 162
 										$i = 1;
163
-										foreach( $all_forms as $id => $form ) {
163
+										foreach ( $all_forms as $id => $form ) {
164 164
 										?>
165
-										<tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>">
165
+										<tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>">
166 166
 											<th class="check-column num" scope="row"><input type="checkbox" /></th>
167 167
 											<td class="column-columnname num"><span class="form-id-container"><?php echo intval( $id ); ?></span></td>
168 168
 											<td class="column-columnname">
169 169
 												<!-- row title/link -->
170
-												<a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ) , admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>" class="row-title">
171
-													<?php echo stripslashes( $form['form_name'] ); ?>
170
+												<a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ), admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>" class="row-title">
171
+													<?php echo stripslashes( $form[ 'form_name' ] ); ?>
172 172
 												</a>
173 173
 												<div class="row-actions">
174
-													<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ) , admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>"><?php _e( "Edit" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
175
-													<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-duplicate-form', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'duplicate-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Duplicate" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
176
-													<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-reset-stats', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'reset-stats-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Reset Stats" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
177
-													<span><a href="#" class="view-yikes-mc-form-shortcode" data-alt-text="<?php _e( 'Stats' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( "Shortcode" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
174
+													<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ), admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>"><?php _e( "Edit", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
175
+													<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-duplicate-form', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'duplicate-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Duplicate", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
176
+													<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-reset-stats', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'reset-stats-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Reset Stats", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
177
+													<span><a href="#" class="view-yikes-mc-form-shortcode" data-alt-text="<?php _e( 'Stats', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( "Shortcode", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
178 178
 													<?php
179 179
 														/*
180 180
 														*	Custom action to allow users to add additional action links
181 181
 														*	to each form. We use this in our add-ons.
182 182
 														*	- Delete should remain last
183 183
 														*/
184
-														do_action( 'yikes-mailchimp-custom-form-actions' , $id );
184
+														do_action( 'yikes-mailchimp-custom-form-actions', $id );
185 185
 													?>
186
-													<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'delete-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>" class="yikes-delete-mailchimp-form" onclick="return confirm('<?php printf( __( 'Are you sure you want to delete the %s form? This cannot be undone.' , 'yikes-inc-easy-mailchimp-extender' ), stripslashes( $form['form_name'] ) ); ?>');"><?php _e( "Delete" , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span>
186
+													<span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'delete-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>" class="yikes-delete-mailchimp-form" onclick="return confirm('<?php printf( __( 'Are you sure you want to delete the %s form? This cannot be undone.', 'yikes-inc-easy-mailchimp-extender' ), stripslashes( $form[ 'form_name' ] ) ); ?>');"><?php _e( "Delete", 'yikes-inc-easy-mailchimp-extender' ); ?></a></span>
187 187
 												</div>
188 188
 											</td>
189 189
 
190
-											<td class="column-columnname"><?php echo isset( $form['form_description'] ) ? str_replace( '[yikes-mailchimp-subscriber-count]', do_shortcode( '[yikes-mailchimp-subscriber-count form="' . $id . '"]' ), $form['form_description'] ) : ''; ?></td>
191
-											<td class="column-columnname"><?php if( isset( $list_data ) && $list_data['total'] > 0 ) { $key = $this->findMCListID( $form['list_id'] , $list_data['data'] ); if( isset( $key ) ) { echo $list_data['data'][$key]['name']; } else { echo '<strong>' . __( 'List Not Found' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>'; } } ?></td>
190
+											<td class="column-columnname"><?php echo isset( $form[ 'form_description' ] ) ? str_replace( '[yikes-mailchimp-subscriber-count]', do_shortcode( '[yikes-mailchimp-subscriber-count form="' . $id . '"]' ), $form[ 'form_description' ] ) : ''; ?></td>
191
+											<td class="column-columnname"><?php if ( isset( $list_data ) && $list_data[ 'total' ] > 0 ) { $key = $this->findMCListID( $form[ 'list_id' ], $list_data[ 'data' ] ); if ( isset( $key ) ) { echo $list_data[ 'data' ][ $key ][ 'name' ]; } else { echo '<strong>' . __( 'List Not Found', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>'; } } ?></td>
192 192
 
193 193
 											<td class="column-columnname num stat-container">
194 194
 												<?php
195
-													$impressions = number_format( $form['impressions'] );
196
-													echo '<span title="' . __( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $impressions . '</span>';
195
+													$impressions = number_format( $form[ 'impressions' ] );
196
+													echo '<span title="' . __( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $impressions . '</span>';
197 197
 												?>
198 198
 											</td>
199 199
 											<td class="column-columnname num stat-container">
200 200
 												<?php
201
-													$submissions = number_format( $form['submissions'] );
202
-													echo '<span title="' . __( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $submissions . '</span>';
201
+													$submissions = number_format( $form[ 'submissions' ] );
202
+													echo '<span title="' . __( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $submissions . '</span>';
203 203
 												?>
204 204
 											</td>
205 205
 											<td class="column-columnname num stat-container">
206 206
 												<?php
207
-													if( $impressions != 0 ) {
208
-														$conversion_rate = '%' . ( round( $form['submissions'] / $form['impressions'] , 2 ) * 100 );
209
-														if( $conversion_rate >= '%15' ) {
207
+													if ( $impressions != 0 ) {
208
+														$conversion_rate = '%' . ( round( $form[ 'submissions' ] / $form[ 'impressions' ], 2 ) * 100 );
209
+														if ( $conversion_rate >= '%15' ) {
210 210
 															$conversion_color = '#00cc00'; // green (unicorn!)
211
-														} else if( $conversion_rate < '%15' && $conversion_rate >= '%10' ) {
211
+														} else if ( $conversion_rate < '%15' && $conversion_rate >= '%10' ) {
212 212
 															$conversion_color = '#0080FF'; // light blue (good)
213
-														} else if( $conversion_rate < '%10' && $conversion_rate >= '%5' ) {
213
+														} else if ( $conversion_rate < '%10' && $conversion_rate >= '%5' ) {
214 214
 															$conversion_color = '#FFFF32'; // yellow (ok)
215 215
 														} else {
216 216
 															$conversion_color = '#FF0000'; // red (no bueno)
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 														$conversion_rate = '%0';
220 220
 														$conversion_color = '#333333';
221 221
 													}
222
-													echo '<span style="color:' . esc_attr( $conversion_color ) . ';" title="' . esc_attr__( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $conversion_rate . '</span>';
222
+													echo '<span style="color:' . esc_attr( $conversion_color ) . ';" title="' . esc_attr__( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $conversion_rate . '</span>';
223 223
 												?>
224 224
 											</td>
225 225
 											<!-- shortcode -->
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 											}
233 233
 										} else { ?>
234 234
 										<tr class="no-items">
235
-											<td class="colspanchange no-mailchimp-forms-found" colspan="8"><em><?php _e( 'No MailChimp forms found. Use the form to the right to create a new one.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td>
235
+											<td class="colspanchange no-mailchimp-forms-found" colspan="8"><em><?php _e( 'No MailChimp forms found. Use the form to the right to create a new one.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></td>
236 236
 										</tr>
237 237
 									<?php } ?>
238 238
 								</tbody>
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 					<div class="postbox yikes-easy-mc-postbox">
254 254
 
255 255
 						<?php
256
-							$this->generate_manage_forms_sidebar( $list_data['data'] );
256
+							$this->generate_manage_forms_sidebar( $list_data[ 'data' ] );
257 257
 						?>
258 258
 
259 259
 					</div> <!-- .postbox -->
Please login to merge, or discard this patch.
admin/partials/welcome-page/welcome-sections/knowledge-base-section.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,10 @@
 block discarded – undo
2 2
 /**
3 3
  * Welcome Page - Knowledge Base Links
4 4
  */
5
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+if ( ! defined( 'ABSPATH' ) ) {
6
+	exit;
7
+}
8
+// Exit if accessed directly
6 9
 ?>
7 10
 <div class="wrap about-wrap">
8 11
 
Please login to merge, or discard this patch.