Completed
Push — staging ( f29bf2...e05acd )
by
unknown
04:43
created
admin/partials/edit-form.php 1 patch
Spacing   +205 added lines, -205 removed lines patch added patch discarded remove patch
@@ -2,23 +2,23 @@  discard block
 block discarded – undo
2 2
 	<?php
3 3
 
4 4
 	// if an error was returned in the most recent query
5
-	if( isset( $_GET['sql_error'] ) ) {
5
+	if ( isset( $_GET[ 'sql_error' ] ) ) {
6 6
 		// if error logging is turned on, lets display a better error to help narrow things down
7 7
 		// lets also log things to the error log
8
-		if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
9
-			wp_die( '<strong>' . __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong> <p>' . stripslashes( urldecode( $_GET['sql_error'] ) ) . '</p>' , __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) );
8
+		if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
9
+			wp_die( '<strong>' . __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) . '</strong> <p>' . stripslashes( urldecode( $_GET[ 'sql_error' ] ) ) . '</p>', __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) );
10 10
 		} else {
11
-			wp_die( '<strong>' . __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p>' . __( "Please try again. If the error persists please get in contact with the YIKES Inc. support team." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>' );
11
+			wp_die( '<strong>' . __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p>' . __( "Please try again. If the error persists please get in contact with the YIKES Inc. support team.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>' );
12 12
 		}
13 13
 	}
14 14
 
15 15
 	/* Get The Form ID we need to edit */
16
-	if ( ! isset( $_GET['id'] ) ) {
16
+	if ( ! isset( $_GET[ 'id' ] ) ) {
17 17
 		wp_die( __( 'Oh No!', 'yikes-inc-easy-mailchimp-extender' ), __( 'Error', 'yikes-inc-easy-mailchimp-extender' ) );
18 18
 	}
19 19
 
20 20
 	// grab and store the form ID
21
-	$form_id = (int) $_GET['id'];
21
+	$form_id = (int) $_GET[ 'id' ];
22 22
 
23 23
 	// Get our form interface.
24 24
 	$form_interface = yikes_easy_mailchimp_extender_get_form_interface();
@@ -31,19 +31,19 @@  discard block
 block discarded – undo
31 31
 
32 32
 	// if the form was not found return an error
33 33
 	if ( empty( $form ) ) {
34
-		wp_die( printf( __( "Whoops! It looks like this form doesn't exist. If this error persists you may want to toggle on debugging on the <a href='%s'>%s</a> " , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings' ) ), __( 'debug settings page' , 'yikes-inc-easy-mailchimp-extender' ) ), __( 'Error' , 'yikes-inc-easy-mailchimp-extender' ) );
34
+		wp_die( printf( __( "Whoops! It looks like this form doesn't exist. If this error persists you may want to toggle on debugging on the <a href='%s'>%s</a> ", 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=debug-settings' ) ), __( 'debug settings page', 'yikes-inc-easy-mailchimp-extender' ) ), __( 'Error', 'yikes-inc-easy-mailchimp-extender' ) );
35 35
 	}
36 36
 
37 37
 	// set global form data, mainly for use in custom form field declarations
38
-	$GLOBALS["form_data"] = $form;
38
+	$GLOBALS[ "form_data" ] = $form;
39 39
 
40
-	$custom_styles       = $form['custom_styles'];
41
-	$optin_settings      = $form['optin_settings'];
42
-	$submission_settings = $form['submission_settings'];
43
-	$error_messages      = $form['error_messages'];
40
+	$custom_styles       = $form[ 'custom_styles' ];
41
+	$optin_settings      = $form[ 'optin_settings' ];
42
+	$submission_settings = $form[ 'submission_settings' ];
43
+	$error_messages      = $form[ 'error_messages' ];
44 44
 
45
-	if ( isset( $form['form_settings'] ) ) {
46
-		$form_settings = $form['form_settings'];
45
+	if ( isset( $form[ 'form_settings' ] ) ) {
46
+		$form_settings = $form[ 'form_settings' ];
47 47
 	}
48 48
 
49 49
 	// get defaults if none are saved in the database yet
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 
88 88
 	// Get the merge fields
89
-	$available_merge_variables = $list_handler->get_merge_fields( $form['list_id'] );
89
+	$available_merge_variables = $list_handler->get_merge_fields( $form[ 'list_id' ] );
90 90
 	if ( is_wp_error( $available_merge_variables ) ) {
91 91
 		$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
92 92
 		$error_logging->maybe_write_to_log(
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 
100 100
 	// get the interest group data
101
-	$interest_groupings = $list_handler->get_interest_categories( $form['list_id'] );
101
+	$interest_groupings = $list_handler->get_interest_categories( $form[ 'list_id' ] );
102 102
 	if ( is_wp_error( $interest_groupings ) ) {
103 103
 		$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
104 104
 		$error_logging->maybe_write_to_log(
@@ -115,22 +115,22 @@  discard block
 block discarded – undo
115 115
 		add_query_arg(
116 116
 			array(
117 117
 				'action' => 'yikes-easy-mc-update-form',
118
-				'nonce' => wp_create_nonce( 'update-mailchimp-form'.-$form['id'] )
118
+				'nonce' => wp_create_nonce( 'update-mailchimp-form' . -$form[ 'id' ] )
119 119
 			)
120 120
 		)
121 121
 	);
122 122
 	/* Display Our Form */
123 123
 	?>
124 124
 	<!-- Freddie Logo -->
125
-	<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
125
+	<img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
126 126
 
127
-	<h1>YIKES Easy Forms for MailChimp | <?php echo __( 'Edit' , 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $form['form_name']; ?></h1>
127
+	<h1>YIKES Easy Forms for MailChimp | <?php echo __( 'Edit', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $form[ 'form_name' ]; ?></h1>
128 128
 
129 129
 	<!-- Settings Page Description -->
130
-	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Update this MailChimp form\'s fields, styles and settings below.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
130
+	<p class="yikes-easy-mc-about-text about-text"><?php _e( 'Update this MailChimp form\'s fields, styles and settings below.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
131 131
 
132 132
 	<?php
133
-	if ( isset( $_REQUEST['updated-form'] ) && $_REQUEST['updated-form'] == 'true' ) {
133
+	if ( isset( $_REQUEST[ 'updated-form' ] ) && $_REQUEST[ 'updated-form' ] == 'true' ) {
134 134
 		?>
135 135
 		<div class="updated manage-form-admin-notice">
136 136
 			<p><?php _e( 'Opt-in form successfully updated.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
 						<div class="inside">
155 155
 
156 156
 							<label for="form-name">
157
-								<h3 class="bg-transparent"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
158
-								<input autocomplete="disabled" id="form-name" name="form-name" type="text" value="<?php echo stripslashes( esc_html( $form['form_name'] ) ); ?>" class="widefat" />
159
-								<p class="description"><?php _e( "The title of this signup form." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
157
+								<h3 class="bg-transparent"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
158
+								<input autocomplete="disabled" id="form-name" name="form-name" type="text" value="<?php echo stripslashes( esc_html( $form[ 'form_name' ] ) ); ?>" class="widefat" />
159
+								<p class="description"><?php _e( "The title of this signup form.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
160 160
 							</label>
161 161
 
162 162
 							<label for="form-description">
163
-								<h3 class="bg-transparent"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
164
-								<textarea name="form-description" id="form-description" class="large-text edit-form-form-description"><?php echo isset( $form['form_description'] ) ? stripslashes( esc_textarea( $form['form_description'] ) ) : ''; ?></textarea>
165
-								<p class="description"><?php _e( "Descriptions are optional and you may choose to display it to visitors to your site." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
163
+								<h3 class="bg-transparent"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
164
+								<textarea name="form-description" id="form-description" class="large-text edit-form-form-description"><?php echo isset( $form[ 'form_description' ] ) ? stripslashes( esc_textarea( $form[ 'form_description' ] ) ) : ''; ?></textarea>
165
+								<p class="description"><?php _e( "Descriptions are optional and you may choose to display it to visitors to your site.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
166 166
 								<p class="description"><?php printf( __( 'To display the number of subscribers for the list associated with this form, use %s in the form description field above.', 'yikes-inc-easy-mailchimp-extender' ), '<code>[yikes-mailchimp-subscriber-count]</code>' ); ?><p>
167 167
 							</label>
168 168
 
@@ -178,16 +178,16 @@  discard block
 block discarded – undo
178 178
 
179 179
 						<ul id="yikes_easy_mc_toolbar_links">
180 180
 							<li class="hidden_setting_list">
181
-								<a class="hidden_setting form-builder selected_hidden_setting" data-attr-container="form-builder" onclick="return false;" title="<?php esc_attr_e( 'Customize Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
181
+								<a class="hidden_setting form-builder selected_hidden_setting" data-attr-container="form-builder" onclick="return false;" title="<?php esc_attr_e( 'Customize Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
182 182
 								<div class="selected_setting_triangle"></div>
183 183
 							</li>
184 184
 							<li class="hidden_setting_list">
185
-								<a class="hidden_setting form-settings" onclick="return false;" data-attr-container="form-settings" title="<?php esc_attr_e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
185
+								<a class="hidden_setting form-settings" onclick="return false;" data-attr-container="form-settings" title="<?php esc_attr_e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
186 186
 							</li>
187 187
 							<li class="hidden_setting_list">
188
-								<a class="hidden_setting error-messages" onclick="return false;" data-attr-container="error-messages" title="<?php esc_attr_e( 'Customize Form Messages' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Custom Messages' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
188
+								<a class="hidden_setting error-messages" onclick="return false;" data-attr-container="error-messages" title="<?php esc_attr_e( 'Customize Form Messages', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Custom Messages', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
189 189
 							</li>
190
-							<?php do_action( 'yikes-mailchimp-edit-form-section-links' , $form ); ?>
190
+							<?php do_action( 'yikes-mailchimp-edit-form-section-links', $form ); ?>
191 191
 						</ul>
192 192
 
193 193
 					</div>
@@ -208,22 +208,22 @@  discard block
 block discarded – undo
208 208
 											<div class="meta-box-sortables ui-sortable">
209 209
 												<div class="postbox yikes-easy-mc-postbox">
210 210
 													<!-- container title -->
211
-													<h3 class="edit-form-title" id="form-builder-div" data-list-id="<?php echo $form['list_id'] ?>" ><?php _e( 'Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
212
-													<p id="edit-form-description" class="description edit-form-description-form-builder"><?php _e( 'Click a field to show its advanced options or drag fields to re-arrange them. Click <span class="dashicons dashicons-edit"></span> to edit a field label. Make sure you hit "Update Form" to save all of your changes.' , 'yikes-inc-easy-mailchimp-extender' );?></p>
211
+													<h3 class="edit-form-title" id="form-builder-div" data-list-id="<?php echo $form[ 'list_id' ] ?>" ><?php _e( 'Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
212
+													<p id="edit-form-description" class="description edit-form-description-form-builder"><?php _e( 'Click a field to show its advanced options or drag fields to re-arrange them. Click <span class="dashicons dashicons-edit"></span> to edit a field label. Make sure you hit "Update Form" to save all of your changes.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
213 213
 													<div id="form-builder-container" class="inside">
214 214
 														<!-- #poststuff -->
215
-														<?php echo $this->generate_form_editor( $form['fields'], $form['list_id'] , $available_merge_variables , isset( $interest_groupings ) ? $interest_groupings : array() ); ?>
215
+														<?php echo $this->generate_form_editor( $form[ 'fields' ], $form[ 'list_id' ], $available_merge_variables, isset( $interest_groupings ) ? $interest_groupings : array() ); ?>
216 216
 													</div>
217 217
 
218 218
 													<!-- Bulk Delete Form Fields -->
219
-													<a href="#" class="clear-form-fields" <?php if( isset( $form['fields'] ) && count( $form['fields'] ) <= 0 ) { ?> style="display:none;" <?php } ?>><?php _e( 'Clear Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
219
+													<a href="#" class="clear-form-fields" <?php if ( isset( $form[ 'fields' ] ) && count( $form[ 'fields' ] ) <= 0 ) { ?> style="display:none;" <?php } ?>><?php _e( 'Clear Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
220 220
 
221 221
 													<?php
222
-														$display_none = ( isset( $form['fields'] ) && count( $form['fields'] ) <= 0 ) ? 'display:none;' : '';
222
+														$display_none = ( isset( $form[ 'fields' ] ) && count( $form[ 'fields' ] ) <= 0 ) ? 'display:none;' : '';
223 223
 													?>
224 224
 
225 225
 													<!-- Save Fields Button -->
226
-													<?php submit_button( __( 'Update Form' ) , 'primary' , '' , false , array( 'onclick' => '', 'style' => 'float:right;margin-right:12px;'.$display_none ) ); ?>
226
+													<?php submit_button( __( 'Update Form' ), 'primary', '', false, array( 'onclick' => '', 'style' => 'float:right;margin-right:12px;' . $display_none ) ); ?>
227 227
 
228 228
 													<!-- .inside -->
229 229
 												</div>
@@ -236,15 +236,15 @@  discard block
 block discarded – undo
236 236
 										<div id="postbox-container-1" class="postbox-container">
237 237
 											<div class="meta-box-sortables">
238 238
 												<div class="postbox yikes-easy-mc-postbox">
239
-													<h3 class="edit-form-title"><span><?php _e( "Form Fields &amp; Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
239
+													<h3 class="edit-form-title"><span><?php _e( "Form Fields &amp; Interest Groups", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
240 240
 													<div class="inside">
241 241
 
242 242
 														<h3 class="nav-tab-wrapper mv_ig_list">
243
-															<a href="#" class="nav-tab nav-tab-active" alt="merge-variables"><div class="arrow-down"></div><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
244
-															<?php if( !isset( $merge_variable_error ) ) { ?>
245
-																<a href="#" class="nav-tab"><?php _e( 'Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
243
+															<a href="#" class="nav-tab nav-tab-active" alt="merge-variables"><div class="arrow-down"></div><?php _e( 'Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
244
+															<?php if ( ! isset( $merge_variable_error ) ) { ?>
245
+																<a href="#" class="nav-tab"><?php _e( 'Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
246 246
 															<?php } else { ?>
247
-																<a href="#" class="nav-tab no-interest-groups-found-message" disabled="disabled" title="<?php _e( "No Interest Groups Exist" , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
247
+																<a href="#" class="nav-tab no-interest-groups-found-message" disabled="disabled" title="<?php _e( "No Interest Groups Exist", 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
248 248
 															<?php } ?>
249 249
 														</h3>
250 250
 
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
 
253 253
 															<div id="merge-variables-container" class="list-container">
254 254
 																<?php
255
-																	if( ! isset( $merge_variable_error ) ) {
255
+																	if ( ! isset( $merge_variable_error ) ) {
256 256
 																		// build a list of available merge variables,
257 257
 																		// but exclude the ones already assigned to the form
258
-																		echo '<p class="description">' . __( "Select the fields below to add to the form builder." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
259
-																		$this->build_available_merge_vars( $form['fields'] , $available_merge_variables );
258
+																		echo '<p class="description">' . __( "Select the fields below to add to the form builder.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
259
+																		$this->build_available_merge_vars( $form[ 'fields' ], $available_merge_variables );
260 260
 																	} else {
261 261
 																		echo $merge_variable_error;
262 262
 																	}
@@ -265,14 +265,14 @@  discard block
 block discarded – undo
265 265
 
266 266
 															<div id="interest-groups-container" class="list-container">
267 267
 																<?php
268
-																	if( isset( $interest_groupings ) && ! isset( $interest_groupings['error'] ) ) {
268
+																	if ( isset( $interest_groupings ) && ! isset( $interest_groupings[ 'error' ] ) ) {
269 269
 																		// build a list of available merge variables,
270 270
 																		// but exclude the ones already assigned to the form
271
-																		echo '<p class="description">' . __( "Select an interest group below to add to the form builder." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
271
+																		echo '<p class="description">' . __( "Select an interest group below to add to the form builder.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
272 272
 																		// $this->build_available_merge_vars( $form['fields'] , $available_merge_variables );
273
-																		$this->build_available_interest_groups( $form['fields'] , $interest_groupings , $form['list_id'] );
273
+																		$this->build_available_interest_groups( $form[ 'fields' ], $interest_groupings, $form[ 'list_id' ] );
274 274
 																	} else {
275
-																		echo '<p class="description">' . $interest_groupings['error'] . '</p>';
275
+																		echo '<p class="description">' . $interest_groupings[ 'error' ] . '</p>';
276 276
 																	}
277 277
 																?>
278 278
 															</div>
@@ -305,19 +305,19 @@  discard block
 block discarded – undo
305 305
 										<div id="post-body-content">
306 306
 											<div class="meta-box-sortables ui-sortable">
307 307
 												<div class="postbox yikes-easy-mc-postbox">
308
-													<h3 class="edit-form-title"><span><?php _e( "Additional Form Settings" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
308
+													<h3 class="edit-form-title"><span><?php _e( "Additional Form Settings", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
309 309
 
310 310
 													<div class="inside form-settings-container">
311 311
 
312
-														<p class="edit-form-description"><?php _e( "Adjust some additional form settings below." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
312
+														<p class="edit-form-description"><?php _e( "Adjust some additional form settings below.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
313 313
 
314 314
 														<!-- begin form classes section -->
315 315
 														<strong class="section-title first"><?php _e( 'Overall Form Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
316 316
 														<section class="section-interior">
317 317
 
318 318
 															<!-- form classes -->
319
-															<label for="yikes-easy-mc-form-class-names"><strong><?php _e( 'Form Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
320
-																<input type="text" class="widefat" name="yikes-easy-mc-form-class-names" id="yikes-easy-mc-form-class-names" value="<?php echo $form_settings['yikes-easy-mc-form-class-names']; ?>" placeholder="<?php _e( 'Add additional classes to this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?>" >
319
+															<label for="yikes-easy-mc-form-class-names"><strong><?php _e( 'Form Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
320
+																<input type="text" class="widefat" name="yikes-easy-mc-form-class-names" id="yikes-easy-mc-form-class-names" value="<?php echo $form_settings[ 'yikes-easy-mc-form-class-names' ]; ?>" placeholder="<?php _e( 'Add additional classes to this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?>" >
321 321
 																<p class="description"><?php printf( __( 'Add additional class names to the %s element.', 'yikes-inc-easy-mailchimp-extender' ), '<code>' . htmlentities( '<form>' ) . '</code>' ); ?></p>
322 322
 															</label>
323 323
 
@@ -330,12 +330,12 @@  discard block
 block discarded – undo
330 330
 
331 331
 															<!-- setup the checked state here -->
332 332
 															<!-- inline form -->
333
-															<strong><?php _e( 'Inline Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
333
+															<strong><?php _e( 'Inline Form', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
334 334
 															<label class="inline-form-label">
335
-																<input type="radio" name="yikes-easy-mc-inline-form[]" value="1" <?php checked( $form_settings['yikes-easy-mc-inline-form'], '1' ); ?>/><?php _e( 'Enable', 'yikes-inc-easy-mailchimp-extender' ); ?>
335
+																<input type="radio" name="yikes-easy-mc-inline-form[]" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-inline-form' ], '1' ); ?>/><?php _e( 'Enable', 'yikes-inc-easy-mailchimp-extender' ); ?>
336 336
 															</label>
337 337
 															<label class="inline-form-label">
338
-																<input type="radio" name="yikes-easy-mc-inline-form[]" value="0" <?php checked( $form_settings['yikes-easy-mc-inline-form'], '0' ); ?> /><?php _e( 'Disable', 'yikes-inc-easy-mailchimp-extender' ); ?>
338
+																<input type="radio" name="yikes-easy-mc-inline-form[]" value="0" <?php checked( $form_settings[ 'yikes-easy-mc-inline-form' ], '0' ); ?> /><?php _e( 'Disable', 'yikes-inc-easy-mailchimp-extender' ); ?>
339 339
 															</label>
340 340
 															<p class="description"><?php _e( 'Programatically setup this form so that all fields are on the same line.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
341 341
 															<p class="description"><?php printf( __( 'If you are having issues with your theme not displaying the inline form properly, please see the following %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="https://yikesplugins.com/support/knowledge-base/my-form-fields-are-not-fully-inline-after-enabling-the-inline-form-option-how-come/" target="_blank">' . __( 'knowledge base article', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></p>
@@ -348,21 +348,21 @@  discard block
 block discarded – undo
348 348
 														<section class="section-interior">
349 349
 
350 350
 															<!-- Submit button type -->
351
-															<strong><?php _e( 'Submit Button Type' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
351
+															<strong><?php _e( 'Submit Button Type', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
352 352
 															<label class="inline-form-label">
353
-																<input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="text" <?php checked( $form_settings['yikes-easy-mc-submit-button-type'], 'text' ); ?> /><?php _e( 'Text', 'yikes-inc-easy-mailchimp-extender' ); ?>
353
+																<input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="text" <?php checked( $form_settings[ 'yikes-easy-mc-submit-button-type' ], 'text' ); ?> /><?php _e( 'Text', 'yikes-inc-easy-mailchimp-extender' ); ?>
354 354
 															</label>
355 355
 															<label class="inline-form-label">
356
-																<input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="image" <?php checked( $form_settings['yikes-easy-mc-submit-button-type'], 'image' ); ?> /><?php _e( 'Image', 'yikes-inc-easy-mailchimp-extender' ); ?>
356
+																<input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="image" <?php checked( $form_settings[ 'yikes-easy-mc-submit-button-type' ], 'image' ); ?> /><?php _e( 'Image', 'yikes-inc-easy-mailchimp-extender' ); ?>
357 357
 															</label>
358 358
 															<p class="description"><?php _e( 'Select the submit button type for this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
359 359
 															<!-- end submit button type -->
360 360
 
361 361
 																<!-- Text submit button type -->
362
-																<section class="submit-button-type-text nested-child<?php if( $form_settings['yikes-easy-mc-submit-button-type'] == 'image' ) { echo ' hidden'; } ?>">
362
+																<section class="submit-button-type-text nested-child<?php if ( $form_settings[ 'yikes-easy-mc-submit-button-type' ] == 'image' ) { echo ' hidden'; } ?>">
363 363
 																	<!-- submit button text -->
364
-																	<label for="yikes-easy-mc-submit-button-text"><strong><?php _e( 'Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
365
-																		<input type="text" class="widefat" name="yikes-easy-mc-submit-button-text" id="yikes-easy-mc-submit-button-text" value="<?php echo $form_settings['yikes-easy-mc-submit-button-text']; ?>" placeholder="<?php _e( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); ?>">
364
+																	<label for="yikes-easy-mc-submit-button-text"><strong><?php _e( 'Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
365
+																		<input type="text" class="widefat" name="yikes-easy-mc-submit-button-text" id="yikes-easy-mc-submit-button-text" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-text' ]; ?>" placeholder="<?php _e( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); ?>">
366 366
 																		<p class="description"><?php printf( __( 'Set the submit button text. Leaving this blank will default to %s.', 'yikes-inc-easy-mailchimp-extender' ), '"' . __( 'Submit', 'yikes-inc-easy-mailchimp-extender' ) . '"' ); ?></p>
367 367
 
368 368
 																		<p class="description"><?php _e( 'The submit button text set above, can be overwritten on a per-form basis using shortcodes.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
@@ -371,9 +371,9 @@  discard block
 block discarded – undo
371 371
 																<!-- end text submit button type -->
372 372
 
373 373
 																<!-- Image submit button type -->
374
-																<section class="submit-button-type-image nested-child<?php if( $form_settings['yikes-easy-mc-submit-button-type'] == 'text' ) { echo ' hidden'; } ?>">
375
-																	<label for="yikes-easy-mc-submit-button-image"><strong><?php _e( 'Submit Button URL' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
376
-																		<input type="text" class="widefat" name="yikes-easy-mc-submit-button-image" id="yikes-easy-mc-submit-button-image" value="<?php echo $form_settings['yikes-easy-mc-submit-button-image']; ?>" placeholder="<?php _e( 'http://', 'yikes-inc-easy-mailchimp-extender' ); ?>">
374
+																<section class="submit-button-type-image nested-child<?php if ( $form_settings[ 'yikes-easy-mc-submit-button-type' ] == 'text' ) { echo ' hidden'; } ?>">
375
+																	<label for="yikes-easy-mc-submit-button-image"><strong><?php _e( 'Submit Button URL', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
376
+																		<input type="text" class="widefat" name="yikes-easy-mc-submit-button-image" id="yikes-easy-mc-submit-button-image" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-image' ]; ?>" placeholder="<?php _e( 'http://', 'yikes-inc-easy-mailchimp-extender' ); ?>">
377 377
 																		<p class="description"><?php _e( 'Enter the URL of an image you would like to use as the submit button for this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
378 378
 																	</label>
379 379
 																</section>
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
 
382 382
 
383 383
 															<!-- submit button classes -->
384
-															<label for="yikes-easy-mc-form-submit-button-classes"><strong style="float:left;"><?php _e( 'Submit Button Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
385
-																<input type="text" class="widefat" name="yikes-easy-mc-submit-button-classes" id="yikes-easy-mc-submit-button-classes" value="<?php echo $form_settings['yikes-easy-mc-submit-button-classes']; ?>" placeholder="<?php _e( 'Add additional classes to this submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?>" >
384
+															<label for="yikes-easy-mc-form-submit-button-classes"><strong style="float:left;"><?php _e( 'Submit Button Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
385
+																<input type="text" class="widefat" name="yikes-easy-mc-submit-button-classes" id="yikes-easy-mc-submit-button-classes" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-classes' ]; ?>" placeholder="<?php _e( 'Add additional classes to this submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?>" >
386 386
 																<p class="description"><?php _e( 'Add custom classes to the submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
387 387
 															</label>
388 388
 															<!-- end submit button classes -->
@@ -395,45 +395,45 @@  discard block
 block discarded – undo
395 395
 														<section class="section-interior">
396 396
 															<!-- Schedule form -->
397 397
 															<label class="inline-form-label">
398
-																<input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-schedule" value="1" <?php checked( $form_settings['yikes-easy-mc-form-schedule'], '1' ); ?>/><?php _e( 'Schedule Form', 'yikes-inc-easy-mailchimp-extender' ); ?>
398
+																<input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-schedule" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-form-schedule' ], '1' ); ?>/><?php _e( 'Schedule Form', 'yikes-inc-easy-mailchimp-extender' ); ?>
399 399
 															</label>
400 400
 															<p class="description" style="margin-bottom:0;"><?php _e( 'Set a time period that this form should be active on your site. (mm/dd/yyyy)', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
401 401
 															<p class="description" style="margin: 0 0 .5em 0;"><?php _e( 'Once the end date & time have passed, users will no longer be able to signup for your mailing list.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
402 402
 																<!-- Start Date Limitation Nested -->
403
-																<section class="date-restriction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-schedule'] == '0' ) { echo ' hidden'; } ?>">
403
+																<section class="date-restriction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-schedule' ] == '0' ) { echo ' hidden'; } ?>">
404 404
 																	<!-- Start Date -->
405
-																	<label for="yikes-easy-mc-form-restriction-start-date"><strong><?php _e( 'Start Date' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
406
-																		<input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-start-date" id="yikes-easy-mc-form-restriction-start-date" value="<?php echo ! empty($form_settings['yikes-easy-mc-form-restriction-start'] ) ? date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings['yikes-easy-mc-form-restriction-start'] ) : ''; ?>" >
405
+																	<label for="yikes-easy-mc-form-restriction-start-date"><strong><?php _e( 'Start Date', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
406
+																		<input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-start-date" id="yikes-easy-mc-form-restriction-start-date" value="<?php echo ! empty( $form_settings[ 'yikes-easy-mc-form-restriction-start' ] ) ? date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings[ 'yikes-easy-mc-form-restriction-start' ] ) : ''; ?>" >
407 407
 																		<?php _e( 'at', 'yikes-inc-easy-mailchimp-extender' ); ?>
408 408
 																	</label>
409 409
 
410 410
 																	<!-- Start Time -->
411
-																	<label for="yikes-easy-mc-form-restriction-start-time"><strong><?php _e( 'Start Time' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
412
-																		<input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-start-time" id="yikes-easy-mc-form-restriction-start-time" value="<?php echo ! empty( $form_settings['yikes-easy-mc-form-restriction-start'] ) ? date( 'g:iA', $form_settings['yikes-easy-mc-form-restriction-start'] ) : ''; ?>" >
411
+																	<label for="yikes-easy-mc-form-restriction-start-time"><strong><?php _e( 'Start Time', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
412
+																		<input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-start-time" id="yikes-easy-mc-form-restriction-start-time" value="<?php echo ! empty( $form_settings[ 'yikes-easy-mc-form-restriction-start' ] ) ? date( 'g:iA', $form_settings[ 'yikes-easy-mc-form-restriction-start' ] ) : ''; ?>" >
413 413
 																	</label>
414 414
 																	<p class="description"><?php _e( 'Set the dates that this form should display on your site.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
415 415
 																</section>
416 416
 																<!-- end Start Date Limitation Nested -->
417 417
 
418 418
 																<!-- End Date Limitation Nested -->
419
-																<section class="date-restriction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-schedule'] == '0' ) { echo ' hidden'; } ?> last">
419
+																<section class="date-restriction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-schedule' ] == '0' ) { echo ' hidden'; } ?> last">
420 420
 																	<!-- End Date -->
421
-																	<label for="yikes-easy-mc-form-restriction-end-date"><strong><?php _e( 'End Date' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
422
-																		<input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-end-date" id="yikes-easy-mc-form-restriction-end-date" value="<?php echo ! empty(  $form_settings['yikes-easy-mc-form-restriction-end'] ) ? date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings['yikes-easy-mc-form-restriction-end'] ) : ''; ?>" >
421
+																	<label for="yikes-easy-mc-form-restriction-end-date"><strong><?php _e( 'End Date', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
422
+																		<input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-end-date" id="yikes-easy-mc-form-restriction-end-date" value="<?php echo ! empty( $form_settings[ 'yikes-easy-mc-form-restriction-end' ] ) ? date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings[ 'yikes-easy-mc-form-restriction-end' ] ) : ''; ?>" >
423 423
 																		<?php _e( 'at', 'yikes-inc-easy-mailchimp-extender' ); ?>
424 424
 																	</label>
425 425
 
426 426
 																	<!-- End Time -->
427
-																	<label for="yikes-easy-mc-form-restriction-end-time"><strong><?php _e( 'End Time' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
428
-																		<input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-end-time" id="yikes-easy-mc-form-restriction-end-time" value="<?php echo ! empty( $form_settings['yikes-easy-mc-form-restriction-end'] ) ? date( 'g:iA', $form_settings['yikes-easy-mc-form-restriction-end'] ) : ''; ?>" >
427
+																	<label for="yikes-easy-mc-form-restriction-end-time"><strong><?php _e( 'End Time', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
428
+																		<input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-end-time" id="yikes-easy-mc-form-restriction-end-time" value="<?php echo ! empty( $form_settings[ 'yikes-easy-mc-form-restriction-end' ] ) ? date( 'g:iA', $form_settings[ 'yikes-easy-mc-form-restriction-end' ] ) : ''; ?>" >
429 429
 																	</label>
430 430
 																	<p class="description"><?php _e( 'Set the dates that this form should no longer display on your site.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
431 431
 
432 432
 																	<!-- Form pending message -->
433
-																	<label for="yikes-easy-mc-form-restriction-pending-message"><strong><?php _e( 'Pending Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
433
+																	<label for="yikes-easy-mc-form-restriction-pending-message"><strong><?php _e( 'Pending Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
434 434
 																		<?php
435 435
 																			wp_editor(
436
-																				$form_settings['yikes-easy-mc-form-restriction-pending-message'],
436
+																				$form_settings[ 'yikes-easy-mc-form-restriction-pending-message' ],
437 437
 																				'yikes-easy-mc-form-restriction-pending-message',
438 438
 																				array(
439 439
 																					'editor_class' => 'yikes-easy-mc-form-restriction-pending-message',
@@ -445,10 +445,10 @@  discard block
 block discarded – undo
445 445
 																	<p class="description"><?php _e( 'Set the message that should display prior to the form being active.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
446 446
 
447 447
 																	<!-- form expired message -->
448
-																	<label for="yikes-easy-mc-form-restriction-expired-message"><strong><?php _e( 'Expired Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
448
+																	<label for="yikes-easy-mc-form-restriction-expired-message"><strong><?php _e( 'Expired Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
449 449
 																		<?php
450 450
 																			wp_editor(
451
-																				$form_settings['yikes-easy-mc-form-restriction-expired-message'],
451
+																				$form_settings[ 'yikes-easy-mc-form-restriction-expired-message' ],
452 452
 																				'yikes-easy-mc-form-restriction-expired-message',
453 453
 																				array(
454 454
 																					'editor_class' => 'yikes-easy-mc-form-restriction-expired-message',
@@ -463,16 +463,16 @@  discard block
 block discarded – undo
463 463
 
464 464
 																<!-- Require Users to be Logged In -->
465 465
 																<label class="inline-form-label">
466
-																	<input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-login-required" value="1" <?php checked( $form_settings['yikes-easy-mc-form-login-required'], '1' ); ?> /><?php _e( 'Require Login', 'yikes-inc-easy-mailchimp-extender' ); ?>
466
+																	<input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-login-required" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-form-login-required' ], '1' ); ?> /><?php _e( 'Require Login', 'yikes-inc-easy-mailchimp-extender' ); ?>
467 467
 																</label>
468 468
 																<p class="description"><?php _e( 'Require users to be logged in before they can view and submit this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
469 469
 
470 470
 																<!-- Require Login Message -->
471
-																<section class="login-restriction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-login-required'] == '0' ) { echo ' hidden'; } ?>">
472
-																	<label for="yikes-easy-mc-form-restriction-login-message"><strong><?php _e( 'Required Login Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
471
+																<section class="login-restriction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-login-required' ] == '0' ) { echo ' hidden'; } ?>">
472
+																	<label for="yikes-easy-mc-form-restriction-login-message"><strong><?php _e( 'Required Login Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
473 473
 																		<?php
474 474
 																			wp_editor(
475
-																				$form_settings['yikes-easy-mc-form-restriction-login-message'],
475
+																				$form_settings[ 'yikes-easy-mc-form-restriction-login-message' ],
476 476
 																				'yikes-easy-mc-form-restriction-login-message',
477 477
 																				array(
478 478
 																					'editor_class' => 'yikes-easy-mc-form-restriction-login-message',
@@ -501,14 +501,14 @@  discard block
 block discarded – undo
501 501
 										<div id="postbox-container-1" class="postbox-container">
502 502
 											<div class="meta-box-sortables">
503 503
 												<div class="postbox yikes-easy-mc-postbox">
504
-													<h3 class="edit-form-title"><span><?php _e( "Form Settings Explained" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
504
+													<h3 class="edit-form-title"><span><?php _e( "Form Settings Explained", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
505 505
 													<div class="inside">
506 506
 
507 507
 														<ul>
508
-															<li><strong><?php _e( 'Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Add additional classes to this form, allowing you to target it more easily for customization via CSS.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
509
-															<li><strong><?php _e( 'Form Layout' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Toggle the layout of this form between single column and an inline layout. The inline layout places all of your form fields and the submit button on a single line.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
510
-															<li><strong><?php _e( 'Submit Button' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust setting specific to the submit button. Change the submit button text, or set it to a specified image. Use the "Submit Button Classes" to  assign additional classes to your submit button - ensuring it fits better into your theme.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
511
-															<li><strong><?php _e( 'Form Restrictions' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust the restrictions for this form. Limit form visibility to a given time period, require users to be logged in to sign up or combine the two!' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
508
+															<li><strong><?php _e( 'Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Add additional classes to this form, allowing you to target it more easily for customization via CSS.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
509
+															<li><strong><?php _e( 'Form Layout', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Toggle the layout of this form between single column and an inline layout. The inline layout places all of your form fields and the submit button on a single line.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
510
+															<li><strong><?php _e( 'Submit Button', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust setting specific to the submit button. Change the submit button text, or set it to a specified image. Use the "Submit Button Classes" to  assign additional classes to your submit button - ensuring it fits better into your theme.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
511
+															<li><strong><?php _e( 'Form Restrictions', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust the restrictions for this form. Limit form visibility to a given time period, require users to be logged in to sign up or combine the two!', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
512 512
 														</ul>
513 513
 
514 514
 													</div>
@@ -536,78 +536,78 @@  discard block
 block discarded – undo
536 536
 										<div id="post-body-content">
537 537
 											<div class="meta-box-sortables ui-sortable">
538 538
 												<div class="postbox yikes-easy-mc-postbox">
539
-													<h3 class="edit-form-title"><span><?php _e( "Custom Messages" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
539
+													<h3 class="edit-form-title"><span><?php _e( "Custom Messages", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
540 540
 
541 541
 													<div class="inside error-message-container">
542 542
 														<?php
543 543
 															// build our default options
544 544
 															$error_message_array = array(
545
-																'success' => __( 'Thank You for subscribing! Check your email for the confirmation message.' , 'yikes-inc-easy-mailchimp-extender' ),
546
-																'success-single-optin' => __( 'Thank you for subscribing!' , 'yikes-inc-easy-mailchimp-extender' ),
545
+																'success' => __( 'Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender' ),
546
+																'success-single-optin' => __( 'Thank you for subscribing!', 'yikes-inc-easy-mailchimp-extender' ),
547 547
 																'success-resubscribed' => __( 'Thank you for already being a subscriber! Your profile info has been updated.', 'yikes-inc-easy-mailchimp-extender' ),
548
-																'general-error' => __( "Whoops! It looks like something went wrong. Please try again." , 'yikes-inc-easy-mailchimp-extender' ),
549
-																'email-exists-error' => __( "The email you entered is already a subscriber to this list." , 'yikes-inc-easy-mailchimp-extender' ),
548
+																'general-error' => __( "Whoops! It looks like something went wrong. Please try again.", 'yikes-inc-easy-mailchimp-extender' ),
549
+																'email-exists-error' => __( "The email you entered is already a subscriber to this list.", 'yikes-inc-easy-mailchimp-extender' ),
550 550
 																'update-link' => __( "You're already subscribed. To update your MailChimp profile, please [link]click to send yourself an update link[/link].", 'yikes-inc-easy-mailchimp-extender' ),
551 551
 																'email-subject' => __( 'MailChimp Profile Update', 'yikes-inc-easy-mailchimp-extender' ),
552 552
 																'update-email-success' => sprintf( __( '%s Update email successfully sent. Please check your inbox for the message.', 'yikes-inc-easy-mailchimp-extender' ), '&#10004;' ),
553 553
 																'update-email-failure' => sprintf( __( '%s Email failed to send. Please contact the site administrator.', 'yikes-inc-easy-mailchimp-extender' ), '&#10005;' ),
554 554
 
555 555
 															);
556
-															$global_error_messages = get_option( 'yikes-easy-mc-global-error-messages' , $error_message_array );
556
+															$global_error_messages = get_option( 'yikes-easy-mc-global-error-messages', $error_message_array );
557 557
 														?>
558
-														<p class="edit-form-description"><?php _e( "Customize the response messages for this form. Leave the field blank to use the default message. The messages shown below depend on the Opt-in Settings chosen." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
558
+														<p class="edit-form-description"><?php _e( "Customize the response messages for this form. Leave the field blank to use the default message. The messages shown below depend on the Opt-in Settings chosen.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
559 559
 
560 560
 														<!-- Success Message (refactored @ 6.3.0 for double optin) -->
561
-														<label for="yikes-easy-mc-success-message"><strong><?php _e( 'Success: Double opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
562
-															<input type="text" class="widefat" name="yikes-easy-mc-success-message" id="yikes-easy-mc-success-message" value="<?php echo isset( $error_messages['success'] ) ? stripslashes( esc_html( $error_messages['success'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success']; ?>" >
561
+														<label for="yikes-easy-mc-success-message"><strong><?php _e( 'Success: Double opt-in', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
562
+															<input type="text" class="widefat" name="yikes-easy-mc-success-message" id="yikes-easy-mc-success-message" value="<?php echo isset( $error_messages[ 'success' ] ) ? stripslashes( esc_html( $error_messages[ 'success' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'success' ]; ?>" >
563 563
 														</label>
564 564
 														<!-- Success Message (for single optin) -->
565
-														<label for="yikes-easy-mc-success-single-optin-message"><strong><?php _e( 'Success: Single opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
566
-															<input type="text" class="widefat" name="yikes-easy-mc-success-single-optin-message" id="yikes-easy-mc-success-single-optin-message" value="<?php echo isset( $error_messages['success-single-optin'] ) ? stripslashes( esc_html( $error_messages['success-single-optin'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success-single-optin']; ?>" >
565
+														<label for="yikes-easy-mc-success-single-optin-message"><strong><?php _e( 'Success: Single opt-in', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
566
+															<input type="text" class="widefat" name="yikes-easy-mc-success-single-optin-message" id="yikes-easy-mc-success-single-optin-message" value="<?php echo isset( $error_messages[ 'success-single-optin' ] ) ? stripslashes( esc_html( $error_messages[ 'success-single-optin' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'success-single-optin' ]; ?>" >
567 567
 														</label>
568 568
 														<!-- Resubscribing users when updating your profile via the form is allowed -->
569
-														<label for="yikes-easy-mc-user-resubscribed-success-message"><strong><?php _e( 'Success: Re-subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
570
-															<input type="text" class="widefat" name="yikes-easy-mc-user-resubscribed-success-message" id="yikes-easy-mc-user-resubscribed-success-message" value="<?php echo isset( $error_messages['success-resubscribed'] ) ? stripslashes( esc_html( $error_messages['success-resubscribed'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success-resubscribed']; ?>">
569
+														<label for="yikes-easy-mc-user-resubscribed-success-message"><strong><?php _e( 'Success: Re-subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
570
+															<input type="text" class="widefat" name="yikes-easy-mc-user-resubscribed-success-message" id="yikes-easy-mc-user-resubscribed-success-message" value="<?php echo isset( $error_messages[ 'success-resubscribed' ] ) ? stripslashes( esc_html( $error_messages[ 'success-resubscribed' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'success-resubscribed' ]; ?>">
571 571
 														</label>
572 572
 
573 573
 														<!-- Click the link to update user profile etc. etc. -->
574
-														<label for="yikes-easy-mc-user-subscribed-update-link"><strong><?php _e( 'Success: Re-subscriber with link to email profile update message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
575
-															<input type="text" class="widefat" name="yikes-easy-mc-user-update-link" id="yikes-easy-mc-user-update-link" value="<?php echo isset( $error_messages['update-link'] ) ? stripslashes( esc_html( $error_messages['update-link'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['update-link']; ?>">
574
+														<label for="yikes-easy-mc-user-subscribed-update-link"><strong><?php _e( 'Success: Re-subscriber with link to email profile update message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
575
+															<input type="text" class="widefat" name="yikes-easy-mc-user-update-link" id="yikes-easy-mc-user-update-link" value="<?php echo isset( $error_messages[ 'update-link' ] ) ? stripslashes( esc_html( $error_messages[ 'update-link' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'update-link' ]; ?>">
576 576
 														</label>
577 577
 
578 578
 														<!-- Email Address is already subscribed -->
579
-														<label for="yikes-easy-mc-user-subscribed-message"><strong><?php _e( 'Error: Re-subscribers not permitted' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
580
-															<input type="text" class="widefat" name="yikes-easy-mc-user-subscribed-message" id="yikes-easy-mc-user-subscribed-message" value="<?php echo isset( $error_messages['already-subscribed'] ) ? stripslashes( esc_html( $error_messages['already-subscribed'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['email-exists-error']; ?>">
579
+														<label for="yikes-easy-mc-user-subscribed-message"><strong><?php _e( 'Error: Re-subscribers not permitted', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
580
+															<input type="text" class="widefat" name="yikes-easy-mc-user-subscribed-message" id="yikes-easy-mc-user-subscribed-message" value="<?php echo isset( $error_messages[ 'already-subscribed' ] ) ? stripslashes( esc_html( $error_messages[ 'already-subscribed' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'email-exists-error' ]; ?>">
581 581
 														</label>
582 582
 
583 583
 														<!-- Update email successfully sent -->
584
-														<label for="yikes-easy-mc-update-email-successful"><strong><?php _e( 'Success: Update email successfully sent' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
585
-															<input type="text" class="widefat" name="yikes-easy-mc-update-email-successful" id="yikes-easy-mc-update-email-successful" value="<?php echo isset( $error_messages['update-email-success'] ) ? stripslashes( esc_attr( $error_messages['update-email-success'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['update-email-success']; ?>" >
584
+														<label for="yikes-easy-mc-update-email-successful"><strong><?php _e( 'Success: Update email successfully sent', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
585
+															<input type="text" class="widefat" name="yikes-easy-mc-update-email-successful" id="yikes-easy-mc-update-email-successful" value="<?php echo isset( $error_messages[ 'update-email-success' ] ) ? stripslashes( esc_attr( $error_messages[ 'update-email-success' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'update-email-success' ]; ?>" >
586 586
 														</label>
587 587
 
588 588
 														<!-- Update email failed to send -->
589
-														<label for="yikes-easy-mc-update-email-failure"><strong><?php _e( 'Error: Update email failed to send' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
590
-															<input type="text" class="widefat" name="yikes-easy-mc-update-email-failure" id="yikes-easy-mc-update-email-failure" value="<?php echo isset( $error_messages['update-email-failure'] ) ? stripslashes( esc_attr( $error_messages['update-email-failure'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['update-email-failure']; ?>" >
589
+														<label for="yikes-easy-mc-update-email-failure"><strong><?php _e( 'Error: Update email failed to send', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
590
+															<input type="text" class="widefat" name="yikes-easy-mc-update-email-failure" id="yikes-easy-mc-update-email-failure" value="<?php echo isset( $error_messages[ 'update-email-failure' ] ) ? stripslashes( esc_attr( $error_messages[ 'update-email-failure' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'update-email-failure' ]; ?>" >
591 591
 														</label>
592 592
 
593 593
 														<!-- General Error Message -->
594
-														<label for="yikes-easy-mc-general-error-message"><strong><?php _e( 'Error: General' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
595
-															<input type="text" class="widefat" name="yikes-easy-mc-general-error-message" id="yikes-easy-mc-general-error-message" value="<?php echo isset( $error_messages['general-error'] ) ? stripslashes( esc_html( $error_messages['general-error'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['general-error']; ?>" >
594
+														<label for="yikes-easy-mc-general-error-message"><strong><?php _e( 'Error: General', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
595
+															<input type="text" class="widefat" name="yikes-easy-mc-general-error-message" id="yikes-easy-mc-general-error-message" value="<?php echo isset( $error_messages[ 'general-error' ] ) ? stripslashes( esc_html( $error_messages[ 'general-error' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'general-error' ]; ?>" >
596 596
 														</label>
597 597
 
598 598
 														<!-- Email Section -->
599 599
 
600 600
 														<hr>
601 601
 														<div class="yikes-easy-mc-custom-messages-email-section">
602
-															<p class="edit-form-description"><?php _e( 'Customize the profile verification email sent to re-subscribers. Leave the text unedited to use the default message.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
602
+															<p class="edit-form-description"><?php _e( 'Customize the profile verification email sent to re-subscribers. Leave the text unedited to use the default message.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
603 603
 															<!-- Email Subject -->
604
-															<label for="yikes-easy-mc-user-email-subject"><strong><?php _e( 'Email Subject' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
605
-																<input type="text" class="widefat" name="yikes-easy-mc-user-email-subject" id="yikes-easy-mc-user-email-subject" value="<?php echo isset( $error_messages['email-subject'] ) ? stripslashes( esc_html( $error_messages['email-subject'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['email-subject']; ?>">
604
+															<label for="yikes-easy-mc-user-email-subject"><strong><?php _e( 'Email Subject', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
605
+																<input type="text" class="widefat" name="yikes-easy-mc-user-email-subject" id="yikes-easy-mc-user-email-subject" value="<?php echo isset( $error_messages[ 'email-subject' ] ) ? stripslashes( esc_html( $error_messages[ 'email-subject' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'email-subject' ]; ?>">
606 606
 															</label>
607 607
 															<!-- Email Body -->
608
-															<label for="yikes-easy-mc-user-email-body"><strong><?php _e( 'Email Body' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
608
+															<label for="yikes-easy-mc-user-email-body"><strong><?php _e( 'Email Body', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
609 609
 																<?php 
610
-																	$editor_content = ( isset( $error_messages['email-body'] ) && ! empty( $error_messages['email-body'] ) ) ? $error_messages['email-body'] : Yikes_Inc_Easy_Mailchimp_Forms_Admin::generate_default_email_body();
610
+																	$editor_content = ( isset( $error_messages[ 'email-body' ] ) && ! empty( $error_messages[ 'email-body' ] ) ) ? $error_messages[ 'email-body' ] : Yikes_Inc_Easy_Mailchimp_Forms_Admin::generate_default_email_body();
611 611
 																	wp_editor( $editor_content, 'yikes-easy-mc-user-email-body', array( 'textarea_id' => 'yikes-easy-mc-user-email-body' ) ); 
612 612
 																?>
613 613
 															</label>
@@ -625,17 +625,17 @@  discard block
 block discarded – undo
625 625
 										<div id="postbox-container-1" class="postbox-container yikes-easy-mc-custom-messages-section-help">
626 626
 											<div class="meta-box-sortables">
627 627
 												<div class="postbox yikes-easy-mc-postbox">
628
-													<h3 class="edit-form-title"><span><?php _e( "Custom Message Help" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
628
+													<h3 class="edit-form-title"><span><?php _e( "Custom Message Help", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
629 629
 													<div class="inside">
630 630
 														<ul>
631
-															<li class="yikes-easy-mc-success-message-help"><strong><?php _e( 'Success: Double opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a double opt-in form has been submitted.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
632
-															<li class="yikes-easy-mc-success-single-optin-message-help"><strong><?php _e( 'Success Message: Single opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a single opt-in form has been submitted.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
633
-															<li class="yikes-easy-mc-user-resubscribed-success-message-help"><strong><?php _e( 'Success: Re-subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a subscriber submits a form for a list they are already subscribed to.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
634
-															<li class="yikes-easy-mc-user-subscribed-update-link-help"><strong><?php _e( 'Success: Re-subscriber with link to email profile update message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a subscriber submits a form for a list they are already subscribed to. Wrap the text you want to be the link in <code>[link][/link]</code> tags.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
635
-															<li class="yikes-easy-mc-update-email-successful-help"><strong><?php _e( 'Success: Update email successfully sent', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after an update profile email is successfully sent.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
636
-															<li class="yikes-easy-mc-update-email-failure-help"><strong><?php _e( 'Error: Update email failed to send' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after an update profile email failed to send.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
637
-															<li class="yikes-easy-mc-user-subscribed-message-help"><strong><?php _e( 'Error: Re-subscribers not permitted' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a subscriber tries to join a list they are already subscribed to. You can display the user\'s email in the message  using an <code>[email]</code> tag.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
638
-															<li class="yikes-easy-mc-general-error-message-help"><strong><?php _e( 'Error: General' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed if a form error has occurred.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
631
+															<li class="yikes-easy-mc-success-message-help"><strong><?php _e( 'Success: Double opt-in', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a double opt-in form has been submitted.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
632
+															<li class="yikes-easy-mc-success-single-optin-message-help"><strong><?php _e( 'Success Message: Single opt-in', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a single opt-in form has been submitted.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
633
+															<li class="yikes-easy-mc-user-resubscribed-success-message-help"><strong><?php _e( 'Success: Re-subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a subscriber submits a form for a list they are already subscribed to.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
634
+															<li class="yikes-easy-mc-user-subscribed-update-link-help"><strong><?php _e( 'Success: Re-subscriber with link to email profile update message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a subscriber submits a form for a list they are already subscribed to. Wrap the text you want to be the link in <code>[link][/link]</code> tags.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
635
+															<li class="yikes-easy-mc-update-email-successful-help"><strong><?php _e( 'Success: Update email successfully sent', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after an update profile email is successfully sent.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
636
+															<li class="yikes-easy-mc-update-email-failure-help"><strong><?php _e( 'Error: Update email failed to send', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after an update profile email failed to send.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
637
+															<li class="yikes-easy-mc-user-subscribed-message-help"><strong><?php _e( 'Error: Re-subscribers not permitted', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a subscriber tries to join a list they are already subscribed to. You can display the user\'s email in the message  using an <code>[email]</code> tag.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
638
+															<li class="yikes-easy-mc-general-error-message-help"><strong><?php _e( 'Error: General', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed if a form error has occurred.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
639 639
 														</ul>
640 640
 
641 641
 													</div>
@@ -643,12 +643,12 @@  discard block
 block discarded – undo
643 643
 												</div>
644 644
 
645 645
 												<div class="postbox yikes-easy-mc-postbox yikes-easy-mc-custom-messages-email-section-help">
646
-													<h3 class="edit-form-title"><span><?php _e( "Email Message Help" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
646
+													<h3 class="edit-form-title"><span><?php _e( "Email Message Help", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
647 647
 													<div class="inside">
648 648
 
649 649
 														<ul>
650
-															<li class="yikes-easy-mc-user-email-subject-help"><strong><?php _e( 'Email Subject' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The subject of the email sent to the user.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
651
-															<li class="yikes-easy-mc-user-email-body-help"><strong><?php _e( 'Email Body' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php echo sprintf( __( 'The text in the profile update verification email sent to the subscriber. Wrap the text you want to be the link in <code>[link][/link]</code> tags. The link is required in the email, please don\'t leave these tags out. You can also use <code>[url]</code> tag to display your website\'s URL (e.g. %s).', 'yikes-inc-easy-mailchimp-extender' ), get_home_url() ); ?></li>
650
+															<li class="yikes-easy-mc-user-email-subject-help"><strong><?php _e( 'Email Subject', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The subject of the email sent to the user.', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
651
+															<li class="yikes-easy-mc-user-email-body-help"><strong><?php _e( 'Email Body', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php echo sprintf( __( 'The text in the profile update verification email sent to the subscriber. Wrap the text you want to be the link in <code>[link][/link]</code> tags. The link is required in the email, please don\'t leave these tags out. You can also use <code>[url]</code> tag to display your website\'s URL (e.g. %s).', 'yikes-inc-easy-mailchimp-extender' ), get_home_url() ); ?></li>
652 652
 														</ul>
653 653
 
654 654
 													</div>
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 							</label>
673 673
 							<!-- End Error Messages -->
674 674
 
675
-							<?php do_action( 'yikes-mailchimp-edit-form-sections' , $form ); ?>
675
+							<?php do_action( 'yikes-mailchimp-edit-form-sections', $form ); ?>
676 676
 
677 677
 						</div>
678 678
 						<!-- .inside -->
@@ -687,103 +687,103 @@  discard block
 block discarded – undo
687 687
 			<div id="postbox-container-1" class="postbox-container  yikes-easy-forms-sidebar">
688 688
 				<div class="meta-box-sortables">
689 689
 					<div class="postbox yikes-easy-mc-postbox">
690
-						<h3><span><?php _e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
690
+						<h3><span><?php _e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
691 691
 
692 692
 						<div class="inside">
693 693
 								<p class="inside-section-1">
694
-									<label for="shortcode"><?php _e( 'Edit Another Form' , 'yikes-inc-easy-mailchimp-extender' ); ?><br />
694
+									<label for="shortcode"><?php _e( 'Edit Another Form', 'yikes-inc-easy-mailchimp-extender' ); ?><br />
695 695
 										<select class="widefat" name="form_switcher" id="form_switcher" onchange="YIKES_Easy_MC_SwitchForm(jQuery(this).val());">
696
-											<?php foreach( $all_forms as $single_form ) { ?>
697
-												<option <?php selected( $form_id , $single_form['id'] ); ?>value="<?php echo $single_form['id']; ?>"><?php echo $single_form['form_name']; ?></option>
696
+											<?php foreach ( $all_forms as $single_form ) { ?>
697
+												<option <?php selected( $form_id, $single_form[ 'id' ] ); ?>value="<?php echo $single_form[ 'id' ]; ?>"><?php echo $single_form[ 'form_name' ]; ?></option>
698 698
 											<?php } ?>
699 699
 										</select>
700 700
 									</label>
701 701
 								</p>
702 702
 
703 703
 								<p class="inside-section-2">
704
-									<label for="shortcode"><?php _e( 'Shortcode' , 'yikes-inc-easy-mailchimp-extender' ); ?><br />
705
-										<input type="text" onclick="this.setSelectionRange(0, this.value.length)" class="widefat shortcode-input-field" readonly value='[yikes-mailchimp form="<?php echo $form['id']; ?>"]' />
704
+									<label for="shortcode"><?php _e( 'Shortcode', 'yikes-inc-easy-mailchimp-extender' ); ?><br />
705
+										<input type="text" onclick="this.setSelectionRange(0, this.value.length)" class="widefat shortcode-input-field" readonly value='[yikes-mailchimp form="<?php echo $form[ 'id' ]; ?>"]' />
706 706
 									</label>
707 707
 								</p>
708 708
 
709 709
 
710 710
 							<a href="#" class="expansion-section-title settings-sidebar">
711
-								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php _e( 'Associated List Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>
711
+								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php _e( 'Associated List Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>
712 712
 							</a>
713 713
 							<div class="yikes-mc-settings-expansion-section">
714 714
 								<!-- Associated List -->
715 715
 								<p class="form-field-container">
716 716
 									<!-- necessary to prevent skipping on slideToggle(); -->
717
-									<label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
717
+									<label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
718 718
 										<select name="associated-list" id="associated-list" <?php if ( empty( $list_data ) ) { echo 'disabled="disabled"'; } ?> onchange="jQuery('.view-list-link').attr( 'href', '<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' ) ); ?>' + jQuery( this ).val() );">
719 719
 											<?php
720 720
 											if ( ! empty( $list_data ) ) {
721
-												foreach( $list_data as $mailing_list ) {
721
+												foreach ( $list_data as $mailing_list ) {
722 722
 													?>
723
-													<option <?php selected( $form['list_id'] , $mailing_list['id'] ); ?> value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
723
+													<option <?php selected( $form[ 'list_id' ], $mailing_list[ 'id' ] ); ?> value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option>
724 724
 													<?php
725 725
 												}
726 726
 											} else {
727 727
 												?>
728
-												<option value="no-forms"><?php _e( 'No Lists Found' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
728
+												<option value="no-forms"><?php _e( 'No Lists Found', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
729 729
 												<?php
730 730
 											}
731 731
 											?>
732 732
 										</select>
733
-										<?php if( ! empty( $form['list_id'] ) ) { ?>
733
+										<?php if ( ! empty( $form[ 'list_id' ] ) ) { ?>
734 734
 											<p class="description view-list">
735
-												<a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $form['list_id'] ) ); ?>" class="view-list-link"><?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
735
+												<a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $form[ 'list_id' ] ) ); ?>" class="view-list-link"><?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
736 736
 											</p>
737 737
 											<p class="description">
738
-												<?php _e( "Users who sign up via this form will be added to the list selected above." , 'yikes-inc-easy-mailchimp-extender' ); ?>
738
+												<?php _e( "Users who sign up via this form will be added to the list selected above.", 'yikes-inc-easy-mailchimp-extender' ); ?>
739 739
 											</p>
740 740
 										<?php } else { ?>
741 741
 											<p class="description">
742
-												<?php _e( "It looks like you first need to create a list to assign this form to. Head over to" , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" title="<?php _e( 'Create a new list' , 'yikes-inc-easy-mailchimp-extender' ); ?>">MailChimp</a> <?php _e( 'to create your first list' , 'yikes-inc-easy-mailchimp-extender' ); ?>.
742
+												<?php _e( "It looks like you first need to create a list to assign this form to. Head over to", 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" title="<?php _e( 'Create a new list', 'yikes-inc-easy-mailchimp-extender' ); ?>">MailChimp</a> <?php _e( 'to create your first list', 'yikes-inc-easy-mailchimp-extender' ); ?>.
743 743
 											</p>
744 744
 										<?php } ?>
745 745
 
746 746
 										<!-- Display our Clear API Cache button -->
747 747
 										<?php if ( false === get_transient( 'yikes-easy-mailchimp-list-data' ) && false === get_transient( 'yikes-easy-mailchimp-profile-data' ) && false === get_transient( 'yikes-easy-mailchimp-account-data' ) && false === get_transient( 'yikesinc_eme_list_ids' ) && false === get_transient( 'yikes_eme_lists' ) ) { ?>
748
-											<p><a href="#" class="button-secondary" disabled="disabled" title="<?php _e( 'No MailChimp data found in temporary cache storage.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
748
+											<p><a href="#" class="button-secondary" disabled="disabled" title="<?php _e( 'No MailChimp data found in temporary cache storage.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Clear MailChimp API Cache', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
749 749
 										<?php } else { ?>
750
-											<p><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data' , 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" class="button-primary"><?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
750
+											<p><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data', 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" class="button-primary"><?php _e( 'Clear MailChimp API Cache', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
751 751
 										<?php } ?>
752 752
 									</label>
753 753
 								</p>
754 754
 							</div>
755 755
 
756 756
 							<a href="#" class="expansion-section-title settings-sidebar">
757
-								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php _e( 'Opt-in Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>
757
+								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php _e( 'Opt-in Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>
758 758
 							</a>
759 759
 							<div class="yikes-mc-settings-expansion-section">
760 760
 
761 761
 								<!-- Single or Double Opt-in -->
762 762
 								<?php
763
-									if( !isset( $optin_settings['optin'] ) ) {
764
-										$optin_settings['optin'] = '1';
763
+									if ( ! isset( $optin_settings[ 'optin' ] ) ) {
764
+										$optin_settings[ 'optin' ] = '1';
765 765
 									}
766 766
 								?>
767
-								<p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="single-double-optin"><strong><?php _e( 'Single or Double Opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
767
+								<p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="single-double-optin"><strong><?php _e( 'Single or Double Opt-in', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
768 768
 									<span class="edit-form-field-container-span">
769
-										<label for="single"><input id="single" type="radio" name="single-double-optin" value="0" <?php checked( $optin_settings['optin'] , '0' ); ?>><?php _e( 'Single' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
770
-										&nbsp;<label for="double"><input id="double" type="radio" name="single-double-optin" value="1" <?php checked( $optin_settings['optin'] , '1' ); ?>><?php _e( 'Double' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
769
+										<label for="single"><input id="single" type="radio" name="single-double-optin" value="0" <?php checked( $optin_settings[ 'optin' ], '0' ); ?>><?php _e( 'Single', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
770
+										&nbsp;<label for="double"><input id="double" type="radio" name="single-double-optin" value="1" <?php checked( $optin_settings[ 'optin' ], '1' ); ?>><?php _e( 'Double', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
771 771
 									</span>
772
-									<p class="description"><?php _e( "Double opt-in requires users to confirm their email address before being added to a list (recommended)" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
772
+									<p class="description"><?php _e( "Double opt-in requires users to confirm their email address before being added to a list (recommended)", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
773 773
 								</label></p>
774 774
 
775 775
 								<!-- Update Existing Users -->
776 776
 								<?php
777
-									if( !isset( $optin_settings['update_existing_user'] ) ) {
778
-										$optin_settings['update_existing_user'] = '1';
777
+									if ( ! isset( $optin_settings[ 'update_existing_user' ] ) ) {
778
+										$optin_settings[ 'update_existing_user' ] = '1';
779 779
 									}
780 780
 								?>
781
-								<p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Update Existing Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
781
+								<p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Update Existing Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
782 782
 									<span class="form-field-container-span">
783
-										<label for="update-user"><input type="radio" id="update-user" onchange="toggleUpdateEmailContainer(this);return false;" name="update-existing-user" value="1" <?php checked( $optin_settings['update_existing_user'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
784
-										&nbsp;<label for="do-not-update-user"><input type="radio" onchange="toggleUpdateEmailContainer(this);return false;" id="do-not-update-user"  name="update-existing-user" value="0" <?php checked( $optin_settings['update_existing_user'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
783
+										<label for="update-user"><input type="radio" id="update-user" onchange="toggleUpdateEmailContainer(this);return false;" name="update-existing-user" value="1" <?php checked( $optin_settings[ 'update_existing_user' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
784
+										&nbsp;<label for="do-not-update-user"><input type="radio" onchange="toggleUpdateEmailContainer(this);return false;" id="do-not-update-user"  name="update-existing-user" value="0" <?php checked( $optin_settings[ 'update_existing_user' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
785 785
 									</span>
786
-									<p class="description"><?php printf( __( "Update an existing subscriber's profile information instead of displaying a %s message." , "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></p>
786
+									<p class="description"><?php printf( __( "Update an existing subscriber's profile information instead of displaying a %s message.", "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></p>
787 787
 								</label></p>
788 788
 
789 789
 								<!--
@@ -792,101 +792,101 @@  discard block
 block discarded – undo
792 792
 									- No = Just update the user profile without an email
793 793
 								-->
794 794
 								<?php
795
-									$send_update_email = ( isset( $optin_settings['send_update_email'] ) && '' !== $optin_settings['send_update_email'] ) ? $optin_settings['send_update_email'] : 0;
795
+									$send_update_email = ( isset( $optin_settings[ 'send_update_email' ] ) && '' !== $optin_settings[ 'send_update_email' ] ) ? $optin_settings[ 'send_update_email' ] : 0;
796 796
 								?>
797
-								<p class="form-field-container send-update-email" <?php if ( 1 !== absint( $optin_settings['update_existing_user'] ) ) { ?>style="display:none;"<?php } ?>><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Send Update Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
797
+								<p class="form-field-container send-update-email" <?php if ( 1 !== absint( $optin_settings[ 'update_existing_user' ] ) ) { ?>style="display:none;"<?php } ?>><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Send Update Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
798 798
 									<span class="form-field-container-span">
799
-										<label for="update-email"><input type="radio" id="update-email" name="update-existing-email" value="1" <?php checked( $send_update_email , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
800
-										&nbsp;<label for="do-not-update-email"><input type="radio" id="do-not-update-email"  name="update-existing-email" value="0" <?php checked( $send_update_email , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
799
+										<label for="update-email"><input type="radio" id="update-email" name="update-existing-email" value="1" <?php checked( $send_update_email, '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
800
+										&nbsp;<label for="do-not-update-email"><input type="radio" id="do-not-update-email"  name="update-existing-email" value="0" <?php checked( $send_update_email, '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
801 801
 									</span>
802
-									<em><?php printf( __( "Send an email to the user granting their permission to update their profile information. Otherwise, an existing subscriber filling out this form, will have their profile information updated without any further interaction." , "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></em>
802
+									<em><?php printf( __( "Send an email to the user granting their permission to update their profile information. Otherwise, an existing subscriber filling out this form, will have their profile information updated without any further interaction.", "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></em>
803 803
 								</label></p>
804 804
 
805 805
 							</div>
806 806
 
807 807
 							<a href="#" class="expansion-section-title settings-sidebar">
808
-								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php _e( 'Submission Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>
808
+								<span class="dashicons dashicons-plus yikes-mc-expansion-toggle"></span><?php _e( 'Submission Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>
809 809
 							</a>
810 810
 							<div class="yikes-mc-settings-expansion-section">
811 811
 								<!-- AJAX form Submission -->
812 812
 								<?php
813
-									if( !isset( $submission_settings['ajax'] ) ) {
814
-										$submission_settings['ajax'] = '1';
813
+									if ( ! isset( $submission_settings[ 'ajax' ] ) ) {
814
+										$submission_settings[ 'ajax' ] = '1';
815 815
 									}
816 816
 								?>
817
-								<p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="form-ajax-submission"><strong><?php _e( 'Enable AJAX Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
817
+								<p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="form-ajax-submission"><strong><?php _e( 'Enable AJAX Submission', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
818 818
 									<span class="form-field-container-span">
819
-										<label for="enable-ajax"><input type="radio" id="enable-ajax" name="form-ajax-submission" class="yikes-enable-disable-ajax" value="1" <?php checked( $submission_settings['ajax'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
820
-										&nbsp;<label for="disable-ajax"><input type="radio" id="disable-ajax"  name="form-ajax-submission" class="yikes-enable-disable-ajax" value="0" <?php checked( $submission_settings['ajax'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
819
+										<label for="enable-ajax"><input type="radio" id="enable-ajax" name="form-ajax-submission" class="yikes-enable-disable-ajax" value="1" <?php checked( $submission_settings[ 'ajax' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
820
+										&nbsp;<label for="disable-ajax"><input type="radio" id="disable-ajax"  name="form-ajax-submission" class="yikes-enable-disable-ajax" value="0" <?php checked( $submission_settings[ 'ajax' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
821 821
 									</span>
822
-									<p class="description"><?php _e( "AJAX form submissions transmit data without requiring the page to refresh." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
822
+									<p class="description"><?php _e( "AJAX form submissions transmit data without requiring the page to refresh.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
823 823
 								</label></p>
824 824
 
825 825
 								<!-- Redirect User On Submission -->
826 826
 								<?php
827
-									if( !isset( $submission_settings['redirect_on_submission'] ) ) {
828
-										$submission_settings['redirect_on_submission'] = '0';
829
-										$submission_settings['redirect_page'] = '';
827
+									if ( ! isset( $submission_settings[ 'redirect_on_submission' ] ) ) {
828
+										$submission_settings[ 'redirect_on_submission' ] = '0';
829
+										$submission_settings[ 'redirect_page' ] = '';
830 830
 									}
831 831
 								?>
832
-								<p><label for="redirect-user-on-submission"><strong><?php _e( 'Redirect On Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
832
+								<p><label for="redirect-user-on-submission"><strong><?php _e( 'Redirect On Submission', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
833 833
 									<span class="form-field-container-span">
834
-										<label for="redirect-user"><input type="radio" id="redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="1" <?php checked( $submission_settings['redirect_on_submission'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
835
-										&nbsp;<label for="do-not-redirect-user"><input type="radio" id="do-not-redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="0" <?php checked( $submission_settings['redirect_on_submission'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
834
+										<label for="redirect-user"><input type="radio" id="redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="1" <?php checked( $submission_settings[ 'redirect_on_submission' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
835
+										&nbsp;<label for="do-not-redirect-user"><input type="radio" id="do-not-redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="0" <?php checked( $submission_settings[ 'redirect_on_submission' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
836 836
 									</span>
837
-									<?php $this->generate_page_redirect_dropdown( $submission_settings['redirect_on_submission'] , $submission_settings['redirect_page'], ( isset( $submission_settings['custom_redirect_url'] ) ) ? esc_url( $submission_settings['custom_redirect_url'] ) : '' ); ?>
838
-									<p class="description"><?php _e( "When the user signs up would you like to redirect them to another page?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
837
+									<?php $this->generate_page_redirect_dropdown( $submission_settings[ 'redirect_on_submission' ], $submission_settings[ 'redirect_page' ], ( isset( $submission_settings[ 'custom_redirect_url' ] ) ) ? esc_url( $submission_settings[ 'custom_redirect_url' ] ) : '' ); ?>
838
+									<p class="description"><?php _e( "When the user signs up would you like to redirect them to another page?", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
839 839
 								</label></p>
840 840
 
841 841
 								<?php
842
-									if ( ! isset( $submission_settings['redirect_new_window'] ) ) {
843
-										$submission_settings['redirect_new_window'] = '0';
842
+									if ( ! isset( $submission_settings[ 'redirect_new_window' ] ) ) {
843
+										$submission_settings[ 'redirect_new_window' ] = '0';
844 844
 									}
845 845
 								?>
846 846
 
847 847
 								<!-- Option to open the redirect URL in a new window -->
848
-								<div class="redirect-new-window-div" <?php if ( ( ! isset( $submission_settings['redirect_on_submission'] ) || $submission_settings['redirect_on_submission'] === '0' ) || ( ! isset( $submission_settings['ajax'] ) || $submission_settings['ajax'] !== '1' )  ) { echo 'style="display:none;"'; } ?>>
849
-										<p><strong><?php _e( "Open Redirect URL in a New Window" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
848
+								<div class="redirect-new-window-div" <?php if ( ( ! isset( $submission_settings[ 'redirect_on_submission' ] ) || $submission_settings[ 'redirect_on_submission' ] === '0' ) || ( ! isset( $submission_settings[ 'ajax' ] ) || $submission_settings[ 'ajax' ] !== '1' ) ) { echo 'style="display:none;"'; } ?>>
849
+										<p><strong><?php _e( "Open Redirect URL in a New Window", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
850 850
 										<label for="redirect-new-window-yes">
851
-											<input type="radio" class="widefat custom-redirect-new-window" id="redirect-new-window-yes" name="redirect_new_window" value="1" <?php checked( $submission_settings['redirect_new_window'], '1' ); ?>/><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
851
+											<input type="radio" class="widefat custom-redirect-new-window" id="redirect-new-window-yes" name="redirect_new_window" value="1" <?php checked( $submission_settings[ 'redirect_new_window' ], '1' ); ?>/><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?>
852 852
 										</label>
853 853
 										&nbsp;
854 854
 										<label for="redirect-new-window-no">
855
-											<input type="radio" class="widefat redirect-new-window" id="redirect-new-window-no" name="redirect_new_window" value="0" <?php checked( $submission_settings['redirect_new_window'] , '0' ); ?>/><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?>
855
+											<input type="radio" class="widefat redirect-new-window" id="redirect-new-window-no" name="redirect_new_window" value="0" <?php checked( $submission_settings[ 'redirect_new_window' ], '0' ); ?>/><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?>
856 856
 										</label>
857
-										<p class="description"><?php _e( "Should the redirect URL open in a new window/tab?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
857
+										<p class="description"><?php _e( "Should the redirect URL open in a new window/tab?", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
858 858
 								</div>
859 859
 
860 860
 								<!-- Hide Form On Submission -->
861 861
 								<?php
862
-									if( !isset( $submission_settings['hide_form_post_signup'] ) ) {
863
-										$submission_settings['hide_form_post_signup'] = '0';
862
+									if ( ! isset( $submission_settings[ 'hide_form_post_signup' ] ) ) {
863
+										$submission_settings[ 'hide_form_post_signup' ] = '0';
864 864
 									}
865 865
 								?>
866
-								<p><label for="hide-form-post-signup"><strong><?php _e( 'Hide Form After Sign Up' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
866
+								<p><label for="hide-form-post-signup"><strong><?php _e( 'Hide Form After Sign Up', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
867 867
 									<span class="form-field-container-span">
868
-										<label for="hide-form"><input type="radio"  id="hide-form" name="hide-form-post-signup" value="1" <?php checked( $submission_settings['hide_form_post_signup'] , '1' ); ?> checked><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
869
-										&nbsp;<label for="do-not-hide-form"><input type="radio" id="do-not-hide-form" name="hide-form-post-signup" value="0" <?php checked( $submission_settings['hide_form_post_signup'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
868
+										<label for="hide-form"><input type="radio"  id="hide-form" name="hide-form-post-signup" value="1" <?php checked( $submission_settings[ 'hide_form_post_signup' ], '1' ); ?> checked><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
869
+										&nbsp;<label for="do-not-hide-form"><input type="radio" id="do-not-hide-form" name="hide-form-post-signup" value="0" <?php checked( $submission_settings[ 'hide_form_post_signup' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
870 870
 									</span>
871
-									<p class="description"><?php _e( "Should the form be hidden after the user successfully signs up?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
871
+									<p class="description"><?php _e( "Should the form be hidden after the user successfully signs up?", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
872 872
 								</label></p>
873 873
 
874 874
 								<!-- Append or Replace Interest Groups -->
875 875
 								<?php
876
-									if( !isset( $submission_settings['replace_interests'] ) ) {
877
-										$submission_settings['replace_interests'] = '1'; // defaults to true
876
+									if ( ! isset( $submission_settings[ 'replace_interests' ] ) ) {
877
+										$submission_settings[ 'replace_interests' ] = '1'; // defaults to true
878 878
 									}
879 879
 								?>
880
-								<p><label for="replace-interest-groups"><strong><?php _e( 'Existing Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
880
+								<p><label for="replace-interest-groups"><strong><?php _e( 'Existing Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
881 881
 									<span class="form-field-container-span">
882
-										<label for="replace-interest-groups"><input type="radio"  id="replace-interest-groups" name="replace-interest-groups" value="1" <?php checked( $submission_settings['replace_interests'] , '1' ); ?> checked><?php _e( 'Replace' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
883
-										&nbsp;<label for="update-interest-groups"><input type="radio" id="update-interest-groups" name="replace-interest-groups" value="0" <?php checked( $submission_settings['replace_interests'] , '0' ); ?>><?php _e( 'Update' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
882
+										<label for="replace-interest-groups"><input type="radio"  id="replace-interest-groups" name="replace-interest-groups" value="1" <?php checked( $submission_settings[ 'replace_interests' ], '1' ); ?> checked><?php _e( 'Replace', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
883
+										&nbsp;<label for="update-interest-groups"><input type="radio" id="update-interest-groups" name="replace-interest-groups" value="0" <?php checked( $submission_settings[ 'replace_interests' ], '0' ); ?>><?php _e( 'Update', 'yikes-inc-easy-mailchimp-extender' ); ?></label>
884 884
 									</span>
885 885
 
886
-										<p class="description"><small><?php _e( "<strong>Replace</strong>: Replace all interest groups with the new ones submitted." , 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
886
+										<p class="description"><small><?php _e( "<strong>Replace</strong>: Replace all interest groups with the new ones submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
887 887
 
888 888
 
889
-										<p class="description"><small><?php _e( "<strong>Update</strong>: Update <em>only</em> the ones submitted. Leave existing interest groups as is." , 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
889
+										<p class="description"><small><?php _e( "<strong>Update</strong>: Update <em>only</em> the ones submitted. Leave existing interest groups as is.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
890 890
 
891 891
 								</label></p>
892 892
 
@@ -899,9 +899,9 @@  discard block
 block discarded – undo
899 899
 
900 900
 							<span class="form-buttons-container" id="major-publishing-actions">
901 901
 								<?php
902
-									echo submit_button( __( 'Update Form' ) , 'primary' , '' , false , array( 'onclick' => 'jQuery(this).parent().prev().css({"display":"block","visibility":"inherit"});' ) );
903
-									$url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $form['id'] , 'nonce' => wp_create_nonce( 'delete-mailchimp-form-'.$form['id'] ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) );
904
-									echo '<a href="' . $url . '" class="yikes-delete-mailchimp-form" onclick="return confirm(\'' . __( "Are you sure you want to delete this form? This cannot be undone." , 'yikes-inc-easy-mailchimp-extender' ) . '\');">' . __( "Delete Form" , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
902
+									echo submit_button( __( 'Update Form' ), 'primary', '', false, array( 'onclick' => 'jQuery(this).parent().prev().css({"display":"block","visibility":"inherit"});' ) );
903
+									$url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $form[ 'id' ], 'nonce' => wp_create_nonce( 'delete-mailchimp-form-' . $form[ 'id' ] ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) );
904
+									echo '<a href="' . $url . '" class="yikes-delete-mailchimp-form" onclick="return confirm(\'' . __( "Are you sure you want to delete this form? This cannot be undone.", 'yikes-inc-easy-mailchimp-extender' ) . '\');">' . __( "Delete Form", 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
905 905
 								?>
906 906
 							</span>
907 907
 
Please login to merge, or discard this patch.
public/partials/ajax/class.public_ajax.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -11,16 +11,16 @@  discard block
 block discarded – undo
11 11
 	 */
12 12
 	public function __construct() {
13 13
 		// ajax process form submission
14
-		add_action( 'wp_ajax_nopriv_process_form_submission', array( $this , 'process_form_submission' ), 10 );
15
-		add_action( 'wp_ajax_process_form_submission', array( $this , 'process_form_submission' ), 10 );
14
+		add_action( 'wp_ajax_nopriv_process_form_submission', array( $this, 'process_form_submission' ), 10 );
15
+		add_action( 'wp_ajax_process_form_submission', array( $this, 'process_form_submission' ), 10 );
16 16
 
17 17
 		// ajax send update emails
18
-		add_action( 'wp_ajax_nopriv_easy_forms_send_email', array( $this , 'sendUpdateProfileEmail' ), 10 );
19
-		add_action( 'wp_ajax_easy_forms_send_email', array( $this , 'sendUpdateProfileEmail' ), 10 );
18
+		add_action( 'wp_ajax_nopriv_easy_forms_send_email', array( $this, 'sendUpdateProfileEmail' ), 10 );
19
+		add_action( 'wp_ajax_easy_forms_send_email', array( $this, 'sendUpdateProfileEmail' ), 10 );
20 20
 
21 21
 		// increase submission count for a given form on successful submit
22
-		add_action( 'wp_ajax_nopriv_increase_submission_count' , array( $this , 'increase_submission_count' ), 10 );
23
-		add_action( 'wp_ajax_increase_submission_count' , array( $this , 'increase_submission_count' ), 10 );
22
+		add_action( 'wp_ajax_nopriv_increase_submission_count', array( $this, 'increase_submission_count' ), 10 );
23
+		add_action( 'wp_ajax_increase_submission_count', array( $this, 'increase_submission_count' ), 10 );
24 24
 	}
25 25
 
26 26
 	/*
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 * Increase the submission count for a given form.
38 38
 	 */
39 39
 	public function increase_submission_count() {
40
-		$form_id   = intval( $_POST['form_id'] );
40
+		$form_id   = intval( $_POST[ 'form_id' ] );
41 41
 		$interface = yikes_easy_mailchimp_extender_get_form_interface();
42 42
 		$form      = $interface->get_form( $form_id );
43 43
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		}
48 48
 
49 49
 		// Update the form.
50
-		$submission_count = isset( $form['submissions'] ) ? $form['submissions'] + 1 : 1;
50
+		$submission_count = isset( $form[ 'submissions' ] ) ? $form[ 'submissions' ] + 1 : 1;
51 51
 		$interface->update_form_field( $form_id, 'submissions', $submission_count );
52 52
 
53 53
 		exit();
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 		@since v6.0.4.1
59 59
 	*/
60 60
 	public function sendUpdateProfileEmail() {
61
-		$user_email		= $_POST['user_email'];
61
+		$user_email = $_POST[ 'user_email' ];
62 62
 		$user_id		= md5( $user_email );
63
-		$list_id		= $_POST['list_id'];
64
-		$form_id		= $_POST['form_id'];
65
-		$full_site_url	= get_bloginfo( 'url' );
63
+		$list_id		= $_POST[ 'list_id' ];
64
+		$form_id		= $_POST[ 'form_id' ];
65
+		$full_site_url = get_bloginfo( 'url' );
66 66
 		$manager		= yikes_get_mc_api_manager();
67 67
 
68 68
 		// Possibly handle errors.
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 				"class.public_ajax.php"
79 79
 			);
80 80
 			$is_error = true;
81
-			$errors[] = $list_details->get_error_message();
81
+			$errors[ ] = $list_details->get_error_message();
82 82
 		}
83 83
 
84 84
 		// Subscriber details API call
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
88 88
 			$error_logging->maybe_write_to_log( $subscriber_account_details->get_error_code(), __( "Send Update Profile Email - Get Member Info.", 'yikes-inc-easy-mailchimp-extender' ), "class.public_ajax.php" );
89 89
 			$is_error = true;
90
-			$errors[] = $subscriber_account_details->get_error_message();
90
+			$errors[ ] = $subscriber_account_details->get_error_message();
91 91
 		}
92 92
 
93 93
 		// Form details API call
@@ -95,22 +95,22 @@  discard block
 block discarded – undo
95 95
 		if ( ! empty( $interface ) && method_exists( $interface, 'get_form' ) && isset( $form_id ) ) {
96 96
 			$form_data = $interface->get_form( $form_id );
97 97
 			if ( ! empty( $form_data ) ) {
98
-				if ( isset( $form_data['error_messages'] ) ) {
98
+				if ( isset( $form_data[ 'error_messages' ] ) ) {
99 99
 
100
-					if ( isset( $form_data['error_messages']['email-body'] ) && ! empty( $form_data['error_messages']['email-body'] ) ) {
101
-						$email_body = apply_filters( 'the_content', $form_data['error_messages']['email-body'] );
100
+					if ( isset( $form_data[ 'error_messages' ][ 'email-body' ] ) && ! empty( $form_data[ 'error_messages' ][ 'email-body' ] ) ) {
101
+						$email_body = apply_filters( 'the_content', $form_data[ 'error_messages' ][ 'email-body' ] );
102 102
 					}
103 103
 
104
-					if ( isset( $form_data['error_messages']['email-subject'] ) && ! empty( $form_data['error_messages']['email-subject'] ) ) {
105
-						$email_subject = $form_data['error_messages']['email-subject'];
104
+					if ( isset( $form_data[ 'error_messages' ][ 'email-subject' ] ) && ! empty( $form_data[ 'error_messages' ][ 'email-subject' ] ) ) {
105
+						$email_subject = $form_data[ 'error_messages' ][ 'email-subject' ];
106 106
 					}
107 107
 
108
-					if ( isset( $form_data['error_messages']['update-email-success'] ) && ! empty( $form_data['error_messages']['update-email-success'] ) ) {
109
-						$update_email_success_message = $form_data['error_messages']['update-email-success'];
108
+					if ( isset( $form_data[ 'error_messages' ][ 'update-email-success' ] ) && ! empty( $form_data[ 'error_messages' ][ 'update-email-success' ] ) ) {
109
+						$update_email_success_message = $form_data[ 'error_messages' ][ 'update-email-success' ];
110 110
 					}
111 111
 
112
-					if ( isset( $form_data['error_messages']['update-email-failure'] ) && ! empty( $form_data['error_messages']['update-email-failure'] ) ) {
113
-						$update_email_failed_message = $form_data['error_messages']['update-email-failure'];
112
+					if ( isset( $form_data[ 'error_messages' ][ 'update-email-failure' ] ) && ! empty( $form_data[ 'error_messages' ][ 'update-email-failure' ] ) ) {
113
+						$update_email_failed_message = $form_data[ 'error_messages' ][ 'update-email-failure' ];
114 114
 					}
115 115
 				}
116 116
 			}
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 		}
131 131
 
132 132
 		// Construct the headers & email message content
133
-		$subscriber_id 	  = $subscriber_account_details['unique_email_id'];
134
-		$update_link_href = str_replace( '/subscribe', '/profile', $list_details['subscribe_url_long'] );
133
+		$subscriber_id 	  = $subscriber_account_details[ 'unique_email_id' ];
134
+		$update_link_href = str_replace( '/subscribe', '/profile', $list_details[ 'subscribe_url_long' ] );
135 135
 		$update_link_href = add_query_arg( 'e', $subscriber_id, $update_link_href );
136 136
 		$update_link_tag  = '<a href="' . $update_link_href . '">';
137
-		$headers          = 'From: ' . $list_details['campaign_defaults']['from_name'] . ' <' . $list_details['campaign_defaults']['from_email'] . '>' . "\r\n";
138
-		$headers 		 .= 'Content-type: text/html';
137
+		$headers          = 'From: ' . $list_details[ 'campaign_defaults' ][ 'from_name' ] . ' <' . $list_details[ 'campaign_defaults' ][ 'from_email' ] . '>' . "\r\n";
138
+		$headers .= 'Content-type: text/html';
139 139
 
140 140
 		if ( ! isset( $email_subject ) ) {
141 141
 			$email_subject = __( 'MailChimp Profile Update', 'yikes-inc-easy-mailchimp-extender' );
Please login to merge, or discard this patch.
public/partials/shortcodes/process/process_form_submission_ajax.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 $submission_handler = new Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler( $is_ajax = true );
9 9
 
10 10
 // parse our form data
11
-parse_str( $_POST['form_data'], $data );
11
+parse_str( $_POST[ 'form_data' ], $data );
12 12
 
13 13
 // Get the form_id
14
-$form_id   = absint( $_POST['form_id'] );
14
+$form_id = absint( $_POST[ 'form_id' ] );
15 15
 
16 16
 // Send an error if for some reason we can't find the $form_id
17 17
 $submission_handler->handle_empty_form_id( $form_id );
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 $submission_handler->set_form_id( $form_id ); 
21 21
 
22 22
 // Check our nonce
23
-$submission_handler->handle_nonce( $_POST['ajax_security_nonce'], 'yikes_mc_form_submission_security_nonce' );
23
+$submission_handler->handle_nonce( $_POST[ 'ajax_security_nonce' ], 'yikes_mc_form_submission_security_nonce' );
24 24
 
25 25
 // Get the form data
26 26
 $interface = yikes_easy_mailchimp_extender_get_form_interface();
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 $submission_handler->handle_empty_form( $form_data ); 
31 31
 
32 32
 // Set up some variables from the form data -- these are required
33
-$list_id             = isset( $form_data['list_id'] ) ? $form_data['list_id'] : null;
34
-$submission_settings = isset( $form_data['submission_settings'] ) ? $form_data['submission_settings'] : null;
35
-$optin_settings      = isset( $form_data['optin_settings'] ) ? $form_data['optin_settings'] : null;
36
-$form_fields         = isset( $form_data['fields'] ) ? $form_data['fields'] : null;
33
+$list_id             = isset( $form_data[ 'list_id' ] ) ? $form_data[ 'list_id' ] : null;
34
+$submission_settings = isset( $form_data[ 'submission_settings' ] ) ? $form_data[ 'submission_settings' ] : null;
35
+$optin_settings      = isset( $form_data[ 'optin_settings' ] ) ? $form_data[ 'optin_settings' ] : null;
36
+$form_fields         = isset( $form_data[ 'fields' ] ) ? $form_data[ 'fields' ] : null;
37 37
 
38 38
 // Send an error if for some reason we can't find the required form data
39 39
 $submission_handler->handle_empty_fields_generic( array( $list_id, $submission_settings, $optin_settings, $form_fields ) );
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 $submission_handler->check_for_required_interest_groups( $data, $form_fields );
48 48
 
49 49
 // Set up some variables from the form data -- these are not required
50
-$error_messages      = isset( $form_data['error_messages'] ) ? $form_data['error_messages'] : array();
51
-$notifications       = isset( $form_data['custom_notifications'] ) ? $form_data['custom_notifications'] : array();
50
+$error_messages      = isset( $form_data[ 'error_messages' ] ) ? $form_data[ 'error_messages' ] : array();
51
+$notifications       = isset( $form_data[ 'custom_notifications' ] ) ? $form_data[ 'custom_notifications' ] : array();
52 52
 
53 53
 // Set the error messages in our class
54 54
 $submission_handler->set_error_messages( $error_messages );
55 55
 
56 56
 // Some other variables we'll need.
57
-$page_data       = isset( $_POST['page_data'] ) ? $_POST['page_data'] : '';
57
+$page_data       = isset( $_POST[ 'page_data' ] ) ? $_POST[ 'page_data' ] : '';
58 58
 $merge_variables = array();
59 59
 $error           = 0;
60 60
 $list_handler    = yikes_get_mc_api_manager()->get_list_handler();
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 // As of 6.4 we no longer pass the post object, only the ID.
63 63
 // For any users relying on the $post object for their `yikes-mailchimp-redirect-url` filter we'll grab the post object here.
64 64
 // Eventually we should just pass the $post_id into the filter instead of the whole object.
65
-$page_data       = ! empty( $page_data ) ? get_post( $page_data ) : '';
65
+$page_data = ! empty( $page_data ) ? get_post( $page_data ) : '';
66 66
 
67 67
 // Send an error if for some reason we can't find the list_handler
68 68
 $submission_handler->handle_empty_list_handler( $list_handler ); 
69 69
 
70 70
 // Get and sanitize the email
71
-$submitted_email = isset( $data['EMAIL'] ) ? $data['EMAIL'] : '';
71
+$submitted_email = isset( $data[ 'EMAIL' ] ) ? $data[ 'EMAIL' ] : '';
72 72
 $sanitized_email = $submission_handler->get_sanitized_email( $submitted_email ); 
73 73
 $submission_handler->set_email( $sanitized_email );
74 74
 
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 $submission_handler->handle_empty_email( $sanitized_email );
77 77
 
78 78
 // Check for Honeypot filled
79
-$honey_pot_filled = ( isset( $data['yikes-mailchimp-honeypot'] ) && '' !== $data['yikes-mailchimp-honeypot'] ) ? true : false;
79
+$honey_pot_filled = ( isset( $data[ 'yikes-mailchimp-honeypot' ] ) && '' !== $data[ 'yikes-mailchimp-honeypot' ] ) ? true : false;
80 80
 
81 81
 // Send an error if honey pot is not empty
82 82
 $submission_handler->handle_non_empty_honeypot( $honey_pot_filled ); 
83 83
 
84 84
 // Check if reCAPTCHA Response was submitted with the form data, and handle it if needed
85
-if ( isset( $data['g-recaptcha-response'] ) ) {
86
-	$recaptcha_response = $data['g-recaptcha-response'];
85
+if ( isset( $data[ 'g-recaptcha-response' ] ) ) {
86
+	$recaptcha_response = $data[ 'g-recaptcha-response' ];
87 87
 	$submission_handler->handle_recaptcha( $recaptcha_response );
88 88
 }
89 89
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 $merge_variables = $submission_handler->get_submitted_merge_values( $data, $form_fields );
92 92
 
93 93
 // Submission Setting: Replace interest groups or update interest groups
94
-$replace_interests = isset( $submission_settings['replace_interests'] ) ? (bool) $submission_settings['replace_interests'] : true;
94
+$replace_interests = isset( $submission_settings[ 'replace_interests' ] ) ? (bool) $submission_settings[ 'replace_interests' ] : true;
95 95
 
96 96
 // Get the default groups
97 97
 $groups = $submission_handler->get_default_interest_groups( $replace_interests, $list_handler );
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
  *
107 107
  * @param $merge_variables array Array of merge variable to use
108 108
  */
109
-do_action( 'yikes-mailchimp-before-submission',            $merge_variables );
109
+do_action( 'yikes-mailchimp-before-submission', $merge_variables );
110 110
 do_action( "yikes-mailchimp-before-submission-{$form_id}", $merge_variables );
111 111
 
112 112
 // Allow users to check for form values (using the `yikes-mailchimp-filter-before-submission` filter hook in function `get_submitted_merge_values`) 
113 113
 // and pass back an error and message to the user
114 114
 // If error is set and no message, default to our class variable's default error message
115
-if ( isset( $merge_variables['error'] ) ) {
116
-	$merge_error_message = isset( $merge_variables['message'] ) ? $merge_variables['message'] : $submission_handler->default_error_response_message;
117
-	$submission_handler->handle_merge_variables_error( $merge_variables['error'], $merge_error_message );
115
+if ( isset( $merge_variables[ 'error' ] ) ) {
116
+	$merge_error_message = isset( $merge_variables[ 'message' ] ) ? $merge_variables[ 'message' ] : $submission_handler->default_error_response_message;
117
+	$submission_handler->handle_merge_variables_error( $merge_variables[ 'error' ], $merge_error_message );
118 118
 }
119 119
 
120 120
 // This is the array we're going to pass through to the MailChimp API
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 // Only add groups if they exist
128 128
 if ( ! empty( $groups ) ) {
129
-	$member_data['interests'] = $groups;
129
+	$member_data[ 'interests' ] = $groups;
130 130
 }
131 131
 
132 132
 // Check if this member already exists
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 // Likewise, if this member exists but their status is 'pending' it means we're dealing with a double opt-in list and they never confirmed
137 137
 // Or, if this member but their status is 'unsubscribed' it means we're dealing with someone who unsubscribed and they need to re-subscribe
138 138
 // Continue as if they're a new member to force another double opt-in email
139
-$double_optin_resubscribe = is_array( $member_exists ) && isset( $member_exists['status'] ) && ( $member_exists['status'] === 'pending' || $member_exists['status'] === 'unsubscribed' );
139
+$double_optin_resubscribe = is_array( $member_exists ) && isset( $member_exists[ 'status' ] ) && ( $member_exists[ 'status' ] === 'pending' || $member_exists[ 'status' ] === 'unsubscribed' );
140 140
 
141 141
 if ( is_wp_error( $member_exists ) || $double_optin_resubscribe === true ) {
142 142
 
@@ -144,23 +144,23 @@  discard block
 block discarded – undo
144 144
 
145 145
 	// Check the opt-in value - is it double or single?
146 146
 	// Double opt-in means 'status_if_new' => 'pending'
147
-	$double_optin = isset( $optin_settings['optin'] ) ? (int) $optin_settings['optin'] : 0;
147
+	$double_optin = isset( $optin_settings[ 'optin' ] ) ? (int) $optin_settings[ 'optin' ] : 0;
148 148
 
149 149
 	// If the user was unsubscribed and is re-subscribing, we set the status to 'pending', which
150 150
 	// causes Mailchimp to send them a confirmation email.  This is the only way Mailchimp will
151 151
 	// allow us to re-subscribe the user.
152
-	$was_unsubscribed = is_array( $member_exists ) && isset( $member_exists['status'] ) && $member_exists['status'] === 'unsubscribed';
152
+	$was_unsubscribed = is_array( $member_exists ) && isset( $member_exists[ 'status' ] ) && $member_exists[ 'status' ] === 'unsubscribed';
153 153
 
154 154
 	if ( $double_optin === 1 || $was_unsubscribed === true ) {
155 155
 
156 156
 		// Double opt-in
157
-		$member_data['status_if_new'] = 'pending';
158
-		$member_data['status']        = 'pending';
157
+		$member_data[ 'status_if_new' ] = 'pending';
158
+		$member_data[ 'status' ]        = 'pending';
159 159
 	} else {
160 160
 
161 161
 		// Single opt-in
162
-		$member_data['status_if_new'] = 'subscribed';
163
-		$member_data['status']        = 'subscribed';
162
+		$member_data[ 'status_if_new' ] = 'subscribed';
163
+		$member_data[ 'status' ]        = 'subscribed';
164 164
 	}
165 165
 	
166 166
 } else {
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 
170 170
 	// But first let's set our flag, and set the MailChimp status flag
171 171
 	$new_subscriber = false;
172
-	$member_data['status'] = 'subscribed';
172
+	$member_data[ 'status' ] = 'subscribed';
173 173
 
174 174
 	// Check our update_existing_user optin setting
175
-	$update_existing_user = ( $optin_settings['update_existing_user'] === '1' ) ? true : false;
175
+	$update_existing_user = ( $optin_settings[ 'update_existing_user' ] === '1' ) ? true : false;
176 176
 
177 177
 	// If update_existing_user is false (not allowed) then simply fail and return a response message
178 178
 	if ( $update_existing_user === false ) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	}
181 181
 
182 182
 	// If update_existing_user is true, we need to check our 'send_update_email' option
183
-	$send_update_email = ( $optin_settings['send_update_email'] === '1' ) ? true : false;
183
+	$send_update_email = ( $optin_settings[ 'send_update_email' ] === '1' ) ? true : false;
184 184
 
185 185
 	// If $send_update_email is true (we send the email) then we need to fire off the 'send update email' logic
186 186
 	if ( $send_update_email === true ) {
Please login to merge, or discard this patch.
public/classes/checkbox-integrations.php 4 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 		}
107 107
 
108 108
 		/**
109
-		* 	Get the checkbox for the given integration and render it on the front end
110
-		* 	@return string
111
-		*	@since 6.0.0
112
-		*/
109
+		 * 	Get the checkbox for the given integration and render it on the front end
110
+		 * 	@return string
111
+		 *	@since 6.0.0
112
+		 */
113 113
 		public function yikes_get_checkbox() {
114 114
 
115 115
 			// Enqueue our checkbox styles whenever the checkbox is displayed
@@ -204,25 +204,25 @@  discard block
 block discarded – undo
204 204
 				}
205 205
 
206 206
 				/**
207
-				*	'yikes-mailchimp-checkbox-integration-body'
208
-				*
209
-				*	Filter the request body for a MailChimp subscription via the checkbox integrations
210
-				*
211
-				*	@param array  | $data    | The request body
212
-				*	@param string | $type    | The integration type, e.g. 'contact_form_7'
213
-				*	@param string | $list_id | The list ID
214
-				*/
207
+				 *	'yikes-mailchimp-checkbox-integration-body'
208
+				 *
209
+				 *	Filter the request body for a MailChimp subscription via the checkbox integrations
210
+				 *
211
+				 *	@param array  | $data    | The request body
212
+				 *	@param string | $type    | The integration type, e.g. 'contact_form_7'
213
+				 *	@param string | $list_id | The list ID
214
+				 */
215 215
 				$data = apply_filters( 'yikes-mailchimp-checkbox-integration-body', $data, $type, $list_id );
216 216
 
217 217
 				/**
218
-				*	'yikes-mailchimp-checkbox-integration-list-id'
219
-				*
220
-				*	Filter the list ID for a MailChimp subscription via the checkbox integrations
221
-				*
222
-				*	@param string | $list_id | The list ID
223
-				*	@param array  | $data    | The request body
224
-				*	@param string | $type    | The integration type, e.g. 'contact_form_7'
225
-				*/
218
+				 *	'yikes-mailchimp-checkbox-integration-list-id'
219
+				 *
220
+				 *	Filter the list ID for a MailChimp subscription via the checkbox integrations
221
+				 *
222
+				 *	@param string | $list_id | The list ID
223
+				 *	@param array  | $data    | The request body
224
+				 *	@param string | $type    | The integration type, e.g. 'contact_form_7'
225
+				 */
226 226
 				$list_id = apply_filters( 'yikes-mailchimp-checkbox-integration-list-id', $list_id, $data, $type );
227 227
 
228 228
 
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 		}
243 243
 
244 244
 		/**
245
-		* Build merge varaibles array
246
-		*	@since 6.0.0
247
-		*/
245
+		 * Build merge varaibles array
246
+		 *	@since 6.0.0
247
+		 */
248 248
 		public function user_merge_vars( WP_User $user ) {
249 249
 
250 250
 			// Start with user_login as name, since that's always known
@@ -287,10 +287,10 @@  discard block
 block discarded – undo
287 287
 
288 288
 
289 289
 		/**
290
-		*	Alter the registraton complete message
291
-		*	if the registration form checkbox integration is toggled on
292
-		* 	@since 6.0.0
293
-		**/
290
+		 *	Alter the registraton complete message
291
+		 *	if the registration form checkbox integration is toggled on
292
+		 * 	@since 6.0.0
293
+		 **/
294 294
 		public function yikes_reg_complete_msg( $errors, $redirect_to ) {
295 295
 			if( isset( $errors->errors['registered'] ) ) {
296 296
 				$email_error = get_option( 'yikes_register_subscription_error' , '' );
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 					unset( $tmp );
310 310
 					delete_option( 'yikes_register_subscription_error' );
311 311
 				}
312
-		   }
313
-		   return $errors;
312
+			}
313
+			return $errors;
314 314
 		}
315 315
 
316 316
 	}
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -281,6 +281,10 @@
 block discarded – undo
281 281
 		*	before continuing
282 282
 		*	@since 6.0.0
283 283
 		*/
284
+
285
+		/**
286
+		 * @param string $type
287
+		 */
284 288
 		public function was_checkbox_checked( $type ) {
285 289
 			return ( isset( $_POST[ 'yikes_mailchimp_checkbox_' . $type ] ) && $_POST[ 'yikes_mailchimp_checkbox_' . $type ] == 1 );
286 290
 		}
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 	*/
6 6
 
7 7
 	// Prevent direct access to the file
8
-	defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) );
8
+	defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) );
9 9
 
10 10
 	class Yikes_Easy_MC_Checkbox_Integration_Class {
11 11
 
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 			if ( empty( $checkbox_options ) ) {
46 46
 				return false;
47 47
 			}
48
-			if ( ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ]['associated-list'] ) ) {
48
+			if ( ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ][ 'associated-list' ] ) ) {
49 49
 				return false;
50 50
 			}
51 51
 
52
-			$list_ids = $checkbox_options[ $type ]['associated-list'];
52
+			$list_ids = $checkbox_options[ $type ][ 'associated-list' ];
53 53
 			$list_ids = is_array( $list_ids ) ? $list_ids : array( $list_ids );
54 54
 
55 55
 			// Go through each list...
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 				$data = $response->get_error_data();
85 85
 
86 86
 				// If the error response is a 404, they are not subscribed.
87
-				if ( isset( $data['status'] ) && 404 == $data['status'] ) {
87
+				if ( isset( $data[ 'status' ] ) && 404 == $data[ 'status' ] ) {
88 88
 					return false;
89 89
 				} else {
90 90
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 			}
101 101
 
102 102
 			// Look at the status from the API
103
-			$subscribed = 'subscribed' === $response['status'];
103
+			$subscribed = 'subscribed' === $response[ 'status' ];
104 104
 
105 105
 			return apply_filters( 'yikes-mailchimp-integration-is-user-subscribed', $subscribed, $type );
106 106
 		}
@@ -116,22 +116,22 @@  discard block
 block discarded – undo
116 116
 			wp_enqueue_style( 'yikes-easy-mailchimp-checkbox-integration-styles', plugin_dir_url( __FILE__ ) . '../css/yikes-inc-easy-mailchimp-checkbox-integration.min.css' );
117 117
 
118 118
 			// Get our options
119
-			$checkbox_options = get_option( 'optin-checkbox-init' , array() );
120
-			$has_list_ids     = isset( $checkbox_options[$this->type]['associated-list'] ) && $checkbox_options[$this->type]['associated-list'] != '-';
121
-			$has_list_ids     = $has_list_ids && ! in_array( '-', $checkbox_options[$this->type]['associated-list'] );
119
+			$checkbox_options = get_option( 'optin-checkbox-init', array() );
120
+			$has_list_ids     = isset( $checkbox_options[ $this->type ][ 'associated-list' ] ) && $checkbox_options[ $this->type ][ 'associated-list' ] != '-';
121
+			$has_list_ids     = $has_list_ids && ! in_array( '-', $checkbox_options[ $this->type ][ 'associated-list' ] );
122 122
 
123 123
 			// We need to make sure we have a legit list ID right here. I don't think it will ever equal '-'
124 124
 
125 125
 			if ( $has_list_ids ) {
126
-				$checked = ( $checkbox_options[$this->type]['precheck'] == 'true' ) ? 'checked' : '';
126
+				$checked = ( $checkbox_options[ $this->type ][ 'precheck' ] == 'true' ) ? 'checked' : '';
127 127
 				// before checkbox HTML (comment, ...)
128 128
 				$before = '<!-- Easy Forms for MailChimp - https://www.yikesplugins.com/ -->';
129 129
 				$before .= apply_filters( 'yikes-mailchimp-before-checkbox-html', '' );
130 130
 				// checkbox
131 131
 				$content = '<p id="yikes-easy-mailchimp-' . $this->type . '-checkbox" class="yikes-easy-mailchimp-' . $this->type . '-checkbox">';
132 132
 					$content .= '<label>';
133
-						$content .= '<input type="checkbox" name="yikes_mailchimp_checkbox_' . $this->type . '" value="1" '. $checked . ' /> ';
134
-						$content .= ( isset( $checkbox_options[$this->type]['label'] ) && trim( $checkbox_options[$this->type]['label'] ) != '' ) ? trim( $checkbox_options[$this->type]['label'] ) : __( 'Sign me up for your mailing list.', 'yikes-inc-easy-mailchimp-extender' );
133
+						$content .= '<input type="checkbox" name="yikes_mailchimp_checkbox_' . $this->type . '" value="1" ' . $checked . ' /> ';
134
+						$content .= ( isset( $checkbox_options[ $this->type ][ 'label' ] ) && trim( $checkbox_options[ $this->type ][ 'label' ] ) != '' ) ? trim( $checkbox_options[ $this->type ][ 'label' ] ) : __( 'Sign me up for your mailing list.', 'yikes-inc-easy-mailchimp-extender' );
135 135
 					$content .= '</label>';
136 136
 				$content .= '</p>';
137 137
 				// after checkbox HTML (..., honeypot, closing comment)
@@ -155,20 +155,20 @@  discard block
 block discarded – undo
155 155
 			$options = get_option( 'optin-checkbox-init', '' );
156 156
 
157 157
 			// Make sure we have a list ID.
158
-			if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ]['associated-list'] ) ) {
158
+			if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ][ 'associated-list' ] ) ) {
159 159
 				// @todo: Throw some kind of error?
160 160
 				return;
161 161
 			}
162 162
 
163 163
 			// Check for an IP address.
164
-			$user_ip = sanitize_text_field( $_SERVER['REMOTE_ADDR'] );
165
-			if ( isset( $merge_vars['OPTIN_IP'] ) ) {
166
-				$user_ip = sanitize_text_field( $merge_vars['OPTIN_IP'] );
164
+			$user_ip = sanitize_text_field( $_SERVER[ 'REMOTE_ADDR' ] );
165
+			if ( isset( $merge_vars[ 'OPTIN_IP' ] ) ) {
166
+				$user_ip = sanitize_text_field( $merge_vars[ 'OPTIN_IP' ] );
167 167
 			}
168 168
 
169 169
 			// Build our data
170
-			$list_ids  = $options[ $type ]['associated-list'];
171
-			$list_ids  = is_array( $options[ $type ]['associated-list'] ) ? $options[ $type ]['associated-list'] : array( $options[ $type ]['associated-list'] );
170
+			$list_ids  = $options[ $type ][ 'associated-list' ];
171
+			$list_ids  = is_array( $options[ $type ][ 'associated-list' ] ) ? $options[ $type ][ 'associated-list' ] : array( $options[ $type ][ 'associated-list' ] );
172 172
 
173 173
 			// $interests = 
174 174
 
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 
184 184
 			foreach ( $list_ids as $list_id ) {
185 185
 
186
-				$interests = isset( $options[ $type ]['interest-groups'] ) ? $options[ $type ]['interest-groups'] : array();
187
-				$interests = isset( $interests[$list_id] ) ? $interests[$list_id] : $interests;
186
+				$interests = isset( $options[ $type ][ 'interest-groups' ] ) ? $options[ $type ][ 'interest-groups' ] : array();
187
+				$interests = isset( $interests[ $list_id ] ) ? $interests[ $list_id ] : $interests;
188 188
 
189 189
 				// Only re-format and add interest groups if not empty
190 190
 				if ( ! empty( $interests ) ) {
@@ -192,15 +192,15 @@  discard block
 block discarded – undo
192 192
 					$groups = array();
193 193
 
194 194
 					// Need to reformat interest groups array as $interest_group_ID => true
195
-					foreach( $interests as $interest ) {
195
+					foreach ( $interests as $interest ) {
196 196
 						if ( is_array( $interest ) ) {
197
-							foreach( $interest as $group_id ) {
197
+							foreach ( $interest as $group_id ) {
198 198
 								$groups[ $group_id ] = true;
199 199
 							}
200 200
 						}
201 201
 					}
202 202
 
203
-					$data['interests'] = $groups;
203
+					$data[ 'interests' ] = $groups;
204 204
 				}
205 205
 
206 206
 				/**
@@ -253,14 +253,14 @@  discard block
 block discarded – undo
253 253
 			);
254 254
 			
255 255
 			if ( ! empty( $user->first_name ) ) {
256
-				$merge_vars['NAME'] = $user->first_name;
257
-				$merge_vars['FNAME'] = $user->first_name;
256
+				$merge_vars[ 'NAME' ] = $user->first_name;
257
+				$merge_vars[ 'FNAME' ] = $user->first_name;
258 258
 			}
259 259
 			if ( ! empty( $user->last_name ) ) {
260
-				$merge_vars['LNAME'] = $user->last_name;
260
+				$merge_vars[ 'LNAME' ] = $user->last_name;
261 261
 			}
262 262
 			if ( ! empty( $user->first_name ) && ! empty( $user->last_name ) ) {
263
-				$merge_vars['NAME'] = sprintf( '%s %s', $user->first_name, $user->last_name );
263
+				$merge_vars[ 'NAME' ] = sprintf( '%s %s', $user->first_name, $user->last_name );
264 264
 			}
265 265
 
266 266
 			/**
@@ -292,15 +292,15 @@  discard block
 block discarded – undo
292 292
 		* 	@since 6.0.0
293 293
 		**/
294 294
 		public function yikes_reg_complete_msg( $errors, $redirect_to ) {
295
-			if( isset( $errors->errors['registered'] ) ) {
296
-				$email_error = get_option( 'yikes_register_subscription_error' , '' );
297
-				if( isset( $email_error ) && $email_error != '' ) {
295
+			if ( isset( $errors->errors[ 'registered' ] ) ) {
296
+				$email_error = get_option( 'yikes_register_subscription_error', '' );
297
+				if ( isset( $email_error ) && $email_error != '' ) {
298 298
 					// Use the magic __get method to retrieve the errors array:
299 299
 					$tmp = $errors->errors;
300 300
 					$old = 'Registration complete. Please check your e-mail.';
301
-					foreach( $tmp['registered'] as $index => $msg ) {
302
-						if( $msg === $old ) {
303
-							$tmp['registered'][$index] = $old . ' <p class="message"><strong>' . __( 'Note' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>: ' . $email_error . '</p>';
301
+					foreach ( $tmp[ 'registered' ] as $index => $msg ) {
302
+						if ( $msg === $old ) {
303
+							$tmp[ 'registered' ][ $index ] = $old . ' <p class="message"><strong>' . __( 'Note', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>: ' . $email_error . '</p>';
304 304
 						}
305 305
 					}
306 306
 					// Use the magic __set method to override the errors property:
Please login to merge, or discard this patch.
Braces   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	// Prevent direct access to the file
8 8
 	defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) );
9 9
 
10
-	class Yikes_Easy_MC_Checkbox_Integration_Class {
10
+	class Yikes_Easy_MC_Checkbox_Integration_Class {
11 11
 
12 12
 		// declare our integration type
13 13
 		protected $type = 'integration';
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 		 *
25 25
 		 * @return bool Whether the current user is subscribed to a list.
26 26
 		 */
27
-		public function is_user_already_subscribed( $type, $email = '' ) {
27
+		public function is_user_already_subscribed( $type, $email = '' ) {
28 28
 			// Make sure we have an email address to use.
29
-			if ( empty( $email ) ) {
30
-				if ( ! is_user_logged_in() ) {
29
+			if ( empty( $email ) ) {
30
+				if ( ! is_user_logged_in() ) {
31 31
 					return false;
32 32
 				}
33 33
 
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
 			}
37 37
 
38 38
 			// Ensure we have a valid email.
39
-			if ( ! is_email( $email ) ) {
39
+			if ( ! is_email( $email ) ) {
40 40
 				return false;
41 41
 			}
42 42
 
43 43
 			// Convert the integration type to a list ID
44 44
 			$checkbox_options = get_option( 'optin-checkbox-init', '' );
45
-			if ( empty( $checkbox_options ) ) {
45
+			if ( empty( $checkbox_options ) ) {
46 46
 				return false;
47 47
 			}
48
-			if ( ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ]['associated-list'] ) ) {
48
+			if ( ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ]['associated-list'] ) ) {
49 49
 				return false;
50 50
 			}
51 51
 
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 			$list_ids = is_array( $list_ids ) ? $list_ids : array( $list_ids );
54 54
 
55 55
 			// Go through each list...
56
-			foreach ( $list_ids as $list_id ) {
56
+			foreach ( $list_ids as $list_id ) {
57 57
 
58
-				if ( ! $this->is_user_subscribed( $email, $list_id, $type ) ) {
58
+				if ( ! $this->is_user_subscribed( $email, $list_id, $type ) ) {
59 59
 					return false;
60 60
 				}
61 61
 
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
 		 *
76 76
 		 * @return bool Whether the email is subscribed to the list.
77 77
 		 */
78
-		public function is_user_subscribed( $email, $list_id, $type ) {
78
+		public function is_user_subscribed( $email, $list_id, $type ) {
79 79
 			$email_hash = md5( $email );
80 80
 
81 81
 			// Check the API to see the status
82 82
 			$response = yikes_get_mc_api_manager()->get_list_handler()->get_member( $list_id, $email_hash, false );
83
-			if ( is_wp_error( $response ) ) {
83
+			if ( is_wp_error( $response ) ) {
84 84
 				$data = $response->get_error_data();
85 85
 
86 86
 				// If the error response is a 404, they are not subscribed.
87
-				if ( isset( $data['status'] ) && 404 == $data['status'] ) {
87
+				if ( isset( $data['status'] ) && 404 == $data['status'] ) {
88 88
 					return false;
89
-				} else {
89
+				} else {
90 90
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
91 91
 					$error_logging->maybe_write_to_log(
92 92
 						$response->get_error_code(),
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		* 	@return string
111 111
 		*	@since 6.0.0
112 112
 		*/
113
-		public function yikes_get_checkbox() {
113
+		public function yikes_get_checkbox() {
114 114
 
115 115
 			// Enqueue our checkbox styles whenever the checkbox is displayed
116 116
 			wp_enqueue_style( 'yikes-easy-mailchimp-checkbox-integration-styles', plugin_dir_url( __FILE__ ) . '../css/yikes-inc-easy-mailchimp-checkbox-integration.min.css' );
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
 			// We need to make sure we have a legit list ID right here. I don't think it will ever equal '-'
124 124
 
125
-			if ( $has_list_ids ) {
125
+			if ( $has_list_ids ) {
126 126
 				$checked = ( $checkbox_options[$this->type]['precheck'] == 'true' ) ? 'checked' : '';
127 127
 				// before checkbox HTML (comment, ...)
128 128
 				$before = '<!-- Easy Forms for MailChimp - https://www.yikesplugins.com/ -->';
@@ -150,19 +150,19 @@  discard block
 block discarded – undo
150 150
 		 * @param string $type       The integration type.
151 151
 		 * @param array  $merge_vars The array of form data to send.
152 152
 		 */
153
-		public function subscribe_user_integration( $email, $type, $merge_vars ) {
153
+		public function subscribe_user_integration( $email, $type, $merge_vars ) {
154 154
 			// get checkbox data
155 155
 			$options = get_option( 'optin-checkbox-init', '' );
156 156
 
157 157
 			// Make sure we have a list ID.
158
-			if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ]['associated-list'] ) ) {
158
+			if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ]['associated-list'] ) ) {
159 159
 				// @todo: Throw some kind of error?
160 160
 				return;
161 161
 			}
162 162
 
163 163
 			// Check for an IP address.
164 164
 			$user_ip = sanitize_text_field( $_SERVER['REMOTE_ADDR'] );
165
-			if ( isset( $merge_vars['OPTIN_IP'] ) ) {
165
+			if ( isset( $merge_vars['OPTIN_IP'] ) ) {
166 166
 				$user_ip = sanitize_text_field( $merge_vars['OPTIN_IP'] );
167 167
 			}
168 168
 
@@ -181,20 +181,20 @@  discard block
 block discarded – undo
181 181
 				'ip_signup'        => $user_ip,
182 182
 			);
183 183
 
184
-			foreach ( $list_ids as $list_id ) {
184
+			foreach ( $list_ids as $list_id ) {
185 185
 
186 186
 				$interests = isset( $options[ $type ]['interest-groups'] ) ? $options[ $type ]['interest-groups'] : array();
187 187
 				$interests = isset( $interests[$list_id] ) ? $interests[$list_id] : $interests;
188 188
 
189 189
 				// Only re-format and add interest groups if not empty
190
-				if ( ! empty( $interests ) ) {
190
+				if ( ! empty( $interests ) ) {
191 191
 
192 192
 					$groups = array();
193 193
 
194 194
 					// Need to reformat interest groups array as $interest_group_ID => true
195
-					foreach( $interests as $interest ) {
196
-						if ( is_array( $interest ) ) {
197
-							foreach( $interest as $group_id ) {
195
+					foreach( $interests as $interest ) {
196
+						if ( is_array( $interest ) ) {
197
+							foreach( $interest as $group_id ) {
198 198
 								$groups[ $group_id ] = true;
199 199
 							}
200 200
 						}
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
 				// Subscribe the user to the list via the API.
230 230
 				$response = yikes_get_mc_api_manager()->get_list_handler()->member_subscribe( $list_id, $id, $data );
231
-				if ( is_wp_error( $response ) ) {
231
+				if ( is_wp_error( $response ) ) {
232 232
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
233 233
 					$error_logging->maybe_write_to_log(
234 234
 						$response->get_error_code(),
@@ -245,21 +245,21 @@  discard block
 block discarded – undo
245 245
 		* Build merge varaibles array
246 246
 		*	@since 6.0.0
247 247
 		*/
248
-		public function user_merge_vars( WP_User $user ) {
248
+		public function user_merge_vars( WP_User $user ) {
249 249
 
250 250
 			// Start with user_login as name, since that's always known
251 251
 			$merge_vars = array(
252 252
 				'NAME' => $user->user_login,
253 253
 			);
254 254
 			
255
-			if ( ! empty( $user->first_name ) ) {
255
+			if ( ! empty( $user->first_name ) ) {
256 256
 				$merge_vars['NAME'] = $user->first_name;
257 257
 				$merge_vars['FNAME'] = $user->first_name;
258 258
 			}
259
-			if ( ! empty( $user->last_name ) ) {
259
+			if ( ! empty( $user->last_name ) ) {
260 260
 				$merge_vars['LNAME'] = $user->last_name;
261 261
 			}
262
-			if ( ! empty( $user->first_name ) && ! empty( $user->last_name ) ) {
262
+			if ( ! empty( $user->first_name ) && ! empty( $user->last_name ) ) {
263 263
 				$merge_vars['NAME'] = sprintf( '%s %s', $user->first_name, $user->last_name );
264 264
 			}
265 265
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		*	before continuing
282 282
 		*	@since 6.0.0
283 283
 		*/
284
-		public function was_checkbox_checked( $type ) {
284
+		public function was_checkbox_checked( $type ) {
285 285
 			return ( isset( $_POST[ 'yikes_mailchimp_checkbox_' . $type ] ) && $_POST[ 'yikes_mailchimp_checkbox_' . $type ] == 1 );
286 286
 		}
287 287
 
@@ -291,15 +291,15 @@  discard block
 block discarded – undo
291 291
 		*	if the registration form checkbox integration is toggled on
292 292
 		* 	@since 6.0.0
293 293
 		**/
294
-		public function yikes_reg_complete_msg( $errors, $redirect_to ) {
295
-			if( isset( $errors->errors['registered'] ) ) {
294
+		public function yikes_reg_complete_msg( $errors, $redirect_to ) {
295
+			if( isset( $errors->errors['registered'] ) ) {
296 296
 				$email_error = get_option( 'yikes_register_subscription_error' , '' );
297
-				if( isset( $email_error ) && $email_error != '' ) {
297
+				if( isset( $email_error ) && $email_error != '' ) {
298 298
 					// Use the magic __get method to retrieve the errors array:
299 299
 					$tmp = $errors->errors;
300 300
 					$old = 'Registration complete. Please check your e-mail.';
301
-					foreach( $tmp['registered'] as $index => $msg ) {
302
-						if( $msg === $old ) {
301
+					foreach( $tmp['registered'] as $index => $msg ) {
302
+						if( $msg === $old ) {
303 303
 							$tmp['registered'][$index] = $old . ' <p class="message"><strong>' . __( 'Note' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>: ' . $email_error . '</p>';
304 304
 						}
305 305
 					}
Please login to merge, or discard this patch.
blocks/blocks.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 		wp_register_script( 'yikes-datepicker-scripts', YIKES_MC_URL . 'public/js/yikes-datepicker-scripts.min.js', array( 'jquery-ui-datepicker' ), YIKES_MC_VERSION, false );
51 51
 		wp_localize_script( 'yikes-datepicker-scripts', 'datepicker_settings', $datepicker_options );
52 52
 		wp_enqueue_script( 'yikes-datepicker-scripts' );
53
-		wp_enqueue_style( 'jquery-datepicker-styles' , YIKES_MC_URL . 'public/css/jquery-ui.min.css' );
54
-		wp_enqueue_style( 'yikes-datepicker-styles' , YIKES_MC_URL . 'public/css/yikes-datepicker-styles.min.css' );
53
+		wp_enqueue_style( 'jquery-datepicker-styles', YIKES_MC_URL . 'public/css/jquery-ui.min.css' );
54
+		wp_enqueue_style( 'yikes-datepicker-styles', YIKES_MC_URL . 'public/css/yikes-datepicker-styles.min.css' );
55 55
 
56 56
 		wp_register_script( 'yikes-easy-forms-blocks', YIKES_MC_URL . 'blocks/release/blocks.js', array( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ), filemtime( plugin_dir_path( __FILE__ ) . 'release/blocks.js' ) );
57 57
 		wp_localize_script( 'yikes-easy-forms-blocks', 'ez_forms_gb_data', array( 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			wp_send_json_error( '1' );
94 94
 		}
95 95
 
96
-		$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
96
+		$form_id = isset( $_POST[ 'form_id' ] ) ? $_POST[ 'form_id' ] : '';
97 97
 
98 98
 		if ( empty( $form_id ) ) {
99 99
 			wp_send_json_error( '1' );
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
 			wp_send_json_error( '1' );
114 114
 		}
115 115
 
116
-		if ( get_option( 'yikes-mc-recaptcha-status' , '' ) == '1' ) {
116
+		if ( get_option( 'yikes-mc-recaptcha-status', '' ) == '1' ) {
117 117
 
118
-			$site_key   = get_option( 'yikes-mc-recaptcha-site-key' , '' );
119
-			$secret_key = get_option( 'yikes-mc-recaptcha-secret-key' , '' );
118
+			$site_key   = get_option( 'yikes-mc-recaptcha-site-key', '' );
119
+			$secret_key = get_option( 'yikes-mc-recaptcha-secret-key', '' );
120 120
 
121 121
 			// If either of the Private the Secret key is left blank, we should display an error back to the user
122 122
 			if ( empty( $site_key ) || empty( $secret_key ) ) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 			$locale   = get_locale();
127 127
 			$locale_a = explode( '_', $locale );
128
-			$locale   = isset( $locale_a[0] ) ? $locale_a[0] : $locale;
128
+			$locale   = isset( $locale_a[ 0 ] ) ? $locale_a[ 0 ] : $locale;
129 129
 
130 130
 			wp_send_json_success( array( 'site_key' => $site_key, 'secret_key' => $secret_key, 'locale' => $locale ) );
131 131
 		}
@@ -145,26 +145,26 @@  discard block
 block discarded – undo
145 145
 
146 146
 		// Prevent this from being run when in the admin/saving the block.
147 147
 		// I'm not sure why this would run when we're saving a block but it is definitely being called.
148
-		if ( is_admin() || isset( $_POST['status'] ) && $_POST['status'] === 'publish' ) {
148
+		if ( is_admin() || isset( $_POST[ 'status' ] ) && $_POST[ 'status' ] === 'publish' ) {
149 149
 			return null;
150 150
 		}
151 151
 
152 152
 		$shortcode_attributes = array(
153
-			'form'                       => $attributes['form_id'],
154
-			'submit'                     => isset( $attributes['submit_button_text'] ) && ! empty( $attributes['submit_button_text'] ) ? $attributes['submit_button_text'] : '',
155
-			'title'                      => isset( $attributes['show_title'] ) && $attributes['show_title'] === true ? '1' : '0',
156
-			'custom_title'               => isset( $attributes['form_title'] ) ? $attributes['form_title'] : '',
157
-			'description'                => isset( $attributes['show_description'] ) && $attributes['show_description'] === true ? '1' : '0',
158
-			'custom_description'         => isset( $attributes['form_description'] ) ? $attributes['form_description'] : '',
159
-			'ajax'                       => isset( $attributes['is_ajax'] ) && $attributes['is_ajax'] === true ? '1' : '0',
160
-			'recaptcha'                  => isset( $attributes['recaptcha'] ) && $attributes['recaptcha'] === false ? '0' : '',
161
-			'recaptcha_lang'             => isset( $attributes['recaptcha_lang'] ) ? $attributes['recaptcha_lang'] : '',
162
-			'recaptcha_type'             => isset( $attributes['recaptcha_type'] ) ? $attributes['recaptcha_type'] : '',
163
-			'recaptcha_theme'            => isset( $attributes['recaptcha_theme'] ) ? $attributes['recaptcha_theme'] : '',
164
-			'recaptcha_size'             => isset( $attributes['recaptcha_size'] ) ? $attributes['recaptcha_size'] : '',
165
-			'recaptcha_data_callback'    => isset( $attributes['recaptcha_verify_callback'] ) ? $attributes['recaptcha_verify_callback'] : '',
166
-			'recaptcha_expired_callback' => isset( $attributes['recaptcha_expired_callback'] ) ? $attributes['recaptcha_expired_callback'] : '',
167
-			'inline'                     => isset( $attributes['inline'] ) && $attributes['inline'] === true ? '1' : '0',
153
+			'form'                       => $attributes[ 'form_id' ],
154
+			'submit'                     => isset( $attributes[ 'submit_button_text' ] ) && ! empty( $attributes[ 'submit_button_text' ] ) ? $attributes[ 'submit_button_text' ] : '',
155
+			'title'                      => isset( $attributes[ 'show_title' ] ) && $attributes[ 'show_title' ] === true ? '1' : '0',
156
+			'custom_title'               => isset( $attributes[ 'form_title' ] ) ? $attributes[ 'form_title' ] : '',
157
+			'description'                => isset( $attributes[ 'show_description' ] ) && $attributes[ 'show_description' ] === true ? '1' : '0',
158
+			'custom_description'         => isset( $attributes[ 'form_description' ] ) ? $attributes[ 'form_description' ] : '',
159
+			'ajax'                       => isset( $attributes[ 'is_ajax' ] ) && $attributes[ 'is_ajax' ] === true ? '1' : '0',
160
+			'recaptcha'                  => isset( $attributes[ 'recaptcha' ] ) && $attributes[ 'recaptcha' ] === false ? '0' : '',
161
+			'recaptcha_lang'             => isset( $attributes[ 'recaptcha_lang' ] ) ? $attributes[ 'recaptcha_lang' ] : '',
162
+			'recaptcha_type'             => isset( $attributes[ 'recaptcha_type' ] ) ? $attributes[ 'recaptcha_type' ] : '',
163
+			'recaptcha_theme'            => isset( $attributes[ 'recaptcha_theme' ] ) ? $attributes[ 'recaptcha_theme' ] : '',
164
+			'recaptcha_size'             => isset( $attributes[ 'recaptcha_size' ] ) ? $attributes[ 'recaptcha_size' ] : '',
165
+			'recaptcha_data_callback'    => isset( $attributes[ 'recaptcha_verify_callback' ] ) ? $attributes[ 'recaptcha_verify_callback' ] : '',
166
+			'recaptcha_expired_callback' => isset( $attributes[ 'recaptcha_expired_callback' ] ) ? $attributes[ 'recaptcha_expired_callback' ] : '',
167
+			'inline'                     => isset( $attributes[ 'inline' ] ) && $attributes[ 'inline' ] === true ? '1' : '0',
168 168
 		);
169 169
 
170 170
 		return process_mailchimp_shortcode( $shortcode_attributes );
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
 
138 138
 		// Hook server side rendering into render callback
139 139
 		register_block_type( 'yikes-inc-easy-forms/easy-forms-block', array(
140
-		    'render_callback' => array( $this, 'render_easy_forms_block' ),
140
+			 'render_callback' => array( $this, 'render_easy_forms_block' ),
141 141
 		) );	
142 142
 	}
143 143
 
Please login to merge, or discard this patch.
admin/partials/menu/options-sections/integration-settings.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -54,23 +54,23 @@  discard block
 block discarded – undo
54 54
 
55 55
 	// Easy Digital Downloads.
56 56
 	if ( class_exists( 'Easy_Digital_Downloads' ) ) {
57
-		$active_plugins['easy_digital_downloads_checkout_form'] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' );
57
+		$active_plugins[ 'easy_digital_downloads_checkout_form' ] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' );
58 58
 	}
59 59
 	// WooCommerce.
60 60
 	if ( class_exists( 'WooCommerce' ) ) {
61
-		$active_plugins['woocommerce_checkout_form'] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' );
61
+		$active_plugins[ 'woocommerce_checkout_form' ] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' );
62 62
 	}
63 63
 	// BuddyPress.
64 64
 	if ( class_exists( 'BuddyPress' ) ) {
65
-		$active_plugins['buddypress_form'] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' );
65
+		$active_plugins[ 'buddypress_form' ] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' );
66 66
 	}
67 67
 	// bbPress.
68 68
 	if ( class_exists( 'bbPress' ) ) {
69
-		$active_plugins['bbpress_forms'] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' );
69
+		$active_plugins[ 'bbpress_forms' ] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' );
70 70
 	}
71 71
 	// Contact Form 7.
72 72
 	if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
73
-		$active_plugins['contact_form_7'] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' );
73
+		$active_plugins[ 'contact_form_7' ] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' );
74 74
 	}
75 75
 
76 76
 	// store our checkbox options.
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
88 88
 			$error_logging->maybe_write_to_log(
89 89
 				$list_data->get_error_code(),
90
-				__( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ),
90
+				__( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
91 91
 				"Integration Settings Page"
92 92
 			);
93 93
 		}
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
 		<?php
119 119
 			if ( ! empty( $active_plugins ) ) {
120 120
 
121
-				foreach( $active_plugins as $class => $value ) {
121
+				foreach ( $active_plugins as $class => $value ) {
122 122
 
123
-					$checked              = isset( $options[$class]['value'] ) ? 'checked="checked"' : '';
124
-					$hidden               = ! isset( $options[$class]['value'] ) ? 'yikes-easy-mc-hidden' : '';
125
-					$checkbox_label       = isset( $options[$class]['label'] ) ? esc_attr( $options[$class]['label'] ) : '';
126
-					$precheck_checkbox    = isset( $options[$class]['precheck'] ) ? $options[$class]['precheck'] : '';
127
-					$selected_list        = isset( $options[$class]['associated-list'] ) ? $options[$class]['associated-list'] : '-';
128
-					$list_interest_groups = isset( $options[$class]['interest-groups'] ) ? $options[$class]['interest-groups'] : false;
123
+					$checked              = isset( $options[ $class ][ 'value' ] ) ? 'checked="checked"' : '';
124
+					$hidden               = ! isset( $options[ $class ][ 'value' ] ) ? 'yikes-easy-mc-hidden' : '';
125
+					$checkbox_label       = isset( $options[ $class ][ 'label' ] ) ? esc_attr( $options[ $class ][ 'label' ] ) : '';
126
+					$precheck_checkbox    = isset( $options[ $class ][ 'precheck' ] ) ? $options[ $class ][ 'precheck' ] : '';
127
+					$selected_list        = isset( $options[ $class ][ 'associated-list' ] ) ? $options[ $class ][ 'associated-list' ] : '-';
128
+					$list_interest_groups = isset( $options[ $class ][ 'interest-groups' ] ) ? $options[ $class ][ 'interest-groups' ] : false;
129 129
 
130 130
 					// Force the selected list to be an array (@since 6.4).
131 131
 					$selected_list        = is_array( $selected_list ) ? $selected_list : array( $selected_list );
132 132
 					?>
133 133
 						<li class="yikes-mailchimp-checkbox-integration-item">
134 134
 							<label>
135
-								<input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[$class]; ?></div>
135
+								<input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[ $class ]; ?></div>
136 136
 							</label>
137 137
 						</li>
138 138
 						<!-- checkbox settings, text - associated list etc. -->
139 139
 						<li class="optin-checkbox-init[<?php echo $class; ?>]-settings <?php echo $hidden; ?>">
140
-							<?php if( $class == 'contact_form_7' ) { ?>
140
+							<?php if ( $class == 'contact_form_7' ) { ?>
141 141
 								<p style="margin-top:0;"><small class="contact-form-7-notice"><?php printf( __( 'Use %s in Contact Form 7 to display the checkbox.', 'yikes-inc-easy-mailchimp-extender' ), '<code>[yikes_mailchimp_checkbox]</code>' ); ?></small></p>
142 142
 							<?php } ?>
143 143
 							<p style="margin-top:0;padding-top:0;margin-bottom:0;padding-bottom:0;">
@@ -147,24 +147,24 @@  discard block
 block discarded – undo
147 147
 									<?php
148 148
 									if ( count( $list_data ) > 0 ) {
149 149
 									?>
150
-										<?php foreach( $list_data as $list ) { ?>
150
+										<?php foreach ( $list_data as $list ) { ?>
151 151
 
152 152
 											<?php
153
-												$list_interest_groups = isset( $list_interest_groups[ $list['id'] ] ) ? $list_interest_groups[ $list['id'] ] : $list_interest_groups;
153
+												$list_interest_groups = isset( $list_interest_groups[ $list[ 'id' ] ] ) ? $list_interest_groups[ $list[ 'id' ] ] : $list_interest_groups;
154 154
 											?>
155 155
 
156
-											<label class="yikes-mailchimp-checkbox-integration-list" for="list-<?php echo $class ?>-<?php echo $list['id']; ?>">
156
+											<label class="yikes-mailchimp-checkbox-integration-list" for="list-<?php echo $class ?>-<?php echo $list[ 'id' ]; ?>">
157 157
 												<input type="checkbox" class="checkbox-settings-list-item" data-integration="<?php echo $class; ?>" 
158 158
 													name="optin-checkbox-init[<?php echo $class; ?>][associated-list][]"
159
-													value="<?php echo $list['id']; ?>" <?php echo in_array( $list['id'], $selected_list ) ? 'checked="checked"' : ''; ?> 
160
-													id="list-<?php echo $class ?>-<?php echo $list['id']; ?>">
161
-												<?php echo $list['name']; ?>
159
+													value="<?php echo $list[ 'id' ]; ?>" <?php echo in_array( $list[ 'id' ], $selected_list ) ? 'checked="checked"' : ''; ?> 
160
+													id="list-<?php echo $class ?>-<?php echo $list[ 'id' ]; ?>">
161
+												<?php echo $list[ 'name' ]; ?>
162 162
 											</label>
163 163
 
164 164
 											<!-- If interest groups have been selected already, load them here -->
165 165
 											<?php
166
-											if ( in_array( $list['id'], $selected_list ) && $list_interest_groups ) {
167
-												YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list['id'], $class, true );
166
+											if ( in_array( $list[ 'id' ], $selected_list ) && $list_interest_groups ) {
167
+												YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list[ 'id' ], $class, true );
168 168
 											}
169 169
 											?>
170 170
 
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 								<label class="optin-checkbox-label">
186 186
 									<strong><?php _e( 'Precheck Checkbox?', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
187 187
 									<select id="optin-checkbox-init[<?php echo $class; ?>][precheck]" name="optin-checkbox-init[<?php echo $class; ?>][precheck]" class="optin-checkbox-init[<?php echo $class; ?>][precheck] checkbox-settings-list-dropdown">
188
-										<option value="true" <?php selected( $precheck_checkbox , 'true' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
189
-										<option value="false" <?php selected( $precheck_checkbox , 'false' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
188
+										<option value="true" <?php selected( $precheck_checkbox, 'true' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
189
+										<option value="false" <?php selected( $precheck_checkbox, 'false' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
190 190
 									</select>
191 191
 								</label>
192 192
 							</p>
Please login to merge, or discard this patch.
Braces   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -53,23 +53,23 @@  discard block
 block discarded – undo
53 53
 	);
54 54
 
55 55
 	// Easy Digital Downloads.
56
-	if ( class_exists( 'Easy_Digital_Downloads' ) ) {
56
+	if ( class_exists( 'Easy_Digital_Downloads' ) ) {
57 57
 		$active_plugins['easy_digital_downloads_checkout_form'] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' );
58 58
 	}
59 59
 	// WooCommerce.
60
-	if ( class_exists( 'WooCommerce' ) ) {
60
+	if ( class_exists( 'WooCommerce' ) ) {
61 61
 		$active_plugins['woocommerce_checkout_form'] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' );
62 62
 	}
63 63
 	// BuddyPress.
64
-	if ( class_exists( 'BuddyPress' ) ) {
64
+	if ( class_exists( 'BuddyPress' ) ) {
65 65
 		$active_plugins['buddypress_form'] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' );
66 66
 	}
67 67
 	// bbPress.
68
-	if ( class_exists( 'bbPress' ) ) {
68
+	if ( class_exists( 'bbPress' ) ) {
69 69
 		$active_plugins['bbpress_forms'] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' );
70 70
 	}
71 71
 	// Contact Form 7.
72
-	if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
72
+	if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
73 73
 		$active_plugins['contact_form_7'] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' );
74 74
 	}
75 75
 
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 
82 82
 	<?php
83 83
 	// lets confirm the user has a valid API key stored.
84
-	if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
84
+	if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
85 85
 		$list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists();
86
-		if ( is_wp_error( $list_data ) ) {
86
+		if ( is_wp_error( $list_data ) ) {
87 87
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
88 88
 			$error_logging->maybe_write_to_log(
89 89
 				$list_data->get_error_code(),
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 				"Integration Settings Page"
92 92
 			);
93 93
 		}
94
-	} else {
94
+	} else {
95 95
 		?>
96 96
 		<div class="inside">
97 97
 			<?php
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
 	<ul>
118 118
 		<?php
119
-			if ( ! empty( $active_plugins ) ) {
119
+			if ( ! empty( $active_plugins ) ) {
120 120
 
121
-				foreach( $active_plugins as $class => $value ) {
121
+				foreach( $active_plugins as $class => $value ) {
122 122
 
123 123
 					$checked              = isset( $options[$class]['value'] ) ? 'checked="checked"' : '';
124 124
 					$hidden               = ! isset( $options[$class]['value'] ) ? 'yikes-easy-mc-hidden' : '';
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 								<!-- Associated Lists -->
146 146
 								<div class="checkbox-lists"><strong><?php _e( 'Choose Lists: ', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
147 147
 									<?php
148
-									if ( count( $list_data ) > 0 ) {
148
+									if ( count( $list_data ) > 0 ) {
149 149
 									?>
150 150
 										<?php foreach( $list_data as $list ) { ?>
151 151
 
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 
164 164
 											<!-- If interest groups have been selected already, load them here -->
165 165
 											<?php
166
-											if ( in_array( $list['id'], $selected_list ) && $list_interest_groups ) {
166
+											if ( in_array( $list['id'], $selected_list ) && $list_interest_groups ) {
167 167
 												YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list['id'], $class, true );
168 168
 											}
169 169
 											?>
170 170
 
171 171
 										<?php } ?>
172 172
 									<?php
173
-								} else {
173
+								} else {
174 174
 									echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. Head over to MailChimp and setup your first list.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>';
175 175
 								}
176 176
 								?>
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 						</li>
194 194
 					<?php
195 195
 			}
196
-		} else {
196
+		} else {
197 197
 			?>
198 198
 				<li>
199 199
 					<?php _e( 'Nothing is active.', 'yikes-inc-easy-mailchimp-extender' ); ?>
Please login to merge, or discard this patch.
partials/menu/options-sections/templates/integration-interest-groups.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 		*/
28 28
 		foreach ( $interest_groupings as $id => $interest_group ) {
29 29
 
30
-			$interest_group_type      = isset( $interest_group['type'] ) ? $interest_group['type'] : '';
31
-			$interest_groups_fields   = isset( $interest_group['items'] ) ? $interest_group['items'] : array();
32
-			$selected_interest_groups = isset( $integration_options[ $integration_type ]['interest-groups'] ) ? $integration_options[ $integration_type ]['interest-groups'] : array();
33
-			$selected_interest_groups = isset( $selected_interest_groups[$list_id] ) ? $selected_interest_groups[$list_id] : $selected_interest_groups;
30
+			$interest_group_type      = isset( $interest_group[ 'type' ] ) ? $interest_group[ 'type' ] : '';
31
+			$interest_groups_fields   = isset( $interest_group[ 'items' ] ) ? $interest_group[ 'items' ] : array();
32
+			$selected_interest_groups = isset( $integration_options[ $integration_type ][ 'interest-groups' ] ) ? $integration_options[ $integration_type ][ 'interest-groups' ] : array();
33
+			$selected_interest_groups = isset( $selected_interest_groups[ $list_id ] ) ? $selected_interest_groups[ $list_id ] : $selected_interest_groups;
34 34
 			?>
35 35
 			<section class="interest-group-section">
36
-				<strong class="interest-group-section-title"><?php echo ucwords( $interest_group['title'] ); ?></strong>
36
+				<strong class="interest-group-section-title"><?php echo ucwords( $interest_group[ 'title' ] ); ?></strong>
37 37
 			<?php
38 38
 
39 39
 			/*
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 							<input type="checkbox"
56 56
 								name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $list_id; ?>][<?php echo $id; ?>][]"
57 57
 								value="<?php echo $field_id; ?>" <?php echo $checked; ?>>
58
-							<?php echo $field['name']; ?>
58
+							<?php echo $field[ 'name' ]; ?>
59 59
 						</label>
60 60
 						<?php
61 61
 					}
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 							<input type="radio"
72 72
 								name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $list_id; ?>][<?php echo $id; ?>][]"
73 73
 								value="<?php echo $field_id; ?>" <?php echo $checked; ?>>
74
-							<?php echo $field['name']; ?>
74
+							<?php echo $field[ 'name' ]; ?>
75 75
 						</label>
76 76
 						<?php
77 77
 					}
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 							}
90 90
 						?>
91 91
 							<option value="<?php echo $field_id; ?>" <?php echo $selected; ?>>
92
-								<?php echo $field['name']; ?>
92
+								<?php echo $field[ 'name' ]; ?>
93 93
 							</option>
94 94
 						<?php
95 95
 						}
Please login to merge, or discard this patch.
admin/partials/menu/options-sections/recaptcha-settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 		<?php settings_fields( 'yikes_inc_easy_mc_recaptcha_settings_page' ); ?>
30 30
 
31 31
 			<label for="yikes-mc-recaptcha-setting">
32
-				<input type="checkbox" name="yikes-mc-recaptcha-status" class="recaptcha-setting-checkbox" value="1" <?php checked( get_option( 'yikes-mc-recaptcha-status', '' ) , '1' ); ?>>
32
+				<input type="checkbox" name="yikes-mc-recaptcha-status" class="recaptcha-setting-checkbox" value="1" <?php checked( get_option( 'yikes-mc-recaptcha-status', '' ), '1' ); ?>>
33 33
 				<strong><?php _e( 'Enable reCAPTCHA Protection', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
34 34
 			</label>
35 35
 
Please login to merge, or discard this patch.
yikes-inc-easy-mailchimp-extender.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
  * 	@since 6.1.3
44 44
  */
45 45
 if ( ! defined( 'YIKES_MC_VERSION' ) ) {
46
-	define( 'YIKES_MC_VERSION' , '6.4.1' );
46
+	define( 'YIKES_MC_VERSION', '6.4.1' );
47 47
 }
48 48
 
49 49
 /**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
  * 	@since 6.0.0
53 53
  */
54 54
 if ( ! defined( 'YIKES_MC_PATH' ) ) {
55
-	define( 'YIKES_MC_PATH' , plugin_dir_path( __FILE__ ) );
55
+	define( 'YIKES_MC_PATH', plugin_dir_path( __FILE__ ) );
56 56
 }
57 57
 
58 58
 /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  * 	@since 6.0.0
62 62
  */
63 63
 if ( ! defined( 'YIKES_MC_URL' ) ) {
64
-	define( 'YIKES_MC_URL' , plugin_dir_url( __FILE__ ) );
64
+	define( 'YIKES_MC_URL', plugin_dir_url( __FILE__ ) );
65 65
 }
66 66
 
67 67
 // Include our autoloader
Please login to merge, or discard this patch.