@@ -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 |
@@ -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 |