Completed
Push — staging ( a71db2...a3b9a9 )
by Evan
20:58
created
admin/class-yikes-inc-easy-mailchimp-extender-admin.php 4 patches
Doc Comments   -4 removed lines patch added patch discarded remove patch
@@ -1214,8 +1214,6 @@  discard block
 block discarded – undo
1214 1214
 	 * the correct WordPress options API (old plugin stored options wierdly)
1215 1215
 	 *
1216 1216
 	 * @since    1.0.0
1217
-	 * @param      string    $yikes_inc_easy_mailchimp_extender       The name of this plugin.
1218
-	 * @param      string    $version    The version of this plugin.
1219 1217
 	 */
1220 1218
 	public function check_for_old_yks_mc_options() {
1221 1219
 		$old_plugin_options = get_option( 'ykseme_storage' );
@@ -1250,8 +1248,6 @@  discard block
 block discarded – undo
1250 1248
 		 * the correct WordPress options API (old plugin stored options wierdly)
1251 1249
 		 *
1252 1250
 		 * @since    1.0.0
1253
-		 * @param      string    $yikes_inc_easy_mailchimp_extender       The name of this plugin.
1254
-		 * @param      string    $version    The version of this plugin.
1255 1251
 		 */
1256 1252
 		public function display_options_migrate_notice() {
1257 1253
 			
Please login to merge, or discard this patch.
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 		*	@ return	array	$links		New array of plugin actions
185 185
 		*/
186 186
 		public function easy_forms_plugin_action_links( $links ) {
187
-		   $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
188
-		   $links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
189
-		   return $links;
187
+			$links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
188
+			$links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
189
+			return $links;
190 190
 		}
191 191
 
192 192
 		/**
@@ -419,10 +419,10 @@  discard block
 block discarded – undo
419 419
 		}
420 420
 
421 421
 		/**
422
-		*	Dismiss the migrate options notice (incase the user wants to do things manually)
423
-		*
424
-		*	@since 6.0.0
425
-		**/
422
+		 *	Dismiss the migrate options notice (incase the user wants to do things manually)
423
+		 *
424
+		 *	@since 6.0.0
425
+		 **/
426 426
 		public function yikes_easy_mailchimp_dismiss_option_migrate() {
427 427
 			// delete the options and allow the user to manually updadte things
428 428
 
@@ -560,10 +560,10 @@  discard block
 block discarded – undo
560 560
 		}
561 561
 
562 562
 		/**
563
-		* Localize Script
564
-		* Pass our imported list data, to the JS file
565
-		* to build the drop down list in the modal
566
-		*/
563
+		 * Localize Script
564
+		 * Pass our imported list data, to the JS file
565
+		 * to build the drop down list in the modal
566
+		 */
567 567
 		public function tinymce_yikes_easy_mc() {
568 568
 			// check capabilities
569 569
 			if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
 
728 728
 
729 729
 	/**
730
-	*	Localization functions for jQuery ui datepicker
731
-	*	@since 6.0.3.8
732
-	*/
730
+	 *	Localization functions for jQuery ui datepicker
731
+	 *	@since 6.0.3.8
732
+	 */
733 733
 		/**
734 734
 		 * Format array for the datepicker
735 735
 		 * WordPress stores the locale information in an array with a alphanumeric index, and
@@ -788,13 +788,13 @@  discard block
 block discarded – undo
788 788
 			 }
789 789
 		}
790 790
 	/**
791
-	*	end Localization functions for jQuery ui datepicker
792
-	*/
791
+	 *	end Localization functions for jQuery ui datepicker
792
+	 */
793 793
 
794 794
 	/**
795
-	*	Register our admin pages
796
-	*	used to display data back to the user
797
-	**/
795
+	 *	Register our admin pages
796
+	 *	used to display data back to the user
797
+	 **/
798 798
 	public function register_admin_pages() {
799 799
 
800 800
 		/* Top Level Menu 'Easy MailChimp' */
@@ -948,82 +948,82 @@  discard block
 block discarded – undo
948 948
 	}
949 949
 
950 950
 	/**
951
-	* Generate YIKES Inc. Easy MailChimp Manage Forms Page
952
-	*
953
-	* @since    1.0.0
954
-	*/
951
+	 * Generate YIKES Inc. Easy MailChimp Manage Forms Page
952
+	 *
953
+	 * @since    1.0.0
954
+	 */
955 955
 	function generateManageFormsPage() {
956 956
 		require_once YIKES_MC_PATH . 'admin/partials/menu/manage-forms.php'; // include our manage forms page
957 957
 	}
958 958
 
959 959
 	/**
960
-	* Generate YIKES Inc. Easy MailChimp Manage Lists Page
961
-	*
962
-	* @since    1.0.0
963
-	*/
960
+	 * Generate YIKES Inc. Easy MailChimp Manage Lists Page
961
+	 *
962
+	 * @since    1.0.0
963
+	 */
964 964
 	function generateManageListsPage() {
965 965
 		require_once YIKES_MC_PATH . 'admin/partials/menu/manage-lists.php'; // include our lists page
966 966
 	}
967 967
 
968 968
 	/**
969
-	* Generate YIKES Inc. Easy MailChimp Account Details Page
970
-	*
971
-	* @since    1.0.0
972
-	*/
969
+	 * Generate YIKES Inc. Easy MailChimp Account Details Page
970
+	 *
971
+	 * @since    1.0.0
972
+	 */
973 973
 	function generateAccountDetailsPage() {
974 974
 		require_once YIKES_MC_PATH . 'admin/partials/menu/account-details.php'; // include our account details page
975 975
 	}
976 976
 
977 977
 	/**
978
-	* Generate YIKES Inc. Easy MailChimp Support Page
979
-	*
980
-	* @since    1.0.0
981
-	*/
978
+	 * Generate YIKES Inc. Easy MailChimp Support Page
979
+	 *
980
+	 * @since    1.0.0
981
+	 */
982 982
 	function generateSupportPage() {
983 983
 		require_once YIKES_MC_PATH . 'admin/partials/menu/support.php'; // include our options page
984 984
 	}
985 985
 
986 986
 	/**
987
-	* Generate YIKES Inc. Easy MailChimp Edit Form Page
988
-	*
989
-	* @since    1.0.0
990
-	*/
987
+	 * Generate YIKES Inc. Easy MailChimp Edit Form Page
988
+	 *
989
+	 * @since    1.0.0
990
+	 */
991 991
 	function generateEditFormPage() {
992 992
 		require_once YIKES_MC_PATH . 'admin/partials/edit-form.php'; // include our options page
993 993
 	}
994 994
 
995 995
 	/**
996
-	* Generate YIKES Inc. Easy MailChimp Welcome Page
997
-	*
998
-	* @since    1.0.0
999
-	*/
996
+	 * Generate YIKES Inc. Easy MailChimp Welcome Page
997
+	 *
998
+	 * @since    1.0.0
999
+	 */
1000 1000
 	function generateWelcomePage() {
1001 1001
 		require_once YIKES_MC_PATH . 'admin/partials/welcome-page/welcome.php'; // include our options page
1002 1002
 	}
1003 1003
 
1004 1004
 	/**
1005
-	* Generate YIKES Inc. Easy MailChimp View List Page
1006
-	*
1007
-	* @since    1.0.0
1008
-	*/
1005
+	 * Generate YIKES Inc. Easy MailChimp View List Page
1006
+	 *
1007
+	 * @since    1.0.0
1008
+	 */
1009 1009
 	function generateViewListPage() {
1010 1010
 		require_once YIKES_MC_PATH . 'admin/partials/view-list.php'; // include our options page
1011 1011
 	}
1012 1012
 
1013 1013
 	/**
1014
-	* Generate YIKES Inc. Easy MailChimp View User Page
1015
-	*
1016
-	* @since    1.0.0
1017
-	*/
1014
+	 * Generate YIKES Inc. Easy MailChimp View User Page
1015
+	 *
1016
+	 * @since    1.0.0
1017
+	 */
1018 1018
 	function generateViewUserPage() {
1019 1019
 		require_once YIKES_MC_PATH . 'admin/partials/view-user.php'; // include our options page
1020 1020
 	}
1021 1021
 
1022 1022
 	/**
1023
-	*	Register our plugin settings, and display them on our settings page
1024
-	*
1025
-	* @since v.5.4
1026
-	**/
1023
+	 *	Register our plugin settings, and display them on our settings page
1024
+	 *
1025
+	 * @since v.5.4
1026
+	 **/
1027 1027
 	function yikes_easy_mc_settings_init() {
1028 1028
 
1029 1029
 		/* Register General Settings Section */
@@ -1139,9 +1139,9 @@  discard block
 block discarded – undo
1139 1139
 	}
1140 1140
 
1141 1141
 	/**
1142
-	*	Options Sanitization & Validation
1143
-	*	@since complete re-write
1144
-	**/
1142
+	 *	Options Sanitization & Validation
1143
+	 *	@since complete re-write
1144
+	 **/
1145 1145
 	function yikes_mc_validate_api_key( $input ) {
1146 1146
 		if( $input == '' ) {
1147 1147
 			return;
@@ -1180,20 +1180,20 @@  discard block
 block discarded – undo
1180 1180
 	}
1181 1181
 
1182 1182
 	/**
1183
-	* Generate YIKES Inc. Easy Forms for MailChimp Options Page
1184
-	*
1185
-	* @since    1.0.0
1186
-	*/
1183
+	 * Generate YIKES Inc. Easy Forms for MailChimp Options Page
1184
+	 *
1185
+	 * @since    1.0.0
1186
+	 */
1187 1187
 	function generatePageOptions() {
1188 1188
 		require_once YIKES_MC_PATH . 'admin/partials/menu/options.php'; // include our options page
1189 1189
 	}
1190 1190
 
1191 1191
 	/**
1192
-	*	Check if users API key is valid, if not
1193
-	*	this function will apply a disabled attribute
1194
-	*	to form fields. (input, dropdowns, buttons etc.)
1195
-	* 	@since v5.5 re-write
1196
-	**/
1192
+	 *	Check if users API key is valid, if not
1193
+	 *	this function will apply a disabled attribute
1194
+	 *	to form fields. (input, dropdowns, buttons etc.)
1195
+	 * 	@since v5.5 re-write
1196
+	 **/
1197 1197
 	public function is_user_mc_api_valid_form( $echo=true ) {
1198 1198
 		if( $echo == true ) {
1199 1199
 			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
@@ -1233,7 +1233,7 @@  discard block
 block discarded – undo
1233 1233
 	 * Migrate our old options , to the new options API
1234 1234
 	 * moving from 5.5 and beyond..
1235 1235
 	 * @since
1236
-	*/
1236
+	 */
1237 1237
 	public function migrate_old_yks_mc_options() {
1238 1238
 		// include our migrate options helper file
1239 1239
 		include_once YIKES_MC_PATH . 'admin/partials/upgrade-helpers/upgrade-migrate-options.php';
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 	/**
1243 1243
 		Admin Notices
1244 1244
 		- Notifications displayed at the top of admin pages, back to the user
1245
-	**/
1245
+	 **/
1246 1246
 
1247 1247
 		/**
1248 1248
 		 * Check for existing plugin options
@@ -1301,12 +1301,12 @@  discard block
 block discarded – undo
1301 1301
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1302 1302
 		*/
1303 1303
 		function findMCListID($id, $array) {
1304
-		   foreach ($array as $key => $val) {
1305
-			   if ($val['id'] === $id) {
1306
-				   return $key;
1307
-			   }
1308
-		   }
1309
-		   return null;
1304
+			foreach ($array as $key => $val) {
1305
+				if ($val['id'] === $id) {
1306
+					return $key;
1307
+				}
1308
+			}
1309
+			return null;
1310 1310
 		} // end
1311 1311
 
1312 1312
 		/* Ajax Migrate Options */
@@ -1643,9 +1643,9 @@  discard block
 block discarded – undo
1643 1643
 			}
1644 1644
 
1645 1645
 			/**
1646
-			*	Custom action hook for our extensions to hook into
1647
-			*	@parameter	get_current_screen()	current screen information
1648
-			*/
1646
+			 *	Custom action hook for our extensions to hook into
1647
+			 *	@parameter	get_current_screen()	current screen information
1648
+			 */
1649 1649
 			do_action( 'yikes-mailchimp-admin-sidebar', get_current_screen() );
1650 1650
 
1651 1651
 		}
@@ -2795,12 +2795,12 @@  discard block
 block discarded – undo
2795 2795
 		}
2796 2796
 
2797 2797
 		/**
2798
-		*	Return an array of MailChimp lists associated with this account
2799
-		*
2800
-		*	Used when deleting the sites MailChimp cache stored
2801
-		*	@since 6.0.2
2802
-		*	@return 	$list_id_array - array of list id's to loop over
2803
-		*/
2798
+		 *	Return an array of MailChimp lists associated with this account
2799
+		 *
2800
+		 *	Used when deleting the sites MailChimp cache stored
2801
+		 *	@since 6.0.2
2802
+		 *	@return 	$list_id_array - array of list id's to loop over
2803
+		 */
2804 2804
 		public function get_mailchimp_list_ids_on_account() {
2805 2805
 			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
2806 2806
 			if( ! $api_key ) {
@@ -2910,18 +2910,18 @@  discard block
 block discarded – undo
2910 2910
 		}
2911 2911
 
2912 2912
 		/**
2913
-		*	Hook in and display our support page/knowledge base articles
2914
-		*	on the support page
2915
-		*	@since 6.0.3.8
2916
-		*/
2913
+		 *	Hook in and display our support page/knowledge base articles
2914
+		 *	on the support page
2915
+		 *	@since 6.0.3.8
2916
+		 */
2917 2917
 		public function hook_and_display_kb_article_RSS() {
2918 2918
 			include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-articles-RSS.php' );
2919 2919
 		}
2920 2920
 
2921 2921
 		/**
2922
-		*	Check the users version number, and display a notice to upgrade the databse if needed
2923
-		*	@since 6.0.4
2924
-		*/
2922
+		 *	Check the users version number, and display a notice to upgrade the databse if needed
2923
+		 *	@since 6.0.4
2924
+		 */
2925 2925
 		public function check_yikes_mc_table_version() {
2926 2926
 			if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2927 2927
 				require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php';
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -413,8 +413,9 @@  discard block
 block discarded – undo
413 413
 			$create_ticket_response = wp_remote_retrieve_body( $response );
414 414
 
415 415
 			// display it
416
-			if( $create_ticket_response )
417
-				echo $create_ticket_response;
416
+			if( $create_ticket_response ) {
417
+							echo $create_ticket_response;
418
+			}
418 419
 
419 420
 		}
420 421
 
@@ -1160,7 +1161,7 @@  discard block
 block discarded – undo
1160 1161
 			if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) {
1161 1162
 				update_option( 'yikes-mc-api-validation' , 'valid_api_key' );
1162 1163
 			}
1163
-		}  else {
1164
+		} else {
1164 1165
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
1165 1166
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1166 1167
 			$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' ) );
@@ -2009,7 +2010,8 @@  discard block
 block discarded – undo
2009 2010
 
2010 2011
 
2011 2012
 
2012
-					} else { // THIS IS AN INTEREST GROUP!
2013
+					} else {
2014
+// THIS IS AN INTEREST GROUP!
2013 2015
 
2014 2016
 						?>
2015 2017
 						<section class="draggable" id="<?php echo $field['group_id']; ?>">
Please login to merge, or discard this patch.
Spacing   +555 added lines, -555 removed lines patch added patch discarded remove patch
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
 		$this->yikes_inc_easy_mailchimp_extender = $yikes_inc_easy_mailchimp_extender;
39 39
 		$this->version = $version;
40 40
 		// check for old plugin options and migrate if exist
41
-		add_action( 'admin_menu' , array( $this , 'register_admin_pages' ) , 11 );
41
+		add_action( 'admin_menu', array( $this, 'register_admin_pages' ), 11 );
42 42
 		// check for old plugin options and migrate if exist
43
-		add_action( 'admin_init' , array( $this , 'check_for_old_yks_mc_options' ) );
43
+		add_action( 'admin_init', array( $this, 'check_for_old_yks_mc_options' ) );
44 44
 		// Ajax function to update new options...
45
-		add_action( 'wp_ajax_migrate_old_plugin_settings', array( $this , 'migrate_archived_options' ) );
45
+		add_action( 'wp_ajax_migrate_old_plugin_settings', array( $this, 'migrate_archived_options' ) );
46 46
 		// Ajax function to migrate our forms
47
-		add_action( 'wp_ajax_migrate_prevoious_forms', array( $this , 'migrate_previously_setup_forms' ) );
47
+		add_action( 'wp_ajax_migrate_prevoious_forms', array( $this, 'migrate_previously_setup_forms' ) );
48 48
 		// fix menu icon spacing
49
-		add_action( 'admin_head' , array( $this , 'fix_menu_icon_spacing' ) );
49
+		add_action( 'admin_head', array( $this, 'fix_menu_icon_spacing' ) );
50 50
 		// register our plugin settings
51
-		add_action( 'admin_init', array( $this , 'yikes_easy_mc_settings_init' ) );
51
+		add_action( 'admin_init', array( $this, 'yikes_easy_mc_settings_init' ) );
52 52
 		// plugin redirect on activation
53
-		add_action( 'admin_init' , array( $this , 'yikes_easy_mc_activation_redirect' ) );
53
+		add_action( 'admin_init', array( $this, 'yikes_easy_mc_activation_redirect' ) );
54 54
 		// Include Third Party Extensions
55 55
 		include_once( YIKES_MC_PATH . 'includes/third-party-integrations/third-party-init.php' );
56 56
 		// Include our dashboard widget class
@@ -60,111 +60,111 @@  discard block
 block discarded – undo
60 60
 		// Include our ajax processing class
61 61
 		include_once( YIKES_MC_PATH . 'admin/partials/ajax/class.ajax.php' );
62 62
 		// load up our helper class
63
-		add_action( 'admin_init' , array( $this , 'yikes_mailchimp_load_helper_class' ) );
63
+		add_action( 'admin_init', array( $this, 'yikes_mailchimp_load_helper_class' ) );
64 64
 		// process the subscriber count shortcode in form descriptions
65 65
 		add_action( 'yikes-mailchimp-form-description', array( $this, 'process_subscriber_count_shortcode_in_form_descriptions' ), 10, 2 );
66 66
 		/***********************/
67 67
 		/** Create A Form **/
68 68
 		/**********************/
69 69
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-form' ) {
70
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_create_form' ) );
70
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
71 71
 		}
72 72
 		/***********************/
73 73
 		/** Delete A Form **/
74 74
 		/**********************/
75 75
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-delete-form' ) {
76
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_delete_form' ) );
76
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
77 77
 		}
78 78
 		/**********************************/
79 79
 		/** Duplicate/Clone A Form 	**/
80 80
 		/********************************/
81 81
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-duplicate-form' ) {
82
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_duplicate_form' ) );
82
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
83 83
 		}
84 84
 		/*************************************/
85 85
 		/**  Reset Form Impression Stats **/
86 86
 		/***********************************/
87 87
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-reset-stats' ) {
88
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_reset_impression_stats' ) );
88
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
89 89
 		}
90 90
 		/**********************************/
91 91
 		/** 	     Update A Form 		**/
92 92
 		/********************************/
93 93
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-update-form' ) {
94
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_update_form' ) );
94
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
95 95
 		}
96 96
 		/**************************************************/
97 97
 		/** 	 Clear Store MailChimp Transient Data   **/
98 98
 		/*************************************************/
99 99
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-transient-data' ) {
100
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_clear_transient_data' ) );
100
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
101 101
 		}
102 102
 		/*******************************************/
103 103
 		/** Remove a user from a mailing list 	 **/
104 104
 		/*****************************************/
105 105
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-unsubscribe-user' ) {
106
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_unsubscribe_user' ) );
106
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
107 107
 		}
108 108
 		/*******************************************/
109 109
 		/** 	Create misisng error log file  **/
110 110
 		/*****************************************/
111 111
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-error-log' ) {
112
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_create_missing_error_log' ) );
112
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
113 113
 		}
114 114
 		/*******************************************/
115 115
 		/**   TinyMCE Initialization Functions	 **/
116 116
 		/*****************************************/
117
-		add_action( 'admin_head' , array( $this, 'add_tinyMCE_buttons' ) );
117
+		add_action( 'admin_head', array( $this, 'add_tinyMCE_buttons' ) );
118 118
 		// pass our lists data to tinyMCE button for use
119
-		foreach ( array('post.php','post-new.php') as $hook ) {
119
+		foreach ( array( 'post.php', 'post-new.php' ) as $hook ) {
120 120
 			add_action( "admin_head-$hook", array( $this, 'tinymce_yikes_easy_mc' ) );
121 121
 		}
122 122
 		// display an admin notice for users on PHP < 5.3
123
-		if( phpversion() < '5.3' ) {
123
+		if ( phpversion() < '5.3' ) {
124 124
 			add_action( "admin_notices", array( $this, 'display_php_warning' ), 999 );
125 125
 		}
126 126
 		// two week , dismissable notification - check the users plugin installation date
127
-		add_action( 'admin_init', array( $this , 'yikes_easy_mailchimp_check_installation_date' ) );
127
+		add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_check_installation_date' ) );
128 128
 		// dismissable notice admin side
129
-		add_action( 'admin_init', array( $this , 'yikes_easy_mailchimp_stop_bugging_me' ), 5 );
129
+		add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_stop_bugging_me' ), 5 );
130 130
 		/**************************************************/
131 131
 		/** 	 	Clear MailChimp Error Log Data 	    **/
132 132
 		/*************************************************/
133 133
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-error-log' ) {
134
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_clear_error_log' ) );
134
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
135 135
 		}
136 136
 		/*********************************************/
137 137
 		/** 		Export MailChimp Opt-in Forms   **/
138 138
 		/*******************************************/
139 139
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-forms' ) {
140
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_export_forms' ) );
140
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
141 141
 		}
142 142
 		/*********************************************/
143 143
 		/** 				Export Plugin Settings    	   **/
144 144
 		/*******************************************/
145 145
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-settings' ) {
146
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_export_plugin_settings' ) );
146
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
147 147
 		}
148 148
 		/*******************************************/
149 149
 		/** 		Import Class Inclusion	   **/
150 150
 		/*****************************************/
151 151
 		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) {
152
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_import_forms' ) );
152
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
153 153
 		}
154 154
 		/*******************************************/
155 155
 		/** 	Premium Support Request     **/
156 156
 		/*****************************************/
157 157
 		if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) {
158
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_premium_support_request' ) );
158
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
159 159
 		}
160 160
 		/****************************************/
161 161
 		/**	Dismiss Options Migrations		**/
162 162
 		/****************************************/
163
-		if( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
164
-			add_action( 'init' , array( $this , 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
163
+		if ( isset( $_REQUEST[ 'dismiss_migration_nonce' ] ) ) {
164
+			add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
165 165
 		}
166 166
 		/** Parse default value into usable dynamic data **/
167
-		add_filter( 'yikes-mailchimp-process-default-tag' , array( $this , 'parse_mailchimp_default_tag' ) );
167
+		add_filter( 'yikes-mailchimp-process-default-tag', array( $this, 'parse_mailchimp_default_tag' ) );
168 168
 		/** Add a disclaimer to ensure that we let people know we are not endorsed/backed by MailChimp at all **/
169 169
 		add_filter( 'admin_footer_text', array( $this, 'yikes_easy_forms_admin_disclaimer' ) );
170 170
 		/** Add custom plugin action links **/
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 		*	@ return	array	$links		New array of plugin actions
185 185
 		*/
186 186
 		public function easy_forms_plugin_action_links( $links ) {
187
-		   $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
188
-		   $links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
187
+		   $links[ ] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) . '">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
188
+		   $links[ ] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
189 189
 		   return $links;
190 190
 		}
191 191
 
@@ -218,29 +218,29 @@  discard block
 block discarded – undo
218 218
 		*	@return	parsed tag content
219 219
 		*/
220 220
 		public function parse_mailchimp_default_tag( $default_tag ) {
221
-			if( ! $default_tag || $default_tag == '' ) {
221
+			if ( ! $default_tag || $default_tag == '' ) {
222 222
 				return $default_tag;
223 223
 			}
224 224
 			global $post;
225 225
 			// page title
226
-			if( $default_tag == '{page_title}' ) {
226
+			if ( $default_tag == '{page_title}' ) {
227 227
 				$default_tag = get_the_title( $post->ID );
228 228
 			}
229 229
 			// page id
230
-			if( $default_tag == '{page_title}' ) {
230
+			if ( $default_tag == '{page_title}' ) {
231 231
 				$default_tag = $post->ID;
232 232
 			}
233 233
 			// page url
234
-			if( $default_tag == '{page_url}' ) {
234
+			if ( $default_tag == '{page_url}' ) {
235 235
 				$default_tag = get_permalink( $post->ID );
236 236
 			}
237 237
 			// blog name
238
-			if( $default_tag == '{blog_name}' ) {
238
+			if ( $default_tag == '{blog_name}' ) {
239 239
 				$default_tag = get_bloginfo( 'name' );
240 240
 			}
241 241
 			// is user logged in
242
-			if( $default_tag == '{user_logged_in}' ) {
243
-				if( is_user_logged_in() ) {
242
+			if ( $default_tag == '{user_logged_in}' ) {
243
+				if ( is_user_logged_in() ) {
244 244
 					$default_tag = 'Registered User';
245 245
 				} else {
246 246
 					$default_tag = 'Guest User';
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
 		*/
259 259
 		public function yikes_easy_mailchimp_clear_error_log() {
260 260
 			// file put contents $returned error + other data
261
-			if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
261
+			if ( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
262 262
 				$clear_log = file_put_contents(
263 263
 					YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php',
264 264
 					''
265 265
 				);
266
-				if( $clear_log === false ) {
266
+				if ( $clear_log === false ) {
267 267
 					// redirect the user to the manage forms page, display error message
268 268
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error-log-cleared=false' ) ) );
269 269
 				} else {
@@ -281,20 +281,20 @@  discard block
 block discarded – undo
281 281
 		*/
282 282
 		public function yikes_easy_mailchimp_export_forms() {
283 283
 			// grab our nonce
284
-			$nonce = $_REQUEST['nonce'];
284
+			$nonce = $_REQUEST[ 'nonce' ];
285 285
 			// grab the forms
286
-			$forms = isset( $_REQUEST['export_forms'] ) ? $_REQUEST['export_forms'] : 'all';
286
+			$forms = isset( $_REQUEST[ 'export_forms' ] ) ? $_REQUEST[ 'export_forms' ] : 'all';
287 287
 			// validate nonce
288
-			if( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
289
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
288
+			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
289
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
290 290
 			}
291 291
 			// include the export class
292
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
292
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
293 293
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-export.class.php' );
294 294
 			}
295 295
 			// run the export function
296 296
 			// parameters: ( $table_name, $form_ids, $file_name )
297
-			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'yikes_easy_mc_forms' , $forms, 'Yikes-Inc-Easy-MailChimp-Forms-Export' );
297
+			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'yikes_easy_mc_forms', $forms, 'Yikes-Inc-Easy-MailChimp-Forms-Export' );
298 298
 			// re-direct the user back to the page
299 299
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) );
300 300
 			die();
@@ -308,13 +308,13 @@  discard block
 block discarded – undo
308 308
 		*/
309 309
 		public function yikes_easy_mailchimp_export_plugin_settings() {
310 310
 			// grab our nonce
311
-			$nonce = $_REQUEST['nonce'];
311
+			$nonce = $_REQUEST[ 'nonce' ];
312 312
 			// validate nonce
313
-			if( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
314
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
313
+			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
314
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
315 315
 			}
316 316
 			// include the export class
317
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
317
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) {
318 318
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-export.class.php' );
319 319
 			}
320 320
 			// run the export function
@@ -331,13 +331,13 @@  discard block
 block discarded – undo
331 331
 		*/
332 332
 		public function yikes_easy_mailchimp_import_forms() {
333 333
 			// grab our nonce
334
-			$nonce = $_REQUEST['nonce'];
334
+			$nonce = $_REQUEST[ 'nonce' ];
335 335
 			// validate nonce
336
-			if( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
337
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
336
+			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
337
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
338 338
 			}
339 339
 			// include the export class
340
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
340
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
341 341
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-import.class.php' );
342 342
 			}
343 343
 			// run the import function
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 		*/
356 356
 		public function yikes_easy_mailchimp_premium_support_request() {
357 357
 
358
-			if( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
359
-				return __( 'We encountered an error. Please contact the YIKES Inc. support team.' , 'yikes-inc-easy-mailchimp-extender' );
358
+			if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] != 'yikes-support-request' ) {
359
+				return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' );
360 360
 			}
361 361
 
362
-			$license = $_POST['license_key'];
363
-			$user_email = $_POST['user-email'];
364
-			$support_topic = $_POST['support-topic'];
365
-			$support_priority = $_POST['support-priority'];
366
-			$support_content = $_POST['support-content'];
362
+			$license = $_POST[ 'license_key' ];
363
+			$user_email = $_POST[ 'user-email' ];
364
+			$support_topic = $_POST[ 'support-topic' ];
365
+			$support_priority = $_POST[ 'support-priority' ];
366
+			$support_content = $_POST[ 'support-content' ];
367 367
 
368 368
 			// wp_die( print_r( $support_content) );
369 369
 
@@ -379,18 +379,18 @@  discard block
 block discarded – undo
379 379
 
380 380
 			$yikes_plugin_support_url = 'https://yikesplugins.com';
381 381
 
382
-			if( $license != 'plugin-core' ) {
382
+			if ( $license != 'plugin-core' ) {
383 383
 				$split_license = explode( '|', $license );
384 384
 				// first let's check that the license key is actually active
385 385
 				$is_license_key_active = wp_remote_post( esc_url( $yikes_plugin_support_url ), array(
386 386
 					'action' => 'check_license',
387
-					'product_name' => urlencode( str_replace( '-', '', $split_license[1] ) . 'for Easy MailChimp' ),
388
-					'license' => $split_license[0],
387
+					'product_name' => urlencode( str_replace( '-', '', $split_license[ 1 ] ) . 'for Easy MailChimp' ),
388
+					'license' => $split_license[ 0 ],
389 389
 				) );
390 390
 
391
-				$response_body =  wp_remote_retrieve_body( $is_license_key_active );
392
-				if( $response_body ) {
393
-					if( $response_body->status != 'valid' ) {
391
+				$response_body = wp_remote_retrieve_body( $is_license_key_active );
392
+				if ( $response_body ) {
393
+					if ( $response_body->status != 'valid' ) {
394 394
 						wp_die( 'Invalid License Key...' );
395 395
 					}
396 396
 				}
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 			) );
405 405
 
406 406
 			// catch the error
407
-			if( is_wp_error( $response ) ) {
407
+			if ( is_wp_error( $response ) ) {
408 408
 				wp_die( $create_ticket_request->getMessage() );
409 409
 				return;
410 410
 			}
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			$create_ticket_response = wp_remote_retrieve_body( $response );
414 414
 
415 415
 			// display it
416
-			if( $create_ticket_response )
416
+			if ( $create_ticket_response )
417 417
 				echo $create_ticket_response;
418 418
 
419 419
 		}
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 			// delete the options and allow the user to manually updadte things
428 428
 
429 429
 			// Verify the NONCE is valid
430
-			check_admin_referer( 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' );
430
+			check_admin_referer( 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' );
431 431
 
432 432
 			// re-direct the user back to the page
433 433
 			wp_redirect( esc_url_raw( admin_url( 'index.php?yikes-mc-options-migration-dismissed="true"' ) ) );
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 		 * @since 6.0.0
443 443
 		 */
444 444
 		public function load_error_logging_class() {
445
-			if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
445
+			if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
446 446
 				// if error logging is enabled we should include our error logging class
447 447
 				/* Generate oure error logging table */
448 448
 				require_once YIKES_MC_PATH . '/includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
@@ -461,17 +461,17 @@  discard block
 block discarded – undo
461 461
 			// add a new option to store the plugin activation date/time
462 462
 			// @since v6.0.0
463 463
 			// this is used to notify the user that they should review after 2 weeks
464
-			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
464
+			if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
465 465
 				add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) );
466 466
 			}
467 467
 
468 468
 			$stop_bugging_me = get_option( 'yikes_easy_mailchimp_review_stop_bugging_me' );
469 469
 
470
-			if( !$stop_bugging_me ) {
470
+			if ( ! $stop_bugging_me ) {
471 471
 				$install_date = get_option( 'yikes_easy_mailchimp_activation_date' );
472 472
 				$past_date = strtotime( '-14 days' );
473 473
 				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
474
-					add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) );
474
+					add_action( 'admin_notices', array( $this, 'yikes_easy_mailchimp_display_review_us_notice' ) );
475 475
 				}
476 476
 			}
477 477
 
@@ -484,13 +484,13 @@  discard block
 block discarded – undo
484 484
 		*/
485 485
 		public function yikes_easy_mailchimp_display_review_us_notice() {
486 486
 			/* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
487
-			if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
487
+			if ( in_array( get_current_screen()->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base, 'yikes-inc-easy-mailchimp' ) !== false ) {
488 488
 				// Review URL - Change to the URL of your plugin on WordPress.org
489 489
 				$reviewurl = 'https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender';
490 490
 				$addons_url = esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) );
491 491
 				$nobugurl = esc_url_raw( add_query_arg( 'yikes_easy_mc_icons_nobug', '1', admin_url() ) );
492 492
 				$review_message = '<div id="yikes-mailchimp-logo"></div>';
493
-				$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 ) . '';
493
+				$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 ) . '';
494 494
 				?>
495 495
 					<div id="review-yikes-easy-mailchimp-notice">
496 496
 						<?php echo $review_message; ?>
@@ -506,8 +506,8 @@  discard block
 block discarded – undo
506 506
 		*/
507 507
 		public function yikes_easy_mailchimp_stop_bugging_me() {
508 508
 			$nobug = "";
509
-			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) ) {
510
-				$nobug = (int) esc_attr( $_GET['yikes_easy_mc_icons_nobug'] );
509
+			if ( isset( $_GET[ 'yikes_easy_mc_icons_nobug' ] ) ) {
510
+				$nobug = (int) esc_attr( $_GET[ 'yikes_easy_mc_icons_nobug' ] );
511 511
 			}
512 512
 			if ( 1 == $nobug ) {
513 513
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', TRUE );
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 
519 519
 		/* Display a warning users who are using PHP < 5.3 */
520 520
 		public function display_php_warning() {
521
-			$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' );
521
+			$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' );
522 522
 			echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>";
523 523
 		}
524 524
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 		public function add_tinyMCE_buttons() {
530 530
 			global $typenow;
531 531
 			// only on Post Type: post and page
532
-			if( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
532
+			if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
533 533
 				return;
534 534
 			}
535 535
 			add_filter( 'mce_buttons', array( $this, 'yks_mc_add_tinymce_button' ) );
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 
546 546
 		// inlcude the js for tinymce
547 547
 		public function yks_mc_add_tinymce_plugin( $plugin_array ) {
548
-			$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
548
+			$plugin_array[ 'yks_mc_tinymce_button' ] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
549 549
 			// Print all plugin js path
550 550
 			// var_dump( $plugin_array );
551 551
 			return $plugin_array;
@@ -558,25 +558,25 @@  discard block
 block discarded – undo
558 558
 		*/
559 559
 		public function tinymce_yikes_easy_mc() {
560 560
 			// check capabilities
561
-			if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
561
+			if ( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
562 562
 				return;
563 563
 			}
564 564
 			global $wpdb;
565 565
 			$list_data = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A );
566 566
 			$lists = array();
567 567
 			$i = 0;
568
-			if( !empty( $list_data ) ) {
568
+			if ( ! empty( $list_data ) ) {
569 569
 				// build an array to pass to our javascript
570
-				foreach( $list_data as $form ) {
571
-						$lists[$i] = array(
572
-							'text' => urlencode( $form['form_name'] ),
573
-							'value' => $form['id']
570
+				foreach ( $list_data as $form ) {
571
+						$lists[ $i ] = array(
572
+							'text' => urlencode( $form[ 'form_name' ] ),
573
+							'value' => $form[ 'id' ]
574 574
 						);
575 575
 						$i++;
576 576
 				}
577 577
 			} else {
578
-				$lists[0] = array(
579
-					'text' => __( 'Please Import Some MailChimp Lists' , 'yikes-inc-easy-mailchimp-extender' ),
578
+				$lists[ 0 ] = array(
579
+					'text' => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ),
580 580
 					'value' => '-'
581 581
 				);
582 582
 			}
@@ -589,10 +589,10 @@  discard block
 block discarded – undo
589 589
 				var localized_data = {
590 590
 					'button_title' : '<?php _e( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ); ?>',
591 591
 					'popup_title' : '<?php _e( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ); ?>',
592
-					'list_id_label' : '<?php _e( 'MailChimp Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
593
-					'show_title_label' : '<?php _e( 'Display Form Title' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
594
-					'show_description_label' : '<?php _e( 'Display Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
595
-					'submit_button_text_label' : '<?php _e( 'Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ); ?>',
592
+					'list_id_label' : '<?php _e( 'MailChimp Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ); ?>',
593
+					'show_title_label' : '<?php _e( 'Display Form Title', 'yikes-inc-easy-mailchimp-extender' ); ?>',
594
+					'show_description_label' : '<?php _e( 'Display Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?>',
595
+					'submit_button_text_label' : '<?php _e( 'Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ); ?>',
596 596
 				};
597 597
 				<?php
598 598
 					$link = sprintf( __( 'You need to <a href="%s" title="%s">create a form</a> before you can add one to a page or post.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ) );
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 		if ( get_option( 'yikes_mailchimp_activation_redirect', 'true' ) == 'true' ) {
612 612
 			update_option( 'yikes_mailchimp_activation_redirect', 'false' );
613 613
 			/* If the user had this plugin activated prior to today, redirect to 'Whats New' */
614
-			if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
614
+			if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
615 615
 				wp_redirect( esc_url( admin_url( 'admin.php?page=yikes-mailchimp-welcome' ) ) );
616 616
 			} else {
617 617
 				/* Else redirect the user over to the 'Getting Started' tab */
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 		/**
668 668
 		 * Enqueue our scripts across the dashboard as needed
669 669
 		 */
670
-		wp_register_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery' , 'jquery-ui-sortable' ), $this->version, false );
670
+		wp_register_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery', 'jquery-ui-sortable' ), $this->version, false );
671 671
 		$localized_data = array(
672 672
 			'admin_url' => esc_url_raw( admin_url() ),
673 673
 			'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
@@ -675,19 +675,19 @@  discard block
 block discarded – undo
675 675
 			'search_preloader_url' => YIKES_MC_URL . 'includes/images/search-interest-group-preloader.gif',
676 676
 			'preloader_url' => esc_url_raw( admin_url( '/images/wpspin_light.gif' ) )
677 677
 		);
678
-		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js' , 'object_data' , $localized_data );
678
+		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js', 'object_data', $localized_data );
679 679
 		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js' );
680 680
 
681 681
 
682 682
 		/*
683 683
 		*	Enqueue required scripts for the form editor
684 684
 		*/
685
-		if( get_current_screen()->base == 'admin_page_yikes-mailchimp-edit-form' ) {
685
+		if ( get_current_screen()->base == 'admin_page_yikes-mailchimp-edit-form' ) {
686 686
 			global $wp_locale;
687 687
 			wp_enqueue_style( 'wp-color-picker' );
688 688
 			wp_enqueue_script( 'wp-color-picker' );
689
-			wp_enqueue_script( 'jquery.timepicker.js',YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js' , array( 'jquery' ) , $this->version, false );
690
-			wp_register_script( 'edit-form-js' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js' , array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ) , $this->version, false );
689
+			wp_enqueue_script( 'jquery.timepicker.js', YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ), $this->version, false );
690
+			wp_register_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ), $this->version, false );
691 691
 			$localized_data = array(
692 692
 				'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
693 693
 				'no_fields_assigned' => __( 'No fields assigned to this form. Select some fields to add to this form from the right hand column.', 'yikes-inc-easy-mailchimp-extender' ),
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 				'isRTL'             => $wp_locale->is_rtl(),
709 709
 				'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' ),
710 710
 			);
711
-			wp_localize_script( 'edit-form-js' , 'object' , $localized_data );
711
+			wp_localize_script( 'edit-form-js', 'object', $localized_data );
712 712
 			wp_enqueue_script( 'edit-form-js' );
713 713
 		}
714 714
 
@@ -728,8 +728,8 @@  discard block
 block discarded – undo
728 728
 		 * the datepicker wants a numerical index. This function replaces the index with a number
729 729
 		 */
730 730
 		public function yikes_jQuery_datepicker_strip_array_indices( $ArrayToStrip ) {
731
-			foreach( $ArrayToStrip as $objArrayItem) {
732
-				$NewArray[] =  $objArrayItem;
731
+			foreach ( $ArrayToStrip as $objArrayItem ) {
732
+				$NewArray[ ] = $objArrayItem;
733 733
 			}
734 734
 			return( $NewArray );
735 735
 		}
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 		 * Convert the php date format string to a js date format
794 794
 		 */
795 795
 		public function yikes_jQuery_datepicker_date_format( $site_option ) {
796
-			switch( $site_option ) {
796
+			switch ( $site_option ) {
797 797
 				//Predefined WP date formats
798 798
 				default:
799 799
 				case 'F j, Y':
@@ -820,9 +820,9 @@  discard block
 block discarded – undo
820 820
 
821 821
 		/* Top Level Menu 'Easy MailChimp' */
822 822
 		add_menu_page(
823
-			__( 'Easy Forms' , 'yikes-inc-easy-mailchimp-extender' ),
823
+			__( 'Easy Forms', 'yikes-inc-easy-mailchimp-extender' ),
824 824
 			'Easy Forms',
825
-			apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
825
+			apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
826 826
 			'yikes-inc-easy-mailchimp',
827 827
 			'', // no callback,
828 828
 			YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_wink_icon.png'
@@ -836,9 +836,9 @@  discard block
 block discarded – undo
836 836
 				/* YIKES Inc. Easy MailChimp Manage Forms */
837 837
 				add_submenu_page(
838 838
 					'yikes-inc-easy-mailchimp',
839
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
840
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
841
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
839
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
840
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
841
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
842 842
 					'yikes-inc-easy-mailchimp',
843 843
 					array( $this, 'generateManageFormsPage' )
844 844
 				);
@@ -846,9 +846,9 @@  discard block
 block discarded – undo
846 846
 				/* YIKES Inc. Easy MailChimp Manage Lists */
847 847
 				add_submenu_page(
848 848
 					'yikes-inc-easy-mailchimp',
849
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
850
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
851
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
849
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
850
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
851
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
852 852
 					'yikes-inc-easy-mailchimp-lists',
853 853
 					array( $this, 'generateManageListsPage' )
854 854
 				);
@@ -862,13 +862,13 @@  discard block
 block discarded – undo
862 862
 
863 863
 
864 864
 			/* YIKES Inc. Easy MailChimp Account Overview */
865
-			if ( get_option('yikes-mc-api-validation') == 'valid_api_key' ) {
865
+			if ( get_option( 'yikes-mc-api-validation' ) == 'valid_api_key' ) {
866 866
 				/* YIKES Inc. Easy MailChimp Settings */
867 867
 				add_submenu_page(
868 868
 					'yikes-inc-easy-mailchimp',
869
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
870
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
871
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
869
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
870
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
871
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
872 872
 					'yikes-inc-easy-mailchimp-account-overview',
873 873
 					array( $this, 'generateAccountDetailsPage' )
874 874
 				);
@@ -878,9 +878,9 @@  discard block
 block discarded – undo
878 878
 			/* YIKES Inc. Easy MailChimp Settings */
879 879
 			add_submenu_page(
880 880
 				'yikes-inc-easy-mailchimp',
881
-				__( 'Settings.' , 'yikes-inc-easy-mailchimp-extender' ),
882
-				__( 'Settings' , 'yikes-inc-easy-mailchimp-extender' ),
883
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
881
+				__( 'Settings.', 'yikes-inc-easy-mailchimp-extender' ),
882
+				__( 'Settings', 'yikes-inc-easy-mailchimp-extender' ),
883
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
884 884
 				'yikes-inc-easy-mailchimp-settings',
885 885
 				array( $this, 'generatePageOptions' )
886 886
 			);
@@ -888,9 +888,9 @@  discard block
 block discarded – undo
888 888
 			/* Support Page */
889 889
 			add_submenu_page(
890 890
 				'yikes-inc-easy-mailchimp',
891
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
892
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
893
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
891
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
892
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
893
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
894 894
 				'yikes-inc-easy-mailchimp-support',
895 895
 				array( $this, 'generateSupportPage' )
896 896
 			);
@@ -898,11 +898,11 @@  discard block
 block discarded – undo
898 898
 			/* Add-Ons Page */
899 899
 			add_submenu_page(
900 900
 				'yikes-inc-easy-mailchimp',
901
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
902
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
903
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
901
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
902
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
903
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
904 904
 				'yikes-inc-easy-mailchimp-addons',
905
-				array( $this , 'generateAddOnsPage' )
905
+				array( $this, 'generateAddOnsPage' )
906 906
 			);
907 907
 
908 908
 			/** Hidden Pages **/
@@ -910,9 +910,9 @@  discard block
 block discarded – undo
910 910
 				/* Add Hidden Edit Form Page */
911 911
 				add_submenu_page(
912 912
 					'options.php',
913
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
914
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
915
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
913
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
914
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
915
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
916 916
 					'yikes-mailchimp-edit-form',
917 917
 					array( $this, 'generateEditFormPage' )
918 918
 				);
@@ -920,19 +920,19 @@  discard block
 block discarded – undo
920 920
 				/* Add Hidden Migrate Options Page */
921 921
 				add_submenu_page(
922 922
 					'options-writing.php',
923
-					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure' , 'yikes-inc-easy-mailchimp-extender' ),
923
+					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure', 'yikes-inc-easy-mailchimp-extender' ),
924 924
 					'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure',
925 925
 					'manage_options',
926
-					'yikes-inc-easy-mailchimp-update' ,
927
-					array( $this , 'migrate_old_yks_mc_options' )
926
+					'yikes-inc-easy-mailchimp-update',
927
+					array( $this, 'migrate_old_yks_mc_options' )
928 928
 				);
929 929
 
930 930
 				/* Add Hidden Welcome Page */
931 931
 				add_submenu_page(
932 932
 					'options.php',
933
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
934
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
935
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
933
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
934
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
935
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
936 936
 					'yikes-mailchimp-welcome',
937 937
 					array( $this, 'generateWelcomePage' )
938 938
 				);
@@ -940,9 +940,9 @@  discard block
 block discarded – undo
940 940
 				/* Add Hidden 'View List' Page */
941 941
 				add_submenu_page(
942 942
 					'options.php',
943
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
944
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
945
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
943
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
944
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
945
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
946 946
 					'yikes-mailchimp-view-list',
947 947
 					array( $this, 'generateViewListPage' )
948 948
 				);
@@ -950,9 +950,9 @@  discard block
 block discarded – undo
950 950
 				/* Add Hidden View User Page */
951 951
 				add_submenu_page(
952 952
 					'options.php',
953
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
954
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
955
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
953
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
954
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
955
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
956 956
 					'yikes-mailchimp-view-user',
957 957
 					array( $this, 'generateViewUserPage' )
958 958
 				);
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
 
1050 1050
 		/* Register General Settings Section */
1051 1051
 
1052
-		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this , 'yikes_mc_validate_api_key' ) );
1052
+		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this, 'yikes_mc_validate_api_key' ) );
1053 1053
 
1054 1054
 		add_settings_section(
1055 1055
 			'yikes_easy_mc_settings_general_section_callback',
@@ -1092,16 +1092,16 @@  discard block
 block discarded – undo
1092 1092
 		add_settings_field(
1093 1093
 			'optin-checkbox-init',
1094 1094
 			__( 'Select Checkboxes to Generate', 'yikes-inc-easy-mailchimp-extender' ),
1095
-			'',  // callback + validation inside of admin/partials/menu/options.php
1095
+			'', // callback + validation inside of admin/partials/menu/options.php
1096 1096
 			'yikes_inc_easy_mc_checkbox_settings'
1097 1097
 		);
1098 1098
 		/* End Checkbox Settings */
1099 1099
 
1100 1100
 		/* reCAPTCHA Settings */
1101 1101
 
1102
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-status' );
1103
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-site-key' );
1104
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-secret-key' );
1102
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-status' );
1103
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-site-key' );
1104
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-secret-key' );
1105 1105
 
1106 1106
 			/* Register reCAPTCHA Settings Section */
1107 1107
 			add_settings_section(
@@ -1114,28 +1114,28 @@  discard block
 block discarded – undo
1114 1114
 			add_settings_field(
1115 1115
 				'yikes-mc-recaptcha-site-key',
1116 1116
 				__( 'Enter reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ),
1117
-				'',  // callback + validation inside of admin/partials/menu/options.php
1117
+				'', // callback + validation inside of admin/partials/menu/options.php
1118 1118
 				'yikes_easy_mc_settings_recpatcha_section'
1119 1119
 			);
1120 1120
 
1121 1121
 			add_settings_field(
1122 1122
 				'yikes-mc-recaptcha-secret-key',
1123 1123
 				__( 'Enter reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ),
1124
-				'',  // callback + validation inside of admin/partials/menu/options.php
1124
+				'', // callback + validation inside of admin/partials/menu/options.php
1125 1125
 				'yikes_easy_mc_settings_recpatcha_section'
1126 1126
 			);
1127 1127
 
1128 1128
 			add_settings_field(
1129 1129
 				'yikes-mc-recaptcha-status',
1130 1130
 				__( 'Enable ReCaptcha', 'yikes-inc-easy-mailchimp-extender' ),
1131
-				'',  // callback + validation inside of admin/partials/menu/options.php
1131
+				'', // callback + validation inside of admin/partials/menu/options.php
1132 1132
 				'yikes_easy_mc_settings_recpatcha_section'
1133 1133
 			);
1134 1134
 
1135 1135
 		/* End reCAPTCHA Settings */
1136 1136
 
1137 1137
 		/* Debug Settings */
1138
-			register_setting( 'yikes_inc_easy_mc_debug_settings_page' , 'yikes-mailchimp-debug-status' );
1138
+			register_setting( 'yikes_inc_easy_mc_debug_settings_page', 'yikes-mailchimp-debug-status' );
1139 1139
 
1140 1140
 			/* Register Debug Settings Section */
1141 1141
 			add_settings_section(
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
 			add_settings_field(
1149 1149
 				'yikes-mailchimp-debug-status',
1150 1150
 				__( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ),
1151
-				'',  // callback + validation inside of admin/partials/menu/options.php
1151
+				'', // callback + validation inside of admin/partials/menu/options.php
1152 1152
 				'yikes_easy_mc_settings_debug_section'
1153 1153
 			);
1154 1154
 
@@ -1164,16 +1164,16 @@  discard block
 block discarded – undo
1164 1164
 	*	@since complete re-write
1165 1165
 	**/
1166 1166
 	function yikes_mc_validate_api_key( $input ) {
1167
-		if( $input == '' ) {
1167
+		if ( $input == '' ) {
1168 1168
 			return;
1169 1169
 		}
1170 1170
 		$api_key = trim( $input );
1171 1171
 		$dash_position = strpos( trim( $input ), '-' );
1172
-		if( $dash_position !== false ) {
1172
+		if ( $dash_position !== false ) {
1173 1173
 			$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/ping.json';
1174 1174
 		} else {
1175 1175
 			update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) );
1176
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1176
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1177 1177
 			return $api_key;
1178 1178
 		}
1179 1179
 		$request_args = array(
@@ -1184,17 +1184,17 @@  discard block
 block discarded – undo
1184 1184
 			'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
1185 1185
 		);
1186 1186
 		$api_key_response = wp_remote_post( $api_endpoint, $request_args );
1187
-		if( ! is_wp_error( $api_key_response ) ) {
1187
+		if ( ! is_wp_error( $api_key_response ) ) {
1188 1188
 			$body = json_decode( wp_remote_retrieve_body( $api_key_response ), true );
1189
-			if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) {
1190
-				update_option( 'yikes-mc-api-validation' , 'valid_api_key' );
1189
+			if ( isset( $body[ 'msg' ] ) && $body[ 'msg' ] == "Everything's Chimpy!" ) {
1190
+				update_option( 'yikes-mc-api-validation', 'valid_api_key' );
1191 1191
 			}
1192
-		}  else {
1192
+		} else {
1193 1193
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
1194 1194
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1195
-			$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' ) );
1196
-			update_option( 'yikes-mc-api-invalid-key-response' , $api_key_response->get_error_message() );
1197
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1195
+			$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' ) );
1196
+			update_option( 'yikes-mc-api-invalid-key-response', $api_key_response->get_error_message() );
1197
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1198 1198
 		}
1199 1199
 		// returned the api key
1200 1200
 		return $api_key;
@@ -1215,13 +1215,13 @@  discard block
 block discarded – undo
1215 1215
 	*	to form fields. (input, dropdowns, buttons etc.)
1216 1216
 	* 	@since v5.5 re-write
1217 1217
 	**/
1218
-	public function is_user_mc_api_valid_form( $echo=true ) {
1219
-		if( $echo == true ) {
1220
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1218
+	public function is_user_mc_api_valid_form( $echo = true ) {
1219
+		if ( $echo == true ) {
1220
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1221 1221
 				echo 'disabled="disabled"';
1222 1222
 			}
1223 1223
 		} else {
1224
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1224
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1225 1225
 				return false;
1226 1226
 			} else {
1227 1227
 				return true;
@@ -1241,11 +1241,11 @@  discard block
 block discarded – undo
1241 1241
 	public function check_for_old_yks_mc_options() {
1242 1242
 		$old_plugin_options = get_option( 'ykseme_storage' );
1243 1243
 		// only perform options migrations if the site is not a multi-site setup
1244
-		if ( !is_multisite() ) {
1245
-			if( apply_filters( 'yikes_mc_old_options_filter' , $old_plugin_options ) ) {
1244
+		if ( ! is_multisite() ) {
1245
+			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1246 1246
 				// display a notice to the user that they should 'migrate'
1247 1247
 				// from the old plugin settings to the new ones
1248
-				add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 );
1248
+				add_action( 'admin_notices', array( $this, 'display_options_migrate_notice' ), 11 );
1249 1249
 			}
1250 1250
 		}
1251 1251
 	}
@@ -1278,11 +1278,11 @@  discard block
 block discarded – undo
1278 1278
 
1279 1279
 			// Confirm that the necessary forms table in the database exists, else bail
1280 1280
 			global $wpdb;
1281
-			if( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1281
+			if ( $wpdb->get_var( "show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'" ) != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1282 1282
 				return;
1283 1283
 			}
1284 1284
 
1285
-			if( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1285
+			if ( isset( $_GET[ 'yikes-mc-options-migration-dismissed' ] ) && $_GET[ 'yikes-mc-options-migration-dismissed' ] == 'true' ) {
1286 1286
 					// Delete the options, start a-new! (this will disable the migration notice altogether)
1287 1287
 					delete_option( 'widget_yikes_mc_widget' );
1288 1288
 					delete_option( 'api_validation' );
@@ -1296,18 +1296,18 @@  discard block
 block discarded – undo
1296 1296
 			} else {
1297 1297
 			?>
1298 1298
 				<div class="yikes-easy-mc-updated migrate-options-notice">
1299
-					<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>
1299
+					<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>
1300 1300
 					<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>
1301 1301
 					<p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1302 1302
 					<section id="migration-buttons">
1303 1303
 						<!-- migrate button -->
1304 1304
 						<form>
1305 1305
 							<input type="hidden" name="yikes-mc-update-option-structure" value="yikes-mc-update-option-structure" />
1306
-							<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>
1306
+							<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>
1307 1307
 						</form>
1308 1308
 						<!-- dismiss button -->
1309 1309
 						<form>
1310
-							<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>
1310
+							<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>
1311 1311
 						</form>
1312 1312
 					</section>
1313 1313
 
@@ -1321,9 +1321,9 @@  discard block
 block discarded – undo
1321 1321
 		*	and return the index ( used to find the list name assigned to a form )
1322 1322
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1323 1323
 		*/
1324
-		function findMCListID($id, $array) {
1325
-		   foreach ($array as $key => $val) {
1326
-			   if ($val['id'] === $id) {
1324
+		function findMCListID( $id, $array ) {
1325
+		   foreach ( $array as $key => $val ) {
1326
+			   if ( $val[ 'id' ] === $id ) {
1327 1327
 				   return $key;
1328 1328
 			   }
1329 1329
 		   }
@@ -1333,9 +1333,9 @@  discard block
 block discarded – undo
1333 1333
 		/* Ajax Migrate Options */
1334 1334
 		function migrate_archived_options() {
1335 1335
 			// all options prefixed with 'yikes-mc-'
1336
-			$option_name = 'yikes-mc-'.$_POST['option_name'];
1337
-			$option_value = $_POST['option_value'];
1338
-			if( json_decode( $option_value ) ) {
1336
+			$option_name = 'yikes-mc-' . $_POST[ 'option_name' ];
1337
+			$option_value = $_POST[ 'option_value' ];
1338
+			if ( json_decode( $option_value ) ) {
1339 1339
 				// decode our lists() array, and store it
1340 1340
 				$opt_value = json_decode( $option_value, true );
1341 1341
 			} else {
@@ -1348,24 +1348,24 @@  discard block
 block discarded – undo
1348 1348
 
1349 1349
 		/* Ajax Migrate Forms */
1350 1350
 		function migrate_previously_setup_forms() {
1351
-			$option_name = $_POST['option_name'];
1352
-			$done = $_POST['done_import'];
1351
+			$option_name = $_POST[ 'option_name' ];
1352
+			$done = $_POST[ 'done_import' ];
1353 1353
 			// Create some starter forms for the user
1354 1354
 			// based on previously imported lists (to our old version)
1355
-			if( $option_name == 'yikes-mc-lists' ) {
1355
+			if ( $option_name == 'yikes-mc-lists' ) {
1356 1356
 				global $wpdb;
1357
-				$option_value = $_POST['option_value'];
1358
-				$new_options = json_decode( stripslashes_deep( $option_value ) , true );
1357
+				$option_value = $_POST[ 'option_value' ];
1358
+				$new_options = json_decode( stripslashes_deep( $option_value ), true );
1359 1359
 
1360
-				$list_id = $new_options['id'];
1361
-				$form_name = $new_options['name'];
1362
-				$fields = $new_options['fields']; // our fields array
1360
+				$list_id = $new_options[ 'id' ];
1361
+				$form_name = $new_options[ 'name' ];
1362
+				$fields = $new_options[ 'fields' ]; // our fields array
1363 1363
 
1364
-				$custom_styles = isset( $new_options['custom_styles'] ) ? json_encode( $new_options['custom_styles'] ) : '0'; // store as an array with all of our styles
1365
-				$custom_template = isset( $new_options['custom_template'] ) ? json_encode( $new_options['custom_template'] ) : '0'; // store template data as an array ( active , template used )
1366
-				$send_welcome_email = isset( $new_options['yks_mailchimp_send_welcome_'.$list_id] ) ? '0' : '1';
1367
-				$redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1368
-				$redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1364
+				$custom_styles = isset( $new_options[ 'custom_styles' ] ) ? json_encode( $new_options[ 'custom_styles' ] ) : '0'; // store as an array with all of our styles
1365
+				$custom_template = isset( $new_options[ 'custom_template' ] ) ? json_encode( $new_options[ 'custom_template' ] ) : '0'; // store template data as an array ( active , template used )
1366
+				$send_welcome_email = isset( $new_options[ 'yks_mailchimp_send_welcome_' . $list_id ] ) ? '0' : '1';
1367
+				$redirect_user_on_submit = isset( $new_options[ 'yks_mailchimp_redirect_' . $list_id ] ) ? '1' : '0';
1368
+				$redirect_page = isset( $new_options[ 'page_id_' . $list_id ] ) ? $new_options[ 'page_id_' . $list_id ] : '';
1369 1369
 
1370 1370
 				/* Insert Forms Function  */
1371 1371
 				$wpdb->insert(
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 					)
1391 1391
 				);
1392 1392
 			}
1393
-			if( $done == 'done' ) {
1393
+			if ( $done == 'done' ) {
1394 1394
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => true ) );
1395 1395
 			} else {
1396 1396
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => false ) );
@@ -1405,35 +1405,35 @@  discard block
 block discarded – undo
1405 1405
 		*	@since v5.6 - complete re-write
1406 1406
 		*/
1407 1407
 		public function generate_options_pages_sidebar_menu() {
1408
-			if( isset( $_REQUEST['section'] ) ) {
1409
-				$selected = $_REQUEST['section'];
1408
+			if ( isset( $_REQUEST[ 'section' ] ) ) {
1409
+				$selected = $_REQUEST[ 'section' ];
1410 1410
 			}
1411
-			$installed_addons = get_option( 'yikes-easy-mc-active-addons' , array() );
1411
+			$installed_addons = get_option( 'yikes-easy-mc-active-addons', array() );
1412 1412
 			// sort our addons array alphabetically so they appear in similar orders across all sites
1413 1413
 			asort( $installed_addons );
1414 1414
 			?>
1415
-				<h3><span><?php _e( 'Additional Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1415
+				<h3><span><?php _e( 'Additional Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1416 1416
 				<div class="inside">
1417 1417
 					<ul id="settings-nav">
1418
-						<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>
1419
-						<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>
1420
-						<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>
1421
-						<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>
1422
-						<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>
1423
-						<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>
1418
+						<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>
1419
+						<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>
1420
+						<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>
1421
+						<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>
1422
+						<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>
1423
+						<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>
1424 1424
 					</ul>
1425 1425
 					<?php
1426 1426
 						// create our add-on settings pages
1427
-						if( !empty( $installed_addons ) ) {
1427
+						if ( ! empty( $installed_addons ) ) {
1428 1428
 							?>
1429 1429
 							<hr class="add-on-settings-divider" />
1430
-							<strong><?php _e( 'Addon Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1430
+							<strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1431 1431
 							<ul id="addon-settings-nav">
1432 1432
 							<?php
1433
-							foreach( $installed_addons as $addon_name ) {
1433
+							foreach ( $installed_addons as $addon_name ) {
1434 1434
 								?>
1435 1435
 									<li>
1436
-										<?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>
1436
+										<?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>
1437 1437
 								<?php
1438 1438
 							}
1439 1439
 							?>
@@ -1461,7 +1461,7 @@  discard block
 block discarded – undo
1461 1461
 				)
1462 1462
 			);
1463 1463
 			?>
1464
-				<h3><?php _e( 'Create a New Signup Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1464
+				<h3><?php _e( 'Create a New Signup Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1465 1465
 
1466 1466
 				<div class="inside">
1467 1467
 
@@ -1470,31 +1470,31 @@  discard block
 block discarded – undo
1470 1470
 					<form id="import-list-to-site" method="POST" action="<?php echo $url; ?>">
1471 1471
 						<input type="hidden" name="import-list-to-site" value="1" />
1472 1472
 						<!-- Name your new form -->
1473
-						<label for="form-name"><strong><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1474
-							<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>
1473
+						<label for="form-name"><strong><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1474
+							<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>
1475 1475
 						</label>
1476 1476
 						<!-- Name your new form -->
1477
-						<label for="form-description"><strong><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1478
-							<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>
1477
+						<label for="form-description"><strong><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1478
+							<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>
1479 1479
 						</label>
1480 1480
 						<!-- Associate this form with a list! -->
1481
-						<label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1482
-							<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"'; } ?>>
1481
+						<label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1482
+							<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"'; } ?>>
1483 1483
 								<?php
1484
-									if( isset( $lists ) && !empty( $lists ) ) {
1485
-										foreach( $lists as $mailing_list ) {
1484
+									if ( isset( $lists ) && ! empty( $lists ) ) {
1485
+										foreach ( $lists as $mailing_list ) {
1486 1486
 											?>
1487
-												<option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1487
+												<option value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option>
1488 1488
 											<?php
1489 1489
 										}
1490 1490
 									} else {
1491
-										if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1491
+										if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1492 1492
 											?>
1493
-												<option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1493
+												<option><?php echo __( "Please enter a valid API key.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1494 1494
 											<?php
1495 1495
 										} else {
1496 1496
 											?>
1497
-												<option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1497
+												<option><?php echo __( "No lists were found on the account.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1498 1498
 											<?php
1499 1499
 
1500 1500
 										}
@@ -1503,8 +1503,8 @@  discard block
 block discarded – undo
1503 1503
 							</select>
1504 1504
 
1505 1505
 							<?php
1506
-							if ( isset( $_GET['transient-cleared'] ) ) {
1507
-								if ( 'true' === $_GET['transient-cleared'] ) {
1506
+							if ( isset( $_GET[ 'transient-cleared' ] ) ) {
1507
+								if ( 'true' === $_GET[ 'transient-cleared' ] ) {
1508 1508
 									?>
1509 1509
 									<div class="yikes-list-refreshed-notice">
1510 1510
 										<p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -1513,11 +1513,11 @@  discard block
 block discarded – undo
1513 1513
 								}
1514 1514
 							}
1515 1515
 
1516
-							if( isset( $lists ) && empty( $lists ) ) {
1517
-								if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'invalid_api_key' ) {
1516
+							if ( isset( $lists ) && empty( $lists ) ) {
1517
+								if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1518 1518
 									?>
1519 1519
 										<p class="description">
1520
-											<?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' ) ); ?>
1520
+											<?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' ) ); ?>
1521 1521
 										</p>
1522 1522
 									<?php
1523 1523
 								}
@@ -1525,12 +1525,12 @@  discard block
 block discarded – undo
1525 1525
 							?>
1526 1526
 						</label>
1527 1527
 						<?php
1528
-							if( $this->is_user_mc_api_valid_form( false ) ) {
1529
-								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary' , '' , false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1528
+							if ( $this->is_user_mc_api_valid_form( false ) ) {
1529
+								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ), 'primary', '', false, array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1530 1530
 							} else {
1531
-								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1531
+								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1532 1532
 								?>
1533
-									<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>
1533
+									<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>
1534 1534
 								<?php
1535 1535
 							}
1536 1536
 						?>
@@ -1538,10 +1538,10 @@  discard block
 block discarded – undo
1538 1538
 
1539 1539
 					<!-- Clear API CACHE -->
1540 1540
 					<?php
1541
-					if( isset( $lists ) && ! empty( $lists ) ) {
1541
+					if ( isset( $lists ) && ! empty( $lists ) ) {
1542 1542
 						if ( false !== get_transient( 'yikes-easy-mailchimp-list-data' ) ) { ?>
1543
-							<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">
1544
-								<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1543
+							<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">
1544
+								<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists', 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1545 1545
 							</form>
1546 1546
 						<?php }
1547 1547
 					}
@@ -1557,14 +1557,14 @@  discard block
 block discarded – undo
1557 1557
 		public function generate_page_redirect_dropdown( $redirect, $redirect_page, $custom_redirect_url ) {
1558 1558
 				$post_types = get_post_types();
1559 1559
 				?>
1560
-				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1561
-					<?php _e( "Select A Page or Post" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1560
+				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1561
+					<?php _e( "Select A Page or Post", 'yikes-inc-easy-mailchimp-extender' ); ?>
1562 1562
 					<select id="redirect-user-to-selection" name="redirect-user-to-selection" onchange="shouldWeDisplayCustomURL( this );return;">
1563 1563
 				<?php
1564 1564
 					// loop over registered post types, and query!
1565
-						foreach( $post_types as $registered_post_type ) {
1565
+						foreach ( $post_types as $registered_post_type ) {
1566 1566
 							// exclude a few built in custom post types
1567
-							if( ! in_array( $registered_post_type , array( 'attachment' , 'revision' , 'nav_menu_item' ) ) ) {
1567
+							if ( ! in_array( $registered_post_type, array( 'attachment', 'revision', 'nav_menu_item' ) ) ) {
1568 1568
 								// run our query, to retreive the posts
1569 1569
 								$pages = get_posts( array(
1570 1570
 									'order' => 'ASC',
@@ -1574,12 +1574,12 @@  discard block
 block discarded – undo
1574 1574
 									'numberposts' => -1
1575 1575
 								) );
1576 1576
 								// only show cpt's that have posts assigned
1577
-								if( !empty( $pages ) ) {
1577
+								if ( ! empty( $pages ) ) {
1578 1578
 									?>
1579
-									<optgroup label="<?php echo ucwords( str_replace( '_' , ' ' , $registered_post_type ) ); ?>">
1579
+									<optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>">
1580 1580
 									<?php
1581
-										foreach( $pages as $page ) {
1582
-											?><option <?php selected( $redirect_page , $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1581
+										foreach ( $pages as $page ) {
1582
+											?><option <?php selected( $redirect_page, $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1583 1583
 										}
1584 1584
 									?>
1585 1585
 									<option <?php selected( $redirect_page, 'custom_url' ); ?> value="custom_url"><?php echo __( 'Custom URL', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
@@ -1591,8 +1591,8 @@  discard block
 block discarded – undo
1591 1591
 					?>
1592 1592
 					</select>
1593 1593
 
1594
-					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1595
-						<?php _e( "Enter Custom URL" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1594
+					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if ( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1595
+						<?php _e( "Enter Custom URL", 'yikes-inc-easy-mailchimp-extender' ); ?>
1596 1596
 						<input type="text" class="widefat custom-redirect-url" name="custom-redirect-url" value="<?php echo $custom_redirect_url; ?>" />
1597 1597
 					</label>
1598 1598
 
@@ -1609,11 +1609,11 @@  discard block
 block discarded – undo
1609 1609
 		public function generate_show_some_love_container() {
1610 1610
 			// if no active add-ons are installed,
1611 1611
 			// lets display our branding and add-on sidebar
1612
-			if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) {
1612
+			if ( get_option( 'yikes-easy-mc-active-addons', array() ) == array() ) {
1613 1613
 
1614 1614
 				/* On Edit Forms Page Display Upsell to Customizer */
1615 1615
 				$screen = get_current_screen();
1616
-				if( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1616
+				if ( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1617 1617
 				?>
1618 1618
 
1619 1619
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
@@ -1627,11 +1627,11 @@  discard block
 block discarded – undo
1627 1627
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
1628 1628
 
1629 1629
 						<!-- review us container -->
1630
-						<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>
1630
+						<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>
1631 1631
 						<div id="review-yikes-easy-mc" class="inside">
1632 1632
 
1633 1633
 							<p>
1634
-								<?php _e( 'Leave a review' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1634
+								<?php _e( 'Leave a review', 'yikes-inc-easy-mailchimp-extender' ); ?>
1635 1635
 								<p class="star-container">
1636 1636
 									<a href="https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender" target="_blank">
1637 1637
 										<b class="dashicons dashicons-star-filled"></b>
@@ -1643,21 +1643,21 @@  discard block
 block discarded – undo
1643 1643
 								</p>
1644 1644
 							</p>
1645 1645
 
1646
-							<?php _e( 'Tweet about it' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1646
+							<?php _e( 'Tweet about it', 'yikes-inc-easy-mailchimp-extender' ); ?>
1647 1647
 							<p class="sidebar-container">
1648 1648
 								<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>
1649 1649
 								<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>
1650 1650
 							</p>
1651 1651
 
1652
-							<?php _e( 'Vote that the plugin works' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1652
+							<?php _e( 'Vote that the plugin works', 'yikes-inc-easy-mailchimp-extender' ); ?>
1653 1653
 							<p class="sidebar-container">
1654 1654
 								<a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">
1655
-									<?php _e( 'Vote for Compatibility' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1655
+									<?php _e( 'Vote for Compatibility', 'yikes-inc-easy-mailchimp-extender' ); ?>
1656 1656
 								</a>
1657 1657
 							</p>
1658 1658
 						</div>
1659 1659
 
1660
-						<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>
1660
+						<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>
1661 1661
 
1662 1662
 						<section id="about-yikes-inc" class="inside">
1663 1663
 							<a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc.">
@@ -1673,10 +1673,10 @@  discard block
 block discarded – undo
1673 1673
 					<div class="postbox yikes-easy-mc-postbox">
1674 1674
 
1675 1675
 						<!-- review us container -->
1676
-						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1676
+						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1677 1677
 						<div id="review-yikes-easy-mc" class="inside">
1678
-							<p><?php _e( "Check out available add-ons for some seriously enhanced features." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1679
-							<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>
1678
+							<p><?php _e( "Check out available add-ons for some seriously enhanced features.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1679
+							<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>
1680 1680
 						</div>
1681 1681
 
1682 1682
 					</div>
@@ -1701,76 +1701,76 @@  discard block
 block discarded – undo
1701 1701
 		public function generate_form_editor( $form_fields, $list_id, $merge_variables, $interest_groups ) {
1702 1702
 
1703 1703
 			// if no list id, die!
1704
-			if( ! $list_id ) {
1705
-				die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) );
1704
+			if ( ! $list_id ) {
1705
+				die( __( "We've encountered an error. No list ID was sent.", 'yikes-inc-easy-mailchimp-extender' ) );
1706 1706
 			}
1707 1707
 
1708
-			if( ! $merge_variables ) {
1709
-				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' ) );
1708
+			if ( ! $merge_variables ) {
1709
+				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' ) );
1710 1710
 			}
1711 1711
 
1712
-			if( ! empty( $form_fields ) ) {
1712
+			if ( ! empty( $form_fields ) ) {
1713 1713
 
1714 1714
 				// find any fields that are assigned to this form, that don't exist in MailChimp
1715 1715
 				// or else were going to run into issues when we submit the form
1716 1716
 				$available_merge_variables = array();
1717 1717
 				$available_interest_groups = array();
1718 1718
 
1719
-				$assigned_fields= array();
1719
+				$assigned_fields = array();
1720 1720
 
1721 1721
 				// loop over merge variables
1722
-				if( ! empty( $merge_variables['data'][0]['merge_vars'] ) ) {
1723
-					foreach( $merge_variables['data'][0]['merge_vars'] as $merge_tag ) {
1724
-						$available_merge_variables[] = $merge_tag['tag'];
1722
+				if ( ! empty( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] ) ) {
1723
+					foreach ( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] as $merge_tag ) {
1724
+						$available_merge_variables[ ] = $merge_tag[ 'tag' ];
1725 1725
 					}
1726 1726
 				}
1727 1727
 
1728 1728
 				// loop over interest groups
1729
-				if( ! empty( $interest_groups ) && ! isset( $interest_groups['error'] ) ) {
1730
-					foreach( $interest_groups as $interest_group ) {
1731
-						$available_interest_groups[] = $interest_group['id'];
1729
+				if ( ! empty( $interest_groups ) && ! isset( $interest_groups[ 'error' ] ) ) {
1730
+					foreach ( $interest_groups as $interest_group ) {
1731
+						$available_interest_groups[ ] = $interest_group[ 'id' ];
1732 1732
 					}
1733 1733
 				}
1734 1734
 
1735 1735
 				// build our assigned fields
1736
-				foreach( $form_fields as $field => $value ) {
1737
-					$assigned_fields[] = $field;
1736
+				foreach ( $form_fields as $field => $value ) {
1737
+					$assigned_fields[ ] = $field;
1738 1738
 				}
1739 1739
 
1740
-				$merged_fields = array_merge( $available_merge_variables , $available_interest_groups );
1741
-				$excluded_fields = array_diff( $assigned_fields , $merged_fields );
1740
+				$merged_fields = array_merge( $available_merge_variables, $available_interest_groups );
1741
+				$excluded_fields = array_diff( $assigned_fields, $merged_fields );
1742 1742
 
1743 1743
 				$i = 1;
1744
-				foreach( $form_fields as $field ) {
1744
+				foreach ( $form_fields as $field ) {
1745 1745
 
1746
-					if( isset( $field['merge'] ) ) {
1746
+					if ( isset( $field[ 'merge' ] ) ) {
1747 1747
 					?>
1748
-						<section class="draggable" id="<?php echo $field['merge']; ?>">
1748
+						<section class="draggable" id="<?php echo $field[ 'merge' ]; ?>">
1749 1749
 							<!-- top -->
1750 1750
 							<a href="#" class="expansion-section-title settings-sidebar">
1751
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
1752
-								<?php if( in_array( $field['merge'] , $excluded_fields ) ) { ?>
1753
-									<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' ); ?>">
1751
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
1752
+								<?php if ( in_array( $field[ 'merge' ], $excluded_fields ) ) { ?>
1753
+									<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' ); ?>">
1754 1754
 								<?php } ?>
1755
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
1755
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
1756 1756
 							</a>
1757 1757
 							<!-- expansion section -->
1758 1758
 							<div class="yikes-mc-settings-expansion-section">
1759 1759
 
1760
-								<?php if( in_array( $field['merge'] , $excluded_fields ) ) { ?>
1761
-									<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>
1760
+								<?php if ( in_array( $field[ 'merge' ], $excluded_fields ) ) { ?>
1761
+									<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>
1762 1762
 								<?php } ?>
1763 1763
 
1764 1764
 								<!-- store the label -->
1765
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][label]" value="<?php echo $field['label']; ?>" />
1766
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][type]" value="<?php echo $field['type']; ?>" />
1767
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" />
1768
-								<input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" />
1765
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
1766
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
1767
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][merge]" value="<?php echo $field[ 'merge' ]; ?>" />
1768
+								<input type="hidden" class="field-<?php echo $field[ 'merge' ]; ?>-position position-input" name="field[<?php echo $field[ 'merge' ]; ?>][position]" value="<?php echo $i++; ?>" />
1769 1769
 
1770
-								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1771
-									$choices = json_decode( $field['choices'], true );
1770
+								<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'dropdown' || $field[ 'type' ] == 'select' ) {
1771
+									$choices = json_decode( $field[ 'choices' ], true );
1772 1772
 								?>
1773
-									<input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1773
+									<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1774 1774
 								<?php } ?>
1775 1775
 
1776 1776
 								<!-- Single or Double Opt-in -->
@@ -1782,16 +1782,16 @@  discard block
 block discarded – undo
1782 1782
 										<tr valign="top">
1783 1783
 											<td scope="row">
1784 1784
 												<label for="merge-tag">
1785
-													<?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1785
+													<?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?>
1786 1786
 												</label>
1787 1787
 											</td>
1788 1788
 											<td>
1789
-												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field['merge']; ?>">
1789
+												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field[ 'merge' ]; ?>">
1790 1790
 											</td>
1791 1791
 										</tr>
1792 1792
 
1793 1793
 										<!-- Placeholder Value -->
1794
-										<?php switch( $field['type'] ) {
1794
+										<?php switch ( $field[ 'type' ] ) {
1795 1795
 
1796 1796
 											case 'text':
1797 1797
 											case 'email':
@@ -1806,12 +1806,12 @@  discard block
 block discarded – undo
1806 1806
 										<tr valign="top">
1807 1807
 											<td scope="row">
1808 1808
 												<label for="placeholder">
1809
-													<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1809
+													<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1810 1810
 												</label>
1811 1811
 											</td>
1812 1812
 											<td>
1813
-												<input type="text" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : '' ; ?>" />
1814
-												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1813
+												<input type="text" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>" />
1814
+												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1815 1815
 											</td>
1816 1816
 										</tr>
1817 1817
 										<?php
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
 										?>
1821 1821
 
1822 1822
 										<!-- Default Value -->
1823
-										<?php switch( $field['type'] ) {
1823
+										<?php switch ( $field[ 'type' ] ) {
1824 1824
 											default:
1825 1825
 											case 'text':
1826 1826
 											case 'number':
@@ -1829,17 +1829,17 @@  discard block
 block discarded – undo
1829 1829
 											<tr valign="top">
1830 1830
 												<td scope="row">
1831 1831
 													<label for="placeholder">
1832
-														<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1832
+														<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
1833 1833
 													</label>
1834 1834
 												</td>
1835 1835
 												<td>
1836
-													<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 } ?> />
1837
-													<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>
1836
+													<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 } ?> />
1837
+													<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>
1838 1838
 													<?php
1839
-													switch( $field['type'] ) {
1839
+													switch ( $field[ 'type' ] ) {
1840 1840
 														case 'text':
1841 1841
 															?>
1842
-																<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>
1842
+																<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>
1843 1843
 															<?php
1844 1844
 														break;
1845 1845
 													} ?>
@@ -1853,18 +1853,18 @@  discard block
 block discarded – undo
1853 1853
 												<tr valign="top">
1854 1854
 													<td scope="row">
1855 1855
 														<label for="placeholder">
1856
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1856
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1857 1857
 														</label>
1858 1858
 													</td>
1859 1859
 													<td>
1860
-														<?php if( ! isset( $field['default_choice'] ) || empty( $field['default_choice'] ) ) { $decode = json_decode( $field['choices'], true ); $field['default_choice'] = $decode[0]; }
1860
+														<?php if ( ! isset( $field[ 'default_choice' ] ) || empty( $field[ 'default_choice' ] ) ) { $decode = json_decode( $field[ 'choices' ], true ); $field[ 'default_choice' ] = $decode[ 0 ]; }
1861 1861
 														$x = 0;
1862
-														foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1863
-															<label for="<?php echo $field['merge'].'-'.$x; ?>">
1864
-																<input id="<?php echo $field['merge'].'-'.$x; ?>" type="radio" name="field[<?php echo $field['merge']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $field['default_choice'], $x ); ?>><?php echo $value; ?>&nbsp;
1862
+														foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1863
+															<label for="<?php echo $field[ 'merge' ] . '-' . $x; ?>">
1864
+																<input id="<?php echo $field[ 'merge' ] . '-' . $x; ?>" type="radio" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $field[ 'default_choice' ], $x ); ?>><?php echo $value; ?>&nbsp;
1865 1865
 															</label>
1866 1866
 														<?php $x++; } ?>
1867
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1867
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1868 1868
 													</td>
1869 1869
 												</tr>
1870 1870
 
@@ -1876,16 +1876,16 @@  discard block
 block discarded – undo
1876 1876
 												<tr valign="top">
1877 1877
 													<td scope="row">
1878 1878
 														<label for="placeholder">
1879
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1879
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1880 1880
 														</label>
1881 1881
 													</td>
1882 1882
 													<td>
1883
-														<select type="default" name="field[<?php echo $field['merge']; ?>][default_choice]">
1884
-															<?php foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1885
-																<option value="<?php echo $choice; ?>" <?php selected( $field['default_choice'] , $choice ); ?>><?php echo $value; ?></option>
1883
+														<select type="default" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]">
1884
+															<?php foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1885
+																<option value="<?php echo $choice; ?>" <?php selected( $field[ 'default_choice' ], $choice ); ?>><?php echo $value; ?></option>
1886 1886
 															<?php } ?>
1887 1887
 														</select>
1888
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1888
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1889 1889
 													</td>
1890 1890
 												</tr>
1891 1891
 
@@ -1905,69 +1905,69 @@  discard block
 block discarded – undo
1905 1905
 										<tr valign="top">
1906 1906
 											<td scope="row">
1907 1907
 												<label for="placeholder">
1908
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1908
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
1909 1909
 												</label>
1910 1910
 											</td>
1911 1911
 											<td>
1912
-												<textarea class="widefat field-description-input" name="field[<?php echo $field['merge']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
1913
-												<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>
1912
+												<textarea class="widefat field-description-input" name="field[<?php echo $field[ 'merge' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
1913
+												<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>
1914 1914
 											</td>
1915 1915
 										</tr>
1916 1916
 										<!-- Additional Classes -->
1917 1917
 										<tr valign="top">
1918 1918
 											<td scope="row">
1919 1919
 												<label for="placeholder">
1920
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1920
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
1921 1921
 												</label>
1922 1922
 											</td>
1923 1923
 											<td>
1924
-												<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'] ) ) : '' ; ?>" />
1925
-												<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>
1924
+												<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' ] ) ) : ''; ?>" />
1925
+												<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>
1926 1926
 											</td>
1927 1927
 										</tr>
1928 1928
 										<!-- Required Toggle -->
1929 1929
 										<tr valign="top">
1930 1930
 											<td scope="row">
1931 1931
 												<label for="field-required">
1932
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1932
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
1933 1933
 												</label>
1934 1934
 											</td>
1935 1935
 											<td>
1936
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
1937
-												<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' ); } ?>">
1938
-												<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>
1936
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
1937
+												<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' ); } ?>">
1938
+												<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>
1939 1939
 											</td>
1940 1940
 										</tr>
1941 1941
 										<!-- Visible Toggle -->
1942 1942
 										<tr valign="top">
1943 1943
 											<td scope="row">
1944 1944
 												<label for="hide-field">
1945
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1945
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
1946 1946
 												</label>
1947 1947
 											</td>
1948 1948
 											<td>
1949
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
1950
-												<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' ); } ?>">
1951
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1949
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
1950
+												<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' ); } ?>">
1951
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1952 1952
 											</td>
1953 1953
 										</tr>
1954 1954
 										<!-- Toggle Field Label Visibility -->
1955 1955
 										<tr valign="top">
1956 1956
 											<td scope="row">
1957 1957
 												<label for="placeholder">
1958
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1958
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
1959 1959
 												</label>
1960 1960
 											</td>
1961 1961
 											<td>
1962
-												<?php $hide_label = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
1963
-												<input type="checkbox" name="field[<?php echo $field['merge']; ?>][hide-label]" value="1" <?php checked( $hide_label , 1 ); ?>/>
1964
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1962
+												<?php $hide_label = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
1963
+												<input type="checkbox" name="field[<?php echo $field[ 'merge' ]; ?>][hide-label]" value="1" <?php checked( $hide_label, 1 ); ?>/>
1964
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1965 1965
 											</td>
1966 1966
 										</tr>
1967 1967
 										<!-- Display Phone/Date Formats back to the user -->
1968 1968
 										<!-- Phone Format Initial Load -->
1969 1969
 										<?php
1970
-											switch( $field['type'] ) {
1970
+											switch ( $field[ 'type' ] ) {
1971 1971
 												/* Store the phone format, for properly regex pattern */
1972 1972
 												case 'phone':
1973 1973
 												case 'birthday':
@@ -1977,23 +1977,23 @@  discard block
 block discarded – undo
1977 1977
 															<td scope="row">
1978 1978
 																<label for="placeholder">
1979 1979
 																	<?php
1980
-																		switch( $field['type'] ) {
1980
+																		switch ( $field[ 'type' ] ) {
1981 1981
 																			default:
1982 1982
 																			case 'birthday':
1983
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
1984
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD';
1983
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
1984
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD';
1985 1985
 																				$format_name = 'date_format';
1986 1986
 																				break;
1987 1987
 
1988 1988
 																			case 'date':
1989
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
1990
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD/YYYY';
1989
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
1990
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD/YYYY';
1991 1991
 																				$format_name = 'date_format';
1992 1992
 																				break;
1993 1993
 
1994 1994
 																			case 'phone':
1995
-																				$type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
1996
-																				$format = ( ( $field['phone_format'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $field['phone_format'] . ' - (###) ### - ####' );
1995
+																				$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
1996
+																				$format = ( ( $field[ 'phone_format' ] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $field[ 'phone_format' ] . ' - (###) ### - ####' );
1997 1997
 																				$format_name = 'phone_format';
1998 1998
 																				break;
1999 1999
 																		}
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 															</td>
2004 2004
 															<td>
2005 2005
 																<strong><?php echo $format; ?></strong>
2006
-																<input type="hidden" name="field[<?php echo $field['merge']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
2006
+																<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
2007 2007
 																<p class="description"><small>
2008 2008
 																	<?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' ) ); ?>
2009 2009
 																</small></p>
@@ -2024,8 +2024,8 @@  discard block
 block discarded – undo
2024 2024
 											</td>
2025 2025
 											<td>
2026 2026
 												<span class="toggle-container">
2027
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2028
-													<a href="#" class="remove-field" alt="<?php echo $field['merge']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2027
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2028
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'merge' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2029 2029
 												</span>
2030 2030
 											</td>
2031 2031
 										</tr>
@@ -2041,35 +2041,35 @@  discard block
 block discarded – undo
2041 2041
 					} else { // THIS IS AN INTEREST GROUP!
2042 2042
 
2043 2043
 						?>
2044
-						<section class="draggable" id="<?php echo $field['group_id']; ?>">
2044
+						<section class="draggable" id="<?php echo $field[ 'group_id' ]; ?>">
2045 2045
 							<!-- top -->
2046 2046
 							<a href="#" class="expansion-section-title settings-sidebar">
2047
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
2048
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2049
-									<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' ); ?>">
2047
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
2048
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2049
+									<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' ); ?>">
2050 2050
 								<?php } ?>
2051
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
2051
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
2052 2052
 							</a>
2053 2053
 							<!-- expansion section -->
2054 2054
 							<div class="yikes-mc-settings-expansion-section">
2055 2055
 
2056 2056
 								<!-- check if this field exists in the available interest group array -->
2057
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2058
-									<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>
2057
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2058
+									<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>
2059 2059
 								<?php } ?>
2060 2060
 
2061 2061
 								<!-- store the label -->
2062
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][label]" value="<?php echo $field['label']; ?>" />
2063
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][type]" value="<?php echo $field['type']; ?>" />
2064
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][group_id]" value="<?php echo $field['group_id']; ?>" />
2065
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field['groups'], true ) ) ); ?>' />
2062
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
2063
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
2064
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][group_id]" value="<?php echo $field[ 'group_id' ]; ?>" />
2065
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field[ 'groups' ], true ) ) ); ?>' />
2066 2066
 
2067 2067
 								<!-- Single or Double Opt-in -->
2068 2068
 								<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
2069 2069
 
2070 2070
 									<table class="form-table form-field-container">
2071 2071
 										<!-- Default Value -->
2072
-										<?php switch( $field['type'] ) {
2072
+										<?php switch ( $field[ 'type' ] ) {
2073 2073
 
2074 2074
 											default:
2075 2075
 											case 'radio':
@@ -2078,26 +2078,26 @@  discard block
 block discarded – undo
2078 2078
 												<tr valign="top">
2079 2079
 													<td scope="row">
2080 2080
 														<label for="placeholder">
2081
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2081
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2082 2082
 														</label>
2083 2083
 													</td>
2084 2084
 													<td>
2085 2085
 														<?php
2086
-															if( $field['type'] != 'checkboxes' ) {
2087
-																if( !isset( $field['default_choice'] ) ) { $field['default_choice'] =  json_decode( stripslashes( $field['groups'] ) , true ); }
2086
+															if ( $field[ 'type' ] != 'checkboxes' ) {
2087
+																if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = json_decode( stripslashes( $field[ 'groups' ] ), true ); }
2088 2088
 															} else {
2089
-																if( !isset( $field['default_choice'] ) ) { $field['default_choice'] = array(); }
2089
+																if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = array(); }
2090 2090
 															}
2091 2091
 														$i = 0;
2092
-														foreach( json_decode( $field['groups'], true ) as $group ) { ?>
2093
-															<label for="<?php echo $field['group_id'].'-'.$i; ?>">
2094
-																<input id="<?php echo $field['group_id'].'-'.$i; ?>" type="<?php if( $field['type'] == 'radio' || $field['type'] == 'hidden' ) { ?>radio<?php } else if( $field['type'] == 'checkboxes' ) { ?>checkbox<?php } ?>" name="field[<?php echo $field['group_id']; ?>][default_choice]<?php if( $field['type'] == 'checkboxes' ) {echo '[]';}?>" value="<?php echo $i; ?>" <?php if( $field['type'] == 'radio' || $field['type'] == 'hidden' ) { checked( $field['default_choice'][0] , $i ); } else if( $field['type'] == 'checkboxes' ) { if( in_array( $i , $field['default_choice'] ) ) { echo 'checked="checked"'; } }?>><?php echo stripslashes( str_replace( '' , '\'' , $group['name'] ) ); ?>&nbsp;
2092
+														foreach ( json_decode( $field[ 'groups' ], true ) as $group ) { ?>
2093
+															<label for="<?php echo $field[ 'group_id' ] . '-' . $i; ?>">
2094
+																<input id="<?php echo $field[ 'group_id' ] . '-' . $i; ?>" type="<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'hidden' ) { ?>radio<?php } else if ( $field[ 'type' ] == 'checkboxes' ) { ?>checkbox<?php } ?>" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]<?php if ( $field[ 'type' ] == 'checkboxes' ) {echo '[]'; }?>" value="<?php echo $i; ?>" <?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'hidden' ) { checked( $field[ 'default_choice' ][ 0 ], $i ); } else if ( $field[ 'type' ] == 'checkboxes' ) { if ( in_array( $i, $field[ 'default_choice' ] ) ) { echo 'checked="checked"'; } }?>><?php echo stripslashes( str_replace( '', '\'', $group[ 'name' ] ) ); ?>&nbsp;
2095 2095
 															</label>
2096 2096
 														<?php
2097 2097
 															$i++;
2098 2098
 															}
2099 2099
 														?>
2100
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2100
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2101 2101
 													</td>
2102 2102
 												</tr>
2103 2103
 
@@ -2109,16 +2109,16 @@  discard block
 block discarded – undo
2109 2109
 												<tr valign="top">
2110 2110
 													<td scope="row">
2111 2111
 														<label for="placeholder">
2112
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2112
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2113 2113
 														</label>
2114 2114
 													</td>
2115 2115
 													<td>
2116
-														<select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2117
-															<?php $i = 0; foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as  $group ) { ?>
2118
-																<option value="<?php echo $i; ?>" <?php selected( $field['default_choice'] , $i ); ?>><?php echo stripslashes( $group['name'] ); ?></option>
2116
+														<select type="default" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]">
2117
+															<?php $i = 0; foreach ( json_decode( stripslashes_deep( $field[ 'groups' ] ), true ) as  $group ) { ?>
2118
+																<option value="<?php echo $i; ?>" <?php selected( $field[ 'default_choice' ], $i ); ?>><?php echo stripslashes( $group[ 'name' ] ); ?></option>
2119 2119
 															<?php $i++; } ?>
2120 2120
 														</select>
2121
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2121
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2122 2122
 													</td>
2123 2123
 												</tr>
2124 2124
 
@@ -2132,12 +2132,12 @@  discard block
 block discarded – undo
2132 2132
 										<tr valign="top">
2133 2133
 											<td scope="row">
2134 2134
 												<label for="placeholder">
2135
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2135
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
2136 2136
 												</label>
2137 2137
 											</td>
2138 2138
 											<td>
2139
-												<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>
2140
-												<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>
2139
+												<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>
2140
+												<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>
2141 2141
 											</td>
2142 2142
 										</tr>
2143 2143
 
@@ -2145,51 +2145,51 @@  discard block
 block discarded – undo
2145 2145
 										<tr valign="top">
2146 2146
 											<td scope="row">
2147 2147
 												<label for="placeholder">
2148
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2148
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2149 2149
 												</label>
2150 2150
 											</td>
2151 2151
 											<td>
2152
-												<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'] ) ) : '' ; ?>" />
2153
-												<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>
2152
+												<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' ] ) ) : ''; ?>" />
2153
+												<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>
2154 2154
 											</td>
2155 2155
 										</tr>
2156 2156
 										<!-- Required Toggle -->
2157 2157
 										<tr valign="top">
2158 2158
 											<td scope="row">
2159 2159
 												<label for="field-required">
2160
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2160
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2161 2161
 												</label>
2162 2162
 											</td>
2163 2163
 											<td>
2164
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2165
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][require]" <?php checked( $checked , 1 ); ?>>
2166
-												<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>
2164
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2165
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][require]" <?php checked( $checked, 1 ); ?>>
2166
+												<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>
2167 2167
 											</td>
2168 2168
 										</tr>
2169 2169
 										<!-- Visible Toggle -->
2170 2170
 										<tr valign="top">
2171 2171
 											<td scope="row">
2172 2172
 												<label for="hide-field">
2173
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2173
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2174 2174
 												</label>
2175 2175
 											</td>
2176 2176
 											<td>
2177
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2178
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][hide]" <?php checked( $hide , 1 ); ?>>
2179
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2177
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2178
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][hide]" <?php checked( $hide, 1 ); ?>>
2179
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2180 2180
 											</td>
2181 2181
 										</tr>
2182 2182
 										<!-- Toggle Field Label Visibility -->
2183 2183
 										<tr valign="top">
2184 2184
 											<td scope="row">
2185 2185
 												<label for="placeholder">
2186
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2186
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2187 2187
 												</label>
2188 2188
 											</td>
2189 2189
 											<td>
2190
-												<?php $hide = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2191
-												<input type="checkbox" name="field[<?php echo $field['group_id']; ?>][hide-label]" value="1" <?php checked( $hide , 1 ); ?>/>
2192
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2190
+												<?php $hide = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2191
+												<input type="checkbox" name="field[<?php echo $field[ 'group_id' ]; ?>][hide-label]" value="1" <?php checked( $hide, 1 ); ?>/>
2192
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2193 2193
 											</td>
2194 2194
 										</tr>
2195 2195
 										<!-- Toggle Buttons -->
@@ -2199,8 +2199,8 @@  discard block
 block discarded – undo
2199 2199
 											</td>
2200 2200
 											<td>
2201 2201
 												<span class="toggle-container">
2202
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2203
-													<a href="#" class="remove-field" alt="<?php echo $field['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2202
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2203
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2204 2204
 												</span>
2205 2205
 											</td>
2206 2206
 										</tr>
@@ -2214,38 +2214,38 @@  discard block
 block discarded – undo
2214 2214
 				}
2215 2215
 			} else {
2216 2216
 				?>
2217
-					<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>
2217
+					<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>
2218 2218
 				<?php
2219 2219
 			}
2220 2220
 				/* Pre Defined Merge Tag Container - Always rendered so the modal appears and links are clickable on initial page load */
2221 2221
 				add_thickbox();
2222 2222
 				// enqueue jquery qtip for our tooltip
2223
-				wp_enqueue_script( 'jquery-qtip-tooltip' , YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) );
2224
-				wp_enqueue_style( 'jquery-qtip-style' ,  YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2223
+				wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) );
2224
+				wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2225 2225
 					$available_tags = array(
2226 2226
 						array(
2227 2227
 							'tag' => '{page_title}',
2228
-							'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' ),
2228
+							'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' ),
2229 2229
 							'title' => __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' )
2230 2230
 						),
2231 2231
 						array(
2232 2232
 							'tag' => '{page_id}',
2233
-							'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' ),
2233
+							'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' ),
2234 2234
 							'title' => __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' )
2235 2235
 						),
2236 2236
 						array(
2237 2237
 							'tag' => '{page_url}',
2238
-							'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' ),
2238
+							'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' ),
2239 2239
 							'title' => __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' )
2240 2240
 						),
2241 2241
 						array(
2242 2242
 							'tag' => '{blog_name}',
2243
-							'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' ),
2243
+							'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' ),
2244 2244
 							'title' => __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' )
2245 2245
 						),
2246 2246
 						array(
2247 2247
 							'tag' => '{user_logged_in}',
2248
-							'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' ),
2248
+							'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' ),
2249 2249
 							'title' => __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' )
2250 2250
 						),
2251 2251
 					);
@@ -2273,17 +2273,17 @@  discard block
 block discarded – undo
2273 2273
 				<div id="pre-defined-tag-container">
2274 2274
 					<input type="hidden" value="" class="clicked-input">
2275 2275
 					<div id="pre-defined-tag-interior-container">
2276
-						<h3><?php _e( 'Pre Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2277
-						<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>
2276
+						<h3><?php _e( 'Pre Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2277
+						<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>
2278 2278
 						<ul>
2279
-							<?php foreach( apply_filters( 'yikes-mailchimp-custom-default-value-tags' , $available_tags ) as $tag ) { ?>
2279
+							<?php foreach ( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2280 2280
 								<li class="tooltop-tag">
2281 2281
 									<!-- link/tag -->
2282
-									<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>
2282
+									<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>
2283 2283
 									<!-- help icon -->
2284 2284
 									<span class="dashicons dashicons-editor-help"></span>
2285 2285
 									<!-- tooltip -->
2286
-									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag['description']; ?></div>
2286
+									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag[ 'description' ]; ?></div>
2287 2287
 								</li>
2288 2288
 							<?php } ?>
2289 2289
 						</ul>
@@ -2299,32 +2299,32 @@  discard block
 block discarded – undo
2299 2299
 		*	-
2300 2300
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2301 2301
 		*/
2302
-		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2302
+		public function build_available_merge_vars( $form_fields, $available_merge_variables ) {
2303 2303
 			$fields_assigned_to_form = array();
2304
-			if( !empty( $form_fields ) ) {
2305
-				foreach( $form_fields as $assigned_field ) {
2304
+			if ( ! empty( $form_fields ) ) {
2305
+				foreach ( $form_fields as $assigned_field ) {
2306 2306
 					// print_r( $assigned_field) ;
2307 2307
 					// switch between merge variables and interest groups
2308
-					if( isset( $assigned_field['merge'] ) ) {
2309
-						$fields_assigned_to_form[] = $assigned_field['merge'];
2308
+					if ( isset( $assigned_field[ 'merge' ] ) ) {
2309
+						$fields_assigned_to_form[ ] = $assigned_field[ 'merge' ];
2310 2310
 					}
2311 2311
 				}
2312 2312
 			}
2313
-			if( !empty( $available_merge_variables['data'][0] ) ) {
2313
+			if ( ! empty( $available_merge_variables[ 'data' ][ 0 ] ) ) {
2314 2314
 				?><ul id="available-fields"><?php
2315
-				foreach( $available_merge_variables['data'][0]['merge_vars'] as $merge_var ) {
2316
-					if( in_array( $merge_var['tag'] , $fields_assigned_to_form ) ) {
2315
+				foreach ( $available_merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] as $merge_var ) {
2316
+					if ( in_array( $merge_var[ 'tag' ], $fields_assigned_to_form ) ) {
2317 2317
 						?>
2318
-							<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>
2318
+							<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>
2319 2319
 						<?php
2320 2320
 					} else {
2321 2321
 						?>
2322
-							<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>
2322
+							<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>
2323 2323
 						<?php
2324 2324
 					}
2325 2325
 				}
2326 2326
 				?></ul>
2327
-				<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>
2327
+				<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>
2328 2328
 				<?php
2329 2329
 			}
2330 2330
 		}
@@ -2336,30 +2336,30 @@  discard block
 block discarded – undo
2336 2336
 		*	-
2337 2337
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2338 2338
 		*/
2339
-		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2339
+		public function build_available_interest_groups( $form_fields, $available_interest_groups, $list_id ) {
2340 2340
 			$fields_assigned_to_form = array();
2341
-			if( !empty( $form_fields ) ) {
2342
-					foreach( $form_fields as $assigned_interest_group ) {
2343
-					if( isset( $assigned_interest_group['group_id'] ) ) {
2344
-						$fields_assigned_to_form[] = $assigned_interest_group['group_id'];
2341
+			if ( ! empty( $form_fields ) ) {
2342
+					foreach ( $form_fields as $assigned_interest_group ) {
2343
+					if ( isset( $assigned_interest_group[ 'group_id' ] ) ) {
2344
+						$fields_assigned_to_form[ ] = $assigned_interest_group[ 'group_id' ];
2345 2345
 					}
2346 2346
 				}
2347 2347
 			}
2348
-			if( !empty( $available_interest_groups) ) {
2348
+			if ( ! empty( $available_interest_groups ) ) {
2349 2349
 				?><ul id="available-interest-groups"><?php
2350
-				foreach( $available_interest_groups as $interest_group ) {
2351
-					if( in_array( $interest_group['id'] , $fields_assigned_to_form ) ) {
2350
+				foreach ( $available_interest_groups as $interest_group ) {
2351
+					if ( in_array( $interest_group[ 'id' ], $fields_assigned_to_form ) ) {
2352 2352
 						?>
2353
-							<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>
2353
+							<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>
2354 2354
 						<?php
2355 2355
 					} else {
2356 2356
 						?>
2357
-							<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>
2357
+							<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>
2358 2358
 						<?php
2359 2359
 					}
2360 2360
 				}
2361 2361
 				?></ul>
2362
-				<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>
2362
+				<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>
2363 2363
 				<?php
2364 2364
 			}
2365 2365
 		}
@@ -2371,9 +2371,9 @@  discard block
 block discarded – undo
2371 2371
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2372 2372
 		*/
2373 2373
 		public function yikes_easy_mailchimp_create_form() {
2374
-			$nonce = $_REQUEST['nonce'];
2375
-			if( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2376
-				die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) );
2374
+			$nonce = $_REQUEST[ 'nonce' ];
2375
+			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2376
+				die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ) );
2377 2377
 			}
2378 2378
 			global $wpdb;
2379 2379
 				/* Default values */
@@ -2396,7 +2396,7 @@  discard block
 block discarded – undo
2396 2396
 					)
2397 2397
 				);
2398 2398
 				// setup our default error message array
2399
-				$error_settings= json_encode(
2399
+				$error_settings = json_encode(
2400 2400
 					array(
2401 2401
 						'success' => '',
2402 2402
 						'general-error' => '',
@@ -2410,9 +2410,9 @@  discard block
 block discarded – undo
2410 2410
 				$wpdb->insert(
2411 2411
 					$wpdb->prefix . 'yikes_easy_mc_forms',
2412 2412
 					array(
2413
-						'list_id' => $_POST['associated-list'],
2414
-						'form_name' => stripslashes( $_POST['form-name'] ),
2415
-						'form_description' => stripslashes( $_POST['form-description'] ),
2413
+						'list_id' => $_POST[ 'associated-list' ],
2414
+						'form_name' => stripslashes( $_POST[ 'form-name' ] ),
2415
+						'form_description' => stripslashes( $_POST[ 'form-description' ] ),
2416 2416
 						'fields' => '',
2417 2417
 						'custom_styles' => 0,
2418 2418
 						'custom_template' => 0,
@@ -2433,33 +2433,33 @@  discard block
 block discarded – undo
2433 2433
 						'%s', // form description
2434 2434
 						'%s', // fields
2435 2435
 						'%s', // custom styles
2436
-						'%d',	// custom template
2437
-						'%d',	// send welcome email
2438
-						'%s',	// redirect user
2439
-						'%s',	// redirect page
2440
-						'%s',	// submission
2441
-						'%s',	// optin
2436
+						'%d', // custom template
2437
+						'%d', // send welcome email
2438
+						'%s', // redirect user
2439
+						'%s', // redirect page
2440
+						'%s', // submission
2441
+						'%s', // optin
2442 2442
 						'%s', // error
2443 2443
 						'%s', // custom notifications
2444
-						'%d',	// impressions #
2445
-						'%d',	// submissions #
2444
+						'%d', // impressions #
2445
+						'%d', // submissions #
2446 2446
 						'%s', // custom fields
2447 2447
 					)
2448 2448
 				);
2449 2449
 
2450 2450
 			// if an error occurs during the form creation process
2451
-			if( $wpdb->insert_id == '0' ) {
2451
+			if ( $wpdb->insert_id == '0' ) {
2452 2452
 				// write it to the error log
2453 2453
 				// if the form was not created successfully
2454
-				if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2454
+				if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2455 2455
 					require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2456 2456
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2457
-					$error_logging->yikes_easy_mailchimp_write_to_error_log( $wpdb->last_error , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2457
+					$error_logging->yikes_easy_mailchimp_write_to_error_log( $wpdb->last_error, __( "Creating a new form", 'yikes-inc-easy-mailchimp-extender' ), __( "Forms", 'yikes-inc-easy-mailchimp-extender' ) );
2458 2458
 				}
2459
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error='.urlencode( $wpdb->last_error ) ) ) );
2459
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( $wpdb->last_error ) ) ) );
2460 2460
 			} else {
2461 2461
 				// redirect the user to the new form edit page
2462
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id='.$wpdb->insert_id ) ) );
2462
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $wpdb->insert_id ) ) );
2463 2463
 			}
2464 2464
 			exit();
2465 2465
 			die();
@@ -2473,11 +2473,11 @@  discard block
 block discarded – undo
2473 2473
 		*/
2474 2474
 		public function yikes_easy_mailchimp_delete_form() {
2475 2475
 			// grab & store our variables ( associated list & form name )
2476
-			$nonce = $_REQUEST['nonce'];
2477
-			$post_id_to_delete = $_REQUEST['mailchimp-form'];
2476
+			$nonce = $_REQUEST[ 'nonce' ];
2477
+			$post_id_to_delete = $_REQUEST[ 'mailchimp-form' ];
2478 2478
 			// verify our nonce
2479
-			if( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2480
-				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 ) );
2479
+			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-' . $post_id_to_delete ) ) {
2480
+				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 ) );
2481 2481
 			}
2482 2482
 			global $wpdb;
2483 2483
 				/* Working Insert Function */
@@ -2502,39 +2502,39 @@  discard block
 block discarded – undo
2502 2502
 		*/
2503 2503
 		public function yikes_easy_mailchimp_duplicate_form() {
2504 2504
 			// grab & store our variables ( associated list & form name )
2505
-			$nonce = $_REQUEST['nonce'];
2506
-			$post_id_to_clone = $_REQUEST['mailchimp-form'];
2505
+			$nonce = $_REQUEST[ 'nonce' ];
2506
+			$post_id_to_clone = $_REQUEST[ 'mailchimp-form' ];
2507 2507
 			// verify our nonce
2508
-			if( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2509
-				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 ) );
2508
+			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-' . $post_id_to_clone ) ) {
2509
+				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 ) );
2510 2510
 			}
2511 2511
 			global $wpdb;
2512 2512
 				/* Working Insert Function */
2513
-				$form_data = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "yikes_easy_mc_forms WHERE id = ".$post_id_to_clone."");
2513
+				$form_data = $wpdb->get_row( "SELECT * FROM " . $wpdb->prefix . "yikes_easy_mc_forms WHERE id = " . $post_id_to_clone . "" );
2514 2514
 				// create empty array to populate with row data
2515 2515
 				$data = array();
2516 2516
 				// build a data array to duplicate
2517
-				foreach( $form_data as $id => $value ) {
2517
+				foreach ( $form_data as $id => $value ) {
2518 2518
 					// skip the ID field this is unique
2519
-					if( $id != 'id' ) {
2519
+					if ( $id != 'id' ) {
2520 2520
 						// append -Copy- to our new form
2521
-						if( $id == 'form_name' ) {
2521
+						if ( $id == 'form_name' ) {
2522 2522
 							$value = $value . ' - Copy -';
2523 2523
 						}
2524 2524
 						// reset the impressions and submissions back to 0
2525
-						if( $id == 'impressions' || $id == 'submissions' ) {
2525
+						if ( $id == 'impressions' || $id == 'submissions' ) {
2526 2526
 							$value = '0';
2527 2527
 						}
2528 2528
 
2529 2529
 						// add data to our array
2530
-						$data[$id] = $value;
2530
+						$data[ $id ] = $value;
2531 2531
 					}
2532 2532
 				}
2533 2533
 				// insert our new data
2534
-				if( $wpdb->insert(
2534
+				if ( $wpdb->insert(
2535 2535
 					$wpdb->prefix . 'yikes_easy_mc_forms',
2536 2536
 					apply_filters( 'yikes-mailchimp-duplicate-form-data', $data )
2537
-				)  === FALSE ) {
2537
+				) === FALSE ) {
2538 2538
 					// redirect the user to the manage forms page, display error
2539 2539
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp&duplicated-form=false' ) ) );
2540 2540
 				} else {
@@ -2550,15 +2550,15 @@  discard block
 block discarded – undo
2550 2550
 		*/
2551 2551
 		public function yikes_easy_mailchimp_reset_impression_stats() {
2552 2552
 			// grab & store our variables ( associated list & form name )
2553
-			$nonce = $_REQUEST['nonce'];
2554
-			$form_id_to_reset = $_REQUEST['mailchimp-form'];
2553
+			$nonce = $_REQUEST[ 'nonce' ];
2554
+			$form_id_to_reset = $_REQUEST[ 'mailchimp-form' ];
2555 2555
 			// verify our nonce
2556
-			if( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2557
-				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 ) );
2556
+			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-' . $form_id_to_reset ) ) {
2557
+				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 ) );
2558 2558
 			}
2559 2559
 			global $wpdb;
2560 2560
 			/* Update 'Impressions/Submissions' */
2561
-			if( $wpdb->update(
2561
+			if ( $wpdb->update(
2562 2562
 				$wpdb->prefix . 'yikes_easy_mc_forms',
2563 2563
 				array(
2564 2564
 					'impressions' => 0,
@@ -2582,35 +2582,35 @@  discard block
 block discarded – undo
2582 2582
 		*/
2583 2583
 		public function yikes_easy_mailchimp_update_form() {
2584 2584
 			// grab & store our variables ( associated list & form name )
2585
-			$nonce = $_REQUEST['nonce'];
2586
-			$form_id = $_REQUEST['id'];
2585
+			$nonce = $_REQUEST[ 'nonce' ];
2586
+			$form_id = $_REQUEST[ 'id' ];
2587 2587
 
2588 2588
 			// store our values!
2589
-			$list_id = $_POST['associated-list'];
2590
-			$form_name = stripslashes( $_POST['form-name'] );
2591
-			$form_description = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
2592
-			$send_welcome_email = $_POST['send-welcome-email'];
2593
-			$redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2594
-			$redirect_page = $_POST['redirect-user-to-selection'];
2595
-			if( isset( $_POST['custom-styles'] ) ) {
2596
-				$custom_styles = $_POST['custom-styles'];
2589
+			$list_id = $_POST[ 'associated-list' ];
2590
+			$form_name = stripslashes( $_POST[ 'form-name' ] );
2591
+			$form_description = sanitize_text_field( stripslashes( $_POST[ 'form-description' ] ) );
2592
+			$send_welcome_email = $_POST[ 'send-welcome-email' ];
2593
+			$redirect_user_on_submit = $_POST[ 'redirect-user-on-submission' ];
2594
+			$redirect_page = $_POST[ 'redirect-user-to-selection' ];
2595
+			if ( isset( $_POST[ 'custom-styles' ] ) ) {
2596
+				$custom_styles = $_POST[ 'custom-styles' ];
2597 2597
 			}
2598 2598
 
2599 2599
 			// stripslashes_deep on save, to prevent foreign languages from added excessive backslashes
2600
-			$assigned_fields = isset( $_POST['field'] ) ? json_encode( stripslashes_deep( $_POST['field'] ) ) : '';
2600
+			$assigned_fields = isset( $_POST[ 'field' ] ) ? json_encode( stripslashes_deep( $_POST[ 'field' ] ) ) : '';
2601 2601
 
2602 2602
 			// setup our custom styles serialized array
2603
-			if( isset( $custom_styles ) ) {
2603
+			if ( isset( $custom_styles ) ) {
2604 2604
 				$custom_styles = json_encode( array(
2605
-					'active' => $_POST['custom-styles'],
2606
-					'background_color' => $_POST['form-background-color'],
2607
-					'font_color' => $_POST['form-font-color'],
2608
-					'submit_button_color' => $_POST['form-submit-button-color'],
2609
-					'submit_button_text_color' => $_POST['form-submit-button-text-color'],
2610
-					'form_padding' => $_POST['form-padding'],
2611
-					'form_width' => $_POST['form-width'],
2612
-					'form_alignment' => $_POST['form-alignment'],
2613
-					'label_visible' => $_POST['label-visible']
2605
+					'active' => $_POST[ 'custom-styles' ],
2606
+					'background_color' => $_POST[ 'form-background-color' ],
2607
+					'font_color' => $_POST[ 'form-font-color' ],
2608
+					'submit_button_color' => $_POST[ 'form-submit-button-color' ],
2609
+					'submit_button_text_color' => $_POST[ 'form-submit-button-text-color' ],
2610
+					'form_padding' => $_POST[ 'form-padding' ],
2611
+					'form_width' => $_POST[ 'form-width' ],
2612
+					'form_alignment' => $_POST[ 'form-alignment' ],
2613
+					'label_visible' => $_POST[ 'label-visible' ]
2614 2614
 				) );
2615 2615
 			} else {
2616 2616
 				$custom_styles = 0;
@@ -2619,33 +2619,33 @@  discard block
 block discarded – undo
2619 2619
 			// setup our submission settings serialized array
2620 2620
 			$submission_settings = json_encode(
2621 2621
 				array(
2622
-					'ajax' => $_POST['form-ajax-submission'],
2623
-					'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2624
-					'redirect_page' => $_POST['redirect-user-to-selection'],
2625
-					'custom_redirect_url' => esc_url( $_POST['custom-redirect-url'] ),
2626
-					'hide_form_post_signup' => $_POST['hide-form-post-signup'],
2627
-					'replace_interests' => $_POST['replace-interest-groups'],
2622
+					'ajax' => $_POST[ 'form-ajax-submission' ],
2623
+					'redirect_on_submission' => $_POST[ 'redirect-user-on-submission' ],
2624
+					'redirect_page' => $_POST[ 'redirect-user-to-selection' ],
2625
+					'custom_redirect_url' => esc_url( $_POST[ 'custom-redirect-url' ] ),
2626
+					'hide_form_post_signup' => $_POST[ 'hide-form-post-signup' ],
2627
+					'replace_interests' => $_POST[ 'replace-interest-groups' ],
2628 2628
 				)
2629 2629
 			);
2630 2630
 
2631 2631
 			// setup our opt-in settings serialized array
2632 2632
 			$optin_settings = json_encode(
2633 2633
 				array(
2634
-					'optin' => $_POST['single-double-optin'],
2635
-					'update_existing_user' => $_POST['update-existing-user'],
2636
-					'send_update_email' => $_POST['update-existing-email'],
2637
-					'send_welcome_email' => $_POST['send-welcome-email'],
2634
+					'optin' => $_POST[ 'single-double-optin' ],
2635
+					'update_existing_user' => $_POST[ 'update-existing-user' ],
2636
+					'send_update_email' => $_POST[ 'update-existing-email' ],
2637
+					'send_welcome_email' => $_POST[ 'send-welcome-email' ],
2638 2638
 				)
2639 2639
 			);
2640 2640
 
2641 2641
 			// setup our error settings serialized array
2642 2642
 			$error_settings = json_encode(
2643 2643
 				array(
2644
-					'success' => trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2645
-					'general-error' => trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2646
-					'invalid-email' => trim( $_POST['yikes-easy-mc-invalid-email-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-invalid-email-message'] ) ) : '',
2647
-					'already-subscribed' => trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2648
-					'update-link' => trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '',
2644
+					'success' => trim( $_POST[ 'yikes-easy-mc-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-message' ] ) ) : '',
2645
+					'general-error' => trim( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ) : '',
2646
+					'invalid-email' => trim( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ) : '',
2647
+					'already-subscribed' => trim( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ) : '',
2648
+					'update-link' => trim( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ) : '',
2649 2649
 				)
2650 2650
 			);
2651 2651
 
@@ -2654,33 +2654,33 @@  discard block
 block discarded – undo
2654 2654
 			// To Do: Combine date & time so it's a single unix timestamp
2655 2655
 			$form_settings = json_encode(
2656 2656
 				array(
2657
-					'yikes-easy-mc-form-class-names' => trim( $_POST['yikes-easy-mc-form-class-names'] ),
2658
-					'yikes-easy-mc-inline-form' => $_POST['yikes-easy-mc-inline-form'][0],
2659
-					'yikes-easy-mc-submit-button-type' => $_POST['yikes-easy-mc-submit-button-type'][0],
2660
-					'yikes-easy-mc-submit-button-text' => trim( $_POST['yikes-easy-mc-submit-button-text'] ),
2661
-					'yikes-easy-mc-submit-button-image' => esc_url( trim( $_POST['yikes-easy-mc-submit-button-image'] ) ),
2662
-					'yikes-easy-mc-submit-button-classes' => trim( $_POST['yikes-easy-mc-submit-button-classes'] ),
2663
-					'yikes-easy-mc-form-schedule' => ( isset( $_POST['yikes-easy-mc-form-schedule'] ) ) ? '1' : '0',
2664
-					'yikes-easy-mc-form-restriction-start' => strtotime( $_POST['yikes-easy-mc-form-restriction-start-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-start-time'] ),
2665
-					'yikes-easy-mc-form-restriction-end' => strtotime( $_POST['yikes-easy-mc-form-restriction-end-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-end-time'] ),
2666
-					'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST['yikes-easy-mc-form-restriction-pending-message'] ),
2667
-					'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST['yikes-easy-mc-form-restriction-expired-message'] ),
2668
-					'yikes-easy-mc-form-login-required' => ( isset( $_POST['yikes-easy-mc-form-login-required'] ) ) ? '1' : '0',
2669
-					'yikes-easy-mc-form-restriction-login-message' => trim( $_POST['yikes-easy-mc-form-restriction-login-message'] ),
2657
+					'yikes-easy-mc-form-class-names' => trim( $_POST[ 'yikes-easy-mc-form-class-names' ] ),
2658
+					'yikes-easy-mc-inline-form' => $_POST[ 'yikes-easy-mc-inline-form' ][ 0 ],
2659
+					'yikes-easy-mc-submit-button-type' => $_POST[ 'yikes-easy-mc-submit-button-type' ][ 0 ],
2660
+					'yikes-easy-mc-submit-button-text' => trim( $_POST[ 'yikes-easy-mc-submit-button-text' ] ),
2661
+					'yikes-easy-mc-submit-button-image' => esc_url( trim( $_POST[ 'yikes-easy-mc-submit-button-image' ] ) ),
2662
+					'yikes-easy-mc-submit-button-classes' => trim( $_POST[ 'yikes-easy-mc-submit-button-classes' ] ),
2663
+					'yikes-easy-mc-form-schedule' => ( isset( $_POST[ 'yikes-easy-mc-form-schedule' ] ) ) ? '1' : '0',
2664
+					'yikes-easy-mc-form-restriction-start' => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-start-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-start-time' ] ),
2665
+					'yikes-easy-mc-form-restriction-end' => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-end-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-end-time' ] ),
2666
+					'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-pending-message' ] ),
2667
+					'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-expired-message' ] ),
2668
+					'yikes-easy-mc-form-login-required' => ( isset( $_POST[ 'yikes-easy-mc-form-login-required' ] ) ) ? '1' : '0',
2669
+					'yikes-easy-mc-form-restriction-login-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-login-message' ] ),
2670 2670
 				)
2671 2671
 			);
2672 2672
 
2673 2673
 			// setup and store our notification array
2674
-			$custom_notifications = isset( $_POST['custom-notification'] ) ? stripslashes( json_encode( $_POST['custom-notification'] ) ) : '';
2674
+			$custom_notifications = isset( $_POST[ 'custom-notification' ] ) ? stripslashes( json_encode( $_POST[ 'custom-notification' ] ) ) : '';
2675 2675
 
2676 2676
 			// additional custom fields (extensions / user defined fields)
2677
-			if( isset( $_POST['custom-field'] ) ) {
2677
+			if ( isset( $_POST[ 'custom-field' ] ) ) {
2678 2678
 				$custom_field_array = array();
2679
-				foreach( $_POST['custom-field'] as $custom_field => $custom_value ) {
2680
-					if( is_array( $custom_value ) ) {
2681
-						$custom_field_array[$custom_field] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2679
+				foreach ( $_POST[ 'custom-field' ] as $custom_field => $custom_value ) {
2680
+					if ( is_array( $custom_value ) ) {
2681
+						$custom_field_array[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2682 2682
 					} else {
2683
-						$custom_field_array[$custom_field] = stripslashes( $custom_value );
2683
+						$custom_field_array[ $custom_field ] = stripslashes( $custom_value );
2684 2684
 					}
2685 2685
 				}
2686 2686
 				$custom_fields = json_encode( $custom_field_array );
@@ -2689,8 +2689,8 @@  discard block
 block discarded – undo
2689 2689
 			}
2690 2690
 
2691 2691
 			// verify our nonce
2692
-			if( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-'.$form_id ) ) {
2693
-				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 ) );
2692
+			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
2693
+				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 ) );
2694 2694
 			}
2695 2695
 
2696 2696
 				global $wpdb;
@@ -2722,12 +2722,12 @@  discard block
 block discarded – undo
2722 2722
 						'%s', // form description
2723 2723
 						'%s', // fields
2724 2724
 						'%s', // custom styles
2725
-						'%d',	//custom template
2726
-						'%d',	// send welcome email
2727
-						'%s',	// redirect user
2728
-						'%s',	// redirect page
2729
-						'%s',	// submission
2730
-						'%s',	// opt-in
2725
+						'%d', //custom template
2726
+						'%d', // send welcome email
2727
+						'%s', // redirect user
2728
+						'%s', // redirect page
2729
+						'%s', // submission
2730
+						'%s', // opt-in
2731 2731
 						'%s', // error
2732 2732
 						'%s', // custom notifications
2733 2733
 						'%s', // custom fields
@@ -2736,7 +2736,7 @@  discard block
 block discarded – undo
2736 2736
 				);
2737 2737
 
2738 2738
 			/* Custom action hook which allows users to update specific options when a form is updated - used in add ons */
2739
-			do_action( 'yikes-mailchimp-save-form', $form_id,  json_decode( $custom_fields, true ) );
2739
+			do_action( 'yikes-mailchimp-save-form', $form_id, json_decode( $custom_fields, true ) );
2740 2740
 
2741 2741
 			// redirect the user to the manage forms page, display confirmation
2742 2742
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form_id . '&updated-form=true' ) ) );
@@ -2746,18 +2746,18 @@  discard block
 block discarded – undo
2746 2746
 
2747 2747
 		/* Unsubscribe a given user from our list */
2748 2748
 		public function yikes_easy_mailchimp_unsubscribe_user() {
2749
-			$nonce = $_REQUEST['nonce'];
2750
-			$list_id = $_REQUEST['mailchimp-list'];
2751
-			$email_id = $_REQUEST['email_id'];
2749
+			$nonce = $_REQUEST[ 'nonce' ];
2750
+			$list_id = $_REQUEST[ 'mailchimp-list' ];
2751
+			$email_id = $_REQUEST[ 'email_id' ];
2752 2752
 			// verify our nonce
2753
-			if( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2754
-				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 ) );
2753
+			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2754
+				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 ) );
2755 2755
 			}
2756 2756
 			// only re-run the API request if our API key has changed
2757 2757
 			// initialize MailChimp Class
2758
-			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
2758
+			$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
2759 2759
 			$dash_position = strpos( $api_key, '-' );
2760
-			if( $dash_position !== false ) {
2760
+			if ( $dash_position !== false ) {
2761 2761
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/unsubscribe.json';
2762 2762
 			}
2763 2763
 			$response = wp_remote_post( $api_endpoint, array(
@@ -2771,13 +2771,13 @@  discard block
 block discarded – undo
2771 2771
 				'timeout' => 10,
2772 2772
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2773 2773
 			) );
2774
-			if( ! is_wp_error( $response ) ) {
2774
+			if ( ! is_wp_error( $response ) ) {
2775 2775
 				$response_body = json_decode( wp_remote_retrieve_body( $response ), true );
2776
-				if( isset( $response_body['error'] ) ) {
2777
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2776
+				if ( isset( $response_body[ 'error' ] ) ) {
2777
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2778 2778
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2779 2779
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2780
-						$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' ) );
2780
+						$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' ) );
2781 2781
 					}
2782 2782
 				}
2783 2783
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id . '&user-unsubscribed=true' ) ) );
@@ -2788,21 +2788,21 @@  discard block
 block discarded – undo
2788 2788
 
2789 2789
 		public function yikes_easy_mailchimp_create_missing_error_log() {
2790 2790
 			// grab our nonnce
2791
-			$nonce = $_REQUEST['nonce'];
2791
+			$nonce = $_REQUEST[ 'nonce' ];
2792 2792
 			// validate nonce
2793
-			if( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2794
-				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 ) );
2793
+			if ( ! wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2794
+				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 ) );
2795 2795
 			}
2796 2796
 			// setup the path to the error log
2797
-			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php' , 'w' );
2797
+			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' );
2798 2798
 			try {
2799 2799
 				// create the file
2800
-				fwrite( $error_log , '' );
2800
+				fwrite( $error_log, '' );
2801 2801
 				// close out
2802 2802
 				fclose( $error_log );
2803 2803
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=true' ) ) );
2804 2804
 			} catch ( Exception $e ) {
2805
-				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() ) ) ) );
2805
+				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() ) ) ) );
2806 2806
 			}
2807 2807
 		}
2808 2808
 
@@ -2813,16 +2813,16 @@  discard block
 block discarded – undo
2813 2813
 		public function yikes_easy_mailchimp_clear_transient_data() {
2814 2814
 			$referer = wp_get_referer();
2815 2815
 			// grab & store our variables ( associated list & form name )
2816
-			$nonce = $_REQUEST['nonce'];
2816
+			$nonce = $_REQUEST[ 'nonce' ];
2817 2817
 			// verify our nonce
2818
-			if( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2819
-				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 ) );
2818
+			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2819
+				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 ) );
2820 2820
 			}
2821 2821
 			// delete all of the integration settings list data in the cache
2822 2822
 			$list_ids = $this->get_mailchimp_list_ids_on_account();
2823 2823
 			// confirm the list IDs was returned and is not empty
2824
-			if( isset( $list_ids ) && ! empty( $list_ids ) ) {
2825
-				foreach( $list_ids as $id ) {
2824
+			if ( isset( $list_ids ) && ! empty( $list_ids ) ) {
2825
+				foreach ( $list_ids as $id ) {
2826 2826
 					// loop over each interest group and delete the transient associated with it
2827 2827
 					// this is created & stored on the integration list page
2828 2828
 					// id = groupID_interest_group
@@ -2854,13 +2854,13 @@  discard block
 block discarded – undo
2854 2854
 		*	@return 	$list_id_array - array of list id's to loop over
2855 2855
 		*/
2856 2856
 		public function get_mailchimp_list_ids_on_account() {
2857
-			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
2858
-			if( ! $api_key ) {
2857
+			$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
2858
+			if ( ! $api_key ) {
2859 2859
 				// if no api key is set/site is not connected, return an empty array
2860 2860
 				return array();
2861 2861
 			}
2862 2862
 			$dash_position = strpos( $api_key, '-' );
2863
-			if( $dash_position !== false ) {
2863
+			if ( $dash_position !== false ) {
2864 2864
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
2865 2865
 			}
2866 2866
 			$mailchimp_lists = wp_remote_post( $api_endpoint, array(
@@ -2871,19 +2871,19 @@  discard block
 block discarded – undo
2871 2871
 				'timeout' => 10,
2872 2872
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2873 2873
 			) );
2874
-			if( ! is_wp_error( $mailchimp_lists ) ) {
2874
+			if ( ! is_wp_error( $mailchimp_lists ) ) {
2875 2875
 				$list_data = json_decode( wp_remote_retrieve_body( $mailchimp_lists ), true );
2876
-				if( isset( $list_data['error'] ) ) {
2877
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2876
+				if ( isset( $list_data[ 'error' ] ) ) {
2877
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2878 2878
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2879 2879
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2880
-						$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' ) );
2880
+						$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' ) );
2881 2881
 					}
2882 2882
 				}
2883 2883
 				$mail_chimp_list_ids = array();
2884
-				if( $mailchimp_lists ) {
2885
-					foreach( $list_data as $list ) {
2886
-						$mail_chimp_list_ids[] = $list['id'];
2884
+				if ( $mailchimp_lists ) {
2885
+					foreach ( $list_data as $list ) {
2886
+						$mail_chimp_list_ids[ ] = $list[ 'id' ];
2887 2887
 					}
2888 2888
 					return $mail_chimp_list_ids;
2889 2889
 				} else {
@@ -2899,7 +2899,7 @@  discard block
 block discarded – undo
2899 2899
 		*/
2900 2900
 		public function yikes_mailchimp_load_helper_class() {
2901 2901
 			// check to see if it's already loaded up
2902
-			if( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2902
+			if ( ! class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2903 2903
 				// Include our main helper class file
2904 2904
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' );
2905 2905
 			}
@@ -2976,7 +2976,7 @@  discard block
 block discarded – undo
2976 2976
 		*	@since 6.0.4
2977 2977
 		*/
2978 2978
 		public function check_yikes_mc_table_version() {
2979
-			if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2979
+			if ( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2980 2980
 				require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php';
2981 2981
 				global $wpdb;
2982 2982
 				Yikes_Inc_Easy_Mailchimp_Extender_Activator::_activate_yikes_easy_mailchimp( $wpdb );
Please login to merge, or discard this patch.
includes/import-export/yikes-easy-mailchimp-export.class.php 4 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -9,6 +9,11 @@  discard block
 block discarded – undo
9 9
 	*	@form_ids 		array of form ID's to export ie: array( 1,4,5,6 ) (user can select specific forms)
10 10
 	*	@file_name 	the name of the exported file
11 11
 	*/	
12
+
13
+	/**
14
+	 * @param string $table_name
15
+	 * @param string $file_name
16
+	 */
12 17
 	public static function yikes_mailchimp_form_export( $table_name, $form_ids , $file_name ) {
13 18
 		global $wpdb;
14 19
 		$wpdb->show_errors(); 															
@@ -64,6 +69,10 @@  discard block
 block discarded – undo
64 69
 	*	@parameters
65 70
 	*	@file_name 	the name of the exported file
66 71
 	*/	
72
+
73
+	/**
74
+	 * @param string $file_name
75
+	 */
67 76
 	public static function yikes_mailchimp_settings_export( $file_name ) {
68 77
 		
69 78
 		// get an array of all of our plugin settings (on the settings pages), to loop over
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@
 block discarded – undo
48 48
 				 $first = false;
49 49
 			  }
50 50
 			  
51
-			   $leadArray = (array) $row; // Cast the Object to an array
52
-			   // Add row to file
53
-			   fputcsv( $output_handle, $leadArray );
51
+				$leadArray = (array) $row; // Cast the Object to an array
52
+				// Add row to file
53
+				fputcsv( $output_handle, $leadArray );
54 54
 			}
55 55
 			 
56 56
 			// Close output file stream
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -9,22 +9,22 @@  discard block
 block discarded – undo
9 9
 	*	@form_ids 		array of form ID's to export ie: array( 1,4,5,6 ) (user can select specific forms)
10 10
 	*	@file_name 	the name of the exported file
11 11
 	*/	
12
-	public static function yikes_mailchimp_form_export( $table_name, $form_ids , $file_name ) {
12
+	public static function yikes_mailchimp_form_export( $table_name, $form_ids, $file_name ) {
13 13
 		global $wpdb;
14 14
 		$wpdb->show_errors(); 															
15
-		if( is_array( $form_ids ) ) {
16
-			$results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . $table_name . ' where ID in (' . implode( ', ' , $form_ids ) . ')' );
15
+		if ( is_array( $form_ids ) ) {
16
+			$results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . $table_name . ' where ID in (' . implode( ', ', $form_ids ) . ')' );
17 17
 		} else {
18 18
 			$results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . $table_name );
19 19
 		}
20 20
 					
21 21
 		// Process report request
22
-		if (! $results) {
22
+		if ( ! $results ) {
23 23
 			$Error = $wpdb->print_error();
24
-			die("The following error was found: $Error");
24
+			die( "The following error was found: $Error" );
25 25
 		} else {
26 26
 			// Set header row values
27
-			$output_filename = $file_name . '-'. date( 'm-d-Y' )  . '.csv';
27
+			$output_filename = $file_name . '-' . date( 'm-d-Y' ) . '.csv';
28 28
 			$output_handle = @fopen( 'php://output', 'w' );
29 29
 			 
30 30
 			header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 
37 37
 			$first = true;
38 38
 			// Parse results to csv format
39
-			foreach ($results as $row) {
39
+			foreach ( $results as $row ) {
40 40
 			 
41 41
 			  // Add table headers
42
-			  if($first){
42
+			  if ( $first ) {
43 43
 				 $titles = array();
44
-				 foreach($row as $key=>$val){
45
-					$titles[] = $key;
44
+				 foreach ( $row as $key=>$val ) {
45
+					$titles[ ] = $key;
46 46
 				 }
47
-				 fputcsv($output_handle, $titles);
47
+				 fputcsv( $output_handle, $titles );
48 48
 				 $first = false;
49 49
 			  }
50 50
 			  
@@ -68,25 +68,25 @@  discard block
 block discarded – undo
68 68
 		
69 69
 		// get an array of all of our plugin settings (on the settings pages), to loop over
70 70
 		$plugin_settings = array();
71
-		$plugin_settings['yikes-mc-api-key'] = get_option( 'yikes-mc-api-key' , '' ); // api key
72
-		$plugin_settings['yikes-mc-api-validation'] = get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ); // api key validation
73
-		$plugin_settings['optin-checkbox-init'] = get_option( 'optin-checkbox-init', '' ); // checkbox settings
74
-		$plugin_settings['yikes-mc-recaptcha-status'] = get_option( 'yikes-mc-recaptcha-status' , '' ); // recaptcha status
75
-		$plugin_settings['yikes-mc-recaptcha-site-key'] = get_option( 'yikes-mc-recaptcha-site-key', '' ); // recaptcha site key
76
-		$plugin_settings['yikes-mc-recaptcha-secret-key'] = get_option( 'yikes-mc-recaptcha-secret-key', '' ); // recaptcha secret key
77
-		$plugin_settings['yikes-mailchimp-debug-status'] = get_option( 'yikes-mailchimp-debug-status' , '' ); // debug settings
71
+		$plugin_settings[ 'yikes-mc-api-key' ] = get_option( 'yikes-mc-api-key', '' ); // api key
72
+		$plugin_settings[ 'yikes-mc-api-validation' ] = get_option( 'yikes-mc-api-validation', 'invalid_api_key' ); // api key validation
73
+		$plugin_settings[ 'optin-checkbox-init' ] = get_option( 'optin-checkbox-init', '' ); // checkbox settings
74
+		$plugin_settings[ 'yikes-mc-recaptcha-status' ] = get_option( 'yikes-mc-recaptcha-status', '' ); // recaptcha status
75
+		$plugin_settings[ 'yikes-mc-recaptcha-site-key' ] = get_option( 'yikes-mc-recaptcha-site-key', '' ); // recaptcha site key
76
+		$plugin_settings[ 'yikes-mc-recaptcha-secret-key' ] = get_option( 'yikes-mc-recaptcha-secret-key', '' ); // recaptcha secret key
77
+		$plugin_settings[ 'yikes-mailchimp-debug-status' ] = get_option( 'yikes-mailchimp-debug-status', '' ); // debug settings
78 78
 		$titles = array();
79 79
 		$content = array();
80
-		foreach ($plugin_settings as $option_name => $option_value ) {
81
-			$titles[] = $option_name;
80
+		foreach ( $plugin_settings as $option_name => $option_value ) {
81
+			$titles[ ] = $option_name;
82 82
 		}
83 83
 		// Process report request
84
-		if (! $plugin_settings) {
84
+		if ( ! $plugin_settings ) {
85 85
 			$Error = $wpdb->print_error();
86
-			die("The following error was found: $Error");
86
+			die( "The following error was found: $Error" );
87 87
 		} else {
88 88
 			// Set header row values
89
-			$output_filename = $file_name . '-'. date( 'm-d-Y' )  . '.csv';
89
+			$output_filename = $file_name . '-' . date( 'm-d-Y' ) . '.csv';
90 90
 			$output_handle = @fopen( 'php://output', 'w' );
91 91
 			 
92 92
 			header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
@@ -98,14 +98,14 @@  discard block
 block discarded – undo
98 98
 
99 99
 			$first = true;
100 100
 			// Parse results to csv format
101
-			foreach ($plugin_settings as $option_name => $option_value ) {
101
+			foreach ( $plugin_settings as $option_name => $option_value ) {
102 102
 			
103 103
 			// Add table headers
104
-			  if( $first ) {
105
-				 fputcsv($output_handle, $titles);
104
+			  if ( $first ) {
105
+				 fputcsv( $output_handle, $titles );
106 106
 				 $first = false;
107 107
 			  }
108
-			  $content[] = $option_value;		   
108
+			  $content[ ] = $option_value;		   
109 109
 
110 110
 			}
111 111
 			fputcsv( $output_handle, $content );
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@
 block discarded – undo
39 39
 			foreach ($results as $row) {
40 40
 			 
41 41
 			  // Add table headers
42
-			  if($first){
42
+			  if($first) {
43 43
 				 $titles = array();
44
-				 foreach($row as $key=>$val){
44
+				 foreach($row as $key=>$val) {
45 45
 					$titles[] = $key;
46 46
 				 }
47 47
 				 fputcsv($output_handle, $titles);
Please login to merge, or discard this patch.
public/classes/checkbox-integrations.php 4 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -23,6 +23,10 @@  discard block
 block discarded – undo
23 23
 		*	@since 6.0.0
24 24
 		*	@$integration_type - pass in the type of checkbox integration
25 25
 		*/
26
+
27
+		/**
28
+		 * @param string $integration_type
29
+		 */
26 30
 		public function is_user_already_subscribed( $integration_type ) {
27 31
 			// first check if the user is logged in
28 32
 			if( is_user_logged_in() ) {
@@ -69,6 +73,10 @@  discard block
 block discarded – undo
69 73
 		*	@$email - users email address entered into the form
70 74
 		*	@$integration_type - pass in the type of checkbox integration
71 75
 		*/
76
+
77
+		/**
78
+		 * @param string $integration_type
79
+		 */
72 80
 		public function is_new_registration_already_subscribed( $email , $integration_type ) {
73 81
 			// first check if the user is logged in
74 82
 			$checkbox_options = get_option( 'optin-checkbox-init' , '' );
@@ -233,6 +241,10 @@  discard block
 block discarded – undo
233 241
 		*	before continuing
234 242
 		*	@since 6.0.0
235 243
 		*/
244
+
245
+		/**
246
+		 * @param string $type
247
+		 */
236 248
 		public function was_checkbox_checked( $type ) {
237 249
 			// was sign-up checkbox checked - return the value
238 250
 			return ( isset( $_POST[ 'yikes_mailchimp_checkbox_'.$type ] ) && $_POST[ 'yikes_mailchimp_checkbox_'.$type ] == 1 );
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
 		}
103 103
 			
104 104
 		/**
105
-		* 	Get the checkbox for the given integration and render it on the front end
106
-		* 	@return string
107
-		*	@since 6.0.0
108
-		*/
105
+		 * 	Get the checkbox for the given integration and render it on the front end
106
+		 * 	@return string
107
+		 *	@since 6.0.0
108
+		 */
109 109
 		public function yikes_get_checkbox() {
110 110
 			// enqueue our checkbox styles whenever the checkbox is displayed
111 111
 			wp_enqueue_style( 'yikes-easy-mailchimp-checkbox-integration-styles', plugin_dir_url( __FILE__ ) . '../css/yikes-inc-easy-mailchimp-checkbox-integration.min.css' );
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		 *	a new integration type is submitted
136 136
 		 *
137 137
 		 *	@since 6.0.0
138
-		**/
138
+		 **/
139 139
 		public function subscribe_user_integration( $email, $type, $merge_vars ) {			
140 140
 			// get checkbox data
141 141
 			$checkbox_options = get_option( 'optin-checkbox-init' , '' );
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
 		}
199 199
 		
200 200
 		/**
201
-		* Build merge varaibles array
202
-		*	@since 6.0.0
203
-		*/	
201
+		 * Build merge varaibles array
202
+		 *	@since 6.0.0
203
+		 */	
204 204
 		public function user_merge_vars( WP_User $user ) {
205 205
 			// start with user_login as name, since that's always known
206 206
 			$merge_vars = array(
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
 		
241 241
 		
242 242
 		/**
243
-		*	Alter the registraton complete message	
244
-		*	if the registration form checkbox integration is toggled on
245
-		* 	@since 6.0.0
246
-		**/
243
+		 *	Alter the registraton complete message	
244
+		 *	if the registration form checkbox integration is toggled on
245
+		 * 	@since 6.0.0
246
+		 **/
247 247
 		public function yikes_reg_complete_msg( $errors, $redirect_to ) {
248 248
 			if( isset( $errors->errors['registered'] ) ) {
249 249
 				$email_error = get_option( 'yikes_register_subscription_error' , '' );
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
 					unset( $tmp );
263 263
 					delete_option( 'yikes_register_subscription_error' );
264 264
 				}
265
-		   }
266
-		   return $errors;
265
+			}
266
+			return $errors;
267 267
 		}
268 268
 		
269 269
 	}
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 	*/
6 6
 	
7 7
 	// Prevent direct access to the file
8
-	defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) );
8
+	defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) );
9 9
 	
10 10
 	class Yikes_Easy_MC_Checkbox_Integration_Class {
11 11
 	
@@ -25,35 +25,35 @@  discard block
 block discarded – undo
25 25
 		*/
26 26
 		public function is_user_already_subscribed( $integration_type ) {
27 27
 			// first check if the user is logged in
28
-			if( is_user_logged_in() ) {
29
-				$checkbox_options = get_option( 'optin-checkbox-init' , '' );
28
+			if ( is_user_logged_in() ) {
29
+				$checkbox_options = get_option( 'optin-checkbox-init', '' );
30 30
 				$current_user = wp_get_current_user();
31 31
 				$email = $current_user->user_email;
32 32
 
33
-				$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
33
+				$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
34 34
 				$dash_position = strpos( $api_key, '-' );
35
-				if( $dash_position !== false ) {
35
+				if ( $dash_position !== false ) {
36 36
 					$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/member-info.json';
37 37
 				}
38 38
 				$already_subscribed = wp_remote_post( $api_endpoint, array( 
39 39
 					'body' => array( 
40 40
 						'apikey' => $api_key, 
41
-						'id' => $checkbox_options[$integration_type]['associated-list'],
41
+						'id' => $checkbox_options[ $integration_type ][ 'associated-list' ],
42 42
 						'emails' => array( array( 'email' => sanitize_email( $email ) ) )
43 43
 					),
44 44
 					'timeout' => 10,
45 45
 					'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
46 46
 				) );
47 47
 				$already_subscribed = json_decode( wp_remote_retrieve_body( $already_subscribed ), true );	
48
-				if( isset( $already_subscribed['error'] ) ) {	
49
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
48
+				if ( isset( $already_subscribed[ 'error' ] ) ) {	
49
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
50 50
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
51 51
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
52
-						$error_logging->yikes_easy_mailchimp_write_to_error_log( $already_subscribed['error'], __( "Get Member Info" , 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations Page" );
52
+						$error_logging->yikes_easy_mailchimp_write_to_error_log( $already_subscribed[ 'error' ], __( "Get Member Info", 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations Page" );
53 53
 					}
54 54
 				}
55
-				if( ! Isset( $already_subscribed['error'] ) ) {
56
-					return $already_subscribed['success_count'];
55
+				if ( ! Isset( $already_subscribed[ 'error' ] ) ) {
56
+					return $already_subscribed[ 'success_count' ];
57 57
 				}
58 58
 			} else {
59 59
 				// if the user isn't logged in
@@ -69,33 +69,33 @@  discard block
 block discarded – undo
69 69
 		*	@$email - users email address entered into the form
70 70
 		*	@$integration_type - pass in the type of checkbox integration
71 71
 		*/
72
-		public function is_new_registration_already_subscribed( $email , $integration_type ) {
72
+		public function is_new_registration_already_subscribed( $email, $integration_type ) {
73 73
 			// first check if the user is logged in
74
-			$checkbox_options = get_option( 'optin-checkbox-init' , '' );
74
+			$checkbox_options = get_option( 'optin-checkbox-init', '' );
75 75
 			try {
76
-				$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
76
+				$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
77 77
 				$dash_position = strpos( $api_key, '-' );
78
-				if( $dash_position !== false ) {
78
+				if ( $dash_position !== false ) {
79 79
 					$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/member-info.json';
80 80
 				}
81 81
 				$already_subscribed = wp_remote_post( $api_endpoint, array( 
82 82
 					'body' => array( 
83 83
 						'apikey' => $api_key, 
84
-						'id' => $checkbox_options[$integration_type]['associated-list'],
84
+						'id' => $checkbox_options[ $integration_type ][ 'associated-list' ],
85 85
 						'emails' => array( array( 'email' => sanitize_email( $email ) ) )
86 86
 					),
87 87
 					'timeout' => 10,
88 88
 					'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
89 89
 				) );
90 90
 				$already_subscribed = json_decode( wp_remote_retrieve_body( $already_subscribed ), true );
91
-				if( isset( $already_subscribed['error'] ) ) {	
92
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
91
+				if ( isset( $already_subscribed[ 'error' ] ) ) {	
92
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
93 93
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
94 94
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
95
-						$error_logging->yikes_easy_mailchimp_write_to_error_log( $already_subscribed['error'], __( "Get Member Info" , 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations Page" );
95
+						$error_logging->yikes_easy_mailchimp_write_to_error_log( $already_subscribed[ 'error' ], __( "Get Member Info", 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations Page" );
96 96
 					}
97 97
 				}				
98
-				return $already_subscribed['success_count'];
98
+				return $already_subscribed[ 'success_count' ];
99 99
 			} catch ( Exception $error ) {
100 100
 				return $error->getMessage();
101 101
 			}
@@ -110,17 +110,17 @@  discard block
 block discarded – undo
110 110
 			// enqueue our checkbox styles whenever the checkbox is displayed
111 111
 			wp_enqueue_style( 'yikes-easy-mailchimp-checkbox-integration-styles', plugin_dir_url( __FILE__ ) . '../css/yikes-inc-easy-mailchimp-checkbox-integration.min.css' );
112 112
 			// store our options
113
-			$checkbox_options = get_option( 'optin-checkbox-init' , '' );
114
-			if( isset( $checkbox_options[$this->type]['associated-list'] ) && $checkbox_options[$this->type]['associated-list'] != '-' ) {
115
-				$checked = ( $checkbox_options[$this->type]['precheck'] == 'true' ) ? 'checked' : '';
113
+			$checkbox_options = get_option( 'optin-checkbox-init', '' );
114
+			if ( isset( $checkbox_options[ $this->type ][ 'associated-list' ] ) && $checkbox_options[ $this->type ][ 'associated-list' ] != '-' ) {
115
+				$checked = ( $checkbox_options[ $this->type ][ 'precheck' ] == 'true' ) ? 'checked' : '';
116 116
 				// before checkbox HTML (comment, ...)
117 117
 				$before = '<!-- Easy Forms for MailChimp by YIKES, Inc. - https://www.yikesinc.com/ -->';
118 118
 				$before .= apply_filters( 'yikes-mailchimp-before-checkbox-html', '' );
119 119
 				// checkbox
120 120
 				$content = '<p id="yikes-easy-mailchimp-' . $this->type . '-checkbox" class="yikes-easy-mailchimp-' . $this->type . '-checkbox">';
121 121
 					$content .= '<label>';
122
-						$content .= '<input type="checkbox" name="yikes_mailchimp_checkbox_' . $this->type . '" value="1" '. $checked . ' /> ';
123
-						$content .= ( isset( $checkbox_options[$this->type]['label'] ) && trim( $checkbox_options[$this->type]['label'] ) != '' ) ? trim( $checkbox_options[$this->type]['label'] ) : __( 'Sign me up for your mailing list.', 'yikes-inc-easy-mailchimp-extender' );
122
+						$content .= '<input type="checkbox" name="yikes_mailchimp_checkbox_' . $this->type . '" value="1" ' . $checked . ' /> ';
123
+						$content .= ( isset( $checkbox_options[ $this->type ][ 'label' ] ) && trim( $checkbox_options[ $this->type ][ 'label' ] ) != '' ) ? trim( $checkbox_options[ $this->type ][ 'label' ] ) : __( 'Sign me up for your mailing list.', 'yikes-inc-easy-mailchimp-extender' );
124 124
 					$content .= '</label>';
125 125
 				$content .= '</p>';
126 126
 				// after checkbox HTML (..., honeypot, closing comment)
@@ -138,43 +138,43 @@  discard block
 block discarded – undo
138 138
 		**/
139 139
 		public function subscribe_user_integration( $email, $type, $merge_vars ) {			
140 140
 			// get checkbox data
141
-			$checkbox_options = get_option( 'optin-checkbox-init' , '' );
142
-			if( $type != 'registration_form' ) {
141
+			$checkbox_options = get_option( 'optin-checkbox-init', '' );
142
+			if ( $type != 'registration_form' ) {
143 143
 				$update = '1';
144 144
 			} else {
145 145
 				$update = '0';
146 146
 			}
147 147
 			// set ip address
148
-			if( ! isset( $merge_vars['OPTIN_IP'] ) && isset( $_SERVER['REMOTE_ADDR'] ) ) {
149
-				$merge_vars['OPTIN_IP'] = sanitize_text_field( $_SERVER['REMOTE_ADDR'] );
148
+			if ( ! isset( $merge_vars[ 'OPTIN_IP' ] ) && isset( $_SERVER[ 'REMOTE_ADDR' ] ) ) {
149
+				$merge_vars[ 'OPTIN_IP' ] = sanitize_text_field( $_SERVER[ 'REMOTE_ADDR' ] );
150 150
 			}
151 151
 			// set the optin time
152
-			$merge_vars['OPTIN_TIME'] = current_time( 'Y-m-d H:i:s', 1 );
152
+			$merge_vars[ 'OPTIN_TIME' ] = current_time( 'Y-m-d H:i:s', 1 );
153 153
 			// check for interest groups
154
-			$interest_groups = ( isset( $checkbox_options[$type]['interest-groups'] ) ) ? $checkbox_options[$type]['interest-groups'] : false;
154
+			$interest_groups = ( isset( $checkbox_options[ $type ][ 'interest-groups' ] ) ) ? $checkbox_options[ $type ][ 'interest-groups' ] : false;
155 155
 			// if interest groups were found, push them to the merge variable array
156
-			if( $interest_groups ) {
157
-				$merge_vars['groupings'] = array();
158
-				foreach( $interest_groups as $interest_group_id => $interest_group_selections ) {
156
+			if ( $interest_groups ) {
157
+				$merge_vars[ 'groupings' ] = array();
158
+				foreach ( $interest_groups as $interest_group_id => $interest_group_selections ) {
159 159
 					// merge variable interest groups array
160
-					$merge_vars['groupings'][] = array(
160
+					$merge_vars[ 'groupings' ][ ] = array(
161 161
 						'id' => $interest_group_id,
162 162
 						'groups' => $interest_group_selections,
163 163
 					); 	
164 164
 				}
165 165
 				// replace the interest groups - to avoid any errors thrown if the admin switches lists, or interest groups
166
-				$merge_vars['replace_interests'] = 1;
166
+				$merge_vars[ 'replace_interests' ] = 1;
167 167
 			}
168 168
 			// initialize MailChimp API
169
-			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
169
+			$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
170 170
 			$dash_position = strpos( $api_key, '-' );
171
-			if( $dash_position !== false ) {
171
+			if ( $dash_position !== false ) {
172 172
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/subscribe.json';
173 173
 			}
174 174
 			$subscribe_response = wp_remote_post( $api_endpoint, array( 
175 175
 				'body' => apply_filters( 'yikes-mailchimp-checkbox-integration-subscribe-api-request', array( 
176
-					'apikey' => get_option( 'yikes-mc-api-key' , '' ),
177
-					'id' => $checkbox_options[$type]['associated-list'],
176
+					'apikey' => get_option( 'yikes-mc-api-key', '' ),
177
+					'id' => $checkbox_options[ $type ][ 'associated-list' ],
178 178
 					'email' => array( 'email' => sanitize_email( $email ) ),
179 179
 					'merge_vars' => apply_filters( 'yikes-mailchimp-checkbox-integration-merge-variables', $merge_vars, $type ), // filter merge variables
180 180
 					'double_optin' => 1,
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
 				'timeout' => 10,
185 185
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
186 186
 			) );
187
-			if( ! Is_wp_error( $subscribe_response ) ) {
187
+			if ( ! Is_wp_error( $subscribe_response ) ) {
188 188
 				$response_body = json_decode( wp_remote_retrieve_body( $subscribe_response ), true );
189
-				if( WP_DEBUG || isset( $response_body['error'] ) ) {	
190
-					if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
189
+				if ( WP_DEBUG || isset( $response_body[ 'error' ] ) ) {	
190
+					if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
191 191
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
192 192
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
193
-						$error_logging->yikes_easy_mailchimp_write_to_error_log( $response_body['error'], __( "Checkbox Integration Subscribe User" , 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations" );
193
+						$error_logging->yikes_easy_mailchimp_write_to_error_log( $response_body[ 'error' ], __( "Checkbox Integration Subscribe User", 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations" );
194 194
 					}
195 195
 				}		
196 196
 			}
@@ -206,15 +206,15 @@  discard block
 block discarded – undo
206 206
 			$merge_vars = array(
207 207
 				'NAME' => $user->user_login,
208 208
 			);
209
-			if( '' !== $user->first_name ) {
210
-				$merge_vars['NAME'] = $user->first_name;
211
-				$merge_vars['FNAME'] = $user->first_name;
209
+			if ( '' !== $user->first_name ) {
210
+				$merge_vars[ 'NAME' ] = $user->first_name;
211
+				$merge_vars[ 'FNAME' ] = $user->first_name;
212 212
 			}
213
-			if( '' !== $user->last_name ) {
214
-				$merge_vars['LNAME'] = $user->last_name;
213
+			if ( '' !== $user->last_name ) {
214
+				$merge_vars[ 'LNAME' ] = $user->last_name;
215 215
 			}
216
-			if( '' !== $user->first_name && '' !== $user->last_name ) {
217
-				$merge_vars['NAME'] = sprintf( '%s %s', $user->first_name, $user->last_name );
216
+			if ( '' !== $user->first_name && '' !== $user->last_name ) {
217
+				$merge_vars[ 'NAME' ] = sprintf( '%s %s', $user->first_name, $user->last_name );
218 218
 			}
219 219
 			/**
220 220
 			 * @filter `yikes-mailchimp-user-merge-vars`
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		*/
236 236
 		public function was_checkbox_checked( $type ) {
237 237
 			// was sign-up checkbox checked - return the value
238
-			return ( isset( $_POST[ 'yikes_mailchimp_checkbox_'.$type ] ) && $_POST[ 'yikes_mailchimp_checkbox_'.$type ] == 1 );
238
+			return ( isset( $_POST[ 'yikes_mailchimp_checkbox_' . $type ] ) && $_POST[ 'yikes_mailchimp_checkbox_' . $type ] == 1 );
239 239
 		}
240 240
 		
241 241
 		
@@ -245,15 +245,15 @@  discard block
 block discarded – undo
245 245
 		* 	@since 6.0.0
246 246
 		**/
247 247
 		public function yikes_reg_complete_msg( $errors, $redirect_to ) {
248
-			if( isset( $errors->errors['registered'] ) ) {
249
-				$email_error = get_option( 'yikes_register_subscription_error' , '' );
250
-				if( isset( $email_error ) && $email_error != '' ) {	
248
+			if ( isset( $errors->errors[ 'registered' ] ) ) {
249
+				$email_error = get_option( 'yikes_register_subscription_error', '' );
250
+				if ( isset( $email_error ) && $email_error != '' ) {	
251 251
 					// Use the magic __get method to retrieve the errors array:
252 252
 					$tmp = $errors->errors; 
253 253
 					$old = 'Registration complete. Please check your e-mail.';
254
-					foreach( $tmp['registered'] as $index => $msg ) {
255
-						if( $msg === $old ) {
256
-							$tmp['registered'][$index] = $old . ' <p class="message"><strong>' . __( 'Note' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>: ' . $email_error . '</p>';        
254
+					foreach ( $tmp[ 'registered' ] as $index => $msg ) {
255
+						if ( $msg === $old ) {
256
+							$tmp[ 'registered' ][ $index ] = $old . ' <p class="message"><strong>' . __( 'Note', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>: ' . $email_error . '</p>';        
257 257
 						}
258 258
 					}
259 259
 					// Use the magic __set method to override the errors property:
Please login to merge, or discard this patch.
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 		protected $type = 'integration';
14 14
 		private $text_domain = 'yikes-inc-easy-mailchimp-extender';
15 15
 		
16
-		public function __construct() {	
16
+		public function __construct() {
17 17
 			
18 18
 		}
19 19
 			
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 					'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
46 46
 				) );
47 47
 				$already_subscribed = json_decode( wp_remote_retrieve_body( $already_subscribed ), true );	
48
-				if( isset( $already_subscribed['error'] ) ) {	
48
+				if( isset( $already_subscribed['error'] ) ) {
49 49
 					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
50 50
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
51 51
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 					'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
89 89
 				) );
90 90
 				$already_subscribed = json_decode( wp_remote_retrieve_body( $already_subscribed ), true );
91
-				if( isset( $already_subscribed['error'] ) ) {	
91
+				if( isset( $already_subscribed['error'] ) ) {
92 92
 					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
93 93
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
94 94
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		 *
137 137
 		 *	@since 6.0.0
138 138
 		**/
139
-		public function subscribe_user_integration( $email, $type, $merge_vars ) {			
139
+		public function subscribe_user_integration( $email, $type, $merge_vars ) {
140 140
 			// get checkbox data
141 141
 			$checkbox_options = get_option( 'optin-checkbox-init' , '' );
142 142
 			if( $type != 'registration_form' ) {
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			) );
187 187
 			if( ! Is_wp_error( $subscribe_response ) ) {
188 188
 				$response_body = json_decode( wp_remote_retrieve_body( $subscribe_response ), true );
189
-				if( WP_DEBUG || isset( $response_body['error'] ) ) {	
189
+				if( WP_DEBUG || isset( $response_body['error'] ) ) {
190 190
 					if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
191 191
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
192 192
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		public function yikes_reg_complete_msg( $errors, $redirect_to ) {
248 248
 			if( isset( $errors->errors['registered'] ) ) {
249 249
 				$email_error = get_option( 'yikes_register_subscription_error' , '' );
250
-				if( isset( $email_error ) && $email_error != '' ) {	
250
+				if( isset( $email_error ) && $email_error != '' ) {
251 251
 					// Use the magic __get method to retrieve the errors array:
252 252
 					$tmp = $errors->errors; 
253 253
 					$old = 'Registration complete. Please check your e-mail.';
Please login to merge, or discard this patch.
public/classes/checkbox-integrations/class.bbpress_forms-checkbox.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 		 * @param array $anonymous_data
42 42
 		 * @param int $user_id
43 43
 		 * @param string $trigger
44
-		 * @return boolean
44
+		 * @return boolean|null
45 45
 		 */
46 46
 		public function subscribe_from_bbpress( $anonymous_data, $user_id, $trigger ) {
47 47
 			$user_data = get_userdata( $user_id );
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 	*/
7 7
 	
8 8
 	// Prevent direct access to the file
9
-	defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) );
9
+	defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) );
10 10
 	
11 11
 	class Yikes_Easy_MC_bbPress_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class {
12 12
 	
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		*/
32 32
 		public function output_checkbox() {
33 33
 			// if the user is already subscribed, abort and don't render the checkbox
34
-			if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
34
+			if ( $this->is_user_already_subscribed( $this->type ) == '1' ) {
35 35
 				return;
36 36
 			}
37 37
 			echo $this->yikes_get_checkbox();
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		 */
46 46
 		public function subscribe_from_bbpress( $anonymous_data, $user_id, $trigger ) {
47 47
 			$user_data = get_userdata( $user_id );
48
-			return $this->subscribe_user_integration( $user_data->user_email, $this->type , array(
48
+			return $this->subscribe_user_integration( $user_data->user_email, $this->type, array(
49 49
 				'FNAME' => $user_data->first_name,
50 50
 				'LNAME' => $user_data->last_name,
51 51
 				'NAE' => $user_data->first_name,
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
 		
28 28
 		
29 29
 		/**
30
-		* Outputs a checkbox
31
-		*/
30
+		 * Outputs a checkbox
31
+		 */
32 32
 		public function output_checkbox() {
33 33
 			if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
34 34
 				return;
Please login to merge, or discard this patch.
public/classes/checkbox-integrations/class.buddypress_form-checkbox.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,6 @@
 block discarded – undo
40 40
 		 * @param string $user_login
41 41
 		 * @param string $user_password
42 42
 		 * @param string $user_email
43
-		 * @param array $usermeta
44 43
 		 */
45 44
 		public function subscribe_from_buddypress_form( $user_id, $user_login, $user_password, $user_email ) {
46 45
 			if ( $this->was_checkbox_checked( $this->type ) === false ) {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
18 18
 		}
19 19
 		
20 20
 		/**
21
-		* Outputs a checkbox, if user is not already subscribed
22
-		*/
21
+		 * Outputs a checkbox, if user is not already subscribed
22
+		 */
23 23
 		public function output_checkbox() {
24 24
 			if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
25 25
 				return;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 	*/
7 7
 	
8 8
 	// Prevent direct access to the file
9
-	defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) );
9
+	defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) );
10 10
 	
11 11
 	class Yikes_Easy_MC_BuddyPress_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class {
12 12
 		
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		* Outputs a checkbox, if user is not already subscribed
22 22
 		*/
23 23
 		public function output_checkbox() {
24
-			if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
24
+			if ( $this->is_user_already_subscribed( $this->type ) == '1' ) {
25 25
 				return;
26 26
 			}
27 27
 			?>
Please login to merge, or discard this patch.
class.easy_digital_downloads_checkout_form-checkbox.php 3 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,6 @@  discard block
 block discarded – undo
41 41
 		
42 42
 		
43 43
 		/**
44
-		 * @param array $meta
45 44
 		 *
46 45
 		 * @return array
47 46
 		 */
@@ -57,7 +56,7 @@  discard block
 block discarded – undo
57 56
 		/**
58 57
 		 * @param int $payment_id The ID of the payment
59 58
 		 *
60
-		 * @return bool|string
59
+		 * @return false|null
61 60
 		 */
62 61
 		public function subscribe_from_edd_purchase( $payment_id ) {
63 62
 			$meta = get_post_meta( $payment_id , '_yikes_easy_mc_optin' , true );
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
 		
28 28
 		
29 29
 		/**
30
-		* Outputs a checkbox
31
-		*/
30
+		 * Outputs a checkbox
31
+		 */
32 32
 		public function output_checkbox() {
33 33
 			if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
34 34
 				return;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	*/
8 8
 	
9 9
 	// Prevent direct access to the file
10
-	defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) );
10
+	defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) );
11 11
 
12 12
 	class Yikes_Easy_MC_EDD_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class {
13 13
 	
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 		 */
22 22
 		public function __construct() {
23 23
 			add_action( 'edd_purchase_form_user_info_fields', array( $this, 'output_checkbox' ) );
24
-			add_action( 'edd_insert_payment', array( $this, 'update_payment_post_meta' ) , 99999 );
25
-			add_action( 'edd_complete_purchase', array( $this, 'subscribe_from_edd_purchase'), 50 );
24
+			add_action( 'edd_insert_payment', array( $this, 'update_payment_post_meta' ), 99999 );
25
+			add_action( 'edd_complete_purchase', array( $this, 'subscribe_from_edd_purchase' ), 50 );
26 26
 		}
27 27
 		
28 28
 		
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 		* Outputs a checkbox
31 31
 		*/
32 32
 		public function output_checkbox() {
33
-			if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
33
+			if ( $this->is_user_already_subscribed( $this->type ) == '1' ) {
34 34
 				return;
35 35
 			}
36 36
 			// render our field if the user isn't current subscribed
37
-			echo do_action( 'yikes-mailchimp-before-checkbox' , $this->type );
37
+			echo do_action( 'yikes-mailchimp-before-checkbox', $this->type );
38 38
 				echo $this->yikes_get_checkbox();
39
-			echo do_action( 'yikes-mailchimp-after-checkbox' , $this->type );
39
+			echo do_action( 'yikes-mailchimp-after-checkbox', $this->type );
40 40
 		}	
41 41
 		
42 42
 		
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		 */
48 48
 		public function update_payment_post_meta( $payment_id = 0, $payment_data = array() ) {
49 49
 			// don't save anything if the checkbox was not checked
50
-			if( ! $this->was_checkbox_checked( $this->type ) ) {
50
+			if ( ! $this->was_checkbox_checked( $this->type ) ) {
51 51
 				update_post_meta( $payment_id, '_yikes_easy_mc_optin', '0' );
52 52
 				return;
53 53
 			}
@@ -60,25 +60,25 @@  discard block
 block discarded – undo
60 60
 		 * @return bool|string
61 61
 		 */
62 62
 		public function subscribe_from_edd_purchase( $payment_id ) {
63
-			$meta = get_post_meta( $payment_id , '_yikes_easy_mc_optin' , true );
64
-			if( $meta == '0' ) {
63
+			$meta = get_post_meta( $payment_id, '_yikes_easy_mc_optin', true );
64
+			if ( $meta == '0' ) {
65 65
 				return false;
66 66
 			}
67 67
 			$email = (string) edd_get_payment_user_email( $payment_id );
68 68
 			$merge_vars = array();
69 69
 			// add first and last name to merge vars, if given
70 70
 			$user_info = (array) edd_get_payment_meta_user_info( $payment_id );
71
-			if( isset( $user_info['first_name'] ) && isset( $user_info['last_name'] ) ) {
72
-				$merge_vars['NAME'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
71
+			if ( isset( $user_info[ 'first_name' ] ) && isset( $user_info[ 'last_name' ] ) ) {
72
+				$merge_vars[ 'NAME' ] = $user_info[ 'first_name' ] . ' ' . $user_info[ 'last_name' ];
73 73
 			}
74
-			if( isset( $user_info['first_name'] ) ) {
75
-				$merge_vars['FNAME'] = $user_info['first_name'];
74
+			if ( isset( $user_info[ 'first_name' ] ) ) {
75
+				$merge_vars[ 'FNAME' ] = $user_info[ 'first_name' ];
76 76
 			}
77
-			if( isset( $user_info['last_name'] ) ) {
78
-				$merge_vars['LNAME'] = $user_info['last_name'];
77
+			if ( isset( $user_info[ 'last_name' ] ) ) {
78
+				$merge_vars[ 'LNAME' ] = $user_info[ 'last_name' ];
79 79
 			}
80 80
 			// subscribe the user
81
-			$this->subscribe_user_integration( sanitize_email( $email ) , $this->type , $merge_vars );
81
+			$this->subscribe_user_integration( sanitize_email( $email ), $this->type, $merge_vars );
82 82
 		}
83 83
 	
84 84
 	}
Please login to merge, or discard this patch.
public/classes/checkbox-integrations/class.registration_form-checkbox.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 	 *
36 36
 	 * @param int $user_id
37 37
 	 *
38
-	 * @return bool|string
38
+	 * @return false|null
39 39
 	*/
40 40
 	public function subscribe_from_registration( $user_id ) {
41 41
 		// was sign-up checkbox checked?
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 	
26 26
 	/**
27
-	* Outputs a checkbox
28
-	*/
27
+	 * Outputs a checkbox
28
+	 */
29 29
 	public function output_checkbox() {
30 30
 		echo $this->yikes_get_checkbox();
31 31
 	}
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 * @param int $user_id
37 37
 	 *
38 38
 	 * @return bool|string
39
-	*/
39
+	 */
40 40
 	public function subscribe_from_registration( $user_id ) {
41 41
 		// was sign-up checkbox checked?
42 42
 		if ( $this->was_checkbox_checked( $this->type ) === false ) {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 */
9 9
 
10 10
 // Prevent direct access to the file
11
-defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) );
11
+defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) );
12 12
 	
13 13
 class Yikes_Easy_MC_Registration_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class {
14 14
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 		add_action( 'register_form', array( $this, 'output_checkbox' ), 20 );
21 21
 		add_action( 'user_register', array( $this, 'subscribe_from_registration' ), 90, 1 );
22 22
 		// alter the error message, if there was an error with the users email address
23
-		add_filter( 'wp_login_errors', array( $this , 'yikes_reg_complete_msg' ), 10,  2 );
23
+		add_filter( 'wp_login_errors', array( $this, 'yikes_reg_complete_msg' ), 10, 2 );
24 24
 	}
25 25
 	
26 26
 	/**
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
 		// build our merge vars
52 52
 		$merge_variables = $this->user_merge_vars( $user );
53 53
 		// only subscribe the user if they aren't already on the list
54
-		if( $this->is_new_registration_already_subscribed( $user->user_email , 'registration_form' ) != '1' ) {
55
-			$this->subscribe_user_integration( sanitize_email( $user->user_email ) , $this->type , $merge_variables );
54
+		if ( $this->is_new_registration_already_subscribed( $user->user_email, 'registration_form' ) != '1' ) {
55
+			$this->subscribe_user_integration( sanitize_email( $user->user_email ), $this->type, $merge_variables );
56 56
 		} else {
57 57
 			// add a temporary option to pass our email address and let the user know they are already subscribed
58
-			$user_already_subscirbed_message = sprintf( __( "You have not been subscribed to our mailing list. %s is already subscribed to this list.", "yikes-inc-easy-mailchimp-extender" ), $user->user_email  );
59
-			add_option( 'yikes_register_subscription_error' , $user_already_subscirbed_message );
58
+			$user_already_subscirbed_message = sprintf( __( "You have not been subscribed to our mailing list. %s is already subscribed to this list.", "yikes-inc-easy-mailchimp-extender" ), $user->user_email );
59
+			add_option( 'yikes_register_subscription_error', $user_already_subscirbed_message );
60 60
 		}
61 61
 	}
62 62
 	
Please login to merge, or discard this patch.
yikes-inc-easy-mailchimp-extender.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
  *	@return void
44 44
  */
45 45
 if ( ! defined( 'YIKES_MC_PATH' ) ) {
46
-	define( 'YIKES_MC_PATH' , plugin_dir_path( __FILE__ ) );
46
+	define( 'YIKES_MC_PATH', plugin_dir_path( __FILE__ ) );
47 47
 }
48 48
 
49 49
 /**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
  *	@return void
54 54
  */
55 55
 if ( ! defined( 'YIKES_MC_URL' ) ) {
56
-	define( 'YIKES_MC_URL' , plugin_dir_url( __FILE__ ) );
56
+	define( 'YIKES_MC_URL', plugin_dir_url( __FILE__ ) );
57 57
 }
58 58
 
59 59
 /**
Please login to merge, or discard this patch.
admin/partials/dashboard-widgets/class.list-activity-widget.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 		}
55 55
 					
56 56
 		/**
57
-		* Create the function to output our list stats dashboard widget
58
-		*/
57
+		 * Create the function to output our list stats dashboard widget
58
+		 */
59 59
 		function list_stats_dashboard_widget() {
60 60
 				// Get our list data!
61 61
 				// Check for a transient, if not - set one up for one hour
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 		} 
116 116
 		
117 117
 		/**
118
-		* Create the function to output our account activity dashboard widget
119
-		*/
118
+		 * Create the function to output our account activity dashboard widget
119
+		 */
120 120
 		function account_activity_dashboard_widget() {
121 121
 				// Get our list data!
122 122
 				// Check for a transient, if not - set one up for one hour
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@  discard block
 block discarded – undo
7 7
 
8 8
 		// Construction
9 9
 		public function __construct() {
10
-			if( get_option( 'yikes-mc-api-key' , '' ) != '' && get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'valid_api_key' ) {
10
+			if ( get_option( 'yikes-mc-api-key', '' ) != '' && get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'valid_api_key' ) {
11 11
 				// hook in and display our list stats dashboard widget
12
-				add_action( 'wp_dashboard_setup', array( $this , 'yks_mc_add_chimp_chatter_dashboard_widget' ) , 10 );
12
+				add_action( 'wp_dashboard_setup', array( $this, 'yks_mc_add_chimp_chatter_dashboard_widget' ), 10 );
13 13
 			}
14
-			add_action( 'admin_enqueue_scripts' , array( $this, 'enqueue_dashboard_widget_script' ) );
14
+			add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_dashboard_widget_script' ) );
15 15
 		}
16 16
 
17 17
 		// enqueue our JS file on the main dashboard page
18 18
 		function enqueue_dashboard_widget_script( $hook ) {
19
-			if( 'index.php' == $hook ) { // default 'dashboard' page
20
-				wp_register_script( 'yikes-easy-mc-dashboard-widget-script' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js' , array( 'jquery' ) , 'all' , false );
19
+			if ( 'index.php' == $hook ) { // default 'dashboard' page
20
+				wp_register_script( 'yikes-easy-mc-dashboard-widget-script', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js', array( 'jquery' ), 'all', false );
21 21
 				$data_array = array(
22 22
 					'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
23
-					'preloader' => '<img src="' . esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) . '" title="' . __( 'Preloader' , 'yikes-inc-easy-mailchimp-extender' ) . '" alt="' . __( 'Preloader' , 'yikes-inc-easy-mailchimp-extender' ) . '" class="yikes-easy-mc-widget-preloader">'
23
+					'preloader' => '<img src="' . esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) . '" title="' . __( 'Preloader', 'yikes-inc-easy-mailchimp-extender' ) . '" alt="' . __( 'Preloader', 'yikes-inc-easy-mailchimp-extender' ) . '" class="yikes-easy-mc-widget-preloader">'
24 24
 				);
25 25
 				// localize our data, to pass along to JS file
26
-				wp_localize_script( 'yikes-easy-mc-dashboard-widget-script' , 'object' , $data_array );
26
+				wp_localize_script( 'yikes-easy-mc-dashboard-widget-script', 'object', $data_array );
27 27
 				wp_enqueue_script( 'yikes-easy-mc-dashboard-widget-script' );
28 28
 			}
29 29
 		}
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
 			if ( apply_filters( 'yikes-mailchimp-user-role-access', current_user_can( 'manage_options' ) ) ) {
42 42
 				/* List Stats Dashboard Widget */
43 43
 				wp_add_dashboard_widget(
44
-					 'yikes_easy_mc_list_stats_widget',         // Widget slug.
45
-					 __( 'MailChimp List Stats', 'yikes-inc-easy-mailchimp-extender' ),         // Title.
46
-					array( $this , 'list_stats_dashboard_widget' ) // Display function.
44
+					 'yikes_easy_mc_list_stats_widget', // Widget slug.
45
+					 __( 'MailChimp List Stats', 'yikes-inc-easy-mailchimp-extender' ), // Title.
46
+					array( $this, 'list_stats_dashboard_widget' ) // Display function.
47 47
 				);
48 48
 				/* Chimp Chatter Dashboard Widget */
49 49
 				wp_add_dashboard_widget(
50
-					 'yikes_easy_mc_account_activity_widget',         // Widget slug.
51
-					 __( 'MailChimp Account Activity', 'yikes-inc-easy-mailchimp-extender' ),         // Title.
52
-					array( $this , 'account_activity_dashboard_widget' ) // Display function.
50
+					 'yikes_easy_mc_account_activity_widget', // Widget slug.
51
+					 __( 'MailChimp Account Activity', 'yikes-inc-easy-mailchimp-extender' ), // Title.
52
+					array( $this, 'account_activity_dashboard_widget' ) // Display function.
53 53
 				);
54 54
 			}
55 55
 		}
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 				// Get our list data!
62 62
 				// Check for a transient, if not - set one up for one hour
63 63
 				if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) {
64
-					$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
64
+					$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
65 65
 					$dash_position = strpos( $api_key, '-' );
66
-					if( $dash_position !== false ) {
66
+					if ( $dash_position !== false ) {
67 67
 						$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
68 68
 					}
69 69
 					$list_data = wp_remote_post( $api_endpoint, array(
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 						'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
76 76
 					) );
77 77
 					$list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
78
-					if( isset( $list_data['error'] ) ) {
79
-						if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
78
+					if ( isset( $list_data[ 'error' ] ) ) {
79
+						if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
80 80
 							require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
81 81
 							$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
82
-							$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" );
82
+							$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" );
83 83
 						}
84 84
 					} else {
85 85
 						// set our transient
@@ -88,29 +88,29 @@  discard block
 block discarded – undo
88 88
 				}
89 89
 			?>
90 90
 				<!-- Dropdown to Change the list -->
91
-				<?php if( ! empty( $list_data['data'] ) ) {
91
+				<?php if ( ! empty( $list_data[ 'data' ] ) ) {
92 92
 					?><section class="inside-widget yikes-dashboard-widget-section">
93
-							<strong class="select-list-title"><?php _e( 'Select a list' , 'yikes-inc-easy-mailchimp-extender' ) ?>:</strong>
93
+							<strong class="select-list-title"><?php _e( 'Select a list', 'yikes-inc-easy-mailchimp-extender' ) ?>:</strong>
94 94
 							<select id="yikes-easy-mc-dashboard-change-list" class="widefat">
95 95
 								<?php
96
-									foreach( $list_data['data'] as $list ) {
97
-										?><option val="<?php echo $list['id']; ?>"><?php echo $list['name']; ?></option><?php
96
+									foreach ( $list_data[ 'data' ] as $list ) {
97
+										?><option val="<?php echo $list[ 'id' ]; ?>"><?php echo $list[ 'name' ]; ?></option><?php
98 98
 									}
99 99
 								?>
100 100
 							</select>
101
-							<p class="description"><?php _e( 'Select a list from the dropdown above. View statistics related to this list below.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
101
+							<p class="description"><?php _e( 'Select a list from the dropdown above. View statistics related to this list below.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
102 102
 					</section>
103 103
 					<!-- display stats here! -->
104 104
 					<section id="yikes-easy-mc-dashboard-widget-stats">
105 105
 						<?php
106
-							if( !empty( $list_data['data'] ) ) {
106
+							if ( ! empty( $list_data[ 'data' ] ) ) {
107 107
 								include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/stats-list-template.php' );
108 108
 							}
109 109
 						?>
110 110
 					</section>
111 111
 				<?php } else { ?>
112 112
 					<section id="yikes-easy-mc-dashboard-widget-stats">
113
-						<p class="no-lists-error"><?php _e( "Whoops, you don't have any lists set up. Head over to MailChimp to set up lists." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
113
+						<p class="no-lists-error"><?php _e( "Whoops, you don't have any lists set up. Head over to MailChimp to set up lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
114 114
 					</section>
115 115
 				<?php }
116 116
 		}
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
 				// Get our list data!
123 123
 				// Check for a transient, if not - set one up for one hour
124 124
 				if ( false === ( $account_activity = get_transient( 'yikes-easy-mailchimp-account-activity' ) ) ) {
125
-					$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
125
+					$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
126 126
 					$dash_position = strpos( $api_key, '-' );
127
-					if( $dash_position !== false ) {
127
+					if ( $dash_position !== false ) {
128 128
 						$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/chimp-chatter.json';
129 129
 					}
130 130
 					$account_activity = wp_remote_post( $api_endpoint, array(
@@ -135,18 +135,18 @@  discard block
 block discarded – undo
135 135
 						'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
136 136
 					) );
137 137
 					$account_activity = json_decode( wp_remote_retrieve_body( $account_activity ), true );
138
-					if( isset( $account_activity['error'] ) ) {
139
-						if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
138
+					if ( isset( $account_activity[ 'error' ] ) ) {
139
+						if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
140 140
 							require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
141 141
 							$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
142
-							$error_logging->yikes_easy_mailchimp_write_to_error_log( $account_activity['error'], __( "Get Account Activity" , 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" );
142
+							$error_logging->yikes_easy_mailchimp_write_to_error_log( $account_activity[ 'error' ], __( "Get Account Activity", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" );
143 143
 						}
144 144
 					} else {
145 145
 						// set our transient for one hour
146 146
 						set_transient( 'yikes-easy-mailchimp-account-activity', $account_activity, 1 * HOUR_IN_SECONDS );
147 147
 					}
148 148
 				}
149
-				if( ! empty( $account_activity ) ) {
149
+				if ( ! empty( $account_activity ) ) {
150 150
 					include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/account-activity-template.php' );
151 151
 				}
152 152
 		}
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@  discard block
 block discarded – undo
2 2
 	/*
3 3
 	* Our ajax is processed inside of class.ajax.php
4 4
 	*/
5
-	class YIKES_Inc_Easy_MailChimp_Dashboard_Widgets
6
-	{
5
+	class YIKES_Inc_Easy_MailChimp_Dashboard_Widgets {
7 6
 
8 7
 		// Construction
9 8
 		public function __construct() {
@@ -16,7 +15,8 @@  discard block
 block discarded – undo
16 15
 
17 16
 		// enqueue our JS file on the main dashboard page
18 17
 		function enqueue_dashboard_widget_script( $hook ) {
19
-			if( 'index.php' == $hook ) { // default 'dashboard' page
18
+			if( 'index.php' == $hook ) {
19
+// default 'dashboard' page
20 20
 				wp_register_script( 'yikes-easy-mc-dashboard-widget-script' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js' , array( 'jquery' ) , 'all' , false );
21 21
 				$data_array = array(
22 22
 					'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
Please login to merge, or discard this patch.