Completed
Push — staging ( db2286...a0e6e2 )
by
unknown
12:24
created
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.