@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $api_error_response = ''; |
11 | 11 | } else { |
12 | 12 | $api_connection = '<span id="connection-container" class="api-not-connected"><span class="dashicons dashicons-no-alt yikes-mc-api-not-connected"></span> ' . __( "Not Connected" , 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
13 | - if( get_option( 'yikes-mc-api-invalid-key-response' , '' ) != '' ) { |
|
13 | + if( get_option( 'yikes-mc-api-invalid-key-response' , '' ) != '' ) { |
|
14 | 14 | $api_error_response = '<p><small><i class="dashicons dashicons-no-alt"></i> ' . get_option( 'yikes-mc-api-invalid-key-response' , '' ) . '</small></p>'; |
15 | 15 | } else { |
16 | 16 | $api_error_response = ''; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | <div class="postbox yikes-easy-mc-postbox"> |
111 | 111 | |
112 | - <?php if( !isset( $_REQUEST['section'] ) || $_REQUEST['section'] == '' ) { |
|
112 | + <?php if( !isset( $_REQUEST['section'] ) || $_REQUEST['section'] == '' ) { |
|
113 | 113 | include YIKES_MC_PATH . 'admin/partials/menu/options-sections/general-settings.php'; |
114 | 114 | } else { |
115 | 115 | if( isset( $_REQUEST['addon'] ) && $_REQUEST['addon'] == 'true' ) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
18 | 18 | ) ); |
19 | 19 | $profile_info = json_decode( wp_remote_retrieve_body( $profile_info ), true ); |
20 | - if( isset( $profile_info['error'] ) ) { |
|
20 | + if( isset( $profile_info['error'] ) ) { |
|
21 | 21 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
22 | 22 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
23 | 23 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
42 | 42 | ) ); |
43 | 43 | $account_details = json_decode( wp_remote_retrieve_body( $account_details ), true ); |
44 | - if( isset( $account_details['error'] ) ) { |
|
44 | + if( isset( $account_details['error'] ) ) { |
|
45 | 45 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
46 | 46 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
47 | 47 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
66 | 66 | ) ); |
67 | 67 | $account_activity = json_decode( wp_remote_retrieve_body( $account_activity ), true ); |
68 | - if( isset( $account_activity['error'] ) ) { |
|
68 | + if( isset( $account_activity['error'] ) ) { |
|
69 | 69 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
70 | 70 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
71 | 71 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | </section> |
149 | 149 | <?php |
150 | 150 | } else { |
151 | - if( $x == 7 ) { |
|
151 | + if( $x == 7 ) { |
|
152 | 152 | ?> |
153 | 153 | <div id="hidden-chatter" class="yikes-easy-mc-hidden"> |
154 | 154 | <?php |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
18 | 18 | ) ); |
19 | 19 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
20 | - if( isset( $list_data['error'] ) ) { |
|
20 | + if( isset( $list_data['error'] ) ) { |
|
21 | 21 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
22 | 22 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
23 | 23 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | |
81 | 81 | <!-- TABLE BODY --> |
82 | 82 | <tbody> |
83 | - <?php if( $list_data['total'] > 0 ) { |
|
83 | + <?php if( $list_data['total'] > 0 ) { |
|
84 | 84 | $i = 1; |
85 | - foreach( $list_data['data'] as $list ) { |
|
85 | + foreach( $list_data['data'] as $list ) { |
|
86 | 86 | ?> |
87 | 87 | <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
88 | 88 | <td class="column-columnname"> |
@@ -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(); |