@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | new YIKES_Inc_Easy_MailChimp_Public_Ajax(); |
57 | 57 | |
58 | 58 | // Include our error logging class |
59 | - add_action( 'init' , array( $this , 'load_error_logging_class' ) , 1 ); |
|
59 | + add_action( 'init', array( $this, 'load_error_logging_class' ), 1 ); |
|
60 | 60 | // load our checkbox classes |
61 | - add_action( 'init' , array( $this , 'load_checkbox_integration_classes' ) , 1 ); |
|
61 | + add_action( 'init', array( $this, 'load_checkbox_integration_classes' ), 1 ); |
|
62 | 62 | // custom front end filter |
63 | 63 | add_action( 'init', array( $this, 'yikes_custom_frontend_content_filter' ) ); |
64 | 64 | // Process non-ajax forms in the header |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | **/ |
94 | 94 | public function load_checkbox_integration_classes() { |
95 | 95 | // store our options |
96 | - $integrations = get_option( 'optin-checkbox-init' , array() ); |
|
97 | - if( ! empty( $integrations ) && is_array( $integrations ) ) { |
|
96 | + $integrations = get_option( 'optin-checkbox-init', array() ); |
|
97 | + if ( ! empty( $integrations ) && is_array( $integrations ) ) { |
|
98 | 98 | // load our mail integrations class |
99 | 99 | require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations.php'; |
100 | 100 | // loop over selected classes and load them up! |
101 | - foreach( $integrations as $integration => $value ) { |
|
102 | - if( isset( $value['value'] ) && $value['value'] == 'on' ) { |
|
101 | + foreach ( $integrations as $integration => $value ) { |
|
102 | + if ( isset( $value[ 'value' ] ) && $value[ 'value' ] == 'on' ) { |
|
103 | 103 | // load our class extensions |
104 | - require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations/class.'.$integration.'-checkbox.php'; |
|
104 | + require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations/class.' . $integration . '-checkbox.php'; |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @since 6.0.0 |
116 | 116 | */ |
117 | 117 | public function load_error_logging_class() { |
118 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
118 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
119 | 119 | // if error logging is enabled we should include our error logging class |
120 | 120 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
121 | 121 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging; |
@@ -128,19 +128,19 @@ discard block |
||
128 | 128 | * @since 6.0.3.4 |
129 | 129 | */ |
130 | 130 | public function yikes_process_non_ajax_forms( $form_submitted ) { |
131 | - global $wpdb,$post; |
|
132 | - $form_id = ( ! empty( $_POST['yikes-mailchimp-submitted-form'] ) ) ? (int) $_POST['yikes-mailchimp-submitted-form'] : false; // store form id |
|
133 | - if( $form_id ) { |
|
131 | + global $wpdb, $post; |
|
132 | + $form_id = ( ! empty( $_POST[ 'yikes-mailchimp-submitted-form' ] ) ) ? (int) $_POST[ 'yikes-mailchimp-submitted-form' ] : false; // store form id |
|
133 | + if ( $form_id ) { |
|
134 | 134 | $form_settings = self::yikes_retrieve_form_settings( $form_id ); |
135 | - if( isset( $_POST ) && !empty( $_POST ) && isset( $form_id ) && $form_settings['submission_settings']['ajax'] == 0 ) { |
|
136 | - if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { // ensure we only process the form that was submitted |
|
135 | + if ( isset( $_POST ) && ! empty( $_POST ) && isset( $form_id ) && $form_settings[ 'submission_settings' ][ 'ajax' ] == 0 ) { |
|
136 | + if ( $_POST[ 'yikes-mailchimp-submitted-form' ] == $form_id ) { // ensure we only process the form that was submitted |
|
137 | 137 | |
138 | 138 | // Lets include our form processing file |
139 | 139 | include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' ); |
140 | - if( $form_settings['submission_settings']['redirect_on_submission'] == '1' ) { |
|
141 | - if( $form_submitted == 1 ) { |
|
140 | + if ( $form_settings[ 'submission_settings' ][ 'redirect_on_submission' ] == '1' ) { |
|
141 | + if ( $form_submitted == 1 ) { |
|
142 | 142 | // decode our settings |
143 | - $redirect_page = ( 'custom_url' != $form_settings['submission_settings']['redirect_page'] ) ? get_permalink( (int) $form_settings['submission_settings']['redirect_page'] ) : $form_settings['submission_settings']['custom_redirect_url']; |
|
143 | + $redirect_page = ( 'custom_url' != $form_settings[ 'submission_settings' ][ 'redirect_page' ] ) ? get_permalink( (int) $form_settings[ 'submission_settings' ][ 'redirect_page' ] ) : $form_settings[ 'submission_settings' ][ 'custom_redirect_url' ]; |
|
144 | 144 | wp_redirect( apply_filters( 'yikes-mailchimp-redirect-url', esc_url( $redirect_page ), $form_id, $post ) ); |
145 | 145 | exit; |
146 | 146 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public static function yikes_retrieve_form_settings( $form_id ) { |
170 | 170 | // if no form id, abort |
171 | - if( ! $form_id ) { |
|
171 | + if ( ! $form_id ) { |
|
172 | 172 | return array(); |
173 | 173 | } |
174 | 174 | |
@@ -197,13 +197,13 @@ discard block |
||
197 | 197 | return; |
198 | 198 | } |
199 | 199 | // trim trailing period |
200 | - if ( isset( $form_settings['error_messages']['update-link'] ) && ! empty( $form_settings['error_messages']['update-link'] ) ) { |
|
201 | - $response_text = $form_settings['error_messages']['update-link']; |
|
200 | + if ( isset( $form_settings[ 'error_messages' ][ 'update-link' ] ) && ! empty( $form_settings[ 'error_messages' ][ 'update-link' ] ) ) { |
|
201 | + $response_text = $form_settings[ 'error_messages' ][ 'update-link' ]; |
|
202 | 202 | // extract the link text |
203 | 203 | preg_match( '/\[link].*?\[\/link\]/', $response_text, $link_text ); |
204 | 204 | if ( $link_text && ! empty( $link_text ) ) { |
205 | 205 | // Extract the custom link text ([link]*[/link]) |
206 | - $custom_link_text = str_replace( '[/link]', '', str_replace( '[link]', '', str_replace( 'click to send yourself an update link', $link_text[0], $link ) ) ); |
|
206 | + $custom_link_text = str_replace( '[/link]', '', str_replace( '[link]', '', str_replace( 'click to send yourself an update link', $link_text[ 0 ], $link ) ) ); |
|
207 | 207 | // Replace the link text, with our custom link text |
208 | 208 | $response_text = str_replace( $link_text, $custom_link_text, $response_text ); |
209 | 209 | } |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | } |
233 | 233 | |
234 | 234 | // trim trailing period |
235 | - if ( isset( $form_settings['error_messages']['already-subscribed'] ) && ! empty( $form_settings['error_messages']['already-subscribed'] ) ) { |
|
236 | - $response_text = str_replace( '[email]', $email, $form_settings['error_messages']['already-subscribed'] ); |
|
235 | + if ( isset( $form_settings[ 'error_messages' ][ 'already-subscribed' ] ) && ! empty( $form_settings[ 'error_messages' ][ 'already-subscribed' ] ) ) { |
|
236 | + $response_text = str_replace( '[email]', $email, $form_settings[ 'error_messages' ][ 'already-subscribed' ] ); |
|
237 | 237 | } |
238 | 238 | // Return our new string |
239 | 239 | return $response_text; |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | - * Create our own custom the_content(); filter to prevent plugins and such from hooking in where not wanted |
|
74 | - * |
|
75 | - * @since 6.0.3 |
|
76 | - */ |
|
73 | + * Create our own custom the_content(); filter to prevent plugins and such from hooking in where not wanted |
|
74 | + * |
|
75 | + * @since 6.0.3 |
|
76 | + */ |
|
77 | 77 | public function yikes_custom_frontend_content_filter() { |
78 | 78 | add_filter( 'yikes-mailchimp-frontend-content', 'wptexturize' ); |
79 | 79 | add_filter( 'yikes-mailchimp-frontend-content', 'convert_smilies' ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * load our checkbox classes |
91 | 91 | * |
92 | 92 | * @since 6.0.0 |
93 | - **/ |
|
93 | + **/ |
|
94 | 94 | public function load_checkbox_integration_classes() { |
95 | 95 | // store our options |
96 | 96 | $integrations = get_option( 'optin-checkbox-init' , array() ); |
@@ -133,7 +133,8 @@ |
||
133 | 133 | if( $form_id ) { |
134 | 134 | $form_settings = self::yikes_retrieve_form_settings( $form_id ); |
135 | 135 | if( isset( $_POST ) && !empty( $_POST ) && isset( $form_id ) && $form_settings['submission_settings']['ajax'] == 0 ) { |
136 | - if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { // ensure we only process the form that was submitted |
|
136 | + if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { |
|
137 | +// ensure we only process the form that was submitted |
|
137 | 138 | |
138 | 139 | // Lets include our form processing file |
139 | 140 | include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' ); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /* The template file for displaying our stats in the Admin dashboard widget */ |
3 | 3 | |
4 | 4 | if ( isset( $list_data ) ) { |
5 | - if ( isset( $list_data['id'] ) ) { |
|
5 | + if ( isset( $list_data[ 'id' ] ) ) { |
|
6 | 6 | |
7 | 7 | // When a user selects a list from the dropdown, capture the array value here |
8 | 8 | $list = $list_data; |
@@ -13,12 +13,12 @@ discard block |
||
13 | 13 | // Get the list IDs, capture the first list ID |
14 | 14 | $first_list_id = ''; |
15 | 15 | $list_ids = array_keys( $list_data ); |
16 | - if ( is_array( $list_ids ) && isset( $list_ids[0] ) ) { |
|
17 | - $first_list_id = $list_ids[0]; |
|
16 | + if ( is_array( $list_ids ) && isset( $list_ids[ 0 ] ) ) { |
|
17 | + $first_list_id = $list_ids[ 0 ]; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | // Set our $list value to the first list in the list_data array |
21 | - if ( isset( $list_data[ $first_list_id ] ) && is_array( $list_data[ $first_list_id ] ) && isset( $list_data[ $first_list_id ]['id'] ) ) { |
|
21 | + if ( isset( $list_data[ $first_list_id ] ) && is_array( $list_data[ $first_list_id ] ) && isset( $list_data[ $first_list_id ][ 'id' ] ) ) { |
|
22 | 22 | $list = $list_data[ $first_list_id ]; |
23 | 23 | } |
24 | 24 | } |
@@ -31,36 +31,36 @@ discard block |
||
31 | 31 | |
32 | 32 | ?> |
33 | 33 | <section id="yikes-easy-mc-widget-stat-holder"> |
34 | - <h3><?php echo $list['name']; ?> <small><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list['id'] . '' ) ); ?>" title="<?php _e( 'view List' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'view list' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></h3> |
|
34 | + <h3><?php echo $list[ 'name' ]; ?> <small><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list[ 'id' ] . '' ) ); ?>" title="<?php _e( 'view List', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'view list', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></h3> |
|
35 | 35 | |
36 | 36 | <table class="yikes-easy-mc-stats-table"> |
37 | 37 | <thead class="yikes-easy-mc-hidden"> |
38 | 38 | <tr> |
39 | - <th><?php _e( 'Subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
40 | - <th><?php _e( 'Unsubscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
41 | - <th><?php _e( 'New Since Send' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
42 | - <th><?php _e( 'Avg. Sub. Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
39 | + <th><?php _e( 'Subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
40 | + <th><?php _e( 'Unsubscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
41 | + <th><?php _e( 'New Since Send', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
42 | + <th><?php _e( 'Avg. Sub. Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
43 | 43 | </tr> |
44 | 44 | </thead> |
45 | 45 | <tbody> |
46 | 46 | <tr class="yikes-easy-mc-table-stats-tr yikes-easy-mc-table-stats-tr-first"> |
47 | - <td title="<?php _e( 'Number of active subscribers.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
48 | - <p class="yikes-easy-mc-dashboard-stat"><?php echo $list['stats']['member_count']; ?></p> |
|
49 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
47 | + <td title="<?php _e( 'Number of active subscribers.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
48 | + <p class="yikes-easy-mc-dashboard-stat"><?php echo $list[ 'stats' ][ 'member_count' ]; ?></p> |
|
49 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
50 | 50 | </td> |
51 | - <td title="<?php _e( 'Number of users who have unsusbscribed.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
52 | - <p class="yikes-easy-mc-dashboard-stat"><?php echo $list['stats']['unsubscribe_count']; ?></p> |
|
53 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'unsubscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
51 | + <td title="<?php _e( 'Number of users who have unsusbscribed.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
52 | + <p class="yikes-easy-mc-dashboard-stat"><?php echo $list[ 'stats' ][ 'unsubscribe_count' ]; ?></p> |
|
53 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'unsubscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
54 | 54 | </td> |
55 | 55 | </tr> |
56 | 56 | <tr class="yikes-easy-mc-table-stats-tr yikes-easy-mc-table-stats-tr-second"> |
57 | - <td title="<?php _e( 'Number of new subscribers since the last campaign was sent.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
58 | - <p class="yikes-easy-mc-dashboard-stat"><?php echo $list['stats']['member_count_since_send']; ?></p> |
|
59 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'new since send' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
57 | + <td title="<?php _e( 'Number of new subscribers since the last campaign was sent.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
58 | + <p class="yikes-easy-mc-dashboard-stat"><?php echo $list[ 'stats' ][ 'member_count_since_send' ]; ?></p> |
|
59 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'new since send', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
60 | 60 | </td> |
61 | - <td title="<?php _e( 'Average number of subscribers per month.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
62 | - <p class="yikes-easy-mc-dashboard-stat"><?php echo $list['stats']['avg_sub_rate']; ?></p> |
|
63 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'avg. sub. rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
61 | + <td title="<?php _e( 'Average number of subscribers per month.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
62 | + <p class="yikes-easy-mc-dashboard-stat"><?php echo $list[ 'stats' ][ 'avg_sub_rate' ]; ?></p> |
|
63 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'avg. sub. rate', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
64 | 64 | </td> |
65 | 65 | </tr> |
66 | 66 | </tbody> |
@@ -118,8 +118,8 @@ |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * Save changes to a field's label |
|
122 | - */ |
|
121 | + * Save changes to a field's label |
|
122 | + */ |
|
123 | 123 | public function save_field_label_edits() { |
124 | 124 | |
125 | 125 | // Capture our $_POST variables |
@@ -7,8 +7,7 @@ |
||
7 | 7 | * @since 6.0.0 |
8 | 8 | * Author: Yikes Inc. | https://www.yikesinc.com |
9 | 9 | */ |
10 | - class YIKES_Inc_Easy_MailChimp_Process_Ajax |
|
11 | - { |
|
10 | + class YIKES_Inc_Easy_MailChimp_Process_Ajax { |
|
12 | 11 | |
13 | 12 | public function __construct() { |
14 | 13 |
@@ -13,22 +13,22 @@ discard block |
||
13 | 13 | public function __construct() { |
14 | 14 | |
15 | 15 | // Ajax send merge variable to form builder |
16 | - add_action( 'wp_ajax_add_field_to_form', array( $this , 'send_field_to_form' ), 10 ); |
|
16 | + add_action( 'wp_ajax_add_field_to_form', array( $this, 'send_field_to_form' ), 10 ); |
|
17 | 17 | |
18 | 18 | // Ajax send interest group to form builder |
19 | - add_action( 'wp_ajax_add_interest_group_to_form', array( $this , 'send_interest_group_to_form' ), 10 ); |
|
19 | + add_action( 'wp_ajax_add_interest_group_to_form', array( $this, 'send_interest_group_to_form' ), 10 ); |
|
20 | 20 | |
21 | 21 | // Return new list data + activity (for dashboard widget ) |
22 | - add_action( 'wp_ajax_get_new_list_data', array( $this , 'get_new_list_data' ), 10 ); |
|
22 | + add_action( 'wp_ajax_get_new_list_data', array( $this, 'get_new_list_data' ), 10 ); |
|
23 | 23 | |
24 | 24 | // Return new list data + activity (for dashboard widget ) |
25 | - add_action( 'wp_ajax_check_list_for_interest_groups', array( $this , 'check_list_for_interest_groups' ), 10 ); |
|
25 | + add_action( 'wp_ajax_check_list_for_interest_groups', array( $this, 'check_list_for_interest_groups' ), 10 ); |
|
26 | 26 | |
27 | 27 | // Add a new notification to a form |
28 | - add_action( 'wp_ajax_add_notification_to_form', array( $this , 'add_notification_to_form' ), 10 , 1 ); |
|
28 | + add_action( 'wp_ajax_add_notification_to_form', array( $this, 'add_notification_to_form' ), 10, 1 ); |
|
29 | 29 | |
30 | 30 | // Save field label edits |
31 | - add_action( 'wp_ajax_save_field_label_edits', array( $this , 'save_field_label_edits' ), 10 , 1 ); |
|
31 | + add_action( 'wp_ajax_save_field_label_edits', array( $this, 'save_field_label_edits' ), 10, 1 ); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /* |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * - return a single container |
37 | 37 | */ |
38 | 38 | public function add_notification_to_form() { |
39 | - if( $_POST['notification_name'] ) { |
|
39 | + if ( $_POST[ 'notification_name' ] ) { |
|
40 | 40 | include_once( YIKES_MC_PATH . 'admin/partials/ajax/add_notification_to_form.php' ); |
41 | 41 | } |
42 | 42 | exit(); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // when the user wants to switch which form data |
47 | 47 | // is displayed on the dashboard |
48 | 48 | public function get_new_list_data() { |
49 | - $list_id = $_POST['list_id']; |
|
49 | + $list_id = $_POST[ 'list_id' ]; |
|
50 | 50 | $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_list( $list_id ); |
51 | 51 | if ( is_wp_error( $list_data ) ) { |
52 | 52 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | /* note: this function is called statically from the integration settings page */ |
70 | 70 | public static function check_list_for_interest_groups( $list_id = '', $integration_type = '', $load = false ) { |
71 | 71 | if ( ! $list_id ) { |
72 | - $list_id = $_POST['list_id']; |
|
72 | + $list_id = $_POST[ 'list_id' ]; |
|
73 | 73 | } |
74 | 74 | if ( ! $integration_type ) { |
75 | - $integration_type = $_POST['integration']; |
|
75 | + $integration_type = $_POST[ 'integration' ]; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
82 | 82 | $error_logging->maybe_write_to_log( |
83 | 83 | $interest_groupings->get_error_code(), |
84 | - __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), |
|
84 | + __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ), |
|
85 | 85 | "class.ajax.php" |
86 | 86 | ); |
87 | 87 | $interest_groupings = array(); |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | public function save_field_label_edits() { |
128 | 128 | |
129 | 129 | // Capture our $_POST variables |
130 | - $list_id = isset( $_POST['list_id'] ) ? $_POST['list_id'] : ''; |
|
131 | - $field_data = isset( $_POST['field_data'] ) ? $_POST['field_data'] : array(); |
|
132 | - $field_name = isset( $field_data['field_name'] ) ? $field_data['field_name'] : ''; |
|
133 | - $field_id = isset( $field_data['field_id'] ) ? $field_data['field_id'] : ''; |
|
130 | + $list_id = isset( $_POST[ 'list_id' ] ) ? $_POST[ 'list_id' ] : ''; |
|
131 | + $field_data = isset( $_POST[ 'field_data' ] ) ? $_POST[ 'field_data' ] : array(); |
|
132 | + $field_name = isset( $field_data[ 'field_name' ] ) ? $field_data[ 'field_name' ] : ''; |
|
133 | + $field_id = isset( $field_data[ 'field_id' ] ) ? $field_data[ 'field_id' ] : ''; |
|
134 | 134 | |
135 | 135 | // Make sure we have our required variables before continuing |
136 | 136 | if ( $list_id === '' || $field_name === '' || $field_id === '' ) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
150 | 150 | $error_logging->maybe_write_to_log( |
151 | 151 | $merge_field->get_error_code(), |
152 | - __( "Updating merge field" , 'yikes-inc-easy-mailchimp-extender' ), |
|
152 | + __( "Updating merge field", 'yikes-inc-easy-mailchimp-extender' ), |
|
153 | 153 | "class.ajax.php" |
154 | 154 | ); |
155 | 155 | wp_send_json_error( array( |
@@ -179,19 +179,19 @@ |
||
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
182 | - * Update a merge field for a particular list |
|
183 | - * |
|
184 | - * @author Kevin Utz |
|
185 | - * |
|
186 | - * @since 6.3.3 |
|
187 | - * |
|
188 | - * @param string | $list_id | The ID of the MailChimp list |
|
189 | - * @param string | $field_id | The ID of the merge field |
|
190 | - * @param array | $field_data | An array of field data constituting the body of our API request |
|
191 | - * @param bool | $clear_transient | Flag whether we should delete the transients associated with this list |
|
192 | - * |
|
193 | - * @return array | WP_Error |
|
194 | - */ |
|
182 | + * Update a merge field for a particular list |
|
183 | + * |
|
184 | + * @author Kevin Utz |
|
185 | + * |
|
186 | + * @since 6.3.3 |
|
187 | + * |
|
188 | + * @param string | $list_id | The ID of the MailChimp list |
|
189 | + * @param string | $field_id | The ID of the merge field |
|
190 | + * @param array | $field_data | An array of field data constituting the body of our API request |
|
191 | + * @param bool | $clear_transient | Flag whether we should delete the transients associated with this list |
|
192 | + * |
|
193 | + * @return array | WP_Error |
|
194 | + */ |
|
195 | 195 | public function update_merge_field( $list_id, $field_id, $field_data, $clear_transient = true ) { |
196 | 196 | $path = "{$this->base_path}/{$list_id}/merge-fields/{$field_id}"; |
197 | 197 | $field = $this->patch_to_api( $path, $field_data ); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $email_field = apply_filters( 'yikes-easy-mailchimp-email-address-field', $email_field, $list_id ); |
175 | 175 | |
176 | 176 | array_unshift( $merge_fields, $email_field ); |
177 | - $merge_object['merge_fields'] = $merge_fields; |
|
177 | + $merge_object[ 'merge_fields' ] = $merge_fields; |
|
178 | 178 | set_transient( "yikes_eme_merge_variables_{$list_id}", $merge_object, HOUR_IN_SECONDS ); |
179 | 179 | |
180 | 180 | return $merge_object; |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | * @return array | WP_Error |
196 | 196 | */ |
197 | 197 | public function update_merge_field( $list_id, $field_id, $field_data, $clear_transient = true ) { |
198 | - $path = "{$this->base_path}/{$list_id}/merge-fields/{$field_id}"; |
|
199 | - $field = $this->patch_to_api( $path, $field_data ); |
|
198 | + $path = "{$this->base_path}/{$list_id}/merge-fields/{$field_id}"; |
|
199 | + $field = $this->patch_to_api( $path, $field_data ); |
|
200 | 200 | |
201 | 201 | if ( is_wp_error( $field ) ) { |
202 | 202 | return $field; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | return $interests; |
245 | 245 | } |
246 | 246 | |
247 | - $category['items'] = $interests; |
|
247 | + $category[ 'items' ] = $interests; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | set_transient( "yikes_eme_interest_categories_{$list_id}", $categories, HOUR_IN_SECONDS ); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | // required..* |
18 | 18 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
19 | 19 | /* Visual Composer */ |
20 | - if( is_plugin_active( 'js_composer/js_composer.php' ) ) { |
|
20 | + if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { |
|
21 | 21 | new YIKES_MailChimp_Visual_Composer_Extension(); |
22 | 22 | } |
23 | 23 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
9 | 9 | // users can only unisntall a plugin from the network dashboard page |
10 | 10 | // Get all blog ids |
11 | - $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); |
|
11 | + $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); |
|
12 | 12 | foreach ( $blogids as $blog_id ) { |
13 | 13 | switch_to_blog( $blog_id ); |
14 | 14 | self::_uninstall_yikes_easy_mailchimp( $wpdb ); |
@@ -28,15 +28,15 @@ discard block |
||
28 | 28 | * @since 6.0.0 |
29 | 29 | */ |
30 | 30 | static function _uninstall_yikes_easy_mailchimp( $wpdb ) { |
31 | - require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
31 | + require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
32 | 32 | |
33 | 33 | /* Clean up and delete our custom table from the databse */ |
34 | - $table = $wpdb->prefix."yikes_easy_mc_forms"; |
|
34 | + $table = $wpdb->prefix . "yikes_easy_mc_forms"; |
|
35 | 35 | $sql = 'DROP TABLE IF EXISTS ' . $table; |
36 | 36 | |
37 | 37 | //Delete any options thats stored also? |
38 | 38 | $wpdb->query( $sql ); |
39 | - dbDelta($sql); |
|
39 | + dbDelta( $sql ); |
|
40 | 40 | |
41 | 41 | /* Clear All Transient Data */ |
42 | 42 | delete_transient( 'yikes-easy-mailchimp-list-data' ); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | <div class="addon-footer-wrap give-clearfix"> |
34 | 34 | <a href="<?php echo esc_attr( $permalink ); ?>" title="<?php echo esc_attr( $add_on_title ); ?>" class="button-secondary" target="_blank"> |
35 | - <?php esc_attr_e( 'View Add-on' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
35 | + <?php esc_attr_e( 'View Add-on', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
36 | 36 | <span class="dashicons dashicons-external"></span></a> |
37 | 37 | </div> |
38 | 38 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | <div class="addon-footer-wrap give-clearfix"> |
34 | 34 | <a href="<?php echo esc_attr( $permalink ); ?>" title="<?php echo esc_attr( $add_on_title ); ?>" class="button-secondary" target="_blank"> |
35 | - <?php esc_attr_e( 'View Add-on' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
35 | + <?php esc_attr_e( 'View Add-on', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
36 | 36 | <span class="dashicons dashicons-external"></span></a> |
37 | 37 | </div> |
38 | 38 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | <div class="addon-footer-wrap give-clearfix"> |
34 | 34 | <a href="<?php echo esc_attr( $permalink ); ?>" title="<?php echo esc_attr( $add_on_title ); ?>" class="button-secondary" target="_blank"> |
35 | - <?php esc_attr_e( 'View Add-on' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
35 | + <?php esc_attr_e( 'View Add-on', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
36 | 36 | <span class="dashicons dashicons-external"></span></a> |
37 | 37 | </div> |
38 | 38 |