@@ -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 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | public function __construct() { |
13 | 13 | |
14 | 14 | // Ajax send merge variable to form builder. |
15 | - add_action( 'wp_ajax_add_field_to_form', array( $this , 'send_field_to_form' ), 10 ); |
|
15 | + add_action( 'wp_ajax_add_field_to_form', array( $this, 'send_field_to_form' ), 10 ); |
|
16 | 16 | |
17 | 17 | // Ajax send interest group to form builder. |
18 | 18 | add_action( 'wp_ajax_add_interest_group_to_form', array( $this, 'send_interest_group_to_form' ), 10 ); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * - return a single container |
42 | 42 | */ |
43 | 43 | public function add_notification_to_form() { |
44 | - if ( isset( $_POST['notification_name'] ) ) { |
|
44 | + if ( isset( $_POST[ 'notification_name' ] ) ) { |
|
45 | 45 | include_once YIKES_MC_PATH . 'admin/partials/ajax/add_notification_to_form.php'; |
46 | 46 | } |
47 | 47 | exit(); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | // when the user wants to switch which form data |
52 | 52 | // is displayed on the dashboard |
53 | 53 | public function get_new_list_data() { |
54 | - $list_id = $_POST['list_id']; |
|
54 | + $list_id = $_POST[ 'list_id' ]; |
|
55 | 55 | $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_list( $list_id ); |
56 | 56 | if ( is_wp_error( $list_data ) ) { |
57 | 57 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | /* note: this function is called statically from the integration settings page */ |
75 | 75 | public static function check_list_for_interest_groups( $list_id = '', $integration_type = '', $load = false ) { |
76 | 76 | if ( ! $list_id ) { |
77 | - $list_id = $_POST['list_id']; |
|
77 | + $list_id = $_POST[ 'list_id' ]; |
|
78 | 78 | } |
79 | 79 | if ( ! $integration_type ) { |
80 | - $integration_type = $_POST['integration']; |
|
80 | + $integration_type = $_POST[ 'integration' ]; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | if ( ! check_ajax_referer( 'add-tag', 'nonce', false ) ) { |
123 | 123 | wp_send_json_error( '1' ); |
124 | 124 | } |
125 | - $tags = isset( $_POST['tags'] ) ? wp_unslash( $_POST['tags'] ) : array(); |
|
126 | - $list_id = isset( $_POST['list_id'] ) ? filter_var( wp_unslash( $_POST['list_id'] ), FILTER_SANITIZE_STRING ) : ''; |
|
127 | - $form_id = isset( $_POST['form_id'] ) ? filter_var( wp_unslash( $_POST['form_id'] ), FILTER_SANITIZE_NUMBER_INT ) : 0; |
|
125 | + $tags = isset( $_POST[ 'tags' ] ) ? wp_unslash( $_POST[ 'tags' ] ) : array(); |
|
126 | + $list_id = isset( $_POST[ 'list_id' ] ) ? filter_var( wp_unslash( $_POST[ 'list_id' ] ), FILTER_SANITIZE_STRING ) : ''; |
|
127 | + $form_id = isset( $_POST[ 'form_id' ] ) ? filter_var( wp_unslash( $_POST[ 'form_id' ] ), FILTER_SANITIZE_NUMBER_INT ) : 0; |
|
128 | 128 | |
129 | 129 | if ( empty( $tags ) || empty( $list_id ) || empty( $form_id ) ) { |
130 | 130 | wp_send_json_error( '2' ); |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | |
137 | 137 | // This data came from $_POST so sanitize it. |
138 | 138 | foreach ( $tags as $tag ) { |
139 | - $form_tags[ filter_var( $tag['tag_id'], FILTER_SANITIZE_NUMBER_INT ) ] = array( |
|
140 | - 'name' => filter_var( $tag['tag_name'], FILTER_SANITIZE_STRING ), |
|
141 | - 'id' => filter_var( $tag['tag_id'], FILTER_SANITIZE_NUMBER_INT ), |
|
139 | + $form_tags[ filter_var( $tag[ 'tag_id' ], FILTER_SANITIZE_NUMBER_INT ) ] = array( |
|
140 | + 'name' => filter_var( $tag[ 'tag_name' ], FILTER_SANITIZE_STRING ), |
|
141 | + 'id' => filter_var( $tag[ 'tag_id' ], FILTER_SANITIZE_NUMBER_INT ), |
|
142 | 142 | ); |
143 | 143 | } |
144 | 144 | |
145 | - $form['tags'] = $form_tags + ( isset( $form['tags'] ) ? $form['tags'] : array() ); |
|
145 | + $form[ 'tags' ] = $form_tags + ( isset( $form[ 'tags' ] ) ? $form[ 'tags' ] : array() ); |
|
146 | 146 | $form_interface->update_form( $form_id, $form ); |
147 | 147 | wp_send_json_success( array( 'tags' => $form_tags ) ); |
148 | 148 | } |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | if ( ! check_ajax_referer( 'remove-tag', 'nonce', false ) ) { |
156 | 156 | wp_send_json_error( '1' ); |
157 | 157 | } |
158 | - $tag = isset( $_POST['tag'] ) ? filter_var( wp_unslash( $_POST['tag'] ), FILTER_SANITIZE_NUMBER_INT ) : array(); |
|
159 | - $list_id = isset( $_POST['list_id'] ) ? filter_var( wp_unslash( $_POST['list_id'] ), FILTER_SANITIZE_STRING ) : ''; |
|
160 | - $form_id = isset( $_POST['form_id'] ) ? filter_var( wp_unslash( $_POST['form_id'] ), FILTER_SANITIZE_NUMBER_INT ) : 0; |
|
158 | + $tag = isset( $_POST[ 'tag' ] ) ? filter_var( wp_unslash( $_POST[ 'tag' ] ), FILTER_SANITIZE_NUMBER_INT ) : array(); |
|
159 | + $list_id = isset( $_POST[ 'list_id' ] ) ? filter_var( wp_unslash( $_POST[ 'list_id' ] ), FILTER_SANITIZE_STRING ) : ''; |
|
160 | + $form_id = isset( $_POST[ 'form_id' ] ) ? filter_var( wp_unslash( $_POST[ 'form_id' ] ), FILTER_SANITIZE_NUMBER_INT ) : 0; |
|
161 | 161 | |
162 | 162 | if ( empty( $tag ) || empty( $list_id ) || empty( $form_id ) ) { |
163 | 163 | wp_send_json_error( '2' ); |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | |
166 | 166 | $form_interface = yikes_easy_mailchimp_extender_get_form_interface(); |
167 | 167 | $form = $form_interface->get_form( $form_id ); |
168 | - if ( isset( $form['tags'] ) && isset( $form['tags'][ $tag ] ) ) { |
|
169 | - unset( $form['tags'][ $tag ] ); |
|
168 | + if ( isset( $form[ 'tags' ] ) && isset( $form[ 'tags' ][ $tag ] ) ) { |
|
169 | + unset( $form[ 'tags' ][ $tag ] ); |
|
170 | 170 | } |
171 | 171 | $form_interface->update_form( $form_id, $form ); |
172 | 172 | wp_send_json_success(); |
@@ -190,10 +190,10 @@ discard block |
||
190 | 190 | public function save_field_label_edits() { |
191 | 191 | |
192 | 192 | // Capture our $_POST variables |
193 | - $list_id = isset( $_POST['list_id'] ) ? $_POST['list_id'] : ''; |
|
194 | - $field_data = isset( $_POST['field_data'] ) ? $_POST['field_data'] : array(); |
|
195 | - $field_name = isset( $field_data['field_name'] ) ? $field_data['field_name'] : ''; |
|
196 | - $field_id = isset( $field_data['field_id'] ) ? $field_data['field_id'] : ''; |
|
193 | + $list_id = isset( $_POST[ 'list_id' ] ) ? $_POST[ 'list_id' ] : ''; |
|
194 | + $field_data = isset( $_POST[ 'field_data' ] ) ? $_POST[ 'field_data' ] : array(); |
|
195 | + $field_name = isset( $field_data[ 'field_name' ] ) ? $field_data[ 'field_name' ] : ''; |
|
196 | + $field_id = isset( $field_data[ 'field_id' ] ) ? $field_data[ 'field_id' ] : ''; |
|
197 | 197 | |
198 | 198 | // Make sure we have our required variables before continuing |
199 | 199 | if ( $list_id === '' || $field_name === '' || $field_id === '' ) { |
@@ -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 |
@@ -3,18 +3,18 @@ |
||
3 | 3 | - Clear MailChimp transient data such as forms, form fields, list data, subscribers etc. |
4 | 4 | * transient cache is stored for 60 minutes. |
5 | 5 | --> |
6 | -<h3><span><?php _e( 'API Cache Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
6 | +<h3><span><?php _e( 'API Cache Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
7 | 7 | <div class="inside"> |
8 | 8 | |
9 | 9 | <!-- Settings Form --> |
10 | - <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data' , 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post"> |
|
10 | + <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data', 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post"> |
|
11 | 11 | |
12 | - <p><?php _e( "Delete all MailChimp data stored in your sites cache. Most data is stored in the cache for 1 hour." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
12 | + <p><?php _e( "Delete all MailChimp data stored in your sites cache. Most data is stored in the cache for 1 hour.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
13 | 13 | <!-- check if any of our transients contain data --> |
14 | 14 | <?php if ( false === get_transient( 'yikes-easy-mailchimp-list-data' ) && false === get_transient( 'yikes-easy-mailchimp-profile-data' ) && false === get_transient( 'yikes-easy-mailchimp-account-data' ) && false === get_transient( 'yikesinc_eme_list_ids' ) && false === get_transient( 'yikes_eme_lists' ) ) { ?> |
15 | - <p><a href="#" class="button-secondary" disabled="disabled" title="<?php _e( 'No MailChimp data found in temporary cache storage.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> |
|
15 | + <p><a href="#" class="button-secondary" disabled="disabled" title="<?php _e( 'No MailChimp data found in temporary cache storage.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Clear MailChimp API Cache', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> |
|
16 | 16 | <?php } else { ?> |
17 | - <p><input type="submit" class="button-primary" value="<?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
17 | + <p><input type="submit" class="button-primary" value="<?php _e( 'Clear MailChimp API Cache', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
18 | 18 | <?php } ?> |
19 | 19 | |
20 | 20 | </form> |