@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @return bool Whether the form was successfully updated. |
49 | 49 | */ |
50 | 50 | public function update_form( $form_id, $data ) { |
51 | - $data['id'] = $form_id; |
|
51 | + $data[ 'id' ] = $form_id; |
|
52 | 52 | $all_forms = $this->get_all_forms(); |
53 | 53 | |
54 | 54 | if ( ! isset( $all_forms[ $form_id ] ) ) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $all_ids = $this->get_form_ids(); |
80 | 80 | $last_id = end( $all_ids ); |
81 | 81 | $new_id = false === $last_id ? 1 : $last_id + 1; |
82 | - $form_data['id'] = $new_id; |
|
82 | + $form_data[ 'id' ] = $new_id; |
|
83 | 83 | |
84 | 84 | // Ensure our data is consistently sorted |
85 | 85 | ksort( $form_data ); |
@@ -5,25 +5,25 @@ |
||
5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
6 | 6 | * @since 6.0 |
7 | 7 | */ |
8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
11 | - $field_data = $form_data['custom_fields']; |
|
8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
12 | 12 | } |
13 | 13 | ?> |
14 | 14 | <div class="custom-field-section"> |
15 | 15 | <!-- title --> |
16 | - <strong><?php echo $field['label']; ?></strong> |
|
16 | + <strong><?php echo $field[ 'label' ]; ?></strong> |
|
17 | 17 | |
18 | 18 | <!-- Dropdown --> |
19 | - <select class="custom-select-field" name="custom-field[<?php echo $field['id']; ?>]"> |
|
20 | - <?php foreach( $field['options'] as $value => $label ) { ?> |
|
21 | - <option value="<?php echo $value; ?>" <?php if( isset( $field_data[$field['id']] ) ) { selected( $field_data[$field['id']] , $value ); } ?>><?php echo $label; ?></option> |
|
19 | + <select class="custom-select-field" name="custom-field[<?php echo $field[ 'id' ]; ?>]"> |
|
20 | + <?php foreach ( $field[ 'options' ] as $value => $label ) { ?> |
|
21 | + <option value="<?php echo $value; ?>" <?php if ( isset( $field_data[ $field[ 'id' ] ] ) ) { selected( $field_data[ $field[ 'id' ] ], $value ); } ?>><?php echo $label; ?></option> |
|
22 | 22 | <?php } ?> |
23 | 23 | </select> |
24 | 24 | |
25 | 25 | <!-- description --> |
26 | - <?php if( isset( $field['description'] ) && $field['description'] != '' ) { ?> |
|
27 | - <p class="description"><?php echo $field['description']; ?></p> |
|
26 | + <?php if ( isset( $field[ 'description' ] ) && $field[ 'description' ] != '' ) { ?> |
|
27 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
28 | 28 | <?php } ?> |
29 | 29 | </div> |
30 | 30 | \ No newline at end of file |
@@ -5,16 +5,16 @@ |
||
5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
6 | 6 | * @since 6.0 |
7 | 7 | */ |
8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
11 | - $field_data = $form_data['custom_fields']; |
|
8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
12 | 12 | } |
13 | 13 | ?> |
14 | 14 | <label class="custom-field-section"> |
15 | - <strong><?php echo $field['label']; ?></strong> |
|
16 | - <input type="text" class="widefat" name="custom-field[<?php echo $field['id']; ?>]" id="custom-field" value="<?php echo isset( $field_data[$field['id']] ) ? $field_data[$field['id']] : ''; ?>" placeholder="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : ''; ?>"> |
|
17 | - <?php if( isset( $field['description'] ) && $field['description'] != '' ) { ?> |
|
18 | - <p class="description"><?php echo $field['description']; ?></p> |
|
15 | + <strong><?php echo $field[ 'label' ]; ?></strong> |
|
16 | + <input type="text" class="widefat" name="custom-field[<?php echo $field[ 'id' ]; ?>]" id="custom-field" value="<?php echo isset( $field_data[ $field[ 'id' ] ] ) ? $field_data[ $field[ 'id' ] ] : ''; ?>" placeholder="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>"> |
|
17 | + <?php if ( isset( $field[ 'description' ] ) && $field[ 'description' ] != '' ) { ?> |
|
18 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
19 | 19 | <?php } ?> |
20 | 20 | </label> |
21 | 21 | \ No newline at end of file |
@@ -5,16 +5,16 @@ |
||
5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
6 | 6 | * @since 6.0 |
7 | 7 | */ |
8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
11 | - $field_data = $form_data['custom_fields']; |
|
8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
12 | 12 | } |
13 | 13 | ?> |
14 | 14 | <label class="custom-field-section"> |
15 | - <strong><?php echo $field['label']; ?></strong> |
|
16 | - <input type="checkbox" class="widefat" name="custom-field[<?php echo $field['id']; ?>]" id="custom-field" value="1" <?php checked( isset( $field_data[$field['id']] ) ? $field_data[$field['id']] : 0, 1, true ); ?>> |
|
17 | - <?php if( isset( $field['description'] ) && $field['description'] != '' ) { ?> |
|
18 | - <p class="description"><?php echo $field['description']; ?></p> |
|
15 | + <strong><?php echo $field[ 'label' ]; ?></strong> |
|
16 | + <input type="checkbox" class="widefat" name="custom-field[<?php echo $field[ 'id' ]; ?>]" id="custom-field" value="1" <?php checked( isset( $field_data[ $field[ 'id' ] ] ) ? $field_data[ $field[ 'id' ] ] : 0, 1, true ); ?>> |
|
17 | + <?php if ( isset( $field[ 'description' ] ) && $field[ 'description' ] != '' ) { ?> |
|
18 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
19 | 19 | <?php } ?> |
20 | 20 | </label> |
@@ -5,10 +5,10 @@ discard block |
||
5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
6 | 6 | * @since 6.0 |
7 | 7 | */ |
8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
11 | - $field_data = $form_data['custom_fields']; |
|
8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // This will enqueue the Media Uploader script |
@@ -16,27 +16,27 @@ discard block |
||
16 | 16 | // And let's not forget the script we wrote earlier |
17 | 17 | wp_enqueue_script( 'yikes-mailchimp-file-field-script', plugin_dir_url( __FILE__ ) . 'js/yikes-mc-file-upload.js', array( 'jquery' ), '1.0', false ); |
18 | 18 | // print_r( $field_data ); |
19 | - wp_localize_script( 'yikes-mailchimp-file-field-script' , 'additional_data' , array( |
|
19 | + wp_localize_script( 'yikes-mailchimp-file-field-script', 'additional_data', array( |
|
20 | 20 | 'wp_includes_image_url' => includes_url() . 'images/media/' |
21 | 21 | ) ); |
22 | 22 | $i = 1; |
23 | 23 | // create an single item array when nothing is stored yet, loop for one field |
24 | - $field_data['incentive-attachment'] = ( isset( $field_data['incentive-attachment'] ) && !empty( $field_data['incentive-attachment'] ) ) ? $field_data['incentive-attachment'] : array( '' ); |
|
24 | + $field_data[ 'incentive-attachment' ] = ( isset( $field_data[ 'incentive-attachment' ] ) && ! empty( $field_data[ 'incentive-attachment' ] ) ) ? $field_data[ 'incentive-attachment' ] : array( '' ); |
|
25 | 25 | ?> |
26 | 26 | |
27 | 27 | <div class="yikes-mailchimp-file-field"> |
28 | - <label for="image_url" class="widefat"><strong><?php echo $field['label']; ?></strong></label> |
|
29 | - <?php foreach( $field_data['incentive-attachment'] as $attachment ) { ?> |
|
30 | - <input type="text" name="custom-field[<?php echo $field['id']; ?>][<?php echo $i; ?>]" id="custom-field[<?php echo $field['id']; ?>][<?php echo $i; ?>]" class="file-attachment" value="<?php echo isset( $field_data[$field['id']][$i] ) ? $field_data[$field['id']][$i] : ''; ?>"> |
|
31 | - <input type="button" name="upload-btn" id="upload-btn" class="button-secondary" data-attr-position="<?php echo $i; ?>" value="<?php _e( 'Upload File' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
28 | + <label for="image_url" class="widefat"><strong><?php echo $field[ 'label' ]; ?></strong></label> |
|
29 | + <?php foreach ( $field_data[ 'incentive-attachment' ] as $attachment ) { ?> |
|
30 | + <input type="text" name="custom-field[<?php echo $field[ 'id' ]; ?>][<?php echo $i; ?>]" id="custom-field[<?php echo $field[ 'id' ]; ?>][<?php echo $i; ?>]" class="file-attachment" value="<?php echo isset( $field_data[ $field[ 'id' ] ][ $i ] ) ? $field_data[ $field[ 'id' ] ][ $i ] : ''; ?>"> |
|
31 | + <input type="button" name="upload-btn" id="upload-btn" class="button-secondary" data-attr-position="<?php echo $i; ?>" value="<?php _e( 'Upload File', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
32 | 32 | <div class="file-container"> |
33 | 33 | <p class="file-remove-wrapper"> |
34 | - <a href="#" class="remove-file-button" data-attr-position="<?php echo $i; ?>"><?php _e( 'Remove File' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
34 | + <a href="#" class="remove-file-button" data-attr-position="<?php echo $i; ?>"><?php _e( 'Remove File', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
35 | 35 | </p> |
36 | 36 | </div> |
37 | 37 | <?php $i++; } ?> |
38 | - <?php if( isset( $field['repeat'] ) ) { ?> |
|
38 | + <?php if ( isset( $field[ 'repeat' ] ) ) { ?> |
|
39 | 39 | <a href="#" class="button-secondary add-new-incentive-attachment" data-attr-position="<?php echo $i; ?>"><span class="dashicons dashicons-plus"></span></a> |
40 | 40 | <?php } ?> |
41 | - <p class="description"><?php echo $field['description']; ?></p> |
|
41 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
42 | 42 | </div> |
43 | 43 | \ No newline at end of file |
@@ -6,18 +6,18 @@ |
||
6 | 6 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
7 | 7 | * @since 6.0 |
8 | 8 | */ |
9 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
10 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
11 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
12 | - $field_data = $form_data['custom_fields']; |
|
9 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
10 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
11 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
12 | + $field_data = $form_data[ 'custom_fields' ]; |
|
13 | 13 | } |
14 | 14 | |
15 | - $content = ( isset( $field_data[$field['id']] ) ) ? $field_data[$field['id']] : ( isset( $field['default'] ) ? $field['default'] : '' ); |
|
16 | - $wysiwyg_id = 'custom-field['.$field['id'].']'; |
|
15 | + $content = ( isset( $field_data[ $field[ 'id' ] ] ) ) ? $field_data[ $field[ 'id' ] ] : ( isset( $field[ 'default' ] ) ? $field[ 'default' ] : '' ); |
|
16 | + $wysiwyg_id = 'custom-field[' . $field[ 'id' ] . ']'; |
|
17 | 17 | ?> |
18 | 18 | |
19 | 19 | <div class="yikes-mailchimp-wysiwyg-field"> |
20 | - <label for="image_url" class="widefat"><strong><?php echo $field['label']; ?></strong></label> |
|
21 | - <?php wp_editor( $content, $field['id'], array( 'textarea_name' => $wysiwyg_id ) ); ?> |
|
22 | - <p class="description"><?php echo $field['description']; ?></p> |
|
20 | + <label for="image_url" class="widefat"><strong><?php echo $field[ 'label' ]; ?></strong></label> |
|
21 | + <?php wp_editor( $content, $field[ 'id' ], array( 'textarea_name' => $wysiwyg_id ) ); ?> |
|
22 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
23 | 23 | </div> |
@@ -5,26 +5,26 @@ |
||
5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
6 | 6 | * @since 6.0 |
7 | 7 | */ |
8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
11 | - $field_data = $form_data['custom_fields']; |
|
8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
12 | 12 | } |
13 | 13 | ?> |
14 | 14 | <div class="custom-field-section"> |
15 | 15 | <!-- title --> |
16 | - <strong><?php echo $field['label']; ?></strong> |
|
16 | + <strong><?php echo $field[ 'label' ]; ?></strong> |
|
17 | 17 | <!-- radio buttons --> |
18 | 18 | <section class="custom-radio-holder"> |
19 | - <?php foreach( $field['options'] as $value => $label ) { ?> |
|
19 | + <?php foreach ( $field[ 'options' ] as $value => $label ) { ?> |
|
20 | 20 | <label class="custom-radio-label"> |
21 | - <input type="radio" name="custom-field[<?php echo $field['id']; ?>][]" id="custom-field" value="<?php echo $value; ?>" <?php if( isset( $field_data[$field['id']] ) ) { checked( $field_data[$field['id']] , $value ); } ?>> |
|
21 | + <input type="radio" name="custom-field[<?php echo $field[ 'id' ]; ?>][]" id="custom-field" value="<?php echo $value; ?>" <?php if ( isset( $field_data[ $field[ 'id' ] ] ) ) { checked( $field_data[ $field[ 'id' ] ], $value ); } ?>> |
|
22 | 22 | <?php echo $label; ?> |
23 | 23 | </label> |
24 | 24 | <?php } ?> |
25 | 25 | </section> |
26 | 26 | <!-- description --> |
27 | - <?php if( isset( $field['description'] ) && $field['description'] != '' ) { ?> |
|
28 | - <p class="description"><?php echo $field['description']; ?></p> |
|
27 | + <?php if ( isset( $field[ 'description' ] ) && $field[ 'description' ] != '' ) { ?> |
|
28 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
29 | 29 | <?php } ?> |
30 | 30 | </div> |
31 | 31 | \ No newline at end of file |
@@ -302,9 +302,9 @@ |
||
302 | 302 | ?></ul><?php |
303 | 303 | } |
304 | 304 | /** |
305 | - * Custom action hook for our add-ons to hook into |
|
306 | - * @since 6.0.3.8 |
|
307 | - */ |
|
305 | + * Custom action hook for our add-ons to hook into |
|
306 | + * @since 6.0.3.8 |
|
307 | + */ |
|
308 | 308 | do_action( 'yikes-mailchimp-list-form-fields-metabox' ); |
309 | 309 | ?> |
310 | 310 |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! isset( $_REQUEST['list-id'] ) ) { |
|
2 | +if ( ! isset( $_REQUEST[ 'list-id' ] ) ) { |
|
3 | 3 | wp_die( __( 'Oops, we can\'t determine what List to view. Please go back and try again.' ) ); |
4 | 4 | } |
5 | 5 | |
6 | -$list_id = sanitize_key( $_REQUEST['list-id'] ); |
|
6 | +$list_id = sanitize_key( $_REQUEST[ 'list-id' ] ); |
|
7 | 7 | $list_helper = yikes_get_mc_api_manager()->get_list_handler(); |
8 | 8 | $api_key = yikes_get_mc_api_key(); |
9 | 9 | $dash_position = strpos( $api_key, '-' ); |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | // setup pagination variables |
63 | -$paged = isset( $_REQUEST['paged'] ) ? filter_var( $_REQUEST['paged'], FILTER_SANITIZE_NUMBER_INT ) : 0; |
|
63 | +$paged = isset( $_REQUEST[ 'paged' ] ) ? filter_var( $_REQUEST[ 'paged' ], FILTER_SANITIZE_NUMBER_INT ) : 0; |
|
64 | 64 | $limit = apply_filters( 'yikes_admin_list_subscriber_limit', 20 ); |
65 | -$page_offset = (int) $paged * (int) $limit; |
|
66 | -$sort_dir = isset( $_REQUEST['sort'] ) ? $_REQUEST['sort'] : 'DESC'; |
|
65 | +$page_offset = (int) $paged * (int) $limit; |
|
66 | +$sort_dir = isset( $_REQUEST[ 'sort' ] ) ? $_REQUEST[ 'sort' ] : 'DESC'; |
|
67 | 67 | |
68 | 68 | if ( $sort_dir === 'DESC' ) { |
69 | 69 | $opposite_sort_dir = 'ASC'; |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | ?> |
91 | 91 | <div class="wrap"> |
92 | 92 | <!-- Freddie Logo --> |
93 | - <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" /> |
|
93 | + <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" /> |
|
94 | 94 | |
95 | - <h1>YIKES Easy Forms for MailChimp | <?php echo $list_data['name']; ?></h1> |
|
95 | + <h1>YIKES Easy Forms for MailChimp | <?php echo $list_data[ 'name' ]; ?></h1> |
|
96 | 96 | |
97 | 97 | <!-- Settings Page Description --> |
98 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'View all subscribers below. View additional subscriber info, or add additional fields to this list.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
99 | - <!-- <p class="add-new-subscriber-button"><a href="#" onclick="jQuery(this).parent().next().slideToggle();" class="add-new-h2"><?php _e( 'New Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> --> |
|
98 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'View all subscribers below. View additional subscriber info, or add additional fields to this list.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
99 | + <!-- <p class="add-new-subscriber-button"><a href="#" onclick="jQuery(this).parent().next().slideToggle();" class="add-new-h2"><?php _e( 'New Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> --> |
|
100 | 100 | |
101 | 101 | <?php |
102 | 102 | /* Display our admin notices here */ |
103 | 103 | // Unsubscribe user confirmation message |
104 | - if( isset( $_REQUEST['user-unsubscribed'] ) && $_REQUEST['user-unsubscribed'] == 'true' ) { |
|
104 | + if ( isset( $_REQUEST[ 'user-unsubscribed' ] ) && $_REQUEST[ 'user-unsubscribed' ] == 'true' ) { |
|
105 | 105 | ?> |
106 | 106 | <div class="updated manage-form-admin-notice"> |
107 | 107 | <p><?php _e( 'User successfully unsubscribed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
108 | 108 | </div> |
109 | 109 | <?php |
110 | 110 | } |
111 | - if( isset( $_REQUEST['user-unsubscribed'] ) && $_REQUEST['user-unsubscribed'] == 'false' ) { |
|
111 | + if ( isset( $_REQUEST[ 'user-unsubscribed' ] ) && $_REQUEST[ 'user-unsubscribed' ] == 'false' ) { |
|
112 | 112 | ?> |
113 | 113 | <div class="error manage-form-admin-notice"> |
114 | 114 | <p><?php _e( "We've encountered an error trying to remove the subscriber. Please try again. If the error persists please get in contact with the YIKES Inc. support staff.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | ?> |
119 | 119 | |
120 | 120 | <section class="add-new-subscriber-form-container"> |
121 | - <h4><?php _e( 'Add New Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
121 | + <h4><?php _e( 'Add New Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
122 | 122 | <form id="add-new-subcscriber"> |
123 | - <input type="text" class="regular-text" placeholder="<?php _e( 'User Email Address' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
123 | + <input type="text" class="regular-text" placeholder="<?php _e( 'User Email Address', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
124 | 124 | <p><?php submit_button( 'Add Subscriber' ); ?></p> |
125 | 125 | </form> |
126 | 126 | </section> |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | <!-- TABLE HEAD --> |
143 | 143 | <thead> |
144 | 144 | <tr> |
145 | - <th id="user-email columnname" class="manage-column column-columnname" scope="col"><a id="user-email-sort" href="<?php echo esc_url_raw( add_query_arg( array( 'column' => 'email' , 'sort' => $opposite_sort_dir ) ) ); ?>"><?php _e( 'User Email' , 'yikes-inc-easy-mailchimp-extender' ); echo $icon;?></a></th> |
|
146 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
145 | + <th id="user-email columnname" class="manage-column column-columnname" scope="col"><a id="user-email-sort" href="<?php echo esc_url_raw( add_query_arg( array( 'column' => 'email', 'sort' => $opposite_sort_dir ) ) ); ?>"><?php _e( 'User Email', 'yikes-inc-easy-mailchimp-extender' ); echo $icon; ?></a></th> |
|
146 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
147 | 147 | </tr> |
148 | 148 | </thead> |
149 | 149 | <!-- end header --> |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | <!-- FOOTER --> |
152 | 152 | <tfoot> |
153 | 153 | <tr> |
154 | - <th class="manage-column column-columnname" scope="col"><?php _e( 'User Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
155 | - <th class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
154 | + <th class="manage-column column-columnname" scope="col"><?php _e( 'User Email', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
155 | + <th class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
156 | 156 | </tr> |
157 | 157 | </tfoot> |
158 | 158 | <!-- end footer --> |
@@ -162,15 +162,15 @@ discard block |
||
162 | 162 | <?php if ( count( $subscribers_list ) > 0 ) { |
163 | 163 | $i = 1; |
164 | 164 | foreach ( $subscribers_list as $subscriber ) { |
165 | - $user_id = $subscriber['id']; |
|
165 | + $user_id = $subscriber[ 'id' ]; |
|
166 | 166 | $path = YIKES_MC_URL . "includes/images/na.png"; |
167 | 167 | $email_client_icon = "<img width='35' src='" . $path . "' alt='" . __( 'not set', 'yikes-inc-easy-mailchimp-extender' ) . "' title='" . __( 'not set', 'yikes-inc-easy-mailchimp-extender' ) . "'>"; |
168 | 168 | |
169 | 169 | ?> |
170 | 170 | <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
171 | 171 | <td class="column-columnname"> |
172 | - <a class="user-email row-title" href="mailto:<?php echo sanitize_email( $subscriber['email_address'] ); ?>"> |
|
173 | - <?php echo sanitize_email( $subscriber['email_address'] ); ?> |
|
172 | + <a class="user-email row-title" href="mailto:<?php echo sanitize_email( $subscriber[ 'email_address' ] ); ?>"> |
|
173 | + <?php echo sanitize_email( $subscriber[ 'email_address' ] ); ?> |
|
174 | 174 | </a> |
175 | 175 | <div class="row-actions"> |
176 | 176 | <?php $view_user_info_url = esc_url_raw( add_query_arg( array( |
@@ -184,17 +184,17 @@ discard block |
||
184 | 184 | 'nonce' => wp_create_nonce( 'unsubscribe-user-' . $user_id ), |
185 | 185 | 'email_id' => $user_id, |
186 | 186 | ) ) ); ?> |
187 | - <span><a href="<?php echo $url; ?>" onclick="return confirm('<?php printf( __( "Are you sure you want to unsubscribe %s from this mailing list?", 'yikes-inc-easy-mailchimp-extender' ), sanitize_email( $subscriber['email_address'] ) ); ?>');" class="yikes-delete-subscriber"><?php _e( "Unsubscribe", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
187 | + <span><a href="<?php echo $url; ?>" onclick="return confirm('<?php printf( __( "Are you sure you want to unsubscribe %s from this mailing list?", 'yikes-inc-easy-mailchimp-extender' ), sanitize_email( $subscriber[ 'email_address' ] ) ); ?>');" class="yikes-delete-subscriber"><?php _e( "Unsubscribe", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
188 | 188 | </div> |
189 | 189 | </td> |
190 | 190 | <td class="column-columnname num"><?php echo $email_client_icon; ?></td> |
191 | 191 | </tr> |
192 | 192 | <?php |
193 | - $i ++; |
|
193 | + $i++; |
|
194 | 194 | } |
195 | 195 | } else { ?> |
196 | 196 | <tr class="no-items"> |
197 | - <td class="colspanchange no-current-subscriber-notice" colspan="2"><em><?php _e( 'No one is currently subscribed to this list.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
197 | + <td class="colspanchange no-current-subscriber-notice" colspan="2"><em><?php _e( 'No one is currently subscribed to this list.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
198 | 198 | </tr> |
199 | 199 | <?php } ?> |
200 | 200 | </tbody> |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | <!-- pagination --> |
207 | 207 | <div class="tablenav"> |
208 | 208 | <div class="tablenav-pages"> |
209 | - <a class='first-page <?php if( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the first page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => 0 ) ) ); ?>'>«</a> |
|
210 | - <a class='prev-page <?php if( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the previous page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged - 1 ) ) ) ); ?>'>‹</a> |
|
211 | - <span class="paging-input"><input class='current-page' title='<?php _e( "Current page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' type='text' name='paged' value='<?php if( $paged == 0 ) { echo '1'; } else { echo intval( $paged + 1 ); } ?>' size='1' /> <?php _e( 'of', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class='total-pages'><?php echo $total_pages; ?></span></span> |
|
212 | - <a class='next-page <?php if( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the next page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged + 1 ) ) ) ); ?>'>›</a> |
|
213 | - <a class='last-page <?php if( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the last page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $total_pages - 1 ) ) ) ); ?>'>»</a> |
|
209 | + <a class='first-page <?php if ( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the first page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => 0 ) ) ); ?>'>«</a> |
|
210 | + <a class='prev-page <?php if ( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the previous page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged - 1 ) ) ) ); ?>'>‹</a> |
|
211 | + <span class="paging-input"><input class='current-page' title='<?php _e( "Current page", 'yikes-inc-easy-mailchimp-extender' ); ?>' type='text' name='paged' value='<?php if ( $paged == 0 ) { echo '1'; } else { echo intval( $paged + 1 ); } ?>' size='1' /> <?php _e( 'of', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class='total-pages'><?php echo $total_pages; ?></span></span> |
|
212 | + <a class='next-page <?php if ( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the next page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged + 1 ) ) ) ); ?>'>›</a> |
|
213 | + <a class='last-page <?php if ( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the last page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $total_pages - 1 ) ) ) ); ?>'>»</a> |
|
214 | 214 | </div> |
215 | 215 | </div> |
216 | 216 | |
@@ -225,21 +225,21 @@ discard block |
||
225 | 225 | |
226 | 226 | <div class="postbox yikes-easy-mc-postbox"> |
227 | 227 | |
228 | - <h3><?php _e( 'List Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
228 | + <h3><?php _e( 'List Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
229 | 229 | |
230 | 230 | <?php |
231 | 231 | // store list rating |
232 | - $list_rating = $list_data['list_rating']; |
|
233 | - if( $list_rating > 0 ) { |
|
234 | - $list_rating_explosion = explode( '.' , $list_rating ); |
|
232 | + $list_rating = $list_data[ 'list_rating' ]; |
|
233 | + if ( $list_rating > 0 ) { |
|
234 | + $list_rating_explosion = explode( '.', $list_rating ); |
|
235 | 235 | $star_array = array(); |
236 | 236 | $x = 1; |
237 | - while( $list_rating_explosion[0] >= $x ) { |
|
238 | - $star_array[] = '<span class="dashicons dashicons-star-filled list-rating-star"></span>'; |
|
237 | + while ( $list_rating_explosion[ 0 ] >= $x ) { |
|
238 | + $star_array[ ] = '<span class="dashicons dashicons-star-filled list-rating-star"></span>'; |
|
239 | 239 | $x++; |
240 | 240 | } |
241 | - if( $list_rating_explosion[1] == '5' ) { |
|
242 | - $star_array[] = '<span class="dashicons dashicons-star-half list-rating-star"></span>'; |
|
241 | + if ( $list_rating_explosion[ 1 ] == '5' ) { |
|
242 | + $star_array[ ] = '<span class="dashicons dashicons-star-half list-rating-star"></span>'; |
|
243 | 243 | } |
244 | 244 | } else { |
245 | 245 | $star_array = array( 'n/a' ); |
@@ -247,40 +247,40 @@ discard block |
||
247 | 247 | ?> |
248 | 248 | <table class="form-table"> |
249 | 249 | <tr valign="top"> |
250 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'List Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
251 | - <td><?php echo implode( ' ' , $star_array ); ?></td> |
|
250 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'List Rating', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
251 | + <td><?php echo implode( ' ', $star_array ); ?></td> |
|
252 | 252 | </tr> |
253 | 253 | <tr valign="top"> |
254 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Average Subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
255 | - <td><?php echo $list_data['stats']['avg_sub_rate']; ?><small> / <?php _e( 'month' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></td> |
|
254 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Average Subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
255 | + <td><?php echo $list_data[ 'stats' ][ 'avg_sub_rate' ]; ?><small> / <?php _e( 'month', 'yikes-inc-easy-mailchimp-extender' ); ?></small></td> |
|
256 | 256 | </tr> |
257 | 257 | <tr valign="top"> |
258 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
259 | - <td><?php echo intval( $list_data['stats']['member_count'] ); ?></td> |
|
258 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
259 | + <td><?php echo intval( $list_data[ 'stats' ][ 'member_count' ] ); ?></td> |
|
260 | 260 | </tr> |
261 | 261 | <tr valign="top"> |
262 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'New Since Last Campaign' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
263 | - <td><?php echo intval( $list_data['stats']['member_count_since_send'] ); ?></td> |
|
262 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'New Since Last Campaign', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
263 | + <td><?php echo intval( $list_data[ 'stats' ][ 'member_count_since_send' ] ); ?></td> |
|
264 | 264 | </tr> |
265 | 265 | <tr valign="top"> |
266 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Created' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
267 | - <td><?php echo date( get_option('date_format') , strtotime( $list_data['date_created'] ) ); ?></td> |
|
266 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Created', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
267 | + <td><?php echo date( get_option( 'date_format' ), strtotime( $list_data[ 'date_created' ] ) ); ?></td> |
|
268 | 268 | </tr> |
269 | 269 | <tr valign="top"> |
270 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'List Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
271 | - <td><?php echo intval( $list_data['stats']['merge_field_count'] + 1 ); // add 1 for our email field.. ?></td> |
|
270 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'List Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
271 | + <td><?php echo intval( $list_data[ 'stats' ][ 'merge_field_count' ] + 1 ); // add 1 for our email field.. ?></td> |
|
272 | 272 | </tr> |
273 | 273 | <tr valign="top"> |
274 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Short Signup URL' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
275 | - <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo esc_url_raw( $list_data['subscribe_url_short'] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
274 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Short Signup URL', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
275 | + <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo esc_url_raw( $list_data[ 'subscribe_url_short' ] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
276 | 276 | </tr> |
277 | 277 | <tr valign="top"> |
278 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
279 | - <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo sanitize_email( $list_data['campaign_defaults']['from_email'] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
278 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
279 | + <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo sanitize_email( $list_data[ 'campaign_defaults' ][ 'from_email' ] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
280 | 280 | </tr> |
281 | 281 | <tr valign="top"> |
282 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
283 | - <td><?php echo $list_data['campaign_defaults']['from_name']; ?></td> |
|
282 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
283 | + <td><?php echo $list_data[ 'campaign_defaults' ][ 'from_name' ]; ?></td> |
|
284 | 284 | </tr> |
285 | 285 | </table> |
286 | 286 | |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | <!-- Merge Field Info --> |
291 | 291 | <div class="postbox yikes-easy-mc-postbox"> |
292 | 292 | |
293 | - <h3><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
293 | + <h3><?php _e( 'Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
294 | 294 | <?php |
295 | - if( count( $merge_fields['merge_fields'] ) >= 1 ) { |
|
295 | + if ( count( $merge_fields[ 'merge_fields' ] ) >= 1 ) { |
|
296 | 296 | ?><ul class="merge-variable-ul"><?php |
297 | - echo '<li class="interest-group-count">' . sprintf( _n( '%d Field', '%d Fields', intval( count( $merge_fields['merge_fields'] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $merge_fields['merge_fields'] ) ) ) . '</li>'; |
|
298 | - foreach( $merge_fields['merge_fields'] as $merge_field ) { |
|
297 | + echo '<li class="interest-group-count">' . sprintf( _n( '%d Field', '%d Fields', intval( count( $merge_fields[ 'merge_fields' ] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $merge_fields[ 'merge_fields' ] ) ) ) . '</li>'; |
|
298 | + foreach ( $merge_fields[ 'merge_fields' ] as $merge_field ) { |
|
299 | 299 | // new action hook @since 6.0.3.8 |
300 | - echo '<li class="' . $merge_field['tag'] . '"><span class="dashicons dashicons-marker"></span>' . $merge_field['name'] . ' ' . do_action( 'yikes-mailchimp-list-field', $merge_field ) . '</li>'; |
|
300 | + echo '<li class="' . $merge_field[ 'tag' ] . '"><span class="dashicons dashicons-marker"></span>' . $merge_field[ 'name' ] . ' ' . do_action( 'yikes-mailchimp-list-field', $merge_field ) . '</li>'; |
|
301 | 301 | } |
302 | 302 | ?></ul><?php |
303 | 303 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | <div class="postbox yikes-easy-mc-postbox"> |
315 | 315 | |
316 | 316 | |
317 | - <h3><?php _e( 'Interest Groups Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
317 | + <h3><?php _e( 'Interest Groups Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
318 | 318 | <?php |
319 | 319 | if ( ! empty( $interest_groupings ) ) { |
320 | 320 | ?> |
@@ -322,8 +322,8 @@ discard block |
||
322 | 322 | echo '<li class="interest-group-count">' . sprintf( _n( '%d Interest Group', '%d Interest Groups', intval( count( $interest_groupings ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $interest_groupings ) ) ) . '</li>'; |
323 | 323 | foreach ( $interest_groupings as $interest_group ) { |
324 | 324 | // Build up the total subscribers |
325 | - $count = array_sum( wp_list_pluck( $interest_group['items'], 'subscriber_count' ) ); |
|
326 | - echo '<li><span class="dashicons dashicons-marker"></span>' . $interest_group['title'] . '<span class="interest-group-title"></span><small title="' . $count . ' ' . __( "subscribers assigned to this group", 'yikes-inc-easy-mailchimp-extender' ) . '">(' . $count . ')</small></li>'; |
|
325 | + $count = array_sum( wp_list_pluck( $interest_group[ 'items' ], 'subscriber_count' ) ); |
|
326 | + echo '<li><span class="dashicons dashicons-marker"></span>' . $interest_group[ 'title' ] . '<span class="interest-group-title"></span><small title="' . $count . ' ' . __( "subscribers assigned to this group", 'yikes-inc-easy-mailchimp-extender' ) . '">(' . $count . ')</small></li>'; |
|
327 | 327 | } |
328 | 328 | ?></ul><?php |
329 | 329 | } else { |
@@ -347,17 +347,17 @@ discard block |
||
347 | 347 | <div class="postbox yikes-easy-mc-postbox"> |
348 | 348 | |
349 | 349 | |
350 | - <h3><?php _e( 'Segments Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
350 | + <h3><?php _e( 'Segments Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
351 | 351 | <?php |
352 | - if( isset( $segments['saved'] ) && count( $segments['saved'] ) >= 1 ) { |
|
352 | + if ( isset( $segments[ 'saved' ] ) && count( $segments[ 'saved' ] ) >= 1 ) { |
|
353 | 353 | $i = 1; |
354 | 354 | ?><ul class="segment-ul"><?php |
355 | - echo '<li class="segment-group-count">' . sprintf( _n( '%d Segment', '%d Segments', intval( count( $segments['saved'] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $segments['saved'] ) ) ) . '</li>'; |
|
356 | - foreach( $segments['saved'] as $segment ) { |
|
357 | - echo '<li><span class="dashicons dashicons-arrow-right"></span>' . $segment['name'] . ' <small><a href="#" onclick="jQuery(this).parent().parent().next().slideToggle();jQuery(this).toggleText();return false;" data-alt-text="' . __( 'hide conditions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( "view conditions" , 'yikes-inc-easy-mailchimp-extender' ) . '</a></small></li>'; |
|
355 | + echo '<li class="segment-group-count">' . sprintf( _n( '%d Segment', '%d Segments', intval( count( $segments[ 'saved' ] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $segments[ 'saved' ] ) ) ) . '</li>'; |
|
356 | + foreach ( $segments[ 'saved' ] as $segment ) { |
|
357 | + echo '<li><span class="dashicons dashicons-arrow-right"></span>' . $segment[ 'name' ] . ' <small><a href="#" onclick="jQuery(this).parent().parent().next().slideToggle();jQuery(this).toggleText();return false;" data-alt-text="' . __( 'hide conditions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( "view conditions", 'yikes-inc-easy-mailchimp-extender' ) . '</a></small></li>'; |
|
358 | 358 | ?><div class="conditionals yikes-easy-mc-hidden"><?php |
359 | - foreach( $segment['segment_opts']['conditions'] as $condition ) { |
|
360 | - echo '<li><small>' . sprintf( __( 'condition #%s : If %s %s %s', 'yikes-inc-easy-mailchimp-extender' ), intval( $i ), $condition['field'], $condition['op'], $condition['value'] ) . '</small></li>'; |
|
359 | + foreach ( $segment[ 'segment_opts' ][ 'conditions' ] as $condition ) { |
|
360 | + echo '<li><small>' . sprintf( __( 'condition #%s : If %s %s %s', 'yikes-inc-easy-mailchimp-extender' ), intval( $i ), $condition[ 'field' ], $condition[ 'op' ], $condition[ 'value' ] ) . '</small></li>'; |
|
361 | 361 | $i++; |
362 | 362 | } |
363 | 363 | ?></div><?php |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | } |
373 | 373 | ?> |
374 | 374 | <!-- |
375 | - <a class="edit-segments-button" href="#" onclick="return false;" class="button-primary"><?php _e( 'Edit Segments' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
375 | + <a class="edit-segments-button" href="#" onclick="return false;" class="button-primary"><?php _e( 'Edit Segments', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
376 | 376 | --> |
377 | - <p class="description edit-segment-description"><?php _e( 'To edit this lists segments, head over to' , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" target="_blank">MailChimp</a></p> |
|
377 | + <p class="description edit-segment-description"><?php _e( 'To edit this lists segments, head over to', 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" target="_blank">MailChimp</a></p> |
|
378 | 378 | |
379 | 379 | </div> |
380 | 380 |
@@ -3,8 +3,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | <span class="member-subscription-date"> |
139 | 139 | <?php echo __( 'Subscribed:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . gmdate( 'F jS, Y h:i a', $last_changed ); ?> |
140 | 140 | </span> |
141 | - <?php if ( isset( $user_data['location'] ) && ! empty( $user_data['location'] ) ) { ?> |
|
142 | - <?php if ( isset( $user_data['location']['latitude'] ) && isset( $user_data['location']['longitude'] ) ) { ?> |
|
141 | + <?php if ( isset( $user_data[ 'location' ] ) && ! empty( $user_data[ 'location' ] ) ) { ?> |
|
142 | + <?php if ( isset( $user_data[ 'location' ][ 'latitude' ] ) && isset( $user_data[ 'location' ][ 'longitude' ] ) ) { ?> |
|
143 | 143 | <span class="member-location-data"> |
144 | - <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . yikes_mc_geocode_subscriber_data( $user_data['location']['latitude'], $user_data['location']['longitude'] ); ?> |
|
144 | + <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . yikes_mc_geocode_subscriber_data( $user_data[ 'location' ][ 'latitude' ], $user_data[ 'location' ][ 'longitude' ] ); ?> |
|
145 | 145 | </span> |
146 | 146 | <?php } else { ?> |
147 | 147 | <span class="member-location-data"> |
148 | - <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $user_data['location']['timezone'] . ', ' . $user_data['location']['country_code']; ?> |
|
148 | + <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $user_data[ 'location' ][ 'timezone' ] . ', ' . $user_data[ 'location' ][ 'country_code' ]; ?> |
|
149 | 149 | </span> |
150 | 150 | <?php |
151 | 151 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | <hr class="yikes-mc-subscriber-hr" /> |
157 | 157 | |
158 | 158 | <?php |
159 | - if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { |
|
159 | + if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'subscriber-data' ) ) { |
|
160 | 160 | ?> |
161 | 161 | <section class="yikes-mc-card-body merge-variable-section"> |
162 | 162 | <h3><?php _e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | <strong><?php _e( 'No Subscriber Data Found', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
177 | 177 | <?php |
178 | 178 | } |
179 | - if ( isset( $user_data['ip_signup'] ) && $user_data['ip_signup'] != '' ) { |
|
179 | + if ( isset( $user_data[ 'ip_signup' ] ) && $user_data[ 'ip_signup' ] != '' ) { |
|
180 | 180 | ?> |
181 | 181 | <li> |
182 | 182 | <label> |
183 | - <strong class="section-label"><?php echo __( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p class="section-value"><em>' . $user_data['ip_signup']; ?></strong></p> |
|
183 | + <strong class="section-label"><?php echo __( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p class="section-value"><em>' . $user_data[ 'ip_signup' ]; ?></strong></p> |
|
184 | 184 | </label> |
185 | 185 | </li> |
186 | 186 | <?php |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | <?php |
192 | 192 | |
193 | 193 | |
194 | - if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { |
|
194 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { |
|
195 | 195 | ?> |
196 | 196 | <section class="yikes-mc-card-body"> |
197 | 197 | <?php |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | ?> |
221 | 221 | |
222 | 222 | <?php |
223 | - if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { |
|
223 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { |
|
224 | 224 | $unsubscribe_subscriber_url = esc_url_raw( add_query_arg( array( |
225 | 225 | 'action' => 'yikes-easy-mc-unsubscribe-user', |
226 | 226 | 'mailchimp-list' => $list_id, |
@@ -275,36 +275,36 @@ discard block |
||
275 | 275 | <div id="customer-tab-wrapper"> |
276 | 276 | <ul id="customer-tab-wrapper-list"> |
277 | 277 | |
278 | - <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?> |
|
278 | + <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?> |
|
279 | 279 | <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; ?>"> |
280 | 280 | <?php } ?> |
281 | 281 | |
282 | - <li <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
282 | + <li <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
283 | 283 | <span class="dashicons dashicons-id"></span></li> |
284 | 284 | |
285 | - <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?> |
|
285 | + <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?> |
|
286 | 286 | </a> |
287 | 287 | <?php } ?> |
288 | 288 | |
289 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] != 'additional-subscriptions' ) ) { ?> |
|
289 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'additional-subscriptions' ) ) { ?> |
|
290 | 290 | <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; ?>"> |
291 | 291 | <?php } ?> |
292 | 292 | |
293 | - <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
293 | + <li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
294 | 294 | <span class="dashicons dashicons-portfolio"></span></li> |
295 | 295 | |
296 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) ) { ?> |
|
296 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) ) { ?> |
|
297 | 297 | </a> |
298 | 298 | <?php } ?> |
299 | 299 | |
300 | - <?php if ( ! isset( $_GET['section'] ) || isset( $_GET['section'] ) && $_GET['section'] != 'delete-subscriber' ) { ?> |
|
300 | + <?php if ( ! isset( $_GET[ 'section' ] ) || isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'delete-subscriber' ) { ?> |
|
301 | 301 | <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; ?>"> |
302 | 302 | <?php } ?> |
303 | 303 | |
304 | - <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
304 | + <li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
305 | 305 | <span class="dashicons dashicons-trash"></span></li> |
306 | 306 | |
307 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) ) { ?> |
|
307 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) ) { ?> |
|
308 | 308 | </a> |
309 | 309 | <?php } ?> |
310 | 310 | |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | if ( is_wp_error( $geocode_response_body ) ) { |
327 | 327 | return; |
328 | 328 | } |
329 | - $city = $geocode_response_body['results'][0]['address_components'][2]['short_name']; |
|
330 | - $state = $geocode_response_body['results'][0]['address_components'][5]['short_name']; |
|
331 | - $country = $geocode_response_body['results'][0]['address_components'][6]['short_name']; |
|
329 | + $city = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 2 ][ 'short_name' ]; |
|
330 | + $state = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 5 ][ 'short_name' ]; |
|
331 | + $country = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 6 ][ 'short_name' ]; |
|
332 | 332 | |
333 | 333 | return $link = '<a href="http://maps.google.com/maps?q=' . $latitude . ',' . $longitude . '" target="_blank" title="' . __( 'View Google Map', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $city . ', ' . $state . ', ' . $country . '</a> <span class="flag-icon flag-icon-' . strtolower( $country ) . '"></span>'; |
334 | 334 | } |