Completed
Pull Request — master (#811)
by
unknown
09:59 queued 07:34
created
class.easy_digital_downloads_checkout_form-checkbox.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,11 +80,11 @@
 block discarded – undo
80 80
 
81 81
 		$user_info  = (array) edd_get_payment_meta_user_info( $payment_id );
82 82
 		$merge_vars = array();
83
-		if ( isset( $user_info['first_name'] ) ) {
84
-			$merge_vars['FNAME'] = $user_info['first_name'];
83
+		if ( isset( $user_info[ 'first_name' ] ) ) {
84
+			$merge_vars[ 'FNAME' ] = $user_info[ 'first_name' ];
85 85
 		}
86
-		if ( isset( $user_info['last_name'] ) ) {
87
-			$merge_vars['LNAME'] = $user_info['last_name'];
86
+		if ( isset( $user_info[ 'last_name' ] ) ) {
87
+			$merge_vars[ 'LNAME' ] = $user_info[ 'last_name' ];
88 88
 		}
89 89
 
90 90
 		// Subscribe the user.
Please login to merge, or discard this patch.
public/classes/checkbox-integrations/class.comment_form-checkbox.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,12 +75,12 @@
 block discarded – undo
75 75
 
76 76
 		// Create merge variables based on comment data.
77 77
 		$merge_vars = array(
78
-			'FNAME'    => $comment_data['comment_author'],
79
-			'OPTIN_IP' => $comment_data['comment_author_IP'],
78
+			'FNAME'    => $comment_data[ 'comment_author' ],
79
+			'OPTIN_IP' => $comment_data[ 'comment_author_IP' ],
80 80
 		);
81 81
 
82 82
 		// Subscribe the user.
83
-		$this->subscribe_user_integration( $comment_data['comment_author_email'], $this->type, $merge_vars );
83
+		$this->subscribe_user_integration( $comment_data[ 'comment_author_email' ], $this->type, $merge_vars );
84 84
 	}
85 85
 }
86 86
 $yikes_easy_mc_comment_checkbox_class = new Yikes_Easy_MC_Comment_Checkbox_Class();
Please login to merge, or discard this patch.
public/classes/checkbox-integrations/class.contact_form_7-checkbox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * @return array $data CF7 posted data.
49 49
 	 */
50 50
 	public function alter_cf7_data( $data = array() ) {
51
-		$data['yikes_mailchimp_checkbox'] = $this->was_checkbox_checked( $this->type ) ? __( 'Yes', 'yikes-inc-easy-mailchimp-extender' ) : __( 'No', 'yikes-inc-easy-mailchimp-extender' );
51
+		$data[ 'yikes_mailchimp_checkbox' ] = $this->was_checkbox_checked( $this->type ) ? __( 'Yes', 'yikes-inc-easy-mailchimp-extender' ) : __( 'No', 'yikes-inc-easy-mailchimp-extender' );
52 52
 		return $data;
53 53
 	}
54 54
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		$submission          = WPCF7_Submission::get_instance();
66 66
 		if ( $submission ) {
67 67
 			$data   = $submission->get_posted_data();
68
-			$email  = isset( $data['your-email'] ) ? $data['your-email'] : '';
68
+			$email  = isset( $data[ 'your-email' ] ) ? $data[ 'your-email' ] : '';
69 69
 			$fields = array( 'email' => $email );
70 70
 			$this->subscribe_user_integration( $email, $this->type, apply_filters( 'yikes-mailchimp-contact-form-7', $fields, $data ) );
71 71
 		}
Please login to merge, or discard this patch.
blocks/api/api.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 			wp_send_json_error( '1' );
41 41
 		}
42 42
 
43
-		$form_id = isset( $_POST['form_id'] ) ? filter_var( wp_unslash( $_POST['form_id'] ), FILTER_SANITIZE_NUMBER_INT ) : '';
43
+		$form_id = isset( $_POST[ 'form_id' ] ) ? filter_var( wp_unslash( $_POST[ 'form_id' ] ), FILTER_SANITIZE_NUMBER_INT ) : '';
44 44
 
45 45
 		if ( empty( $form_id ) ) {
46 46
 			wp_send_json_error( '1' );
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 
76 76
 			$locale   = get_locale();
77 77
 			$locale_a = explode( '_', $locale );
78
-			$locale   = isset( $locale_a[0] ) ? $locale_a[0] : $locale;
78
+			$locale   = isset( $locale_a[ 0 ] ) ? $locale_a[ 0 ] : $locale;
79 79
 			$return   = apply_filters( 'yikes_mailchimp_recaptcha_data', array(
80 80
 				'site_key'   => $site_key,
81 81
 				'secret_key' => $secret_key,
82 82
 				'locale'     => $locale,
83
-			));
83
+			) );
84 84
 
85 85
 			wp_send_json_success( $return );
86 86
 		}
Please login to merge, or discard this patch.
public/classes/checkbox-integrations.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 
47 47
 		// Convert the integration type to a list ID.
48 48
 		$checkbox_options = get_option( 'optin-checkbox-init', '' );
49
-		if ( empty( $checkbox_options ) || ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ]['associated-list'] ) ) {
49
+		if ( empty( $checkbox_options ) || ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ][ 'associated-list' ] ) ) {
50 50
 			return false;
51 51
 		}
52 52
 
53
-		$list_ids = $checkbox_options[ $type ]['associated-list'];
53
+		$list_ids = $checkbox_options[ $type ][ 'associated-list' ];
54 54
 		$list_ids = is_array( $list_ids ) ? $list_ids : array( $list_ids );
55 55
 
56 56
 		// 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 === (int) $data['status'] ) {
87
+			if ( isset( $data[ 'status' ] ) && 404 === (int) $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
 	}
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
 
115 115
 		// Get our options.
116 116
 		$checkbox_options = get_option( 'optin-checkbox-init', array() );
117
-		$has_list_ids     = isset( $checkbox_options[ $this->type ]['associated-list'] ) && '-' !== $checkbox_options[ $this->type ]['associated-list'];
118
-		$has_list_ids     = $has_list_ids && ! in_array( '-', $checkbox_options[ $this->type ]['associated-list'], true );
117
+		$has_list_ids     = isset( $checkbox_options[ $this->type ][ 'associated-list' ] ) && '-' !== $checkbox_options[ $this->type ][ 'associated-list' ];
118
+		$has_list_ids     = $has_list_ids && ! in_array( '-', $checkbox_options[ $this->type ][ 'associated-list' ], true );
119 119
 
120 120
 		if ( $has_list_ids ) {
121
-			$label    = isset( $checkbox_options[ $this->type ]['label'] ) && ! empty( $checkbox_options[ $this->type ]['label'] ) ? trim( $checkbox_options[ $this->type ]['label'] ) : __( 'Sign me up for your mailing list.', 'yikes-inc-easy-mailchimp-extender' );
122
-			$checked  = 'true' === $checkbox_options[ $this->type ]['precheck'] ? 'checked="checked"' : '';
121
+			$label    = isset( $checkbox_options[ $this->type ][ 'label' ] ) && ! empty( $checkbox_options[ $this->type ][ 'label' ] ) ? trim( $checkbox_options[ $this->type ][ 'label' ] ) : __( 'Sign me up for your mailing list.', 'yikes-inc-easy-mailchimp-extender' );
122
+			$checked  = 'true' === $checkbox_options[ $this->type ][ 'precheck' ] ? 'checked="checked"' : '';
123 123
 			$before   = apply_filters( 'yikes-mailchimp-before-checkbox-html', '' );
124 124
 			$content  = '<p id="yikes-easy-mailchimp-' . esc_attr( $this->type ) . '-checkbox" class="yikes-easy-mailchimp-' . esc_attr( $this->type ) . '-checkbox">';
125 125
 			$content .= '<label>';
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		$options = get_option( 'optin-checkbox-init', '' );
149 149
 
150 150
 		// Make sure we have a list ID.
151
-		if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ]['associated-list'] ) ) {
151
+		if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ][ 'associated-list' ] ) ) {
152 152
 			// @todo: Throw some kind of error?
153 153
 			return;
154 154
 		}
@@ -156,14 +156,14 @@  discard block
 block discarded – undo
156 156
 		$email = sanitize_email( $email );
157 157
 
158 158
 		// Check for an IP address.
159
-		$user_ip = sanitize_text_field( $_SERVER['REMOTE_ADDR'] );
160
-		if ( isset( $merge_vars['OPTIN_IP'] ) ) {
161
-			$user_ip = sanitize_text_field( $merge_vars['OPTIN_IP'] );
159
+		$user_ip = sanitize_text_field( $_SERVER[ 'REMOTE_ADDR' ] );
160
+		if ( isset( $merge_vars[ 'OPTIN_IP' ] ) ) {
161
+			$user_ip = sanitize_text_field( $merge_vars[ 'OPTIN_IP' ] );
162 162
 		}
163 163
 
164 164
 		// Build our request data.
165
-		$list_ids = $options[ $type ]['associated-list'];
166
-		$list_ids = is_array( $options[ $type ]['associated-list'] ) ? $options[ $type ]['associated-list'] : array( $options[ $type ]['associated-list'] );
165
+		$list_ids = $options[ $type ][ 'associated-list' ];
166
+		$list_ids = is_array( $options[ $type ][ 'associated-list' ] ) ? $options[ $type ][ 'associated-list' ] : array( $options[ $type ][ 'associated-list' ] );
167 167
 		$id       = md5( $email );
168 168
 		$data     = array(
169 169
 			'email_address' => $email,
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
 		foreach ( $list_ids as $list_id ) {
177 177
 
178
-			$interests = isset( $options[ $type ]['interest-groups'] ) ? $options[ $type ]['interest-groups'] : array();
178
+			$interests = isset( $options[ $type ][ 'interest-groups' ] ) ? $options[ $type ][ 'interest-groups' ] : array();
179 179
 			$interests = isset( $interests[ $list_id ] ) ? $interests[ $list_id ] : $interests;
180 180
 
181 181
 			// Only re-format and add interest groups if not empty.
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 					}
192 192
 				}
193 193
 
194
-				$data['interests'] = $groups;
194
+				$data[ 'interests' ] = $groups;
195 195
 			}
196 196
 
197 197
 			/**
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
 			$list_id = apply_filters( 'yikes-mailchimp-checkbox-integration-list-id', $list_id, $data, $type );
218 218
 
219 219
 			// Don't send an empty merge fields array.
220
-			if ( empty( $data['merge_fields'] ) ) {
221
-				unset( $data['merge_fields'] );
220
+			if ( empty( $data[ 'merge_fields' ] ) ) {
221
+				unset( $data[ 'merge_fields' ] );
222 222
 			}
223 223
 
224 224
 			// Subscribe the user to the list via the API.
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
 		$merge_vars = array();
249 249
 
250 250
 		if ( ! empty( $user->first_name ) ) {
251
-			$merge_vars['FNAME'] = $user->first_name;
251
+			$merge_vars[ 'FNAME' ] = $user->first_name;
252 252
 		}
253 253
 		if ( ! empty( $user->last_name ) ) {
254
-			$merge_vars['LNAME'] = $user->last_name;
254
+			$merge_vars[ 'LNAME' ] = $user->last_name;
255 255
 		}
256 256
 
257 257
 		/**
Please login to merge, or discard this patch.
public/partials/ajax/class.public_ajax.php 1 patch
Spacing   +34 added lines, -34 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    = filter_var( $_POST['user_email'], FILTER_SANITIZE_STRING );
61
+		$user_email    = filter_var( $_POST[ 'user_email' ], FILTER_SANITIZE_STRING );
62 62
 		$user_id       = md5( $user_email );
63
-		$list_id       = filter_var( $_POST['list_id'], FILTER_SANITIZE_STRING );
64
-		$form_id       = filter_var( $_POST['form_id'], FILTER_SANITIZE_NUMBER_INT );
65
-		$page_id       = filter_var( $_POST['page_id'], FILTER_SANITIZE_NUMBER_INT );
63
+		$list_id       = filter_var( $_POST[ 'list_id' ], FILTER_SANITIZE_STRING );
64
+		$form_id       = filter_var( $_POST[ 'form_id' ], FILTER_SANITIZE_NUMBER_INT );
65
+		$page_id       = filter_var( $_POST[ 'page_id' ], FILTER_SANITIZE_NUMBER_INT );
66 66
 		$full_site_url = get_bloginfo( 'url' );
67 67
 		$manager       = yikes_get_mc_api_manager();
68 68
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 				'class.public_ajax.php'
80 80
 			);
81 81
 			$is_error = true;
82
-			$errors[] = $list_details->get_error_message();
82
+			$errors[ ] = $list_details->get_error_message();
83 83
 		}
84 84
 
85 85
 		// Subscriber details API call.
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
89 89
 			$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' );
90 90
 			$is_error = true;
91
-			$errors[] = $subscriber_account_details->get_error_message();
91
+			$errors[ ] = $subscriber_account_details->get_error_message();
92 92
 		}
93 93
 
94 94
 		// Form details API call.
@@ -96,22 +96,22 @@  discard block
 block discarded – undo
96 96
 		if ( ! empty( $interface ) && method_exists( $interface, 'get_form' ) && ! empty( $form_id ) ) {
97 97
 			$form_data = $interface->get_form( $form_id );
98 98
 			if ( ! empty( $form_data ) ) {
99
-				if ( isset( $form_data['error_messages'] ) ) {
99
+				if ( isset( $form_data[ 'error_messages' ] ) ) {
100 100
 
101
-					if ( isset( $form_data['error_messages']['email-body'] ) && ! empty( $form_data['error_messages']['email-body'] ) ) {
102
-						$email_body = apply_filters( 'the_content', $form_data['error_messages']['email-body'] );
101
+					if ( isset( $form_data[ 'error_messages' ][ 'email-body' ] ) && ! empty( $form_data[ 'error_messages' ][ 'email-body' ] ) ) {
102
+						$email_body = apply_filters( 'the_content', $form_data[ 'error_messages' ][ 'email-body' ] );
103 103
 					}
104 104
 
105
-					if ( isset( $form_data['error_messages']['email-subject'] ) && ! empty( $form_data['error_messages']['email-subject'] ) ) {
106
-						$email_subject = $form_data['error_messages']['email-subject'];
105
+					if ( isset( $form_data[ 'error_messages' ][ 'email-subject' ] ) && ! empty( $form_data[ 'error_messages' ][ 'email-subject' ] ) ) {
106
+						$email_subject = $form_data[ 'error_messages' ][ 'email-subject' ];
107 107
 					}
108 108
 
109
-					if ( isset( $form_data['error_messages']['update-email-success'] ) && ! empty( $form_data['error_messages']['update-email-success'] ) ) {
110
-						$update_email_success_message = $form_data['error_messages']['update-email-success'];
109
+					if ( isset( $form_data[ 'error_messages' ][ 'update-email-success' ] ) && ! empty( $form_data[ 'error_messages' ][ 'update-email-success' ] ) ) {
110
+						$update_email_success_message = $form_data[ 'error_messages' ][ 'update-email-success' ];
111 111
 					}
112 112
 
113
-					if ( isset( $form_data['error_messages']['update-email-failure'] ) && ! empty( $form_data['error_messages']['update-email-failure'] ) ) {
114
-						$update_email_failed_message = $form_data['error_messages']['update-email-failure'];
113
+					if ( isset( $form_data[ 'error_messages' ][ 'update-email-failure' ] ) && ! empty( $form_data[ 'error_messages' ][ 'update-email-failure' ] ) ) {
114
+						$update_email_failed_message = $form_data[ 'error_messages' ][ 'update-email-failure' ];
115 115
 					}
116 116
 				}
117 117
 			}
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 		}
133 133
 
134 134
 		// Construct the headers & email message content.
135
-		$subscriber_id    = $subscriber_account_details['unique_email_id'];
136
-		$update_link_href = str_replace( '/subscribe', '/profile', $list_details['subscribe_url_long'] );
135
+		$subscriber_id    = $subscriber_account_details[ 'unique_email_id' ];
136
+		$update_link_href = str_replace( '/subscribe', '/profile', $list_details[ 'subscribe_url_long' ] );
137 137
 		$update_link_href = add_query_arg( 'e', $subscriber_id, $update_link_href );
138 138
 		$update_link_tag  = '<a href="' . $update_link_href . '">';
139
-		$headers          = 'From: ' . $list_details['campaign_defaults']['from_name'] . ' <' . $list_details['campaign_defaults']['from_email'] . '>' . "\r\n";
139
+		$headers          = 'From: ' . $list_details[ 'campaign_defaults' ][ 'from_name' ] . ' <' . $list_details[ 'campaign_defaults' ][ 'from_email' ] . '>' . "\r\n";
140 140
 		$headers         .= 'Content-type: text/html';
141 141
 
142 142
 		if ( ! isset( $email_subject ) ) {
@@ -178,26 +178,26 @@  discard block
 block discarded – undo
178 178
 		$email_body = str_replace( array( '[subscriber_id]', '[SUBSCRIBER_ID]' ), $subscriber_id, $email_body );
179 179
 
180 180
 		// We let the user use [form_name] for the form's name so replace [form_name] with the form's name.
181
-		$email_body = str_replace( array( '[form_name]', '[FORM_NAME]' ), $form_data['form_name'], $email_body );
181
+		$email_body = str_replace( array( '[form_name]', '[FORM_NAME]' ), $form_data[ 'form_name' ], $email_body );
182 182
 
183 183
 		// We let the user use [fname] and [lname] so replace those.
184
-		$email_body = str_replace( array( '[fname]', '[FNAME]' ), isset( $subscriber_account_details['merge_fields']['FNAME'] ) ? $subscriber_account_details['merge_fields']['FNAME'] : '', $email_body );
185
-		$email_body = str_replace( array( '[lname]', '[LNAME]' ), isset( $subscriber_account_details['merge_fields']['LNAME'] ) ? $subscriber_account_details['merge_fields']['LNAME'] : '', $email_body );
184
+		$email_body = str_replace( array( '[fname]', '[FNAME]' ), isset( $subscriber_account_details[ 'merge_fields' ][ 'FNAME' ] ) ? $subscriber_account_details[ 'merge_fields' ][ 'FNAME' ] : '', $email_body );
185
+		$email_body = str_replace( array( '[lname]', '[LNAME]' ), isset( $subscriber_account_details[ 'merge_fields' ][ 'LNAME' ] ) ? $subscriber_account_details[ 'merge_fields' ][ 'LNAME' ] : '', $email_body );
186 186
 
187 187
 		/* Confirm that the email was sent */
188 188
 		if ( wp_mail( $user_email, apply_filters( 'yikes-mailchimp-update-email-subject', $email_subject ), apply_filters( 'yikes-mailchimp-update-email-content', $email_body, $update_link_href ), $headers ) ) {
189 189
 
190 190
 			$update_email_success_message = apply_filters( 'yikes-mailchimp-update-email-success-message', $update_email_success_message, $form_id, $user_email );
191
-			$submission_settings          = isset( $form_data['submission_settings'] ) ? $form_data['submission_settings'] : null;
191
+			$submission_settings          = isset( $form_data[ 'submission_settings' ] ) ? $form_data[ 'submission_settings' ] : null;
192 192
 			$redirect_settings            = Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler::handle_submission_response_success_redirect( $form_id, $submission_settings, $page_id );
193 193
 
194 194
 			wp_send_json_success(
195 195
 				array(
196 196
 					'response_text'  => '<div class="yikes-easy-mc-success-message">' . $update_email_success_message . '</div>',
197
-					'redirection'    => $redirect_settings['redirection'],
198
-					'redirect'       => $redirect_settings['redirect'],
199
-					'redirect_timer' => $redirect_settings['redirect_timer'],
200
-					'new_window'     => $redirect_settings['new_window'],
197
+					'redirection'    => $redirect_settings[ 'redirection' ],
198
+					'redirect'       => $redirect_settings[ 'redirect' ],
199
+					'redirect_timer' => $redirect_settings[ 'redirect_timer' ],
200
+					'new_window'     => $redirect_settings[ 'new_window' ],
201 201
 				)
202 202
 			);
203 203
 		} else {
Please login to merge, or discard this patch.
admin/partials/view-user.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 *	Get and store our variables
4 4
 *	@since 6.0
5 5
 */
6
-$list_id     = $_GET['mailchimp-list'];
7
-$email_id    = esc_attr( $_GET['email-id'] );
6
+$list_id     = $_GET[ 'mailchimp-list' ];
7
+$email_id    = esc_attr( $_GET[ 'email-id' ] );
8 8
 $list_helper = yikes_get_mc_api_manager()->get_list_handler();
9 9
 
10 10
 /*
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
 }
37 37
 
38 38
 $other_lists      = $list_helper->get_members_lists( $email_id );
39
-$merge_data_array = $user_data['merge_fields'];
39
+$merge_data_array = $user_data[ 'merge_fields' ];
40 40
 
41 41
 $additional_lists = array();
42 42
 $merge_variable_fields = array();
43 43
 
44 44
 /* Build the array of mailing lists the user is subscribed to */
45 45
 foreach ( $other_lists as $id => $value ) {
46
-	if ( 'subscribed' !== $value['status'] ) {
46
+	if ( 'subscribed' !== $value[ 'status' ] ) {
47 47
 		continue;
48 48
 	}
49 49
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		continue;
59 59
 	}
60 60
 
61
-	$additional_lists[ $list_data['id'] ] = $list_data['name'];
61
+	$additional_lists[ $list_data[ 'id' ] ] = $list_data[ 'name' ];
62 62
 }
63 63
 
64 64
 /* Build the array of merge variables => value */
@@ -74,21 +74,21 @@  discard block
 block discarded – undo
74 74
 }
75 75
 // loop and display
76 76
 if ( $merge_variables ) {
77
-	foreach ( $merge_variables['merge_fields'] as $merge_variable ) {
78
-		if ( $merge_variable['tag'] != 'EMAIL' ) {
79
-			$merge_variable_fields[ $merge_variable['name'] ] = ( isset( $merge_data_array[ $merge_variable['tag'] ] ) ) ? $merge_data_array[ $merge_variable['tag'] ] : '';
77
+	foreach ( $merge_variables[ 'merge_fields' ] as $merge_variable ) {
78
+		if ( $merge_variable[ 'tag' ] != 'EMAIL' ) {
79
+			$merge_variable_fields[ $merge_variable[ 'name' ] ] = ( isset( $merge_data_array[ $merge_variable[ 'tag' ] ] ) ) ? $merge_data_array[ $merge_variable[ 'tag' ] ] : '';
80 80
 		}
81 81
 	}
82 82
 }
83 83
 
84 84
 
85 85
 // store usable data
86
-$user_email = sanitize_email( $user_data['email_address'] );
86
+$user_email = sanitize_email( $user_data[ 'email_address' ] );
87 87
 // prepend our email address to the beginning
88 88
 $merge_variable_fields = array( 'Email Address' => $user_email ) + $merge_variable_fields;
89 89
 $gravatar_image        = get_avatar( $user_email, 120 );
90
-$email_type            = $user_data['email_type'];
91
-$member_rating         = ( ! empty( $user_data['member_rating'] ) ) ? (int) $user_data['member_rating'] : 0;
90
+$email_type            = $user_data[ 'email_type' ];
91
+$member_rating         = ( ! empty( $user_data[ 'member_rating' ] ) ) ? (int) $user_data[ 'member_rating' ] : 0;
92 92
 $member_rating_stars   = '';
93 93
 
94 94
 // Create member rating stars
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 	}
101 101
 }
102 102
 
103
-$last_changed  = strtotime( $user_data['last_changed'] );
104
-$user_language = ( ! empty( $user_data['language'] ) ) ? $user_data['language'] : '';
103
+$last_changed  = strtotime( $user_data[ 'last_changed' ] );
104
+$user_language = ( ! empty( $user_data[ 'language' ] ) ) ? $user_data[ 'language' ] : '';
105 105
 $list_name     = $additional_lists[ $list_id ];
106 106
 
107 107
 // Generate our display page
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 							echo sprintf( esc_html__( 'Subscribed: %1$1s', 'yikes-inc-easy-mailchimp-extender' ), esc_html( gmdate( 'F jS, Y h:i a', $last_changed ) ) );
145 145
 						?>
146 146
 					</span>
147
-				<?php if ( isset( $user_data['location'] ) && isset( $user_data['location']['timezone'] ) && ! empty( $user_data['location']['timezone'] ) && isset( $user_data['location']['country_code'] ) && ! empty( $user_data['location']['country_code'] ) ) { ?>
147
+				<?php if ( isset( $user_data[ 'location' ] ) && isset( $user_data[ 'location' ][ 'timezone' ] ) && ! empty( $user_data[ 'location' ][ 'timezone' ] ) && isset( $user_data[ 'location' ][ 'country_code' ] ) && ! empty( $user_data[ 'location' ][ 'country_code' ] ) ) { ?>
148 148
 					<span class="member-location-data">
149 149
 						<?php
150 150
 							/* translators: the placeholders are a timezone and a country code */
151
-							echo sprintf( esc_html__( 'Location: %1$1s, %2$2s', 'yikes-inc-easy-mailchimp-extender' ), esc_html( $user_data['location']['timezone'] ), esc_html( $user_data['location']['country_code'] ) );
151
+							echo sprintf( esc_html__( 'Location: %1$1s, %2$2s', 'yikes-inc-easy-mailchimp-extender' ), esc_html( $user_data[ 'location' ][ 'timezone' ] ), esc_html( $user_data[ 'location' ][ 'country_code' ] ) );
152 152
 						?>
153 153
 					</span>
154 154
 				<?php } ?>
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 			<hr class="yikes-mc-subscriber-hr" />
158 158
 
159 159
 			<?php
160
-			if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && filter_var( wp_unslash( $_GET['section'] ), FILTER_SANITIZE_STRING ) === 'subscriber-data' ) ) {
160
+			if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && filter_var( wp_unslash( $_GET[ 'section' ] ), FILTER_SANITIZE_STRING ) === 'subscriber-data' ) ) {
161 161
 				?>
162 162
 			<section class="yikes-mc-card-body merge-variable-section">
163 163
 				<h3><?php esc_html_e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 					<strong><?php esc_html_e( 'No Subscriber Data Found', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
178 178
 					<?php
179 179
 				}
180
-				if ( isset( $user_data['ip_signup'] ) && ! empty( $user_data['ip_signup'] ) ) {
180
+				if ( isset( $user_data[ 'ip_signup' ] ) && ! empty( $user_data[ 'ip_signup' ] ) ) {
181 181
 					?>
182 182
 					<li>
183 183
 						<label>
184 184
 							<strong class="section-label"><?php esc_html_e( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
185
-							<p class="section-value"><em><?php esc_html_e( $user_data['ip_signup'] ); ?></em></p>
185
+							<p class="section-value"><em><?php esc_html_e( $user_data[ 'ip_signup' ] ); ?></em></p>
186 186
 						</label>
187 187
 					</li>
188 188
 					<?php
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 			<?php
194 194
 
195 195
 
196
-			if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) {
196
+			if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) {
197 197
 				?>
198 198
 				<section class="yikes-mc-card-body">
199 199
 					<?php
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 			?>
223 223
 
224 224
 			<?php
225
-			if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) {
225
+			if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) {
226 226
 				$unsubscribe_subscriber_url = esc_url_raw( add_query_arg( array(
227 227
 					'action'         => 'yikes-easy-mc-unsubscribe-user',
228 228
 					'mailchimp-list' => $list_id,
@@ -277,36 +277,36 @@  discard block
 block discarded – undo
277 277
 		<div id="customer-tab-wrapper">
278 278
 			<ul id="customer-tab-wrapper-list">
279 279
 
280
-				<?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?>
280
+				<?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?>
281 281
 				<a title="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $subscriber_details; ?>">
282 282
 					<?php } ?>
283 283
 
284
-					<li <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
284
+					<li <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
285 285
 						<span class="dashicons  dashicons-id"></span></li>
286 286
 
287
-					<?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?>
287
+					<?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?>
288 288
 				</a>
289 289
 			<?php } ?>
290 290
 
291
-				<?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] != 'additional-subscriptions' ) ) { ?>
291
+				<?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'additional-subscriptions' ) ) { ?>
292 292
 				<a title="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $additional_subscription_url; ?>">
293 293
 					<?php } ?>
294 294
 
295
-					<li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
295
+					<li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
296 296
 						<span class="dashicons dashicons-portfolio"></span></li>
297 297
 
298
-					<?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) ) { ?>
298
+					<?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) ) { ?>
299 299
 				</a>
300 300
 			<?php } ?>
301 301
 
302
-				<?php if ( ! isset( $_GET['section'] ) || isset( $_GET['section'] ) && $_GET['section'] != 'delete-subscriber' ) { ?>
302
+				<?php if ( ! isset( $_GET[ 'section' ] ) || isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'delete-subscriber' ) { ?>
303 303
 				<a title="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $delete_subscriber_url; ?>">
304 304
 					<?php } ?>
305 305
 
306
-					<li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
306
+					<li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
307 307
 						<span class="dashicons dashicons-trash"></span></li>
308 308
 
309
-					<?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) ) { ?>
309
+					<?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) ) { ?>
310 310
 				</a>
311 311
 			<?php } ?>
312 312
 
Please login to merge, or discard this patch.
admin/partials/ajax/add_interest_group_to_form.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
 $error = 0;
6 6
 
7 7
 // Get our $_POST variables
8
-$list_id = isset( $_POST['list_id'] ) ? $_POST['list_id'] : '';
9
-$interest_groups = isset( $_POST['interest_groups'] ) ? $_POST['interest_groups'] : array();
8
+$list_id = isset( $_POST[ 'list_id' ] ) ? $_POST[ 'list_id' ] : '';
9
+$interest_groups = isset( $_POST[ 'interest_groups' ] ) ? $_POST[ 'interest_groups' ] : array();
10 10
 
11 11
 // Make sure our $_POST variables aren't empty
12 12
 if ( empty( $list_id ) ) {
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
 
50 50
 
51 51
 // Loop through the interest groups data (group_id, field_name, field_type) and add the fields to the form
52
-foreach( $interest_groups as $group ) {
52
+foreach ( $interest_groups as $group ) {
53 53
 
54 54
 	// find and return the location of this merge field in the array
55
-	$index      = $this->findMCListIndex( $group['group_id'], $interest_groupings, 'id' );
55
+	$index      = $this->findMCListIndex( $group[ 'group_id' ], $interest_groupings, 'id' );
56 56
 	$field_data = $interest_groupings[ $index ];
57
-	$groups     = wp_list_pluck( $field_data['items'], 'name' );
57
+	$groups     = wp_list_pluck( $field_data[ 'items' ], 'name' );
58 58
 
59 59
 	?>
60
-	<section class="draggable" id="<?php echo $group['group_id']; ?>">
60
+	<section class="draggable" id="<?php echo $group[ 'group_id' ]; ?>">
61 61
 		<!-- top -->
62 62
 		<a href="#" class="expansion-section-title settings-sidebar">
63
-			<span class="dashicons dashicons-plus yikes-mc-expansion-toggle" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
64
-			<?php echo stripslashes( $group['field_name'] ); ?>
65
-			<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $group['field_type']; ?></small></span>
63
+			<span class="dashicons dashicons-plus yikes-mc-expansion-toggle" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
64
+			<?php echo stripslashes( $group[ 'field_name' ] ); ?>
65
+			<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $group[ 'field_type' ]; ?></small></span>
66 66
 		</a>
67 67
 		<!-- expansion section -->
68 68
 		<div class="yikes-mc-settings-expansion-section">
@@ -70,37 +70,37 @@  discard block
 block discarded – undo
70 70
 			<!-- Single or Double Opt-in -->
71 71
 			<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
72 72
 				<!-- store the label -->
73
-				<input type="hidden" name="field[<?php echo $group['group_id']; ?>][label]" value="<?php echo htmlspecialchars( $group['field_name'] ); ?>" />
74
-				<input type="hidden" name="field[<?php echo $group['group_id']; ?>][type]" value="<?php echo $group['field_type']; ?>" />
75
-				<input type="hidden" name="field[<?php echo $group['group_id']; ?>][group_id]" value="<?php echo $group['group_id']; ?>" />
76
-				<input type="hidden" name="field[<?php echo $group['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( $groups, true ) ); ?>' />
73
+				<input type="hidden" name="field[<?php echo $group[ 'group_id' ]; ?>][label]" value="<?php echo htmlspecialchars( $group[ 'field_name' ] ); ?>" />
74
+				<input type="hidden" name="field[<?php echo $group[ 'group_id' ]; ?>][type]" value="<?php echo $group[ 'field_type' ]; ?>" />
75
+				<input type="hidden" name="field[<?php echo $group[ 'group_id' ]; ?>][group_id]" value="<?php echo $group[ 'group_id' ]; ?>" />
76
+				<input type="hidden" name="field[<?php echo $group[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( $groups, true ) ); ?>' />
77 77
 
78 78
 
79 79
 				<table class="form-table form-field-container">
80 80
 
81 81
 					<!-- Default Value -->
82
-					<?php switch( $group['field_type'] ) {
82
+					<?php switch ( $group[ 'field_type' ] ) {
83 83
 
84 84
 						case 'radio':
85 85
 						?>
86 86
 							<tr valign="top">
87 87
 								<td scope="row">
88 88
 									<label for="placeholder">
89
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
89
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
90 90
 									</label>
91 91
 								</td>
92 92
 								<td>
93 93
 
94
-									<?php $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : 'no-default'; ?>
94
+									<?php $pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : 'no-default'; ?>
95 95
 
96 96
 									<!-- No Default option for radio buttons -->
97
-									<input type="radio" name="field[<?php echo $group['group_id']; ?>][default_choice][]" value="no-default" <?php checked( $pre_selected, 'no-default' ); ?>>No Default
97
+									<input type="radio" name="field[<?php echo $group[ 'group_id' ]; ?>][default_choice][]" value="no-default" <?php checked( $pre_selected, 'no-default' ); ?>>No Default
98 98
 
99
-									<?php foreach ( $field_data['items'] as $id => $interest_group ) { ?>
100
-										<input type="radio" name="field[<?php echo $group['group_id']; ?>][default_choice][]" value="<?php echo esc_attr( $id ); ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group['name'] );
99
+									<?php foreach ( $field_data[ 'items' ] as $id => $interest_group ) { ?>
100
+										<input type="radio" name="field[<?php echo $group[ 'group_id' ]; ?>][default_choice][]" value="<?php echo esc_attr( $id ); ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group[ 'name' ] );
101 101
 									} ?>
102 102
 
103
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
103
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
104 104
 								</td>
105 105
 							</tr>
106 106
 
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
 							<tr valign="top" class="yikes-checkbox-container">
115 115
 								<td scope="row">
116 116
 									<label for="placeholder">
117
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
117
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
118 118
 									</label>
119 119
 								</td>
120 120
 								<td>
121 121
 									<?php
122
-									foreach ( $field_data['items'] as $id => $interest_group ) {
123
-										$pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : '0';
122
+									foreach ( $field_data[ 'items' ] as $id => $interest_group ) {
123
+										$pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : '0';
124 124
 										?>
125
-										<input type="checkbox" name="field[<?php echo $group['group_id']; ?>][default_choice][]" value="<?php echo $id; ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
125
+										<input type="checkbox" name="field[<?php echo $group[ 'group_id' ]; ?>][default_choice][]" value="<?php echo $id; ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group[ 'name' ] ); ?>
126 126
 										<?php
127 127
 									}
128 128
 									?>
129
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
129
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
130 130
 								</td>
131 131
 							</tr>
132 132
 
@@ -138,18 +138,18 @@  discard block
 block discarded – undo
138 138
 							<tr valign="top">
139 139
 								<td scope="row">
140 140
 									<label for="placeholder">
141
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
141
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
142 142
 									</label>
143 143
 								</td>
144 144
 								<td>
145
-									<select type="default" name="field[<?php echo $group['group_id']; ?>][default_choice]">
146
-										<?php $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : 'no-default'; ?>
145
+									<select type="default" name="field[<?php echo $group[ 'group_id' ]; ?>][default_choice]">
146
+										<?php $pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : 'no-default'; ?>
147 147
 										<option value="no-default">No Default</option>
148
-										<?php foreach ( $field_data['items'] as $id => $interest_group ) { ?>
149
-											<option value="<?php echo $id; ?>" <?php selected( $pre_selected, $id ); ?>><?php echo $interest_group['name']; ?></option>
148
+										<?php foreach ( $field_data[ 'items' ] as $id => $interest_group ) { ?>
149
+											<option value="<?php echo $id; ?>" <?php selected( $pre_selected, $id ); ?>><?php echo $interest_group[ 'name' ]; ?></option>
150 150
 										<?php } ?>
151 151
 									</select>
152
-									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
152
+									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
153 153
 								</td>
154 154
 							</tr>
155 155
 
@@ -161,25 +161,25 @@  discard block
 block discarded – undo
161 161
 					<tr valign="top">
162 162
 						<td scope="row">
163 163
 							<label for="placeholder">
164
-								<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
164
+								<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
165 165
 							</label>
166 166
 						</td>
167 167
 						<td>
168
-							<textarea class="widefat field-description-input" name="field[<?php echo $group['group_id']; ?>][description]"></textarea>
169
-							<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
168
+							<textarea class="widefat field-description-input" name="field[<?php echo $group[ 'group_id' ]; ?>][description]"></textarea>
169
+							<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
170 170
 						</td>
171 171
 					</tr>
172 172
 
173 173
 					<!-- Description Above Field -->
174 174
 					<tr valign="top" class="yikes-checkbox-container">
175 175
 						<td scope="row">
176
-							<label for="description_above_<?php echo esc_attr( $group['group_id'] ); ?>">
177
-								<?php _e( 'Description Above Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
176
+							<label for="description_above_<?php echo esc_attr( $group[ 'group_id' ] ); ?>">
177
+								<?php _e( 'Description Above Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
178 178
 							</label>
179 179
 						</td>
180 180
 						<td>
181
-							<input type="checkbox" id="description_above_<?php echo esc_attr( $group['group_id'] ); ?>" class="widefat field-description-input" name="field[<?php echo $group['group_id']; ?>][description_above]" value="1" />
182
-							<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
181
+							<input type="checkbox" id="description_above_<?php echo esc_attr( $group[ 'group_id' ] ); ?>" class="widefat field-description-input" name="field[<?php echo $group[ 'group_id' ]; ?>][description_above]" value="1" />
182
+							<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
183 183
 						</td>
184 184
 					</tr>
185 185
 
@@ -187,48 +187,48 @@  discard block
 block discarded – undo
187 187
 					<tr valign="top">
188 188
 						<td scope="row">
189 189
 							<label for="placeholder">
190
-								<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
190
+								<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
191 191
 							</label>
192 192
 						</td>
193 193
 						<td>
194
-							<input type="text" class="widefat" name="field[<?php echo $group['group_id']; ?>][additional-classes]" value="<?php echo isset( $group['classes'] ) ? stripslashes( wp_strip_all_tags( $group['classes'] ) ) : '' ; ?>" />
195
-							<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
194
+							<input type="text" class="widefat" name="field[<?php echo $group[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $group[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $group[ 'classes' ] ) ) : ''; ?>" />
195
+							<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
196 196
 						</td>
197 197
 						</tr>
198 198
 						<!-- Required Toggle -->
199 199
 						<tr valign="top" class="yikes-checkbox-container">
200 200
 							<td scope="row">
201 201
 								<label for="field-required">
202
-									<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
202
+									<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
203 203
 								</label>
204 204
 							</td>
205 205
 							<td>
206
-								<input type="checkbox" class="widefat" value="1" name="field[<?php echo $group['group_id']; ?>][require]">
207
-								<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
206
+								<input type="checkbox" class="widefat" value="1" name="field[<?php echo $group[ 'group_id' ]; ?>][require]">
207
+								<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
208 208
 							</td>
209 209
 						</tr>
210 210
 						<!-- Visible Toggle -->
211 211
 						<tr valign="top" class="yikes-checkbox-container">
212 212
 							<td scope="row">
213 213
 								<label for="hide-field">
214
-									<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
214
+									<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
215 215
 								</label>
216 216
 							</td>
217 217
 							<td>
218
-								<input type="checkbox" class="widefat" value="1" name="field[<?php echo $group['group_id']; ?>][hide]">
219
-								<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
218
+								<input type="checkbox" class="widefat" value="1" name="field[<?php echo $group[ 'group_id' ]; ?>][hide]">
219
+								<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
220 220
 							</td>
221 221
 						</tr>
222 222
 						<!-- Toggle Field Label Visibility -->
223 223
 						<tr valign="top" class="yikes-checkbox-container">
224 224
 							<td scope="row">
225 225
 								<label for="placeholder">
226
-									<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
226
+									<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
227 227
 								</label>
228 228
 							</td>
229 229
 							<td>
230
-								<input type="checkbox" name="field[<?php echo $group['group_id']; ?>][hide-label]" value="1" />
231
-								<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
230
+								<input type="checkbox" name="field[<?php echo $group[ 'group_id' ]; ?>][hide-label]" value="1" />
231
+								<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
232 232
 							</td>
233 233
 						</tr>
234 234
 						<!-- Toggle Buttons -->
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 							</td>
239 239
 							<td>
240 240
 								<span class="toggle-container">
241
-									<a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
242
-									<a href="#" class="remove-field" alt="<?php echo $group['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
241
+									<a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
242
+									<a href="#" class="remove-field" alt="<?php echo $group[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
243 243
 								</span>
244 244
 							</td>
245 245
 						</tr>
Please login to merge, or discard this patch.
admin/partials/ajax/class.ajax.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		public function __construct() {
13 13
 
14 14
 			// Ajax send merge variable to form builder.
15
-			add_action( 'wp_ajax_add_field_to_form', array( $this , 'send_field_to_form' ), 10 );
15
+			add_action( 'wp_ajax_add_field_to_form', array( $this, 'send_field_to_form' ), 10 );
16 16
 
17 17
 			// Ajax send interest group to form builder.
18 18
 			add_action( 'wp_ajax_add_interest_group_to_form', array( $this, 'send_interest_group_to_form' ), 10 );
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		*	- return a single container
42 42
 		*/
43 43
 		public function add_notification_to_form() {
44
-			if ( isset( $_POST['notification_name'] ) ) {
44
+			if ( isset( $_POST[ 'notification_name' ] ) ) {
45 45
 				include_once YIKES_MC_PATH . 'admin/partials/ajax/add_notification_to_form.php';
46 46
 			}
47 47
 			exit();
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		// when the user wants to switch which form data
52 52
 		// is displayed on the dashboard
53 53
 		public function get_new_list_data() {
54
-			$list_id   = $_POST['list_id'];
54
+			$list_id   = $_POST[ 'list_id' ];
55 55
 			$list_data = yikes_get_mc_api_manager()->get_list_handler()->get_list( $list_id );
56 56
 			if ( is_wp_error( $list_data ) ) {
57 57
 				$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 		/* note: this function is called statically from the integration settings page */
75 75
 		public static function check_list_for_interest_groups( $list_id = '', $integration_type = '', $load = false ) {
76 76
 			if ( ! $list_id ) {
77
-				$list_id = $_POST['list_id'];
77
+				$list_id = $_POST[ 'list_id' ];
78 78
 			}
79 79
 			if ( ! $integration_type ) {
80
-				$integration_type = $_POST['integration'];
80
+				$integration_type = $_POST[ 'integration' ];
81 81
 			}
82 82
 
83 83
 
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
 			if ( ! check_ajax_referer( 'add-tag', 'nonce', false ) ) {
123 123
 				wp_send_json_error( '1' );
124 124
 			}
125
-			$tags    = isset( $_POST['tags'] ) ? wp_unslash( $_POST['tags'] ) : array();
126
-			$list_id = isset( $_POST['list_id'] ) ? filter_var( wp_unslash( $_POST['list_id'] ), FILTER_SANITIZE_STRING ) : '';
127
-			$form_id = isset( $_POST['form_id'] ) ? filter_var( wp_unslash( $_POST['form_id'] ), FILTER_SANITIZE_NUMBER_INT ) : 0;
125
+			$tags    = isset( $_POST[ 'tags' ] ) ? wp_unslash( $_POST[ 'tags' ] ) : array();
126
+			$list_id = isset( $_POST[ 'list_id' ] ) ? filter_var( wp_unslash( $_POST[ 'list_id' ] ), FILTER_SANITIZE_STRING ) : '';
127
+			$form_id = isset( $_POST[ 'form_id' ] ) ? filter_var( wp_unslash( $_POST[ 'form_id' ] ), FILTER_SANITIZE_NUMBER_INT ) : 0;
128 128
 
129 129
 			if ( empty( $tags ) || empty( $list_id ) || empty( $form_id ) ) {
130 130
 				wp_send_json_error( '2' );
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
 
137 137
 			// This data came from $_POST so sanitize it.
138 138
 			foreach ( $tags as $tag ) {
139
-				$form_tags[ filter_var( $tag['tag_id'], FILTER_SANITIZE_NUMBER_INT ) ] = array(
140
-					'name' => filter_var( $tag['tag_name'], FILTER_SANITIZE_STRING ),
141
-					'id'   => filter_var( $tag['tag_id'], FILTER_SANITIZE_NUMBER_INT ),
139
+				$form_tags[ filter_var( $tag[ 'tag_id' ], FILTER_SANITIZE_NUMBER_INT ) ] = array(
140
+					'name' => filter_var( $tag[ 'tag_name' ], FILTER_SANITIZE_STRING ),
141
+					'id'   => filter_var( $tag[ 'tag_id' ], FILTER_SANITIZE_NUMBER_INT ),
142 142
 				);
143 143
 			}
144 144
 
145
-			$form['tags'] = $form_tags + ( isset( $form['tags'] ) ? $form['tags'] : array() );
145
+			$form[ 'tags' ] = $form_tags + ( isset( $form[ 'tags' ] ) ? $form[ 'tags' ] : array() );
146 146
 			$form_interface->update_form( $form_id, $form );
147 147
 			wp_send_json_success( array( 'tags' => $form_tags ) );
148 148
 		}
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 			if ( ! check_ajax_referer( 'remove-tag', 'nonce', false ) ) {
156 156
 				wp_send_json_error( '1' );
157 157
 			}
158
-			$tag     = isset( $_POST['tag'] ) ? filter_var( wp_unslash( $_POST['tag'] ), FILTER_SANITIZE_NUMBER_INT ) : array();
159
-			$list_id = isset( $_POST['list_id'] ) ? filter_var( wp_unslash( $_POST['list_id'] ), FILTER_SANITIZE_STRING ) : '';
160
-			$form_id = isset( $_POST['form_id'] ) ? filter_var( wp_unslash( $_POST['form_id'] ), FILTER_SANITIZE_NUMBER_INT ) : 0;
158
+			$tag     = isset( $_POST[ 'tag' ] ) ? filter_var( wp_unslash( $_POST[ 'tag' ] ), FILTER_SANITIZE_NUMBER_INT ) : array();
159
+			$list_id = isset( $_POST[ 'list_id' ] ) ? filter_var( wp_unslash( $_POST[ 'list_id' ] ), FILTER_SANITIZE_STRING ) : '';
160
+			$form_id = isset( $_POST[ 'form_id' ] ) ? filter_var( wp_unslash( $_POST[ 'form_id' ] ), FILTER_SANITIZE_NUMBER_INT ) : 0;
161 161
 
162 162
 			if ( empty( $tag ) || empty( $list_id ) || empty( $form_id ) ) {
163 163
 				wp_send_json_error( '2' );
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 
166 166
 			$form_interface = yikes_easy_mailchimp_extender_get_form_interface();
167 167
 			$form           = $form_interface->get_form( $form_id );
168
-			if ( isset( $form['tags'] ) && isset( $form['tags'][ $tag ] ) ) {
169
-				unset( $form['tags'][ $tag ] );
168
+			if ( isset( $form[ 'tags' ] ) && isset( $form[ 'tags' ][ $tag ] ) ) {
169
+				unset( $form[ 'tags' ][ $tag ] );
170 170
 			}
171 171
 			$form_interface->update_form( $form_id, $form );
172 172
 			wp_send_json_success();			
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
 		public function save_field_label_edits() {
191 191
 
192 192
 			// Capture our $_POST variables
193
-			$list_id	= isset( $_POST['list_id'] ) ? $_POST['list_id'] : '';
194
-			$field_data = isset( $_POST['field_data'] ) ? $_POST['field_data'] : array();
195
-			$field_name = isset( $field_data['field_name'] ) ? $field_data['field_name'] : '';
196
-			$field_id	= isset( $field_data['field_id'] ) ? $field_data['field_id'] : '';
193
+			$list_id = isset( $_POST[ 'list_id' ] ) ? $_POST[ 'list_id' ] : '';
194
+			$field_data = isset( $_POST[ 'field_data' ] ) ? $_POST[ 'field_data' ] : array();
195
+			$field_name = isset( $field_data[ 'field_name' ] ) ? $field_data[ 'field_name' ] : '';
196
+			$field_id = isset( $field_data[ 'field_id' ] ) ? $field_data[ 'field_id' ] : '';
197 197
 
198 198
 			// Make sure we have our required variables before continuing
199 199
 			if ( $list_id === '' || $field_name === '' || $field_id === '' ) {
Please login to merge, or discard this patch.