Completed
Push — staging ( 9e32c1...a732ae )
by Evan
32:58 queued 12:50
created
admin/class-yikes-inc-easy-mailchimp-extender-admin.php 2 patches
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -492,10 +492,10 @@  discard block
 block discarded – undo
492 492
 		}
493 493
 
494 494
 		/**
495
-		*	Dismiss the migrate options notice (incase the user wants to do things manually)
496
-		*
497
-		*	@since 6.0.0
498
-		**/
495
+		 *	Dismiss the migrate options notice (incase the user wants to do things manually)
496
+		 *
497
+		 *	@since 6.0.0
498
+		 **/
499 499
 		public function yikes_easy_mailchimp_dismiss_option_migrate() {
500 500
 			// delete the options and allow the user to manually updadte things
501 501
 
@@ -626,10 +626,10 @@  discard block
 block discarded – undo
626 626
 		}
627 627
 
628 628
 		/**
629
-		* Localize Script
630
-		* Pass our imported list data, to the JS file
631
-		* to build the drop down list in the modal
632
-		*/
629
+		 * Localize Script
630
+		 * Pass our imported list data, to the JS file
631
+		 * to build the drop down list in the modal
632
+		 */
633 633
 		public function tinymce_yikes_easy_mc() {
634 634
 			// check capabilities
635 635
 			if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
@@ -857,9 +857,9 @@  discard block
 block discarded – undo
857 857
 	}
858 858
 
859 859
 	/**
860
-	*	Register our admin pages
861
-	*	used to display data back to the user
862
-	**/
860
+	 *	Register our admin pages
861
+	 *	used to display data back to the user
862
+	 **/
863 863
 	public function register_admin_pages() {
864 864
 
865 865
 		/* Top Level Menu 'Easy MailChimp' */
@@ -1013,82 +1013,82 @@  discard block
 block discarded – undo
1013 1013
 	}
1014 1014
 
1015 1015
 	/**
1016
-	* Generate YIKES Inc. Easy MailChimp Manage Forms Page
1017
-	*
1018
-	* @since    1.0.0
1019
-	*/
1016
+	 * Generate YIKES Inc. Easy MailChimp Manage Forms Page
1017
+	 *
1018
+	 * @since    1.0.0
1019
+	 */
1020 1020
 	function generateManageFormsPage() {
1021 1021
 		require_once YIKES_MC_PATH . 'admin/partials/menu/manage-forms.php'; // include our manage forms page
1022 1022
 	}
1023 1023
 
1024 1024
 	/**
1025
-	* Generate YIKES Inc. Easy MailChimp Manage Lists Page
1026
-	*
1027
-	* @since    1.0.0
1028
-	*/
1025
+	 * Generate YIKES Inc. Easy MailChimp Manage Lists Page
1026
+	 *
1027
+	 * @since    1.0.0
1028
+	 */
1029 1029
 	function generateManageListsPage() {
1030 1030
 		require_once YIKES_MC_PATH . 'admin/partials/menu/manage-lists.php'; // include our lists page
1031 1031
 	}
1032 1032
 
1033 1033
 	/**
1034
-	* Generate YIKES Inc. Easy MailChimp Account Details Page
1035
-	*
1036
-	* @since    1.0.0
1037
-	*/
1034
+	 * Generate YIKES Inc. Easy MailChimp Account Details Page
1035
+	 *
1036
+	 * @since    1.0.0
1037
+	 */
1038 1038
 	function generateAccountDetailsPage() {
1039 1039
 		require_once YIKES_MC_PATH . 'admin/partials/menu/account-details.php'; // include our account details page
1040 1040
 	}
1041 1041
 
1042 1042
 	/**
1043
-	* Generate YIKES Inc. Easy MailChimp Support Page
1044
-	*
1045
-	* @since    1.0.0
1046
-	*/
1043
+	 * Generate YIKES Inc. Easy MailChimp Support Page
1044
+	 *
1045
+	 * @since    1.0.0
1046
+	 */
1047 1047
 	function generateSupportPage() {
1048 1048
 		require_once YIKES_MC_PATH . 'admin/partials/menu/support.php'; // include our options page
1049 1049
 	}
1050 1050
 
1051 1051
 	/**
1052
-	* Generate YIKES Inc. Easy MailChimp Edit Form Page
1053
-	*
1054
-	* @since    1.0.0
1055
-	*/
1052
+	 * Generate YIKES Inc. Easy MailChimp Edit Form Page
1053
+	 *
1054
+	 * @since    1.0.0
1055
+	 */
1056 1056
 	function generateEditFormPage() {
1057 1057
 		require_once YIKES_MC_PATH . 'admin/partials/edit-form.php'; // include our options page
1058 1058
 	}
1059 1059
 
1060 1060
 	/**
1061
-	* Generate YIKES Inc. Easy MailChimp Welcome Page
1062
-	*
1063
-	* @since    1.0.0
1064
-	*/
1061
+	 * Generate YIKES Inc. Easy MailChimp Welcome Page
1062
+	 *
1063
+	 * @since    1.0.0
1064
+	 */
1065 1065
 	function generateWelcomePage() {
1066 1066
 		require_once YIKES_MC_PATH . 'admin/partials/welcome-page/welcome.php'; // include our options page
1067 1067
 	}
1068 1068
 
1069 1069
 	/**
1070
-	* Generate YIKES Inc. Easy MailChimp View List Page
1071
-	*
1072
-	* @since    1.0.0
1073
-	*/
1070
+	 * Generate YIKES Inc. Easy MailChimp View List Page
1071
+	 *
1072
+	 * @since    1.0.0
1073
+	 */
1074 1074
 	function generateViewListPage() {
1075 1075
 		require_once YIKES_MC_PATH . 'admin/partials/view-list.php'; // include our options page
1076 1076
 	}
1077 1077
 
1078 1078
 	/**
1079
-	* Generate YIKES Inc. Easy MailChimp View User Page
1080
-	*
1081
-	* @since    1.0.0
1082
-	*/
1079
+	 * Generate YIKES Inc. Easy MailChimp View User Page
1080
+	 *
1081
+	 * @since    1.0.0
1082
+	 */
1083 1083
 	function generateViewUserPage() {
1084 1084
 		require_once YIKES_MC_PATH . 'admin/partials/view-user.php'; // include our options page
1085 1085
 	}
1086 1086
 
1087 1087
 	/**
1088
-	*	Register our plugin settings, and display them on our settings page
1089
-	*
1090
-	* @since v.5.4
1091
-	**/
1088
+	 *	Register our plugin settings, and display them on our settings page
1089
+	 *
1090
+	 * @since v.5.4
1091
+	 **/
1092 1092
 	function yikes_easy_mc_settings_init() {
1093 1093
 
1094 1094
 		/* Register General Settings Section */
@@ -1204,9 +1204,9 @@  discard block
 block discarded – undo
1204 1204
 	}
1205 1205
 
1206 1206
 	/**
1207
-	*	Options Sanitization & Validation
1208
-	*	@since complete re-write
1209
-	**/
1207
+	 *	Options Sanitization & Validation
1208
+	 *	@since complete re-write
1209
+	 **/
1210 1210
 	function yikes_mc_validate_api_key( $input ) {
1211 1211
 		if( $input === '' ) {
1212 1212
 			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
@@ -1248,20 +1248,20 @@  discard block
 block discarded – undo
1248 1248
 	}
1249 1249
 
1250 1250
 	/**
1251
-	* Generate YIKES Inc. Easy Forms for MailChimp Options Page
1252
-	*
1253
-	* @since    1.0.0
1254
-	*/
1251
+	 * Generate YIKES Inc. Easy Forms for MailChimp Options Page
1252
+	 *
1253
+	 * @since    1.0.0
1254
+	 */
1255 1255
 	function generatePageOptions() {
1256 1256
 		require_once YIKES_MC_PATH . 'admin/partials/menu/options.php'; // include our options page
1257 1257
 	}
1258 1258
 
1259 1259
 	/**
1260
-	*	Check if users API key is valid, if not
1261
-	*	this function will apply a disabled attribute
1262
-	*	to form fields. (input, dropdowns, buttons etc.)
1263
-	* 	@since v5.5 re-write
1264
-	**/
1260
+	 *	Check if users API key is valid, if not
1261
+	 *	this function will apply a disabled attribute
1262
+	 *	to form fields. (input, dropdowns, buttons etc.)
1263
+	 * 	@since v5.5 re-write
1264
+	 **/
1265 1265
 	public function is_user_mc_api_valid_form( $echo=true ) {
1266 1266
 		if( $echo == true ) {
1267 1267
 			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 	 * Migrate our old options , to the new options API
1302 1302
 	 * moving from 5.5 and beyond..
1303 1303
 	 * @since
1304
-	*/
1304
+	 */
1305 1305
 	public function migrate_old_yks_mc_options() {
1306 1306
 		// include our migrate options helper file
1307 1307
 		include_once YIKES_MC_PATH . 'admin/partials/upgrade-helpers/upgrade-migrate-options.php';
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 	/**
1311 1311
 		Admin Notices
1312 1312
 		- Notifications displayed at the top of admin pages, back to the user
1313
-	**/
1313
+	 **/
1314 1314
 
1315 1315
 		/**
1316 1316
 		 * Check for existing plugin options
@@ -1369,12 +1369,12 @@  discard block
 block discarded – undo
1369 1369
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1370 1370
 		*/
1371 1371
 		function findMCListID($id, $array) {
1372
-		   foreach ($array as $key => $val) {
1373
-			   if ($val['id'] === $id) {
1374
-				   return $key;
1375
-			   }
1376
-		   }
1377
-		   return null;
1372
+			foreach ($array as $key => $val) {
1373
+				if ($val['id'] === $id) {
1374
+					return $key;
1375
+				}
1376
+			}
1377
+			return null;
1378 1378
 		} // end
1379 1379
 
1380 1380
 		/* Ajax Migrate Options */
@@ -1727,9 +1727,9 @@  discard block
 block discarded – undo
1727 1727
 			}
1728 1728
 
1729 1729
 			/**
1730
-			*	Custom action hook for our extensions to hook into
1731
-			*	@parameter	get_current_screen()	current screen information
1732
-			*/
1730
+			 *	Custom action hook for our extensions to hook into
1731
+			 *	@parameter	get_current_screen()	current screen information
1732
+			 */
1733 1733
 			do_action( 'yikes-mailchimp-admin-sidebar', get_current_screen() );
1734 1734
 
1735 1735
 		}
@@ -2773,12 +2773,12 @@  discard block
 block discarded – undo
2773 2773
 		}
2774 2774
 
2775 2775
 		/**
2776
-		*	Return an array of MailChimp lists associated with this account
2777
-		*
2778
-		*	Used when deleting the sites MailChimp cache stored
2779
-		*	@since 6.0.2
2780
-		*	@return 	$list_id_array - array of list id's to loop over
2781
-		*/
2776
+		 *	Return an array of MailChimp lists associated with this account
2777
+		 *
2778
+		 *	Used when deleting the sites MailChimp cache stored
2779
+		 *	@since 6.0.2
2780
+		 *	@return 	$list_id_array - array of list id's to loop over
2781
+		 */
2782 2782
 		public function get_mailchimp_list_ids_on_account() {
2783 2783
 			$api_key = yikes_get_mc_api_key();
2784 2784
 			if( ! $api_key ) {
@@ -2888,19 +2888,19 @@  discard block
 block discarded – undo
2888 2888
 		}
2889 2889
 
2890 2890
 		/**
2891
-		*	Hook in and display our support page/knowledge base articles
2892
-		*	on the support page
2893
-		*	@since 6.0.3.8
2894
-		*/
2891
+		 *	Hook in and display our support page/knowledge base articles
2892
+		 *	on the support page
2893
+		 *	@since 6.0.3.8
2894
+		 */
2895 2895
 		public function hook_and_display_kb_article_RSS() {
2896 2896
 			// include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-articles-RSS.php' );
2897 2897
 			include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-article-links.php' );
2898 2898
 		}
2899 2899
 
2900 2900
 		/**
2901
-		*	Check the users version number, and display a notice to upgrade the databse if needed
2902
-		*	@since 6.0.4
2903
-		*/
2901
+		 *	Check the users version number, and display a notice to upgrade the databse if needed
2902
+		 *	@since 6.0.4
2903
+		 */
2904 2904
 		public function check_yikes_mc_table_version() {
2905 2905
 			if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2906 2906
 				require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php';
Please login to merge, or discard this patch.
Spacing   +483 added lines, -483 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		/***********************/
105 105
 		/** Create A Form **/
106 106
 		/**********************/
107
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) {
107
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-form' ) {
108 108
 
109 109
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
110 110
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 		/***********************/
114 114
 		/** Delete A Form **/
115 115
 		/**********************/
116
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) {
116
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-delete-form' ) {
117 117
 
118 118
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
119 119
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		/**********************************/
123 123
 		/** Duplicate/Clone A Form    **/
124 124
 		/********************************/
125
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) {
125
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-duplicate-form' ) {
126 126
 
127 127
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
128 128
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		/*************************************/
132 132
 		/**  Reset Form Impression Stats **/
133 133
 		/***********************************/
134
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) {
134
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-reset-stats' ) {
135 135
 
136 136
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
137 137
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 		/**********************************/
141 141
 		/**         Update A Form        **/
142 142
 		/********************************/
143
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) {
143
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-update-form' ) {
144 144
 
145 145
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
146 146
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		/**************************************************/
150 150
 		/**     Clear Store MailChimp Transient Data   **/
151 151
 		/*************************************************/
152
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) {
152
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-transient-data' ) {
153 153
 
154 154
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
155 155
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		/*******************************************/
159 159
 		/** Remove a user from a mailing list     **/
160 160
 		/*****************************************/
161
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) {
161
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-unsubscribe-user' ) {
162 162
 
163 163
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
164 164
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		/*******************************************/
168 168
 		/**    Create misisng error log file  **/
169 169
 		/*****************************************/
170
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) {
170
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-error-log' ) {
171 171
 
172 172
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
173 173
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		/**************************************************/
200 200
 		/**        Clear MailChimp Error Log Data        **/
201 201
 		/*************************************************/
202
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) {
202
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-error-log' ) {
203 203
 
204 204
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
205 205
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 		/*********************************************/
209 209
 		/**        Export MailChimp Opt-in Forms   **/
210 210
 		/*******************************************/
211
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) {
211
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-forms' ) {
212 212
 
213 213
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
214 214
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		/*********************************************/
218 218
 		/**                Export Plugin Settings           **/
219 219
 		/*******************************************/
220
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) {
220
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-settings' ) {
221 221
 
222 222
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
223 223
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 		/*******************************************/
227 227
 		/**        Import Class Inclusion       **/
228 228
 		/*****************************************/
229
-		if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) {
229
+		if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) {
230 230
 
231 231
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
232 232
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		/*******************************************/
236 236
 		/**    Premium Support Request     **/
237 237
 		/*****************************************/
238
-		if ( isset( $_POST['submit-premium-support-request'] ) ) {
238
+		if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) {
239 239
 
240 240
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
241 241
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 		/****************************************/
245 245
 		/**    Dismiss Options Migrations        **/
246 246
 		/****************************************/
247
-		if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
247
+		if ( isset( $_REQUEST[ 'dismiss_migration_nonce' ] ) ) {
248 248
 
249 249
 			add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
250 250
 
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
280 280
 		*	@ return	array	$links		New array of plugin actions
281 281
 		*/
282 282
 		public function easy_forms_plugin_action_links( $links ) {
283
-			$links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
284
-			$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>';
283
+			$links[ ] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) . '">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
284
+			$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>';
285 285
 			return $links;
286 286
 		}
287 287
 
@@ -314,29 +314,29 @@  discard block
 block discarded – undo
314 314
 		*	@return	parsed tag content
315 315
 		*/
316 316
 		public function parse_mailchimp_default_tag( $default_tag ) {
317
-			if( ! $default_tag || $default_tag == '' ) {
317
+			if ( ! $default_tag || $default_tag == '' ) {
318 318
 				return $default_tag;
319 319
 			}
320 320
 			global $post;
321 321
 			// page title
322
-			if( $default_tag == '{page_title}' ) {
322
+			if ( $default_tag == '{page_title}' ) {
323 323
 				$default_tag = get_the_title( $post->ID );
324 324
 			}
325 325
 			// page id
326
-			if( $default_tag == '{page_title}' ) {
326
+			if ( $default_tag == '{page_title}' ) {
327 327
 				$default_tag = $post->ID;
328 328
 			}
329 329
 			// page url
330
-			if( $default_tag == '{page_url}' ) {
330
+			if ( $default_tag == '{page_url}' ) {
331 331
 				$default_tag = get_permalink( $post->ID );
332 332
 			}
333 333
 			// blog name
334
-			if( $default_tag == '{blog_name}' ) {
334
+			if ( $default_tag == '{blog_name}' ) {
335 335
 				$default_tag = get_bloginfo( 'name' );
336 336
 			}
337 337
 			// is user logged in
338
-			if( $default_tag == '{user_logged_in}' ) {
339
-				if( is_user_logged_in() ) {
338
+			if ( $default_tag == '{user_logged_in}' ) {
339
+				if ( is_user_logged_in() ) {
340 340
 					$default_tag = 'Registered User';
341 341
 				} else {
342 342
 					$default_tag = 'Guest User';
@@ -354,12 +354,12 @@  discard block
 block discarded – undo
354 354
 		*/
355 355
 		public function yikes_easy_mailchimp_clear_error_log() {
356 356
 			// file put contents $returned error + other data
357
-			if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
357
+			if ( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) {
358 358
 				$clear_log = file_put_contents(
359 359
 					YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php',
360 360
 					''
361 361
 				);
362
-				if( $clear_log === false ) {
362
+				if ( $clear_log === false ) {
363 363
 					// redirect the user to the manage forms page, display error message
364 364
 					wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error-log-cleared=false' ) ) );
365 365
 				} else {
@@ -377,17 +377,17 @@  discard block
 block discarded – undo
377 377
 		*/
378 378
 		public function yikes_easy_mailchimp_export_forms() {
379 379
 			// grab our nonce
380
-			$nonce = $_REQUEST['nonce'];
380
+			$nonce = $_REQUEST[ 'nonce' ];
381 381
 			// grab the forms
382
-			$forms = isset( $_REQUEST['export_forms'] ) ? $_REQUEST['export_forms'] : array();
382
+			$forms = isset( $_REQUEST[ 'export_forms' ] ) ? $_REQUEST[ 'export_forms' ] : array();
383 383
 			// validate nonce
384
-			if( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
385
-				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 ) );
384
+			if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) {
385
+				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 ) );
386 386
 			}
387 387
 
388 388
 			// run the export function
389 389
 			// parameters: ( $table_name, $form_ids, $file_name )
390
-			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export('Yikes-Inc-Easy-MailChimp-Forms-Export', $forms );
390
+			Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'Yikes-Inc-Easy-MailChimp-Forms-Export', $forms );
391 391
 			// re-direct the user back to the page
392 392
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=import-export-forms' ) ) );
393 393
 			die();
@@ -401,10 +401,10 @@  discard block
 block discarded – undo
401 401
 		*/
402 402
 		public function yikes_easy_mailchimp_export_plugin_settings() {
403 403
 			// grab our nonce
404
-			$nonce = $_REQUEST['nonce'];
404
+			$nonce = $_REQUEST[ 'nonce' ];
405 405
 			// validate nonce
406
-			if( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
407
-				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 ) );
406
+			if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) {
407
+				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 ) );
408 408
 			}
409 409
 
410 410
 			// run the export function
@@ -421,13 +421,13 @@  discard block
 block discarded – undo
421 421
 		*/
422 422
 		public function yikes_easy_mailchimp_import_forms() {
423 423
 			// grab our nonce
424
-			$nonce = $_REQUEST['nonce'];
424
+			$nonce = $_REQUEST[ 'nonce' ];
425 425
 			// validate nonce
426
-			if( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
427
-				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 ) );
426
+			if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) {
427
+				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 ) );
428 428
 			}
429 429
 			// include the export class
430
-			if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
430
+			if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) {
431 431
 				include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-import.class.php' );
432 432
 			}
433 433
 			// run the import function
@@ -445,15 +445,15 @@  discard block
 block discarded – undo
445 445
 		*/
446 446
 		public function yikes_easy_mailchimp_premium_support_request() {
447 447
 
448
-			if( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) {
449
-				return __( 'We encountered an error. Please contact the YIKES Inc. support team.' , 'yikes-inc-easy-mailchimp-extender' );
448
+			if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] != 'yikes-support-request' ) {
449
+				return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' );
450 450
 			}
451 451
 
452
-			$license = $_POST['license_key'];
453
-			$user_email = $_POST['user-email'];
454
-			$support_topic = $_POST['support-topic'];
455
-			$support_priority = $_POST['support-priority'];
456
-			$support_content = $_POST['support-content'];
452
+			$license = $_POST[ 'license_key' ];
453
+			$user_email = $_POST[ 'user-email' ];
454
+			$support_topic = $_POST[ 'support-topic' ];
455
+			$support_priority = $_POST[ 'support-priority' ];
456
+			$support_content = $_POST[ 'support-content' ];
457 457
 
458 458
 			// wp_die( print_r( $support_content) );
459 459
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 			) );
478 478
 
479 479
 			// catch the error
480
-			if( is_wp_error( $response ) ) {
480
+			if ( is_wp_error( $response ) ) {
481 481
 				wp_die( $response->getMessage() );
482 482
 				return;
483 483
 			}
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 			$create_ticket_response = wp_remote_retrieve_body( $response );
487 487
 
488 488
 			// display it
489
-			if( $create_ticket_response )
489
+			if ( $create_ticket_response )
490 490
 				echo $create_ticket_response;
491 491
 
492 492
 		}
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 			// delete the options and allow the user to manually updadte things
501 501
 
502 502
 			// Verify the NONCE is valid
503
-			check_admin_referer( 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' );
503
+			check_admin_referer( 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' );
504 504
 
505 505
 			// re-direct the user back to the page
506 506
 			wp_redirect( esc_url_raw( admin_url( 'index.php?yikes-mc-options-migration-dismissed="true"' ) ) );
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 		 * @since 6.0.0
516 516
 		 */
517 517
 		public function load_error_logging_class() {
518
-			if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
518
+			if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
519 519
 				// if error logging is enabled we should include our error logging class
520 520
 				/* Generate oure error logging table */
521 521
 				require_once YIKES_MC_PATH . '/includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
@@ -534,17 +534,17 @@  discard block
 block discarded – undo
534 534
 			// add a new option to store the plugin activation date/time
535 535
 			// @since v6.0.0
536 536
 			// this is used to notify the user that they should review after 2 weeks
537
-			if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
537
+			if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) ) {
538 538
 				add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) );
539 539
 			}
540 540
 
541 541
 			$stop_bugging_me = get_option( 'yikes_easy_mailchimp_review_stop_bugging_me' );
542 542
 
543
-			if( !$stop_bugging_me ) {
543
+			if ( ! $stop_bugging_me ) {
544 544
 				$install_date = get_option( 'yikes_easy_mailchimp_activation_date' );
545 545
 				$past_date = strtotime( '-14 days' );
546 546
 				if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) {
547
-					add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) );
547
+					add_action( 'admin_notices', array( $this, 'yikes_easy_mailchimp_display_review_us_notice' ) );
548 548
 				}
549 549
 			}
550 550
 
@@ -557,13 +557,13 @@  discard block
 block discarded – undo
557 557
 		*/
558 558
 		public function yikes_easy_mailchimp_display_review_us_notice() {
559 559
 			/* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
560
-			if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
560
+			if ( in_array( get_current_screen()->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base, 'yikes-inc-easy-mailchimp' ) !== false ) {
561 561
 				// Review URL - Change to the URL of your plugin on WordPress.org
562 562
 				$reviewurl = 'https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender';
563 563
 				$addons_url = esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) );
564 564
 				$nobugurl = esc_url_raw( add_query_arg( 'yikes_easy_mc_icons_nobug', '1', admin_url() ) );
565 565
 				$review_message = '<div id="yikes-mailchimp-logo"></div>';
566
-				$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 ) . '';
566
+				$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 ) . '';
567 567
 				?>
568 568
 					<div id="review-yikes-easy-mailchimp-notice">
569 569
 						<?php echo $review_message; ?>
@@ -579,8 +579,8 @@  discard block
 block discarded – undo
579 579
 		*/
580 580
 		public function yikes_easy_mailchimp_stop_bugging_me() {
581 581
 			$nobug = "";
582
-			if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) ) {
583
-				$nobug = (int) esc_attr( $_GET['yikes_easy_mc_icons_nobug'] );
582
+			if ( isset( $_GET[ 'yikes_easy_mc_icons_nobug' ] ) ) {
583
+				$nobug = (int) esc_attr( $_GET[ 'yikes_easy_mc_icons_nobug' ] );
584 584
 			}
585 585
 			if ( 1 == $nobug ) {
586 586
 				add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', TRUE );
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 
592 592
 		/* Display a warning users who are using PHP < 5.3 */
593 593
 		public function display_php_warning() {
594
-			$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' );
594
+			$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' );
595 595
 			echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>";
596 596
 		}
597 597
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 		public function add_tinyMCE_buttons() {
603 603
 			global $typenow;
604 604
 			// only on Post Type: post and page
605
-			if( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
605
+			if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
606 606
 				return;
607 607
 			}
608 608
 			add_filter( 'mce_buttons', array( $this, 'yks_mc_add_tinymce_button' ) );
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 		// inlcude the js for tinymce
620 620
 		public function yks_mc_add_tinymce_plugin( $plugin_array ) {
621 621
 
622
-			$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
622
+			$plugin_array[ 'yks_mc_tinymce_button' ] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
623 623
 
624 624
 			return $plugin_array;
625 625
 
@@ -632,23 +632,23 @@  discard block
 block discarded – undo
632 632
 		*/
633 633
 		public function tinymce_yikes_easy_mc() {
634 634
 			// check capabilities
635
-			if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
635
+			if ( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
636 636
 				return;
637 637
 			}
638 638
 
639 639
 			$list_data = $this->form_interface->get_all_forms();
640 640
 			$lists = array();
641
-			if( !empty( $list_data ) ) {
641
+			if ( ! empty( $list_data ) ) {
642 642
 				// build an array to pass to our javascript
643
-				foreach( $list_data as $id => $form ) {
644
-					$lists[] = array(
645
-						'text'  => urlencode( $form['form_name'] ),
643
+				foreach ( $list_data as $id => $form ) {
644
+					$lists[ ] = array(
645
+						'text'  => urlencode( $form[ 'form_name' ] ),
646 646
 						'value' => $id,
647 647
 					);
648 648
 				}
649 649
 			} else {
650
-				$lists[0] = array(
651
-					'text' => __( 'Please Import Some MailChimp Lists' , 'yikes-inc-easy-mailchimp-extender' ),
650
+				$lists[ 0 ] = array(
651
+					'text' => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ),
652 652
 					'value' => '-'
653 653
 				);
654 654
 			}
@@ -658,10 +658,10 @@  discard block
 block discarded – undo
658 658
 				'forms' => json_encode( $lists ),
659 659
 				'button_title' => __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ),
660 660
 				'popup_title' => __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ),
661
-				'list_id_label' => __( 'MailChimp Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ),
662
-				'show_title_label' => __( 'Display Form Title' , 'yikes-inc-easy-mailchimp-extender' ),
663
-				'show_description_label' => __( 'Display Form Description' , 'yikes-inc-easy-mailchimp-extender' ),
664
-				'submit_button_text_label' => __( 'Custom Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ),
661
+				'list_id_label' => __( 'MailChimp Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ),
662
+				'show_title_label' => __( 'Display Form Title', 'yikes-inc-easy-mailchimp-extender' ),
663
+				'show_description_label' => __( 'Display Form Description', 'yikes-inc-easy-mailchimp-extender' ),
664
+				'submit_button_text_label' => __( 'Custom Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ),
665 665
 				'submit_button_message' => '<em>' . __( 'If left empty, the button will use the default submit button text .', 'yikes-inc-easy-mailchimp-extender' ) . '</em>',
666 666
 				'alert_translated' => sprintf( __( 'You need to <a href=%s title="%s">create a form</a> before you can add one to a page or post.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ) ),
667 667
 			) );
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 		if ( get_option( 'yikes_mailchimp_activation_redirect', 'true' ) == 'true' ) {
678 678
 			update_option( 'yikes_mailchimp_activation_redirect', 'false' );
679 679
 			/* If the user had this plugin activated prior to today, redirect to 'Whats New' */
680
-			if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
680
+			if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
681 681
 				wp_redirect( esc_url( admin_url( 'admin.php?page=yikes-mailchimp-welcome' ) ) );
682 682
 			} else {
683 683
 				/* Else redirect the user over to the 'Getting Started' tab */
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 	 * @since    6.0.0
730 730
 	 */
731 731
 	public function enqueue_scripts() {
732
-		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery' , 'jquery-ui-sortable' ), $this->version, false );
732
+		wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery', 'jquery-ui-sortable' ), $this->version, false );
733 733
 
734 734
 		$localized_data = array(
735 735
 			'admin_url'                => esc_url_raw( admin_url() ),
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 			'preloader_url'            => esc_url_raw( admin_url( '/images/wpspin_light.gif' ) ),
740 740
 		);
741 741
 
742
-		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js' , 'object_data' , $localized_data );
742
+		wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js', 'object_data', $localized_data );
743 743
 
744 744
 		// Enqueue required scripts for the form editor
745 745
 		$screen = get_current_screen();
@@ -752,8 +752,8 @@  discard block
 block discarded – undo
752 752
 
753 753
 		wp_enqueue_style( 'wp-color-picker' );
754 754
 		wp_enqueue_script( 'wp-color-picker' );
755
-		wp_enqueue_script( 'jquery.timepicker.js',YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js' , array( 'jquery' ) , $this->version, false );
756
-		wp_enqueue_script( 'edit-form-js' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js' , array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ) , $this->version, false );
755
+		wp_enqueue_script( 'jquery.timepicker.js', YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ), $this->version, false );
756
+		wp_enqueue_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ), $this->version, false );
757 757
 
758 758
 		$localized_data = array(
759 759
 			'ajax_url'                          => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 			'isRTL'                             => $wp_locale->is_rtl(),
779 779
 			'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' ),
780 780
 		);
781
-		wp_localize_script( 'edit-form-js' , 'yikes_mailchimp_edit_form' , $localized_data );
781
+		wp_localize_script( 'edit-form-js', 'yikes_mailchimp_edit_form', $localized_data );
782 782
 	}
783 783
 
784 784
 	/**
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 	 * Convert the php date format string to a js date format
841 841
 	 */
842 842
 	public function yikes_jQuery_datepicker_date_format( $site_option ) {
843
-		switch( $site_option ) {
843
+		switch ( $site_option ) {
844 844
 			//Predefined WP date formats
845 845
 			default:
846 846
 			case 'F j, Y':
@@ -864,9 +864,9 @@  discard block
 block discarded – undo
864 864
 
865 865
 		/* Top Level Menu 'Easy MailChimp' */
866 866
 		add_menu_page(
867
-			__( 'Easy Forms' , 'yikes-inc-easy-mailchimp-extender' ),
867
+			__( 'Easy Forms', 'yikes-inc-easy-mailchimp-extender' ),
868 868
 			'Easy Forms',
869
-			apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
869
+			apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
870 870
 			'yikes-inc-easy-mailchimp',
871 871
 			'', // no callback,
872 872
 			YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_wink_icon.png'
@@ -880,9 +880,9 @@  discard block
 block discarded – undo
880 880
 				/* YIKES Inc. Easy MailChimp Manage Forms */
881 881
 				add_submenu_page(
882 882
 					'yikes-inc-easy-mailchimp',
883
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
884
-					__( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
885
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
883
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
884
+					__( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
885
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
886 886
 					'yikes-inc-easy-mailchimp',
887 887
 					array( $this, 'generateManageFormsPage' )
888 888
 				);
@@ -890,9 +890,9 @@  discard block
 block discarded – undo
890 890
 				/* YIKES Inc. Easy MailChimp Manage Lists */
891 891
 				add_submenu_page(
892 892
 					'yikes-inc-easy-mailchimp',
893
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
894
-					__( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
895
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
893
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
894
+					__( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
895
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
896 896
 					'yikes-inc-easy-mailchimp-lists',
897 897
 					array( $this, 'generateManageListsPage' )
898 898
 				);
@@ -906,13 +906,13 @@  discard block
 block discarded – undo
906 906
 
907 907
 
908 908
 			/* YIKES Inc. Easy MailChimp Account Overview */
909
-			if ( get_option('yikes-mc-api-validation') == 'valid_api_key' ) {
909
+			if ( get_option( 'yikes-mc-api-validation' ) == 'valid_api_key' ) {
910 910
 				/* YIKES Inc. Easy MailChimp Settings */
911 911
 				add_submenu_page(
912 912
 					'yikes-inc-easy-mailchimp',
913
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
914
-					__( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
915
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
913
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
914
+					__( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
915
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
916 916
 					'yikes-inc-easy-mailchimp-account-overview',
917 917
 					array( $this, 'generateAccountDetailsPage' )
918 918
 				);
@@ -922,9 +922,9 @@  discard block
 block discarded – undo
922 922
 			/* YIKES Inc. Easy MailChimp Settings */
923 923
 			add_submenu_page(
924 924
 				'yikes-inc-easy-mailchimp',
925
-				__( 'Settings.' , 'yikes-inc-easy-mailchimp-extender' ),
926
-				__( 'Settings' , 'yikes-inc-easy-mailchimp-extender' ),
927
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
925
+				__( 'Settings.', 'yikes-inc-easy-mailchimp-extender' ),
926
+				__( 'Settings', 'yikes-inc-easy-mailchimp-extender' ),
927
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
928 928
 				'yikes-inc-easy-mailchimp-settings',
929 929
 				array( $this, 'generatePageOptions' )
930 930
 			);
@@ -932,9 +932,9 @@  discard block
 block discarded – undo
932 932
 			/* Support Page */
933 933
 			add_submenu_page(
934 934
 				'yikes-inc-easy-mailchimp',
935
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
936
-				__( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
937
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
935
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
936
+				__( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
937
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
938 938
 				'yikes-inc-easy-mailchimp-support',
939 939
 				array( $this, 'generateSupportPage' )
940 940
 			);
@@ -942,11 +942,11 @@  discard block
 block discarded – undo
942 942
 			/* Add-Ons Page */
943 943
 			add_submenu_page(
944 944
 				'yikes-inc-easy-mailchimp',
945
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
946
-				__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
947
-				apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
945
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
946
+				__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
947
+				apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
948 948
 				'yikes-inc-easy-mailchimp-addons',
949
-				array( $this , 'generateAddOnsPage' )
949
+				array( $this, 'generateAddOnsPage' )
950 950
 			);
951 951
 
952 952
 			/** Hidden Pages **/
@@ -954,9 +954,9 @@  discard block
 block discarded – undo
954 954
 				/* Add Hidden Edit Form Page */
955 955
 				add_submenu_page(
956 956
 					'options.php',
957
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
958
-					__( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
959
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
957
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
958
+					__( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
959
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
960 960
 					'yikes-mailchimp-edit-form',
961 961
 					array( $this, 'generateEditFormPage' )
962 962
 				);
@@ -964,19 +964,19 @@  discard block
 block discarded – undo
964 964
 				/* Add Hidden Migrate Options Page */
965 965
 				add_submenu_page(
966 966
 					'options-writing.php',
967
-					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure' , 'yikes-inc-easy-mailchimp-extender' ),
967
+					__( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure', 'yikes-inc-easy-mailchimp-extender' ),
968 968
 					'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure',
969 969
 					'manage_options',
970
-					'yikes-inc-easy-mailchimp-update' ,
971
-					array( $this , 'migrate_old_yks_mc_options' )
970
+					'yikes-inc-easy-mailchimp-update',
971
+					array( $this, 'migrate_old_yks_mc_options' )
972 972
 				);
973 973
 
974 974
 				/* Add Hidden Welcome Page */
975 975
 				add_submenu_page(
976 976
 					'options.php',
977
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
978
-					__( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
979
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
977
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
978
+					__( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
979
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
980 980
 					'yikes-mailchimp-welcome',
981 981
 					array( $this, 'generateWelcomePage' )
982 982
 				);
@@ -984,9 +984,9 @@  discard block
 block discarded – undo
984 984
 				/* Add Hidden 'View List' Page */
985 985
 				add_submenu_page(
986 986
 					'options.php',
987
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
988
-					__( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
989
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
987
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
988
+					__( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
989
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
990 990
 					'yikes-mailchimp-view-list',
991 991
 					array( $this, 'generateViewListPage' )
992 992
 				);
@@ -994,9 +994,9 @@  discard block
 block discarded – undo
994 994
 				/* Add Hidden View User Page */
995 995
 				add_submenu_page(
996 996
 					'options.php',
997
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
998
-					__( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
999
-					apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
997
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
998
+					__( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
999
+					apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
1000 1000
 					'yikes-mailchimp-view-user',
1001 1001
 					array( $this, 'generateViewUserPage' )
1002 1002
 				);
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
 
1094 1094
 		/* Register General Settings Section */
1095 1095
 
1096
-		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this , 'yikes_mc_validate_api_key' ) );
1096
+		register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this, 'yikes_mc_validate_api_key' ) );
1097 1097
 
1098 1098
 		add_settings_section(
1099 1099
 			'yikes_easy_mc_settings_general_section_callback',
@@ -1136,16 +1136,16 @@  discard block
 block discarded – undo
1136 1136
 		add_settings_field(
1137 1137
 			'optin-checkbox-init',
1138 1138
 			__( 'Select Checkboxes to Generate', 'yikes-inc-easy-mailchimp-extender' ),
1139
-			'',  // callback + validation inside of admin/partials/menu/options.php
1139
+			'', // callback + validation inside of admin/partials/menu/options.php
1140 1140
 			'yikes_inc_easy_mc_checkbox_settings'
1141 1141
 		);
1142 1142
 		/* End Checkbox Settings */
1143 1143
 
1144 1144
 		/* reCAPTCHA Settings */
1145 1145
 
1146
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-status' );
1147
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-site-key' );
1148
-			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-secret-key' );
1146
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-status' );
1147
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-site-key' );
1148
+			register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-secret-key' );
1149 1149
 
1150 1150
 			/* Register reCAPTCHA Settings Section */
1151 1151
 			add_settings_section(
@@ -1158,28 +1158,28 @@  discard block
 block discarded – undo
1158 1158
 			add_settings_field(
1159 1159
 				'yikes-mc-recaptcha-site-key',
1160 1160
 				__( 'Enter reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ),
1161
-				'',  // callback + validation inside of admin/partials/menu/options.php
1161
+				'', // callback + validation inside of admin/partials/menu/options.php
1162 1162
 				'yikes_easy_mc_settings_recpatcha_section'
1163 1163
 			);
1164 1164
 
1165 1165
 			add_settings_field(
1166 1166
 				'yikes-mc-recaptcha-secret-key',
1167 1167
 				__( 'Enter reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ),
1168
-				'',  // callback + validation inside of admin/partials/menu/options.php
1168
+				'', // callback + validation inside of admin/partials/menu/options.php
1169 1169
 				'yikes_easy_mc_settings_recpatcha_section'
1170 1170
 			);
1171 1171
 
1172 1172
 			add_settings_field(
1173 1173
 				'yikes-mc-recaptcha-status',
1174 1174
 				__( 'Enable ReCaptcha', 'yikes-inc-easy-mailchimp-extender' ),
1175
-				'',  // callback + validation inside of admin/partials/menu/options.php
1175
+				'', // callback + validation inside of admin/partials/menu/options.php
1176 1176
 				'yikes_easy_mc_settings_recpatcha_section'
1177 1177
 			);
1178 1178
 
1179 1179
 		/* End reCAPTCHA Settings */
1180 1180
 
1181 1181
 		/* Debug Settings */
1182
-			register_setting( 'yikes_inc_easy_mc_debug_settings_page' , 'yikes-mailchimp-debug-status' );
1182
+			register_setting( 'yikes_inc_easy_mc_debug_settings_page', 'yikes-mailchimp-debug-status' );
1183 1183
 
1184 1184
 			/* Register Debug Settings Section */
1185 1185
 			add_settings_section(
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
 			add_settings_field(
1193 1193
 				'yikes-mailchimp-debug-status',
1194 1194
 				__( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ),
1195
-				'',  // callback + validation inside of admin/partials/menu/options.php
1195
+				'', // callback + validation inside of admin/partials/menu/options.php
1196 1196
 				'yikes_easy_mc_settings_debug_section'
1197 1197
 			);
1198 1198
 
@@ -1208,17 +1208,17 @@  discard block
 block discarded – undo
1208 1208
 	*	@since complete re-write
1209 1209
 	**/
1210 1210
 	function yikes_mc_validate_api_key( $input ) {
1211
-		if( $input === '' ) {
1212
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1211
+		if ( $input === '' ) {
1212
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1213 1213
 			return;
1214 1214
 		}
1215
-		$api_key = strip_tags ( trim( $input ) );
1215
+		$api_key = strip_tags( trim( $input ) );
1216 1216
 		$dash_position = strpos( trim( $input ), '-' );
1217
-		if( $dash_position !== false ) {
1217
+		if ( $dash_position !== false ) {
1218 1218
 			$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/ping.json';
1219 1219
 		} else {
1220 1220
 			update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) );
1221
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1221
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1222 1222
 			return $api_key;
1223 1223
 		}
1224 1224
 		$request_args = array(
@@ -1229,19 +1229,19 @@  discard block
 block discarded – undo
1229 1229
 			'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
1230 1230
 		);
1231 1231
 		$api_key_response = wp_remote_post( $api_endpoint, $request_args );
1232
-		if( ! is_wp_error( $api_key_response ) ) {
1232
+		if ( ! is_wp_error( $api_key_response ) ) {
1233 1233
 			$body = json_decode( wp_remote_retrieve_body( $api_key_response ), true );
1234
-			if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) {
1235
-				update_option( 'yikes-mc-api-validation' , 'valid_api_key' );
1234
+			if ( isset( $body[ 'msg' ] ) && $body[ 'msg' ] == "Everything's Chimpy!" ) {
1235
+				update_option( 'yikes-mc-api-validation', 'valid_api_key' );
1236 1236
 				// Clear the API key transient data
1237 1237
 				$this->delete_yikes_mailchimp_transients();
1238 1238
 			}
1239
-		}  else {
1239
+		} else {
1240 1240
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
1241 1241
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1242
-			$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' ) );
1243
-			update_option( 'yikes-mc-api-invalid-key-response' , $api_key_response->get_error_message() );
1244
-			update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1242
+			$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' ) );
1243
+			update_option( 'yikes-mc-api-invalid-key-response', $api_key_response->get_error_message() );
1244
+			update_option( 'yikes-mc-api-validation', 'invalid_api_key' );
1245 1245
 		}
1246 1246
 		// returned the api key
1247 1247
 		return $api_key;
@@ -1262,13 +1262,13 @@  discard block
 block discarded – undo
1262 1262
 	*	to form fields. (input, dropdowns, buttons etc.)
1263 1263
 	* 	@since v5.5 re-write
1264 1264
 	**/
1265
-	public function is_user_mc_api_valid_form( $echo=true ) {
1266
-		if( $echo == true ) {
1267
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1265
+	public function is_user_mc_api_valid_form( $echo = true ) {
1266
+		if ( $echo == true ) {
1267
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1268 1268
 				echo 'disabled="disabled"';
1269 1269
 			}
1270 1270
 		} else {
1271
-			if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1271
+			if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1272 1272
 				return false;
1273 1273
 			} else {
1274 1274
 				return true;
@@ -1288,11 +1288,11 @@  discard block
 block discarded – undo
1288 1288
 	public function check_for_old_yks_mc_options() {
1289 1289
 		$old_plugin_options = get_option( 'ykseme_storage' );
1290 1290
 		// only perform options migrations if the site is not a multi-site setup
1291
-		if ( !is_multisite() ) {
1292
-			if( apply_filters( 'yikes_mc_old_options_filter' , $old_plugin_options ) ) {
1291
+		if ( ! is_multisite() ) {
1292
+			if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) {
1293 1293
 				// display a notice to the user that they should 'migrate'
1294 1294
 				// from the old plugin settings to the new ones
1295
-				add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 );
1295
+				add_action( 'admin_notices', array( $this, 'display_options_migrate_notice' ), 11 );
1296 1296
 			}
1297 1297
 		}
1298 1298
 	}
@@ -1325,11 +1325,11 @@  discard block
 block discarded – undo
1325 1325
 
1326 1326
 			// Confirm that the necessary forms table in the database exists, else bail
1327 1327
 			global $wpdb;
1328
-			if( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1328
+			if ( $wpdb->get_var( "show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'" ) != $wpdb->prefix . "yikes_easy_mc_forms" ) {
1329 1329
 				return;
1330 1330
 			}
1331 1331
 
1332
-			if( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) {
1332
+			if ( isset( $_GET[ 'yikes-mc-options-migration-dismissed' ] ) && $_GET[ 'yikes-mc-options-migration-dismissed' ] == 'true' ) {
1333 1333
 					// Delete the options, start a-new! (this will disable the migration notice altogether)
1334 1334
 					delete_option( 'widget_yikes_mc_widget' );
1335 1335
 					delete_option( 'api_validation' );
@@ -1343,18 +1343,18 @@  discard block
 block discarded – undo
1343 1343
 			} else {
1344 1344
 			?>
1345 1345
 				<div class="yikes-easy-mc-updated migrate-options-notice">
1346
-					<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>
1346
+					<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>
1347 1347
 					<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>
1348 1348
 					<p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1349 1349
 					<section id="migration-buttons">
1350 1350
 						<!-- migrate button -->
1351 1351
 						<form>
1352 1352
 							<input type="hidden" name="yikes-mc-update-option-structure" value="yikes-mc-update-option-structure" />
1353
-							<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>
1353
+							<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>
1354 1354
 						</form>
1355 1355
 						<!-- dismiss button -->
1356 1356
 						<form>
1357
-							<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>
1357
+							<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>
1358 1358
 						</form>
1359 1359
 					</section>
1360 1360
 
@@ -1368,9 +1368,9 @@  discard block
 block discarded – undo
1368 1368
 		*	and return the index ( used to find the list name assigned to a form )
1369 1369
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
1370 1370
 		*/
1371
-		function findMCListID($id, $array) {
1372
-		   foreach ($array as $key => $val) {
1373
-			   if ($val['id'] === $id) {
1371
+		function findMCListID( $id, $array ) {
1372
+		   foreach ( $array as $key => $val ) {
1373
+			   if ( $val[ 'id' ] === $id ) {
1374 1374
 				   return $key;
1375 1375
 			   }
1376 1376
 		   }
@@ -1380,9 +1380,9 @@  discard block
 block discarded – undo
1380 1380
 		/* Ajax Migrate Options */
1381 1381
 		function migrate_archived_options() {
1382 1382
 			// all options prefixed with 'yikes-mc-'
1383
-			$option_name = 'yikes-mc-'.$_POST['option_name'];
1384
-			$option_value = $_POST['option_value'];
1385
-			if( json_decode( $option_value ) ) {
1383
+			$option_name = 'yikes-mc-' . $_POST[ 'option_name' ];
1384
+			$option_value = $_POST[ 'option_value' ];
1385
+			if ( json_decode( $option_value ) ) {
1386 1386
 				// decode our lists() array, and store it
1387 1387
 				$opt_value = json_decode( $option_value, true );
1388 1388
 			} else {
@@ -1395,23 +1395,23 @@  discard block
 block discarded – undo
1395 1395
 
1396 1396
 		/* Ajax Migrate Forms */
1397 1397
 		function migrate_previously_setup_forms() {
1398
-			$option_name = $_POST['option_name'];
1399
-			$done = $_POST['done_import'];
1398
+			$option_name = $_POST[ 'option_name' ];
1399
+			$done = $_POST[ 'done_import' ];
1400 1400
 			// Create some starter forms for the user
1401 1401
 			// based on previously imported lists (to our old version)
1402
-			if( $option_name == 'yikes-mc-lists' ) {
1403
-				$option_value = $_POST['option_value'];
1404
-				$new_options = json_decode( stripslashes_deep( $option_value ) , true );
1402
+			if ( $option_name == 'yikes-mc-lists' ) {
1403
+				$option_value = $_POST[ 'option_value' ];
1404
+				$new_options = json_decode( stripslashes_deep( $option_value ), true );
1405 1405
 
1406
-				$list_id = $new_options['id'];
1407
-				$form_name = $new_options['name'];
1408
-				$fields = $new_options['fields']; // our fields array
1406
+				$list_id = $new_options[ 'id' ];
1407
+				$form_name = $new_options[ 'name' ];
1408
+				$fields = $new_options[ 'fields' ]; // our fields array
1409 1409
 
1410
-				$custom_styles = isset( $new_options['custom_styles'] ) ? $new_options['custom_styles']: '0'; // store as an array with all of our styles
1411
-				$custom_template = isset( $new_options['custom_template'] ) ? $new_options['custom_template'] : '0'; // store template data as an array ( active , template used )
1412
-				$send_welcome_email = isset( $new_options['yks_mailchimp_send_welcome_'.$list_id] ) ? '0' : '1';
1413
-				$redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1414
-				$redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1410
+				$custom_styles = isset( $new_options[ 'custom_styles' ] ) ? $new_options[ 'custom_styles' ] : '0'; // store as an array with all of our styles
1411
+				$custom_template = isset( $new_options[ 'custom_template' ] ) ? $new_options[ 'custom_template' ] : '0'; // store template data as an array ( active , template used )
1412
+				$send_welcome_email = isset( $new_options[ 'yks_mailchimp_send_welcome_' . $list_id ] ) ? '0' : '1';
1413
+				$redirect_user_on_submit = isset( $new_options[ 'yks_mailchimp_redirect_' . $list_id ] ) ? '1' : '0';
1414
+				$redirect_page = isset( $new_options[ 'page_id_' . $list_id ] ) ? $new_options[ 'page_id_' . $list_id ] : '';
1415 1415
 
1416 1416
 				/* Insert Forms Function  */
1417 1417
 				$this->form_interface->create_form( array(
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
 					'custom_fields'           => '',
1434 1434
 				) );
1435 1435
 			}
1436
-			if( $done == 'done' ) {
1436
+			if ( $done == 'done' ) {
1437 1437
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => true ) );
1438 1438
 			} else {
1439 1439
 				wp_send_json( array( 'form_name' => $form_name, 'completed_import' => false ) );
@@ -1448,35 +1448,35 @@  discard block
 block discarded – undo
1448 1448
 		*	@since v5.6 - complete re-write
1449 1449
 		*/
1450 1450
 		public function generate_options_pages_sidebar_menu() {
1451
-			if( isset( $_REQUEST['section'] ) ) {
1452
-				$selected = $_REQUEST['section'];
1451
+			if ( isset( $_REQUEST[ 'section' ] ) ) {
1452
+				$selected = $_REQUEST[ 'section' ];
1453 1453
 			}
1454
-			$installed_addons = get_option( 'yikes-easy-mc-active-addons' , array() );
1454
+			$installed_addons = get_option( 'yikes-easy-mc-active-addons', array() );
1455 1455
 			// sort our addons array alphabetically so they appear in similar orders across all sites
1456 1456
 			asort( $installed_addons );
1457 1457
 			?>
1458
-				<h3><span><?php _e( 'Additional Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1458
+				<h3><span><?php _e( 'Additional Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
1459 1459
 				<div class="inside">
1460 1460
 					<ul id="settings-nav">
1461
-						<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>
1462
-						<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>
1463
-						<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>
1464
-						<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>
1465
-						<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>
1466
-						<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>
1461
+						<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>
1462
+						<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>
1463
+						<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>
1464
+						<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>
1465
+						<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>
1466
+						<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>
1467 1467
 					</ul>
1468 1468
 					<?php
1469 1469
 						// create our add-on settings pages
1470
-						if( !empty( $installed_addons ) ) {
1470
+						if ( ! empty( $installed_addons ) ) {
1471 1471
 							?>
1472 1472
 							<hr class="add-on-settings-divider" />
1473
-							<strong><?php _e( 'Addon Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1473
+							<strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1474 1474
 							<ul id="addon-settings-nav">
1475 1475
 							<?php
1476
-							foreach( $installed_addons as $addon_name ) {
1476
+							foreach ( $installed_addons as $addon_name ) {
1477 1477
 								?>
1478 1478
 									<li>
1479
-										<?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>
1479
+										<?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>
1480 1480
 								<?php
1481 1481
 							}
1482 1482
 							?>
@@ -1504,7 +1504,7 @@  discard block
 block discarded – undo
1504 1504
 				)
1505 1505
 			);
1506 1506
 			?>
1507
-				<h3><?php _e( 'Create a New Signup Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1507
+				<h3><?php _e( 'Create a New Signup Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1508 1508
 
1509 1509
 				<div class="inside">
1510 1510
 
@@ -1513,31 +1513,31 @@  discard block
 block discarded – undo
1513 1513
 					<form id="import-list-to-site" method="POST" action="<?php echo $url; ?>">
1514 1514
 						<input type="hidden" name="import-list-to-site" value="1" />
1515 1515
 						<!-- Name your new form -->
1516
-						<label for="form-name"><strong><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1517
-							<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>
1516
+						<label for="form-name"><strong><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1517
+							<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>
1518 1518
 						</label>
1519 1519
 						<!-- Name your new form -->
1520
-						<label for="form-description"><strong><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1521
-							<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>
1520
+						<label for="form-description"><strong><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1521
+							<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>
1522 1522
 						</label>
1523 1523
 						<!-- Associate this form with a list! -->
1524
-						<label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1525
-							<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"'; } ?>>
1524
+						<label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1525
+							<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"'; } ?>>
1526 1526
 								<?php
1527
-									if( isset( $lists ) && !empty( $lists ) ) {
1528
-										foreach( $lists as $mailing_list ) {
1527
+									if ( isset( $lists ) && ! empty( $lists ) ) {
1528
+										foreach ( $lists as $mailing_list ) {
1529 1529
 											?>
1530
-												<option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1530
+												<option value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option>
1531 1531
 											<?php
1532 1532
 										}
1533 1533
 									} else {
1534
-										if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1534
+										if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1535 1535
 											?>
1536
-												<option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1536
+												<option><?php echo __( "Please enter a valid API key.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1537 1537
 											<?php
1538 1538
 										} else {
1539 1539
 											?>
1540
-												<option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1540
+												<option><?php echo __( "No lists were found on the account.", 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1541 1541
 											<?php
1542 1542
 
1543 1543
 										}
@@ -1546,8 +1546,8 @@  discard block
 block discarded – undo
1546 1546
 							</select>
1547 1547
 
1548 1548
 							<?php
1549
-							if ( isset( $_GET['transient-cleared'] ) ) {
1550
-								if ( 'true' === $_GET['transient-cleared'] ) {
1549
+							if ( isset( $_GET[ 'transient-cleared' ] ) ) {
1550
+								if ( 'true' === $_GET[ 'transient-cleared' ] ) {
1551 1551
 									?>
1552 1552
 									<div class="yikes-list-refreshed-notice">
1553 1553
 										<p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -1556,11 +1556,11 @@  discard block
 block discarded – undo
1556 1556
 								}
1557 1557
 							}
1558 1558
 
1559
-							if( isset( $lists ) && empty( $lists ) ) {
1560
-								if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'invalid_api_key' ) {
1559
+							if ( isset( $lists ) && empty( $lists ) ) {
1560
+								if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) {
1561 1561
 									?>
1562 1562
 										<p class="description">
1563
-											<?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' ) ); ?>
1563
+											<?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' ) ); ?>
1564 1564
 										</p>
1565 1565
 									<?php
1566 1566
 								}
@@ -1568,12 +1568,12 @@  discard block
 block discarded – undo
1568 1568
 							?>
1569 1569
 						</label>
1570 1570
 						<?php
1571
-							if( $this->is_user_mc_api_valid_form( false ) ) {
1572
-								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary' , '' , false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1571
+							if ( $this->is_user_mc_api_valid_form( false ) ) {
1572
+								echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ), 'primary', '', false, array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1573 1573
 							} else {
1574
-								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1574
+								echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1575 1575
 								?>
1576
-									<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>
1576
+									<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>
1577 1577
 								<?php
1578 1578
 							}
1579 1579
 						?>
@@ -1581,10 +1581,10 @@  discard block
 block discarded – undo
1581 1581
 
1582 1582
 					<!-- Clear API CACHE -->
1583 1583
 					<?php
1584
-					if( isset( $lists ) && ! empty( $lists ) ) {
1584
+					if ( isset( $lists ) && ! empty( $lists ) ) {
1585 1585
 						if ( false !== get_transient( 'yikes-easy-mailchimp-list-data' ) ) { ?>
1586
-							<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">
1587
-								<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1586
+							<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">
1587
+								<input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists', 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1588 1588
 							</form>
1589 1589
 						<?php }
1590 1590
 					}
@@ -1600,14 +1600,14 @@  discard block
 block discarded – undo
1600 1600
 		public function generate_page_redirect_dropdown( $redirect, $redirect_page, $custom_redirect_url ) {
1601 1601
 				$post_types = get_post_types();
1602 1602
 				?>
1603
-				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1604
-					<?php _e( "Select A Page or Post" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1603
+				<label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>">
1604
+					<?php _e( "Select A Page or Post", 'yikes-inc-easy-mailchimp-extender' ); ?>
1605 1605
 					<select id="redirect-user-to-selection" name="redirect-user-to-selection" onchange="shouldWeDisplayCustomURL( this );return;">
1606 1606
 				<?php
1607 1607
 					// loop over registered post types, and query!
1608
-						foreach( $post_types as $registered_post_type ) {
1608
+						foreach ( $post_types as $registered_post_type ) {
1609 1609
 							// exclude a few built in custom post types
1610
-							if( ! in_array( $registered_post_type , array( 'attachment' , 'revision' , 'nav_menu_item' ) ) ) {
1610
+							if ( ! in_array( $registered_post_type, array( 'attachment', 'revision', 'nav_menu_item' ) ) ) {
1611 1611
 								// run our query, to retreive the posts
1612 1612
 								$pages = get_posts( array(
1613 1613
 									'order' => 'ASC',
@@ -1617,12 +1617,12 @@  discard block
 block discarded – undo
1617 1617
 									'numberposts' => -1
1618 1618
 								) );
1619 1619
 								// only show cpt's that have posts assigned
1620
-								if( !empty( $pages ) ) {
1620
+								if ( ! empty( $pages ) ) {
1621 1621
 									?>
1622
-									<optgroup label="<?php echo ucwords( str_replace( '_' , ' ' , $registered_post_type ) ); ?>">
1622
+									<optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>">
1623 1623
 									<?php
1624
-										foreach( $pages as $page ) {
1625
-											?><option <?php selected( $redirect_page , $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1624
+										foreach ( $pages as $page ) {
1625
+											?><option <?php selected( $redirect_page, $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1626 1626
 										}
1627 1627
 									?>
1628 1628
 									<option <?php selected( $redirect_page, 'custom_url' ); ?> value="custom_url"><?php echo __( 'Custom URL', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
@@ -1634,8 +1634,8 @@  discard block
 block discarded – undo
1634 1634
 					?>
1635 1635
 					</select>
1636 1636
 
1637
-					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1638
-						<?php _e( "Enter Custom URL" , 'yikes-inc-easy-mailchimp-extender' ); ?>
1637
+					<label name="custom-redirect-url" class="custom_redirect_url_label" <?php if ( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1638
+						<?php _e( "Enter Custom URL", 'yikes-inc-easy-mailchimp-extender' ); ?>
1639 1639
 						<input type="text" class="widefat custom-redirect-url" name="custom-redirect-url" value="<?php echo $custom_redirect_url; ?>" />
1640 1640
 					</label>
1641 1641
 
@@ -1652,11 +1652,11 @@  discard block
 block discarded – undo
1652 1652
 		public function generate_show_some_love_container() {
1653 1653
 			// if no active add-ons are installed,
1654 1654
 			// lets display our branding and add-on sidebar
1655
-			if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) {
1655
+			if ( get_option( 'yikes-easy-mc-active-addons', array() ) == array() ) {
1656 1656
 
1657 1657
 				/* On Edit Forms Page Display Upsell to Customizer */
1658 1658
 				$screen = get_current_screen();
1659
-				if( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1659
+				if ( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) {
1660 1660
 				?>
1661 1661
 
1662 1662
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
@@ -1670,11 +1670,11 @@  discard block
 block discarded – undo
1670 1670
 					<div class="postbox yikes-easy-mc-postbox show-some-love-container">
1671 1671
 
1672 1672
 						<!-- review us container -->
1673
-						<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>
1673
+						<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>
1674 1674
 						<div id="review-yikes-easy-mc" class="inside">
1675 1675
 
1676 1676
 							<p>
1677
-								<?php _e( 'Leave a review' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1677
+								<?php _e( 'Leave a review', 'yikes-inc-easy-mailchimp-extender' ); ?>
1678 1678
 								<p class="star-container">
1679 1679
 									<a href="https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender" target="_blank">
1680 1680
 										<b class="dashicons dashicons-star-filled"></b>
@@ -1686,21 +1686,21 @@  discard block
 block discarded – undo
1686 1686
 								</p>
1687 1687
 							</p>
1688 1688
 
1689
-							<?php _e( 'Tweet about it' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1689
+							<?php _e( 'Tweet about it', 'yikes-inc-easy-mailchimp-extender' ); ?>
1690 1690
 							<p class="sidebar-container">
1691 1691
 								<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>
1692 1692
 								<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>
1693 1693
 							</p>
1694 1694
 
1695
-							<?php _e( 'Vote that the plugin works' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1695
+							<?php _e( 'Vote that the plugin works', 'yikes-inc-easy-mailchimp-extender' ); ?>
1696 1696
 							<p class="sidebar-container">
1697 1697
 								<a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">
1698
-									<?php _e( 'Vote for Compatibility' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1698
+									<?php _e( 'Vote for Compatibility', 'yikes-inc-easy-mailchimp-extender' ); ?>
1699 1699
 								</a>
1700 1700
 							</p>
1701 1701
 						</div>
1702 1702
 
1703
-						<p class="description sidebar-footer-text"><?php printf( __( "This plugin made with %s by %s" , 'yikes-inc-easy-mailchimp-extender' ), '<span class="dashicons dashicons-heart yikes-love"></span>', '<a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>' ); ?> </p>
1703
+						<p class="description sidebar-footer-text"><?php printf( __( "This plugin made with %s by %s", 'yikes-inc-easy-mailchimp-extender' ), '<span class="dashicons dashicons-heart yikes-love"></span>', '<a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>' ); ?> </p>
1704 1704
 
1705 1705
 						<section id="about-yikes-inc" class="inside">
1706 1706
 							<a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc.">
@@ -1716,10 +1716,10 @@  discard block
 block discarded – undo
1716 1716
 					<div class="postbox yikes-easy-mc-postbox">
1717 1717
 
1718 1718
 						<!-- review us container -->
1719
-						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1719
+						<h3><?php _e( 'Easy Forms for MailChimp Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1720 1720
 						<div id="review-yikes-easy-mc" class="inside">
1721
-							<p><?php _e( "Check out available add-ons for some seriously enhanced features." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1722
-							<p><a class="button-secondary" href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) ); ?>" title="<?php _e( 'View Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'View Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
1721
+							<p><?php _e( "Check out available add-ons for some seriously enhanced features.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1722
+							<p><a class="button-secondary" href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) ); ?>" title="<?php _e( 'View Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'View Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
1723 1723
 						</div>
1724 1724
 
1725 1725
 					</div>
@@ -1744,15 +1744,15 @@  discard block
 block discarded – undo
1744 1744
 		public function generate_form_editor( $form_fields, $list_id, $merge_variables, $interest_groups ) {
1745 1745
 
1746 1746
 			// if no list id, die!
1747
-			if( ! $list_id ) {
1748
-				wp_die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) );
1747
+			if ( ! $list_id ) {
1748
+				wp_die( __( "We've encountered an error. No list ID was sent.", 'yikes-inc-easy-mailchimp-extender' ) );
1749 1749
 			}
1750 1750
 
1751
-			if( ! $merge_variables ) {
1752
-				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support." , 'yikes-inc-easy-mailchimp-extender' ) );
1751
+			if ( ! $merge_variables ) {
1752
+				wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support.", 'yikes-inc-easy-mailchimp-extender' ) );
1753 1753
 			}
1754 1754
 
1755
-			if( ! empty( $form_fields ) ) {
1755
+			if ( ! empty( $form_fields ) ) {
1756 1756
 
1757 1757
 				// find any fields that are assigned to this form, that don't exist in MailChimp
1758 1758
 				// or else were going to run into issues when we submit the form
@@ -1760,12 +1760,12 @@  discard block
 block discarded – undo
1760 1760
 				$available_interest_groups = array();
1761 1761
 
1762 1762
 				// loop over merge variables
1763
-				if ( ! empty( $merge_variables['data'][0]['merge_vars'] ) ) {
1764
-					$available_merge_variables = wp_list_pluck( $merge_variables['data'][0]['merge_vars'], 'tag' );
1763
+				if ( ! empty( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] ) ) {
1764
+					$available_merge_variables = wp_list_pluck( $merge_variables[ 'data' ][ 0 ][ 'merge_vars' ], 'tag' );
1765 1765
 				}
1766 1766
 
1767 1767
 				// loop over interest groups
1768
-				if ( ! empty( $interest_groups ) && ! isset( $interest_groups['error'] ) ) {
1768
+				if ( ! empty( $interest_groups ) && ! isset( $interest_groups[ 'error' ] ) ) {
1769 1769
 					$available_interest_groups = wp_list_pluck( $interest_groups, 'id' );
1770 1770
 				}
1771 1771
 
@@ -1775,38 +1775,38 @@  discard block
 block discarded – undo
1775 1775
 				$excluded_fields = array_diff( $assigned_fields, $merged_fields );
1776 1776
 
1777 1777
 				$i = 1;
1778
-				foreach( $form_fields as $field ) {
1778
+				foreach ( $form_fields as $field ) {
1779 1779
 
1780
-					if ( isset( $field['merge'] ) ) {
1780
+					if ( isset( $field[ 'merge' ] ) ) {
1781 1781
 						// @todo: don't use in_array()
1782
-						$excluded_field = in_array( $field['merge'], $excluded_fields, true );
1782
+						$excluded_field = in_array( $field[ 'merge' ], $excluded_fields, true );
1783 1783
 						?>
1784
-						<section class="draggable" id="<?php echo $field['merge']; ?>">
1784
+						<section class="draggable" id="<?php echo $field[ 'merge' ]; ?>">
1785 1785
 							<!-- top -->
1786 1786
 							<a href="#" class="expansion-section-title settings-sidebar">
1787
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
1787
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
1788 1788
 								<?php if ( $excluded_field ) { ?>
1789
-									<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' ); ?>">
1789
+									<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' ); ?>">
1790 1790
 								<?php } ?>
1791
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
1791
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
1792 1792
 							</a>
1793 1793
 							<!-- expansion section -->
1794 1794
 							<div class="yikes-mc-settings-expansion-section">
1795 1795
 
1796 1796
 								<?php if ( $excluded_field ) { ?>
1797
-									<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>
1797
+									<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>
1798 1798
 								<?php } ?>
1799 1799
 
1800 1800
 								<!-- store the label -->
1801
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][label]" value="<?php echo $field['label']; ?>" />
1802
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][type]" value="<?php echo $field['type']; ?>" />
1803
-								<input type="hidden" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" />
1804
-								<input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" />
1801
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
1802
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
1803
+								<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][merge]" value="<?php echo $field[ 'merge' ]; ?>" />
1804
+								<input type="hidden" class="field-<?php echo $field[ 'merge' ]; ?>-position position-input" name="field[<?php echo $field[ 'merge' ]; ?>][position]" value="<?php echo $i++; ?>" />
1805 1805
 
1806
-								<?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) {
1807
-									$choices = json_decode( $field['choices'], true );
1806
+								<?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'dropdown' || $field[ 'type' ] == 'select' ) {
1807
+									$choices = json_decode( $field[ 'choices' ], true );
1808 1808
 								?>
1809
-									<input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1809
+									<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' />
1810 1810
 								<?php } ?>
1811 1811
 
1812 1812
 								<!-- Single or Double Opt-in -->
@@ -1818,16 +1818,16 @@  discard block
 block discarded – undo
1818 1818
 										<tr valign="top">
1819 1819
 											<td scope="row">
1820 1820
 												<label for="merge-tag">
1821
-													<?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1821
+													<?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?>
1822 1822
 												</label>
1823 1823
 											</td>
1824 1824
 											<td>
1825
-												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field['merge']; ?>">
1825
+												<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field[ 'merge' ]; ?>">
1826 1826
 											</td>
1827 1827
 										</tr>
1828 1828
 
1829 1829
 										<!-- Placeholder Value -->
1830
-										<?php switch( $field['type'] ) {
1830
+										<?php switch ( $field[ 'type' ] ) {
1831 1831
 
1832 1832
 											case 'text':
1833 1833
 											case 'email':
@@ -1842,12 +1842,12 @@  discard block
 block discarded – undo
1842 1842
 										<tr valign="top">
1843 1843
 											<td scope="row">
1844 1844
 												<label for="placeholder">
1845
-													<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1845
+													<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
1846 1846
 												</label>
1847 1847
 											</td>
1848 1848
 											<td>
1849
-												<input type="text" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : '' ; ?>" />
1850
-												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1849
+												<input type="text" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>" />
1850
+												<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1851 1851
 											</td>
1852 1852
 										</tr>
1853 1853
 										<?php
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
 										?>
1857 1857
 
1858 1858
 										<!-- Default Value -->
1859
-										<?php switch( $field['type'] ) {
1859
+										<?php switch ( $field[ 'type' ] ) {
1860 1860
 											default:
1861 1861
 											case 'text':
1862 1862
 											case 'number':
@@ -1865,17 +1865,17 @@  discard block
 block discarded – undo
1865 1865
 											<tr valign="top">
1866 1866
 												<td scope="row">
1867 1867
 													<label for="placeholder">
1868
-														<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1868
+														<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
1869 1869
 													</label>
1870 1870
 												</td>
1871 1871
 												<td>
1872
-													<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 } ?> />
1873
-													<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>
1872
+													<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 } ?> />
1873
+													<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>
1874 1874
 													<?php
1875
-													switch( $field['type'] ) {
1875
+													switch ( $field[ 'type' ] ) {
1876 1876
 														case 'text':
1877 1877
 															?>
1878
-																<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>
1878
+																<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>
1879 1879
 															<?php
1880 1880
 														break;
1881 1881
 													} ?>
@@ -1889,25 +1889,25 @@  discard block
 block discarded – undo
1889 1889
 												<tr valign="top">
1890 1890
 													<td scope="row">
1891 1891
 														<label for="placeholder">
1892
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1892
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1893 1893
 														</label>
1894 1894
 													</td>
1895 1895
 													<td>
1896 1896
 														<?php
1897
-														if ( ! isset( $field['default_choice'] ) ) {
1898
-															$field['default_choice'] = 0;
1897
+														if ( ! isset( $field[ 'default_choice' ] ) ) {
1898
+															$field[ 'default_choice' ] = 0;
1899 1899
 														}
1900 1900
 														$x = 0;
1901 1901
 														foreach ( $choices as $choice => $value ) { ?>
1902
-															<label for="<?php echo $field['merge'].'-'.$x; ?>">
1903
-																<input id="<?php echo $field['merge'].'-'.$x; ?>"
1902
+															<label for="<?php echo $field[ 'merge' ] . '-' . $x; ?>">
1903
+																<input id="<?php echo $field[ 'merge' ] . '-' . $x; ?>"
1904 1904
 																       type="radio"
1905
-																       name="field[<?php echo $field['merge']; ?>][default_choice]"
1906
-																       value="<?php echo $x; ?>" <?php checked( $field['default_choice'], $x ); ?>>
1905
+																       name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]"
1906
+																       value="<?php echo $x; ?>" <?php checked( $field[ 'default_choice' ], $x ); ?>>
1907 1907
 																<?php echo $value; ?>&nbsp;
1908 1908
 															</label>
1909 1909
 														<?php $x++; } ?>
1910
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1910
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1911 1911
 													</td>
1912 1912
 												</tr>
1913 1913
 
@@ -1919,16 +1919,16 @@  discard block
 block discarded – undo
1919 1919
 												<tr valign="top">
1920 1920
 													<td scope="row">
1921 1921
 														<label for="placeholder">
1922
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1922
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
1923 1923
 														</label>
1924 1924
 													</td>
1925 1925
 													<td>
1926
-														<select type="default" name="field[<?php echo $field['merge']; ?>][default_choice]">
1927
-															<?php foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?>
1928
-																<option value="<?php echo $choice; ?>" <?php selected( $field['default_choice'] , $choice ); ?>><?php echo $value; ?></option>
1926
+														<select type="default" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]">
1927
+															<?php foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?>
1928
+																<option value="<?php echo $choice; ?>" <?php selected( $field[ 'default_choice' ], $choice ); ?>><?php echo $value; ?></option>
1929 1929
 															<?php } ?>
1930 1930
 														</select>
1931
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1931
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1932 1932
 													</td>
1933 1933
 												</tr>
1934 1934
 
@@ -1948,69 +1948,69 @@  discard block
 block discarded – undo
1948 1948
 										<tr valign="top">
1949 1949
 											<td scope="row">
1950 1950
 												<label for="placeholder">
1951
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1951
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
1952 1952
 												</label>
1953 1953
 											</td>
1954 1954
 											<td>
1955
-												<textarea class="widefat field-description-input" name="field[<?php echo $field['merge']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea>
1956
-												<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>
1955
+												<textarea class="widefat field-description-input" name="field[<?php echo $field[ 'merge' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea>
1956
+												<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>
1957 1957
 											</td>
1958 1958
 										</tr>
1959 1959
 										<!-- Additional Classes -->
1960 1960
 										<tr valign="top">
1961 1961
 											<td scope="row">
1962 1962
 												<label for="placeholder">
1963
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1963
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
1964 1964
 												</label>
1965 1965
 											</td>
1966 1966
 											<td>
1967
-												<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'] ) ) : '' ; ?>" />
1968
-												<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>
1967
+												<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' ] ) ) : ''; ?>" />
1968
+												<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>
1969 1969
 											</td>
1970 1970
 										</tr>
1971 1971
 										<!-- Required Toggle -->
1972 1972
 										<tr valign="top">
1973 1973
 											<td scope="row">
1974 1974
 												<label for="field-required">
1975
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1975
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
1976 1976
 												</label>
1977 1977
 											</td>
1978 1978
 											<td>
1979
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
1980
-												<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' ); } ?>">
1981
-												<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>
1979
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
1980
+												<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' ); } ?>">
1981
+												<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>
1982 1982
 											</td>
1983 1983
 										</tr>
1984 1984
 										<!-- Visible Toggle -->
1985 1985
 										<tr valign="top">
1986 1986
 											<td scope="row">
1987 1987
 												<label for="hide-field">
1988
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
1988
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
1989 1989
 												</label>
1990 1990
 											</td>
1991 1991
 											<td>
1992
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
1993
-												<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' ); } ?>">
1994
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
1992
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
1993
+												<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' ); } ?>">
1994
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
1995 1995
 											</td>
1996 1996
 										</tr>
1997 1997
 										<!-- Toggle Field Label Visibility -->
1998 1998
 										<tr valign="top">
1999 1999
 											<td scope="row">
2000 2000
 												<label for="placeholder">
2001
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2001
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2002 2002
 												</label>
2003 2003
 											</td>
2004 2004
 											<td>
2005
-												<?php $hide_label = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2006
-												<input type="checkbox" name="field[<?php echo $field['merge']; ?>][hide-label]" value="1" <?php checked( $hide_label , 1 ); ?>/>
2007
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2005
+												<?php $hide_label = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2006
+												<input type="checkbox" name="field[<?php echo $field[ 'merge' ]; ?>][hide-label]" value="1" <?php checked( $hide_label, 1 ); ?>/>
2007
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2008 2008
 											</td>
2009 2009
 										</tr>
2010 2010
 										<!-- Display Phone/Date Formats back to the user -->
2011 2011
 										<!-- Phone Format Initial Load -->
2012 2012
 										<?php
2013
-											switch( $field['type'] ) {
2013
+											switch ( $field[ 'type' ] ) {
2014 2014
 												/* Store the phone format, for properly regex pattern */
2015 2015
 												case 'phone':
2016 2016
 												case 'birthday':
@@ -2020,23 +2020,23 @@  discard block
 block discarded – undo
2020 2020
 															<td scope="row">
2021 2021
 																<label for="placeholder">
2022 2022
 																	<?php
2023
-																		switch( $field['type'] ) {
2023
+																		switch ( $field[ 'type' ] ) {
2024 2024
 																			default:
2025 2025
 																			case 'birthday':
2026
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
2027
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD';
2026
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
2027
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD';
2028 2028
 																				$format_name = 'date_format';
2029 2029
 																				break;
2030 2030
 
2031 2031
 																			case 'date':
2032
-																				$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
2033
-																				$format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD/YYYY';
2032
+																				$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
2033
+																				$format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD/YYYY';
2034 2034
 																				$format_name = 'date_format';
2035 2035
 																				break;
2036 2036
 
2037 2037
 																			case 'phone':
2038
-																				$type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
2039
-																				$format = isset( $field['phone_format'] ) && ! empty( $field['phone_format'] ) ? $field['phone_format'] : __( 'International', 'yikes-inc-easy-mailchimp-extender' );
2038
+																				$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
2039
+																				$format = isset( $field[ 'phone_format' ] ) && ! empty( $field[ 'phone_format' ] ) ? $field[ 'phone_format' ] : __( 'International', 'yikes-inc-easy-mailchimp-extender' );
2040 2040
 																				$format_name = 'phone_format';
2041 2041
 																				break;
2042 2042
 																		}
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 															</td>
2047 2047
 															<td>
2048 2048
 																<strong><?php echo $format; ?></strong>
2049
-																<input type="hidden" name="field[<?php echo $field['merge']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
2049
+																<input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
2050 2050
 																<p class="description"><small>
2051 2051
 																	<?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' ) ); ?>
2052 2052
 																</small></p>
@@ -2067,8 +2067,8 @@  discard block
 block discarded – undo
2067 2067
 											</td>
2068 2068
 											<td>
2069 2069
 												<span class="toggle-container">
2070
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2071
-													<a href="#" class="remove-field" alt="<?php echo $field['merge']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2070
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2071
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'merge' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2072 2072
 												</span>
2073 2073
 											</td>
2074 2074
 										</tr>
@@ -2084,35 +2084,35 @@  discard block
 block discarded – undo
2084 2084
 					} else { // THIS IS AN INTEREST GROUP!
2085 2085
 
2086 2086
 						?>
2087
-						<section class="draggable" id="<?php echo $field['group_id']; ?>">
2087
+						<section class="draggable" id="<?php echo $field[ 'group_id' ]; ?>">
2088 2088
 							<!-- top -->
2089 2089
 							<a href="#" class="expansion-section-title settings-sidebar">
2090
-								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?>
2091
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2092
-									<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' ); ?>">
2090
+								<span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?>
2091
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2092
+									<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' ); ?>">
2093 2093
 								<?php } ?>
2094
-								<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span>
2094
+								<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span>
2095 2095
 							</a>
2096 2096
 							<!-- expansion section -->
2097 2097
 							<div class="yikes-mc-settings-expansion-section">
2098 2098
 
2099 2099
 								<!-- check if this field exists in the available interest group array -->
2100
-								<?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?>
2101
-									<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>
2100
+								<?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?>
2101
+									<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>
2102 2102
 								<?php } ?>
2103 2103
 
2104 2104
 								<!-- store the label -->
2105
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][label]" value="<?php echo $field['label']; ?>" />
2106
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][type]" value="<?php echo $field['type']; ?>" />
2107
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][group_id]" value="<?php echo $field['group_id']; ?>" />
2108
-								<input type="hidden" name="field[<?php echo $field['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field['groups'], true ) ) ); ?>' />
2105
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" />
2106
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" />
2107
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][group_id]" value="<?php echo $field[ 'group_id' ]; ?>" />
2108
+								<input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field[ 'groups' ], true ) ) ); ?>' />
2109 2109
 
2110 2110
 								<!-- Single or Double Opt-in -->
2111 2111
 								<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
2112 2112
 
2113 2113
 									<table class="form-table form-field-container">
2114 2114
 										<!-- Default Value -->
2115
-										<?php switch( $field['type'] ) {
2115
+										<?php switch ( $field[ 'type' ] ) {
2116 2116
 
2117 2117
 											default:
2118 2118
 											case 'radio':
@@ -2121,22 +2121,22 @@  discard block
 block discarded – undo
2121 2121
 												<tr valign="top">
2122 2122
 													<td scope="row">
2123 2123
 														<label for="placeholder">
2124
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2124
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2125 2125
 														</label>
2126 2126
 													</td>
2127 2127
 													<td>
2128 2128
 														<?php
2129
-														if( $field['type'] != 'checkboxes' ) {
2130
-															if( ! isset( $field['default_choice'] ) ) { $field['default_choice'] =  json_decode( stripslashes( $field['groups'] ) , true ); }
2129
+														if ( $field[ 'type' ] != 'checkboxes' ) {
2130
+															if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = json_decode( stripslashes( $field[ 'groups' ] ), true ); }
2131 2131
 														} else {
2132
-															if ( ! isset( $field['default_choice'] ) ) { $field['default_choice'] = array(); }
2132
+															if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = array(); }
2133 2133
 														}
2134 2134
 														$i = 0;
2135
-														foreach( json_decode( $field['groups'], true ) as $group ) {
2136
-															$field_id   = "{$field['group_id']}-{$i}";
2137
-															$field_type = 'hidden' == $field['type'] ? 'radio' : $field['type'];
2135
+														foreach ( json_decode( $field[ 'groups' ], true ) as $group ) {
2136
+															$field_id   = "{$field[ 'group_id' ]}-{$i}";
2137
+															$field_type = 'hidden' == $field[ 'type' ] ? 'radio' : $field[ 'type' ];
2138 2138
 															$field_type = 'checkboxes' == $field_type ? 'checkbox' : $field_type;
2139
-															$field_name = "field[{$field['group_id']}][default_choice]";
2139
+															$field_name = "field[{$field[ 'group_id' ]}][default_choice]";
2140 2140
 															$field_name = 'checkbox' == $field_type ? $field_name . '[]' : $field_name;
2141 2141
 
2142 2142
 															// Determine if the current group is checked.
@@ -2145,11 +2145,11 @@  discard block
 block discarded – undo
2145 2145
 																case 'radio':
2146 2146
 																case 'hidden':
2147 2147
 																default:
2148
-																	$checked = checked( $field['default_choice'], $i, false );
2148
+																	$checked = checked( $field[ 'default_choice' ], $i, false );
2149 2149
 																	break;
2150 2150
 
2151 2151
 																case 'checkbox':
2152
-																	if ( in_array( $i, (array) $field['default_choice'] ) ) {
2152
+																	if ( in_array( $i, (array) $field[ 'default_choice' ] ) ) {
2153 2153
 																		$checked = checked( true, true, false );
2154 2154
 																	}
2155 2155
 															}
@@ -2160,12 +2160,12 @@  discard block
 block discarded – undo
2160 2160
 																       type="<?php echo $field_type; ?>"
2161 2161
 																       name="<?php echo $field_name; ?>"
2162 2162
 																       value="<?php echo $i; ?>" <?php echo $checked; ?>>
2163
-																<?php echo stripslashes( str_replace( '\'' , '' , $group['name'] ) ); ?>&nbsp;
2163
+																<?php echo stripslashes( str_replace( '\'', '', $group[ 'name' ] ) ); ?>&nbsp;
2164 2164
 															</label>
2165 2165
 															<?php
2166 2166
 															$i++;
2167 2167
 														} ?>
2168
-														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2168
+														<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2169 2169
 													</td>
2170 2170
 												</tr>
2171 2171
 
@@ -2177,16 +2177,16 @@  discard block
 block discarded – undo
2177 2177
 												<tr valign="top">
2178 2178
 													<td scope="row">
2179 2179
 														<label for="placeholder">
2180
-															<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2180
+															<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
2181 2181
 														</label>
2182 2182
 													</td>
2183 2183
 													<td>
2184
-														<select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2185
-															<?php $i = 0; foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as  $group ) { ?>
2186
-																<option value="<?php echo $i; ?>" <?php selected( $field['default_choice'] , $i ); ?>><?php echo stripslashes( $group['name'] ); ?></option>
2184
+														<select type="default" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]">
2185
+															<?php $i = 0; foreach ( json_decode( stripslashes_deep( $field[ 'groups' ] ), true ) as  $group ) { ?>
2186
+																<option value="<?php echo $i; ?>" <?php selected( $field[ 'default_choice' ], $i ); ?>><?php echo stripslashes( $group[ 'name' ] ); ?></option>
2187 2187
 															<?php $i++; } ?>
2188 2188
 														</select>
2189
-														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2189
+														<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2190 2190
 													</td>
2191 2191
 												</tr>
2192 2192
 
@@ -2200,12 +2200,12 @@  discard block
 block discarded – undo
2200 2200
 										<tr valign="top">
2201 2201
 											<td scope="row">
2202 2202
 												<label for="placeholder">
2203
-													<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2203
+													<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
2204 2204
 												</label>
2205 2205
 											</td>
2206 2206
 											<td>
2207
-												<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>
2208
-												<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>
2207
+												<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>
2208
+												<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>
2209 2209
 											</td>
2210 2210
 										</tr>
2211 2211
 
@@ -2213,51 +2213,51 @@  discard block
 block discarded – undo
2213 2213
 										<tr valign="top">
2214 2214
 											<td scope="row">
2215 2215
 												<label for="placeholder">
2216
-													<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2216
+													<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
2217 2217
 												</label>
2218 2218
 											</td>
2219 2219
 											<td>
2220
-												<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'] ) ) : '' ; ?>" />
2221
-												<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>
2220
+												<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' ] ) ) : ''; ?>" />
2221
+												<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>
2222 2222
 											</td>
2223 2223
 										</tr>
2224 2224
 										<!-- Required Toggle -->
2225 2225
 										<tr valign="top">
2226 2226
 											<td scope="row">
2227 2227
 												<label for="field-required">
2228
-													<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2228
+													<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
2229 2229
 												</label>
2230 2230
 											</td>
2231 2231
 											<td>
2232
-												<?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?>
2233
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][require]" <?php checked( $checked , 1 ); ?>>
2234
-												<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>
2232
+												<?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?>
2233
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][require]" <?php checked( $checked, 1 ); ?>>
2234
+												<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>
2235 2235
 											</td>
2236 2236
 										</tr>
2237 2237
 										<!-- Visible Toggle -->
2238 2238
 										<tr valign="top">
2239 2239
 											<td scope="row">
2240 2240
 												<label for="hide-field">
2241
-													<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2241
+													<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
2242 2242
 												</label>
2243 2243
 											</td>
2244 2244
 											<td>
2245
-												<?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?>
2246
-												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][hide]" <?php checked( $hide , 1 ); ?>>
2247
-												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2245
+												<?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?>
2246
+												<input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][hide]" <?php checked( $hide, 1 ); ?>>
2247
+												<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2248 2248
 											</td>
2249 2249
 										</tr>
2250 2250
 										<!-- Toggle Field Label Visibility -->
2251 2251
 										<tr valign="top">
2252 2252
 											<td scope="row">
2253 2253
 												<label for="placeholder">
2254
-													<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2254
+													<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
2255 2255
 												</label>
2256 2256
 											</td>
2257 2257
 											<td>
2258
-												<?php $hide = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?>
2259
-												<input type="checkbox" name="field[<?php echo $field['group_id']; ?>][hide-label]" value="1" <?php checked( $hide , 1 ); ?>/>
2260
-												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2258
+												<?php $hide = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?>
2259
+												<input type="checkbox" name="field[<?php echo $field[ 'group_id' ]; ?>][hide-label]" value="1" <?php checked( $hide, 1 ); ?>/>
2260
+												<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
2261 2261
 											</td>
2262 2262
 										</tr>
2263 2263
 										<!-- Toggle Buttons -->
@@ -2267,8 +2267,8 @@  discard block
 block discarded – undo
2267 2267
 											</td>
2268 2268
 											<td>
2269 2269
 												<span class="toggle-container">
2270
-													<a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2271
-													<a href="#" class="remove-field" alt="<?php echo $field['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2270
+													<a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
2271
+													<a href="#" class="remove-field" alt="<?php echo $field[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
2272 2272
 												</span>
2273 2273
 											</td>
2274 2274
 										</tr>
@@ -2282,38 +2282,38 @@  discard block
 block discarded – undo
2282 2282
 				}
2283 2283
 			} else {
2284 2284
 				?>
2285
-					<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>
2285
+					<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>
2286 2286
 				<?php
2287 2287
 			}
2288 2288
 				/* Pre Defined Merge Tag Container - Always rendered so the modal appears and links are clickable on initial page load */
2289 2289
 				add_thickbox();
2290 2290
 				// enqueue jquery qtip for our tooltip
2291
-				wp_enqueue_script( 'jquery-qtip-tooltip' , YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) );
2292
-				wp_enqueue_style( 'jquery-qtip-style' ,  YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2291
+				wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) );
2292
+				wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' );
2293 2293
 					$available_tags = array(
2294 2294
 						array(
2295 2295
 							'tag' => '{page_title}',
2296
-							'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' ),
2296
+							'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' ),
2297 2297
 							'title' => __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' )
2298 2298
 						),
2299 2299
 						array(
2300 2300
 							'tag' => '{page_id}',
2301
-							'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' ),
2301
+							'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' ),
2302 2302
 							'title' => __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' )
2303 2303
 						),
2304 2304
 						array(
2305 2305
 							'tag' => '{page_url}',
2306
-							'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' ),
2306
+							'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' ),
2307 2307
 							'title' => __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' )
2308 2308
 						),
2309 2309
 						array(
2310 2310
 							'tag' => '{blog_name}',
2311
-							'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' ),
2311
+							'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' ),
2312 2312
 							'title' => __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' )
2313 2313
 						),
2314 2314
 						array(
2315 2315
 							'tag' => '{user_logged_in}',
2316
-							'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' ),
2316
+							'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' ),
2317 2317
 							'title' => __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' )
2318 2318
 						),
2319 2319
 					);
@@ -2341,17 +2341,17 @@  discard block
 block discarded – undo
2341 2341
 				<div id="pre-defined-tag-container">
2342 2342
 					<input type="hidden" value="" class="clicked-input">
2343 2343
 					<div id="pre-defined-tag-interior-container">
2344
-						<h3><?php _e( 'Pre Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2345
-						<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>
2344
+						<h3><?php _e( 'Pre Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
2345
+						<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>
2346 2346
 						<ul>
2347
-							<?php foreach( apply_filters( 'yikes-mailchimp-custom-default-value-tags' , $available_tags ) as $tag ) { ?>
2347
+							<?php foreach ( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?>
2348 2348
 								<li class="tooltop-tag">
2349 2349
 									<!-- link/tag -->
2350
-									<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>
2350
+									<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>
2351 2351
 									<!-- help icon -->
2352 2352
 									<span class="dashicons dashicons-editor-help"></span>
2353 2353
 									<!-- tooltip -->
2354
-									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag['description']; ?></div>
2354
+									<div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag[ 'description' ]; ?></div>
2355 2355
 								</li>
2356 2356
 							<?php } ?>
2357 2357
 						</ul>
@@ -2367,32 +2367,32 @@  discard block
 block discarded – undo
2367 2367
 		*	-
2368 2368
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2369 2369
 		*/
2370
-		public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2370
+		public function build_available_merge_vars( $form_fields, $available_merge_variables ) {
2371 2371
 			$fields_assigned_to_form = array();
2372
-			if( !empty( $form_fields ) ) {
2373
-				foreach( $form_fields as $assigned_field ) {
2372
+			if ( ! empty( $form_fields ) ) {
2373
+				foreach ( $form_fields as $assigned_field ) {
2374 2374
 					// print_r( $assigned_field) ;
2375 2375
 					// switch between merge variables and interest groups
2376
-					if( isset( $assigned_field['merge'] ) ) {
2377
-						$fields_assigned_to_form[] = $assigned_field['merge'];
2376
+					if ( isset( $assigned_field[ 'merge' ] ) ) {
2377
+						$fields_assigned_to_form[ ] = $assigned_field[ 'merge' ];
2378 2378
 					}
2379 2379
 				}
2380 2380
 			}
2381
-			if( !empty( $available_merge_variables['data'][0] ) ) {
2381
+			if ( ! empty( $available_merge_variables[ 'data' ][ 0 ] ) ) {
2382 2382
 				?><ul id="available-fields"><?php
2383
-				foreach( $available_merge_variables['data'][0]['merge_vars'] as $merge_var ) {
2384
-					if( in_array( $merge_var['tag'] , $fields_assigned_to_form ) ) {
2383
+				foreach ( $available_merge_variables[ 'data' ][ 0 ][ 'merge_vars' ] as $merge_var ) {
2384
+					if ( in_array( $merge_var[ 'tag' ], $fields_assigned_to_form ) ) {
2385 2385
 						?>
2386
-							<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>
2386
+							<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>
2387 2387
 						<?php
2388 2388
 					} else {
2389 2389
 						?>
2390
-							<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>
2390
+							<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>
2391 2391
 						<?php
2392 2392
 					}
2393 2393
 				}
2394 2394
 				?></ul>
2395
-				<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>
2395
+				<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>
2396 2396
 				<?php
2397 2397
 			}
2398 2398
 		}
@@ -2404,30 +2404,30 @@  discard block
 block discarded – undo
2404 2404
 		*	-
2405 2405
 		* @parameters - $list_id - pass in the list ID to retreive merge variables from
2406 2406
 		*/
2407
-		public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2407
+		public function build_available_interest_groups( $form_fields, $available_interest_groups, $list_id ) {
2408 2408
 			$fields_assigned_to_form = array();
2409
-			if( !empty( $form_fields ) ) {
2410
-					foreach( $form_fields as $assigned_interest_group ) {
2411
-					if( isset( $assigned_interest_group['group_id'] ) ) {
2412
-						$fields_assigned_to_form[] = $assigned_interest_group['group_id'];
2409
+			if ( ! empty( $form_fields ) ) {
2410
+					foreach ( $form_fields as $assigned_interest_group ) {
2411
+					if ( isset( $assigned_interest_group[ 'group_id' ] ) ) {
2412
+						$fields_assigned_to_form[ ] = $assigned_interest_group[ 'group_id' ];
2413 2413
 					}
2414 2414
 				}
2415 2415
 			}
2416
-			if( !empty( $available_interest_groups) ) {
2416
+			if ( ! empty( $available_interest_groups ) ) {
2417 2417
 				?><ul id="available-interest-groups"><?php
2418
-				foreach( $available_interest_groups as $interest_group ) {
2419
-					if( in_array( $interest_group['id'] , $fields_assigned_to_form ) ) {
2418
+				foreach ( $available_interest_groups as $interest_group ) {
2419
+					if ( in_array( $interest_group[ 'id' ], $fields_assigned_to_form ) ) {
2420 2420
 						?>
2421
-							<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>
2421
+							<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>
2422 2422
 						<?php
2423 2423
 					} else {
2424 2424
 						?>
2425
-							<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>
2425
+							<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>
2426 2426
 						<?php
2427 2427
 					}
2428 2428
 				}
2429 2429
 				?></ul>
2430
-				<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>
2430
+				<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>
2431 2431
 				<?php
2432 2432
 			}
2433 2433
 		}
@@ -2439,29 +2439,29 @@  discard block
 block discarded – undo
2439 2439
 		*	- must clean up db tables , ensure what data is going in and what is needed...
2440 2440
 		*/
2441 2441
 		public function yikes_easy_mailchimp_create_form() {
2442
-			$nonce = $_REQUEST['nonce'];
2443
-			if( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2444
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) );
2442
+			$nonce = $_REQUEST[ 'nonce' ];
2443
+			if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) {
2444
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ) );
2445 2445
 			}
2446 2446
 
2447 2447
 			$result = $this->form_interface->create_form( array(
2448
-				'list_id'          => sanitize_key( $_POST['associated-list'] ),
2449
-				'form_name'        => stripslashes( $_POST['form-name'] ),
2450
-				'form_description' => stripslashes( $_POST['form-description'] ),
2448
+				'list_id'          => sanitize_key( $_POST[ 'associated-list' ] ),
2449
+				'form_name'        => stripslashes( $_POST[ 'form-name' ] ),
2450
+				'form_description' => stripslashes( $_POST[ 'form-description' ] ),
2451 2451
 			) );
2452 2452
 
2453 2453
 			// if an error occurs during the form creation process
2454 2454
 			if ( false == $result ) {
2455 2455
 				// write it to the error log
2456 2456
 				// if the form was not created successfully
2457
-				if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2457
+				if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2458 2458
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2459
-					$error_logging->yikes_easy_mailchimp_write_to_error_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender') , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2459
+					$error_logging->yikes_easy_mailchimp_write_to_error_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ), __( "Creating a new form", 'yikes-inc-easy-mailchimp-extender' ), __( "Forms", 'yikes-inc-easy-mailchimp-extender' ) );
2460 2460
 				}
2461 2461
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ) ) ) ) );
2462 2462
 			} else {
2463 2463
 				// redirect the user to the new form edit page
2464
-				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result) ) );
2464
+				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result ) ) );
2465 2465
 			}
2466 2466
 			exit();
2467 2467
 		}
@@ -2474,11 +2474,11 @@  discard block
 block discarded – undo
2474 2474
 		*/
2475 2475
 		public function yikes_easy_mailchimp_delete_form() {
2476 2476
 			// grab & store our variables ( associated list & form name )
2477
-			$nonce = $_REQUEST['nonce'];
2478
-			$post_id_to_delete = $_REQUEST['mailchimp-form'];
2477
+			$nonce = $_REQUEST[ 'nonce' ];
2478
+			$post_id_to_delete = $_REQUEST[ 'mailchimp-form' ];
2479 2479
 			// verify our nonce
2480
-			if( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) {
2481
-				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 ) );
2480
+			if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-' . $post_id_to_delete ) ) {
2481
+				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 ) );
2482 2482
 			}
2483 2483
 
2484 2484
 			$this->form_interface->delete_form( $post_id_to_delete );
@@ -2494,19 +2494,19 @@  discard block
 block discarded – undo
2494 2494
 		*/
2495 2495
 		public function yikes_easy_mailchimp_duplicate_form() {
2496 2496
 			// grab & store our variables ( associated list & form name )
2497
-			$nonce = $_REQUEST['nonce'];
2498
-			$post_id_to_clone = $_REQUEST['mailchimp-form'];
2497
+			$nonce = $_REQUEST[ 'nonce' ];
2498
+			$post_id_to_clone = $_REQUEST[ 'mailchimp-form' ];
2499 2499
 			// verify our nonce
2500
-			if( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) {
2501
-				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 ) );
2500
+			if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-' . $post_id_to_clone ) ) {
2501
+				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 ) );
2502 2502
 			}
2503 2503
 
2504 2504
 			// Get the current form data.
2505 2505
 			$form_data = $this->form_interface->get_form( $post_id_to_clone );
2506 2506
 
2507 2507
 			// Update some of the data before duplication
2508
-			$form_data['form_name'] .= ' - Copy - ';
2509
-			$form_data['impressions'] = $form_data['submissions'] = 0;
2508
+			$form_data[ 'form_name' ] .= ' - Copy - ';
2509
+			$form_data[ 'impressions' ] = $form_data[ 'submissions' ] = 0;
2510 2510
 
2511 2511
 			// Create the new form, and handle the result.
2512 2512
 			$result = $this->form_interface->create_form( $form_data );
@@ -2527,11 +2527,11 @@  discard block
 block discarded – undo
2527 2527
 		*/
2528 2528
 		public function yikes_easy_mailchimp_reset_impression_stats() {
2529 2529
 			// grab & store our variables ( associated list & form name )
2530
-			$nonce = $_REQUEST['nonce'];
2531
-			$form_id_to_reset = $_REQUEST['mailchimp-form'];
2530
+			$nonce = $_REQUEST[ 'nonce' ];
2531
+			$form_id_to_reset = $_REQUEST[ 'mailchimp-form' ];
2532 2532
 			// verify our nonce
2533
-			if( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) {
2534
-				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 ) );
2533
+			if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-' . $form_id_to_reset ) ) {
2534
+				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 ) );
2535 2535
 			}
2536 2536
 
2537 2537
 			$result = $this->form_interface->update_form(
@@ -2559,8 +2559,8 @@  discard block
 block discarded – undo
2559 2559
 		*/
2560 2560
 		public function yikes_easy_mailchimp_update_form() {
2561 2561
 			// grab & store our variables ( associated list & form name )
2562
-			$nonce = $_REQUEST['nonce'];
2563
-			$form_id = $_REQUEST['id'];
2562
+			$nonce = $_REQUEST[ 'nonce' ];
2563
+			$form_id = $_REQUEST[ 'id' ];
2564 2564
 
2565 2565
 			// verify our nonce
2566 2566
 			if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) {
@@ -2574,66 +2574,66 @@  discard block
 block discarded – undo
2574 2574
 			}
2575 2575
 
2576 2576
 			// store our values!
2577
-			$list_id                 = $_POST['associated-list'];
2578
-			$form_name               = stripslashes( $_POST['form-name'] );
2579
-			$form_description        = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
2580
-			$send_welcome_email      = $_POST['send-welcome-email'];
2581
-			$redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2582
-			$redirect_page           = $_POST['redirect-user-to-selection'];
2577
+			$list_id                 = $_POST[ 'associated-list' ];
2578
+			$form_name               = stripslashes( $_POST[ 'form-name' ] );
2579
+			$form_description        = sanitize_text_field( stripslashes( $_POST[ 'form-description' ] ) );
2580
+			$send_welcome_email      = $_POST[ 'send-welcome-email' ];
2581
+			$redirect_user_on_submit = $_POST[ 'redirect-user-on-submission' ];
2582
+			$redirect_page           = $_POST[ 'redirect-user-to-selection' ];
2583 2583
 
2584 2584
 			// stripslashes_deep on save, to prevent foreign languages from added excessive backslashes
2585
-			$assigned_fields = isset( $_POST['field'] ) ? stripslashes_deep( $_POST['field'] ): array();
2585
+			$assigned_fields = isset( $_POST[ 'field' ] ) ? stripslashes_deep( $_POST[ 'field' ] ) : array();
2586 2586
 
2587 2587
 			// setup our submission settings serialized array
2588 2588
 			$submission_settings = array(
2589
-				'ajax'                   => $_POST['form-ajax-submission'],
2590
-				'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2591
-				'redirect_page'          => $_POST['redirect-user-to-selection'],
2592
-				'custom_redirect_url'    => esc_url( $_POST['custom-redirect-url'] ),
2593
-				'hide_form_post_signup'  => $_POST['hide-form-post-signup'],
2594
-				'replace_interests'      => $_POST['replace-interest-groups'],
2589
+				'ajax'                   => $_POST[ 'form-ajax-submission' ],
2590
+				'redirect_on_submission' => $_POST[ 'redirect-user-on-submission' ],
2591
+				'redirect_page'          => $_POST[ 'redirect-user-to-selection' ],
2592
+				'custom_redirect_url'    => esc_url( $_POST[ 'custom-redirect-url' ] ),
2593
+				'hide_form_post_signup'  => $_POST[ 'hide-form-post-signup' ],
2594
+				'replace_interests'      => $_POST[ 'replace-interest-groups' ],
2595 2595
 			);
2596 2596
 
2597 2597
 			// setup our opt-in settings serialized array
2598 2598
 			$optin_settings = array(
2599
-				'optin'                => $_POST['single-double-optin'],
2600
-				'update_existing_user' => $_POST['update-existing-user'],
2601
-				'send_update_email'    => $_POST['update-existing-email'],
2602
-				'send_welcome_email'   => $_POST['send-welcome-email'],
2599
+				'optin'                => $_POST[ 'single-double-optin' ],
2600
+				'update_existing_user' => $_POST[ 'update-existing-user' ],
2601
+				'send_update_email'    => $_POST[ 'update-existing-email' ],
2602
+				'send_welcome_email'   => $_POST[ 'send-welcome-email' ],
2603 2603
 			);
2604 2604
 
2605 2605
 			// setup our error settings serialized array
2606 2606
 			$error_settings = array(
2607
-				'success'            => trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2608
-				'general-error'      => trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2609
-				'invalid-email'      => trim( $_POST['yikes-easy-mc-invalid-email-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-invalid-email-message'] ) ) : '',
2610
-				'already-subscribed' => trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2611
-				'update-link'        => trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '',
2607
+				'success'            => trim( $_POST[ 'yikes-easy-mc-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-message' ] ) ) : '',
2608
+				'general-error'      => trim( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ) : '',
2609
+				'invalid-email'      => trim( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ) : '',
2610
+				'already-subscribed' => trim( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ) : '',
2611
+				'update-link'        => trim( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ) : '',
2612 2612
 			);
2613 2613
 
2614 2614
 			// Setup the new form settings array
2615 2615
 			// @since 6.0.3.8
2616 2616
 			// To Do: Combine date & time so it's a single unix timestamp
2617 2617
 			$form_settings = array(
2618
-				'yikes-easy-mc-form-class-names'                 => trim( $_POST['yikes-easy-mc-form-class-names'] ),
2619
-				'yikes-easy-mc-inline-form'                      => $_POST['yikes-easy-mc-inline-form'][0],
2620
-				'yikes-easy-mc-submit-button-type'               => $_POST['yikes-easy-mc-submit-button-type'][0],
2621
-				'yikes-easy-mc-submit-button-text'               => trim( $_POST['yikes-easy-mc-submit-button-text'] ),
2622
-				'yikes-easy-mc-submit-button-image'              => esc_url( trim( $_POST['yikes-easy-mc-submit-button-image'] ) ),
2623
-				'yikes-easy-mc-submit-button-classes'            => trim( $_POST['yikes-easy-mc-submit-button-classes'] ),
2624
-				'yikes-easy-mc-form-schedule'                    => ( isset( $_POST['yikes-easy-mc-form-schedule'] ) ) ? '1' : '0',
2625
-				'yikes-easy-mc-form-restriction-start'           => strtotime( $_POST['yikes-easy-mc-form-restriction-start-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-start-time'] ),
2626
-				'yikes-easy-mc-form-restriction-end'             => strtotime( $_POST['yikes-easy-mc-form-restriction-end-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-end-time'] ),
2627
-				'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST['yikes-easy-mc-form-restriction-pending-message'] ),
2628
-				'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST['yikes-easy-mc-form-restriction-expired-message'] ),
2629
-				'yikes-easy-mc-form-login-required'              => ( isset( $_POST['yikes-easy-mc-form-login-required'] ) ) ? '1' : '0',
2630
-				'yikes-easy-mc-form-restriction-login-message'   => trim( $_POST['yikes-easy-mc-form-restriction-login-message'] ),
2618
+				'yikes-easy-mc-form-class-names'                 => trim( $_POST[ 'yikes-easy-mc-form-class-names' ] ),
2619
+				'yikes-easy-mc-inline-form'                      => $_POST[ 'yikes-easy-mc-inline-form' ][ 0 ],
2620
+				'yikes-easy-mc-submit-button-type'               => $_POST[ 'yikes-easy-mc-submit-button-type' ][ 0 ],
2621
+				'yikes-easy-mc-submit-button-text'               => trim( $_POST[ 'yikes-easy-mc-submit-button-text' ] ),
2622
+				'yikes-easy-mc-submit-button-image'              => esc_url( trim( $_POST[ 'yikes-easy-mc-submit-button-image' ] ) ),
2623
+				'yikes-easy-mc-submit-button-classes'            => trim( $_POST[ 'yikes-easy-mc-submit-button-classes' ] ),
2624
+				'yikes-easy-mc-form-schedule'                    => ( isset( $_POST[ 'yikes-easy-mc-form-schedule' ] ) ) ? '1' : '0',
2625
+				'yikes-easy-mc-form-restriction-start'           => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-start-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-start-time' ] ),
2626
+				'yikes-easy-mc-form-restriction-end'             => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-end-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-end-time' ] ),
2627
+				'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-pending-message' ] ),
2628
+				'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-expired-message' ] ),
2629
+				'yikes-easy-mc-form-login-required'              => ( isset( $_POST[ 'yikes-easy-mc-form-login-required' ] ) ) ? '1' : '0',
2630
+				'yikes-easy-mc-form-restriction-login-message'   => trim( $_POST[ 'yikes-easy-mc-form-restriction-login-message' ] ),
2631 2631
 			);
2632 2632
 
2633 2633
 			// additional custom fields (extensions / user defined fields)
2634 2634
 			$custom_fields = array();
2635
-			if ( isset( $_POST['custom-field'] ) ) {
2636
-				foreach ( $_POST['custom-field'] as $custom_field => $custom_value ) {
2635
+			if ( isset( $_POST[ 'custom-field' ] ) ) {
2636
+				foreach ( $_POST[ 'custom-field' ] as $custom_field => $custom_value ) {
2637 2637
 					if ( is_array( $custom_value ) ) {
2638 2638
 						$custom_fields[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!)
2639 2639
 					} else {
@@ -2664,7 +2664,7 @@  discard block
 block discarded – undo
2664 2664
 			$this->form_interface->update_form( $form_id, $form_updates );
2665 2665
 
2666 2666
 			/* Custom action hook which allows users to update specific options when a form is updated - used in add ons */
2667
-			do_action( 'yikes-mailchimp-save-form', $form_id,  $custom_fields );
2667
+			do_action( 'yikes-mailchimp-save-form', $form_id, $custom_fields );
2668 2668
 
2669 2669
 			// redirect the user to the manage forms page, display confirmation
2670 2670
 			wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form_id . '&updated-form=true' ) ) );
@@ -2673,18 +2673,18 @@  discard block
 block discarded – undo
2673 2673
 
2674 2674
 		/* Unsubscribe a given user from our list */
2675 2675
 		public function yikes_easy_mailchimp_unsubscribe_user() {
2676
-			$nonce = $_REQUEST['nonce'];
2677
-			$list_id = $_REQUEST['mailchimp-list'];
2678
-			$email_id = $_REQUEST['email_id'];
2676
+			$nonce = $_REQUEST[ 'nonce' ];
2677
+			$list_id = $_REQUEST[ 'mailchimp-list' ];
2678
+			$email_id = $_REQUEST[ 'email_id' ];
2679 2679
 			// verify our nonce
2680
-			if( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2681
-				wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2680
+			if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2681
+				wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) );
2682 2682
 			}
2683 2683
 			// only re-run the API request if our API key has changed
2684 2684
 			// initialize MailChimp Class
2685 2685
 			$api_key = yikes_get_mc_api_key();
2686 2686
 			$dash_position = strpos( $api_key, '-' );
2687
-			if( $dash_position !== false ) {
2687
+			if ( $dash_position !== false ) {
2688 2688
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/unsubscribe.json';
2689 2689
 			}
2690 2690
 			$response = wp_remote_post( $api_endpoint, array(
@@ -2698,13 +2698,13 @@  discard block
 block discarded – undo
2698 2698
 				'timeout' => 10,
2699 2699
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2700 2700
 			) );
2701
-			if( ! is_wp_error( $response ) ) {
2701
+			if ( ! is_wp_error( $response ) ) {
2702 2702
 				$response_body = json_decode( wp_remote_retrieve_body( $response ), true );
2703
-				if( isset( $response_body['error'] ) ) {
2704
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2703
+				if ( isset( $response_body[ 'error' ] ) ) {
2704
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2705 2705
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2706 2706
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2707
-						$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' ) );
2707
+						$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' ) );
2708 2708
 					}
2709 2709
 				}
2710 2710
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id . '&user-unsubscribed=true' ) ) );
@@ -2714,21 +2714,21 @@  discard block
 block discarded – undo
2714 2714
 
2715 2715
 		public function yikes_easy_mailchimp_create_missing_error_log() {
2716 2716
 			// grab our nonnce
2717
-			$nonce = $_REQUEST['nonce'];
2717
+			$nonce = $_REQUEST[ 'nonce' ];
2718 2718
 			// validate nonce
2719
-			if( !wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2720
-				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 ) );
2719
+			if ( ! wp_verify_nonce( $nonce, 'create_error_log' ) ) {
2720
+				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 ) );
2721 2721
 			}
2722 2722
 			// setup the path to the error log
2723
-			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php' , 'w' );
2723
+			$error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' );
2724 2724
 			try {
2725 2725
 				// create the file
2726
-				fwrite( $error_log , '' );
2726
+				fwrite( $error_log, '' );
2727 2727
 				// close out
2728 2728
 				fclose( $error_log );
2729 2729
 				wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings&error_log_created=true' ) ) );
2730 2730
 			} catch ( Exception $e ) {
2731
-				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() ) ) ) );
2731
+				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() ) ) ) );
2732 2732
 			}
2733 2733
 		}
2734 2734
 
@@ -2739,16 +2739,16 @@  discard block
 block discarded – undo
2739 2739
 		public function yikes_easy_mailchimp_clear_transient_data() {
2740 2740
 			$referer = wp_get_referer();
2741 2741
 			// grab & store our variables ( associated list & form name )
2742
-			$nonce = $_REQUEST['nonce'];
2742
+			$nonce = $_REQUEST[ 'nonce' ];
2743 2743
 			// verify our nonce
2744
-			if( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2745
-				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 ) );
2744
+			if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2745
+				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 ) );
2746 2746
 			}
2747 2747
 			// delete all of the integration settings list data in the cache
2748 2748
 			$list_ids = $this->get_mailchimp_list_ids_on_account();
2749 2749
 			// confirm the list IDs was returned and is not empty
2750
-			if( isset( $list_ids ) && ! empty( $list_ids ) ) {
2751
-				foreach( $list_ids as $id ) {
2750
+			if ( isset( $list_ids ) && ! empty( $list_ids ) ) {
2751
+				foreach ( $list_ids as $id ) {
2752 2752
 					// loop over each interest group and delete the transient associated with it
2753 2753
 					// this is created & stored on the integration list page
2754 2754
 					// id = groupID_interest_group
@@ -2781,12 +2781,12 @@  discard block
 block discarded – undo
2781 2781
 		*/
2782 2782
 		public function get_mailchimp_list_ids_on_account() {
2783 2783
 			$api_key = yikes_get_mc_api_key();
2784
-			if( ! $api_key ) {
2784
+			if ( ! $api_key ) {
2785 2785
 				// if no api key is set/site is not connected, return an empty array
2786 2786
 				return array();
2787 2787
 			}
2788 2788
 			$dash_position = strpos( $api_key, '-' );
2789
-			if( $dash_position !== false ) {
2789
+			if ( $dash_position !== false ) {
2790 2790
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
2791 2791
 			}
2792 2792
 			$mailchimp_lists = wp_remote_post( $api_endpoint, array(
@@ -2797,19 +2797,19 @@  discard block
 block discarded – undo
2797 2797
 				'timeout' => 10,
2798 2798
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2799 2799
 			) );
2800
-			if( ! is_wp_error( $mailchimp_lists ) ) {
2800
+			if ( ! is_wp_error( $mailchimp_lists ) ) {
2801 2801
 				$list_data = json_decode( wp_remote_retrieve_body( $mailchimp_lists ), true );
2802
-				if( isset( $list_data['error'] ) ) {
2803
-					if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2802
+				if ( isset( $list_data[ 'error' ] ) ) {
2803
+					if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
2804 2804
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2805 2805
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2806
-						$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' ) );
2806
+						$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' ) );
2807 2807
 					}
2808 2808
 				}
2809 2809
 				$mail_chimp_list_ids = array();
2810
-				if( isset( $list_data['data'] ) ) {
2811
-					foreach( $list_data['data'] as $list ) {
2812
-						$mail_chimp_list_ids[] = $list['id'];
2810
+				if ( isset( $list_data[ 'data' ] ) ) {
2811
+					foreach ( $list_data[ 'data' ] as $list ) {
2812
+						$mail_chimp_list_ids[ ] = $list[ 'id' ];
2813 2813
 					}
2814 2814
 					return $mail_chimp_list_ids;
2815 2815
 				} else {
@@ -2825,7 +2825,7 @@  discard block
 block discarded – undo
2825 2825
 		*/
2826 2826
 		public function yikes_mailchimp_load_helper_class() {
2827 2827
 			// check to see if it's already loaded up
2828
-			if( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2828
+			if ( ! class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) {
2829 2829
 				// Include our main helper class file
2830 2830
 				include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' );
2831 2831
 			}
@@ -2902,7 +2902,7 @@  discard block
 block discarded – undo
2902 2902
 		*	@since 6.0.4
2903 2903
 		*/
2904 2904
 		public function check_yikes_mc_table_version() {
2905
-			if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2905
+			if ( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) {
2906 2906
 				require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php';
2907 2907
 				global $wpdb;
2908 2908
 				Yikes_Inc_Easy_Mailchimp_Extender_Activator::_activate_yikes_easy_mailchimp( $wpdb );
Please login to merge, or discard this patch.