@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | ) ); |
37 | 37 | $user_data = json_decode( wp_remote_retrieve_body( $user_data ), true ); |
38 | 38 | |
39 | - if( isset( $user_data['error'] ) ) { |
|
39 | + if( isset( $user_data['error'] ) ) { |
|
40 | 40 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
41 | 41 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
42 | 42 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | /* Build the array of mailing lists the user is subscribed to */ |
71 | 71 | if( isset( $other_lists ) && count( $other_lists ) >= 1 ) { |
72 | 72 | foreach( $other_lists as $list ) { |
73 | - if( $list['status'] == 'subscribed' ) { |
|
73 | + if( $list['status'] == 'subscribed' ) { |
|
74 | 74 | if( $dash_position !== false ) { |
75 | 75 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json'; |
76 | 76 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
86 | 86 | ) ); |
87 | 87 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
88 | - if( isset( $list_data['error'] ) ) { |
|
88 | + if( isset( $list_data['error'] ) ) { |
|
89 | 89 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
90 | 90 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
91 | 91 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
114 | 114 | ) ); |
115 | 115 | $merge_variables = json_decode( wp_remote_retrieve_body( $merge_variables ), true ); |
116 | - if( isset( $merge_variables['error'] ) ) { |
|
116 | + if( isset( $merge_variables['error'] ) ) { |
|
117 | 117 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
118 | 118 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
119 | 119 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | // loop and display |
124 | 124 | if( $merge_variables ) { |
125 | 125 | foreach( $merge_variables['data'][0]['merge_vars'] as $merge_variable ) { |
126 | - if( $merge_variable['tag'] != 'EMAIL' ) { |
|
126 | + if( $merge_variable['tag'] != 'EMAIL' ) { |
|
127 | 127 | $merge_variable_fields[$merge_variable['name']] = ( isset( $merge_data_array[$merge_variable['tag']] ) ) ? $merge_data_array[$merge_variable['tag']] : ''; |
128 | 128 | } |
129 | 129 | } |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | <hr class="yikes-mc-subscriber-hr" /> |
213 | 213 | |
214 | 214 | <?php |
215 | - if( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { |
|
215 | + if( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { |
|
216 | 216 | ?> |
217 | 217 | <section class="yikes-mc-card-body merge-variable-section"> |
218 | 218 | <h3><?php _e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
219 | 219 | <?php |
220 | - if( ! empty( $merge_variable_fields ) ) { |
|
220 | + if( ! empty( $merge_variable_fields ) ) { |
|
221 | 221 | ?> |
222 | 222 | <?php foreach( $merge_variable_fields as $field_name => $value ) { ?> |
223 | 223 | <li> |
@@ -247,11 +247,11 @@ discard block |
||
247 | 247 | <?php |
248 | 248 | |
249 | 249 | |
250 | - if( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { |
|
250 | + if( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { |
|
251 | 251 | ?> |
252 | 252 | <section class="yikes-mc-card-body"> |
253 | 253 | <?php |
254 | - if( ! empty( $additional_lists ) ) { |
|
254 | + if( ! empty( $additional_lists ) ) { |
|
255 | 255 | // remove this list from the additional lists list |
256 | 256 | unset( $additional_lists[$list_id] ); |
257 | 257 | if( ! empty( $additional_lists ) ) { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | ?> |
277 | 277 | |
278 | 278 | <?php |
279 | - if( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { |
|
279 | + if( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { |
|
280 | 280 | $unsubscribe_subscriber_url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-unsubscribe-user', 'mailchimp-list' => $list_id , 'nonce' => wp_create_nonce( 'unsubscribe-user-'.$email_id ), 'email_id' => $email_id ) ) ); |
281 | 281 | ?> |
282 | 282 | <form id="delete_subscriber" method="POST" action="<?php echo $unsubscribe_subscriber_url; ?>"> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | <?php |
24 | 24 | } |
25 | 25 | $main_field_data = $section_data['main_fields']; |
26 | - foreach( $main_field_data as $field ) { |
|
26 | + foreach( $main_field_data as $field ) { |
|
27 | 27 | if( $field['type'] == 'custom' ) { |
28 | 28 | // execute the custom callback |
29 | 29 | $field['callback'](); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | <?php |
54 | 54 | } |
55 | 55 | $sidebar_field_data = $section_data['sidebar_fields']; |
56 | - foreach( $sidebar_field_data as $field ) { |
|
56 | + foreach( $sidebar_field_data as $field ) { |
|
57 | 57 | if( $field['type'] == 'custom' ) { |
58 | 58 | // execute the custom callback |
59 | 59 | $field['callback'](); |
@@ -45,8 +45,9 @@ |
||
45 | 45 | // before and after widget arguments are defined by themes |
46 | 46 | echo $args['before_widget']; |
47 | 47 | |
48 | - if ( ! empty( $title ) ) |
|
49 | - echo $args['before_title'] . $title . $args['after_title']; |
|
48 | + if ( ! empty( $title ) ) { |
|
49 | + echo $args['before_title'] . $title . $args['after_title']; |
|
50 | + } |
|
50 | 51 | |
51 | 52 | // Custom action hooks to place content in the widget before the form |
52 | 53 | // See FAQ for examples on usage |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - if( isset( $_REQUEST['list-id'] ) ) { |
|
2 | + if( isset( $_REQUEST['list-id'] ) ) { |
|
3 | 3 | $list_id = sanitize_key( $_REQUEST['list-id'] ); |
4 | 4 | $api_key = trim( get_option( 'yikes-mc-api-key' , '' ) ); |
5 | 5 | $dash_position = strpos( $api_key, '-' ); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ), |
16 | 16 | ) ); |
17 | 17 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
18 | - if( isset( $list_data['error'] ) ) { |
|
18 | + if( isset( $list_data['error'] ) ) { |
|
19 | 19 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
20 | 20 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
21 | 21 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ), |
38 | 38 | ) ); |
39 | 39 | $merge_variables = json_decode( wp_remote_retrieve_body( $merge_variables ), true ); |
40 | - if( isset( $merge_variables['error'] ) ) { |
|
40 | + if( isset( $merge_variables['error'] ) ) { |
|
41 | 41 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
42 | 42 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
43 | 43 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ) ); |
63 | 63 | $interest_groupings = json_decode( wp_remote_retrieve_body( $interest_groupings ), true ); |
64 | 64 | |
65 | - if( isset( $interest_groupings['error'] ) ) { |
|
65 | + if( isset( $interest_groupings['error'] ) ) { |
|
66 | 66 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
67 | 67 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
68 | 68 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $icon = '<span class="dashicons dashicons-arrow-up"></span>'; |
106 | 106 | } |
107 | 107 | |
108 | - if( !isset( $_REQUEST['sort'] ) ) { |
|
108 | + if( !isset( $_REQUEST['sort'] ) ) { |
|
109 | 109 | $icon = ''; |
110 | 110 | } |
111 | 111 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ), |
129 | 129 | ) ); |
130 | 130 | $subscribers_list = json_decode( wp_remote_retrieve_body( $subscribers_list ), true ); |
131 | - if( isset( $subscribers_list['error'] ) ) { |
|
131 | + if( isset( $subscribers_list['error'] ) ) { |
|
132 | 132 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
133 | 133 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
134 | 134 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | <tbody> |
218 | 218 | <?php if( $subscribers_list['total'] > 0 ) { |
219 | 219 | $i = 1; |
220 | - foreach( $subscribers_list['data'] as $subscriber ) { |
|
220 | + foreach( $subscribers_list['data'] as $subscriber ) { |
|
221 | 221 | $user_id = $subscriber['leid']; |
222 | 222 | // setup the email client name and icon |
223 | 223 | if( !empty( $subscriber['clients'] ) ) { |
@@ -112,9 +112,11 @@ |
||
112 | 112 | |
113 | 113 | // update 'date_format' on 'birthday' and 'date' fields |
114 | 114 | if( isset( $mailchimp_form['fields'][$new_parent_key]['type'] ) && in_array( $mailchimp_form['fields'][$new_parent_key]['type'], array( 'date', 'birthday' ) ) ) { |
115 | - if( $mailchimp_form['fields'][$new_parent_key]['type'] == 'date' ) { // date |
|
115 | + if( $mailchimp_form['fields'][$new_parent_key]['type'] == 'date' ) { |
|
116 | +// date |
|
116 | 117 | $mailchimp_form['fields'][$new_parent_key]['date_format'] = 'MM/DD'; // mailchimp default (can be altered) |
117 | - } else { // birthday |
|
118 | + } else { |
|
119 | +// birthday |
|
118 | 120 | $mailchimp_form['fields'][$new_parent_key]['date_format'] = 'MM/DD/YYYY'; // mailchimp default (can be altered) |
119 | 121 | } |
120 | 122 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $form_results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms WHERE id = ' . $form . '', ARRAY_A ); |
42 | 42 | // confirm we have some results, or return an error |
43 | 43 | if( ! $form_results ) { |
44 | - if( WP_DEBUG ) { |
|
44 | + if( WP_DEBUG ) { |
|
45 | 45 | return __( "Oh no...This form doesn't exist. Head back to the manage forms page and select a different form." , 'yikes-inc-easy-mailchimp-extender' ); |
46 | 46 | } |
47 | 47 | return; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ) ); |
77 | 77 | |
78 | 78 | $subscriber_count_response = json_decode( wp_remote_retrieve_body( $subscriber_count_response ), true ); |
79 | - if( isset( $subscriber_count_response['error'] ) ) { |
|
79 | + if( isset( $subscriber_count_response['error'] ) ) { |
|
80 | 80 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
81 | 81 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
82 | 82 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -943,7 +943,8 @@ |
||
943 | 943 | |
944 | 944 | } |
945 | 945 | |
946 | - } else { // loop over interest groups |
|
946 | + } else { |
|
947 | +// loop over interest groups |
|
947 | 948 | |
948 | 949 | |
949 | 950 | // store default choice |
@@ -96,9 +96,11 @@ |
||
96 | 96 | $value = date( 'Y-m-d', strtotime( $value ) ); |
97 | 97 | } |
98 | 98 | } |
99 | - if( is_numeric( $merge_tag ) ) { // this is is an interest group! |
|
99 | + if( is_numeric( $merge_tag ) ) { |
|
100 | +// this is is an interest group! |
|
100 | 101 | $merge_variables['groupings'][] = array( 'id' => $merge_tag , 'groups' => ( is_array( $value ) ) ? $value : array( $value ) ); |
101 | - } else { // or else it's just a standard merge variable |
|
102 | + } else { |
|
103 | +// or else it's just a standard merge variable |
|
102 | 104 | $merge_variables[$merge_tag] = $value; |
103 | 105 | } |
104 | 106 | } |
@@ -92,9 +92,11 @@ |
||
92 | 92 | $value = ( '' != $value ) ? date( 'Y-m-d', strtotime( $value ) ) : ''; |
93 | 93 | } |
94 | 94 | } |
95 | - if( is_numeric( $merge_tag ) ) { // this is is an interest group! |
|
95 | + if( is_numeric( $merge_tag ) ) { |
|
96 | +// this is is an interest group! |
|
96 | 97 | $merge_variables['groupings'][] = array( 'id' => $merge_tag , 'groups' => ( is_array( $value ) ) ? $value : array( $value ) ); |
97 | - } else { // or else it's just a standard merge variable |
|
98 | + } else { |
|
99 | +// or else it's just a standard merge variable |
|
98 | 100 | $merge_variables[$merge_tag] = $value; |
99 | 101 | } |
100 | 102 | } |