@@ -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 |
@@ -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' ); |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | new YIKES_Inc_Easy_Mailchimp_Public_Ajax(); |
58 | 58 | |
59 | 59 | // Include our error logging class |
60 | - add_action( 'init' , array( $this , 'load_error_logging_class' ) , 1 ); |
|
60 | + add_action( 'init', array( $this, 'load_error_logging_class' ), 1 ); |
|
61 | 61 | // load our checkbox classes |
62 | - add_action( 'init' , array( $this , 'load_checkbox_integration_classes' ) , 1 ); |
|
62 | + add_action( 'init', array( $this, 'load_checkbox_integration_classes' ), 1 ); |
|
63 | 63 | // custom front end filter |
64 | 64 | add_action( 'init', array( $this, 'yikes_custom_frontend_content_filter' ) ); |
65 | 65 | // Process non-ajax forms in the header |
@@ -94,15 +94,15 @@ discard block |
||
94 | 94 | **/ |
95 | 95 | public function load_checkbox_integration_classes() { |
96 | 96 | // store our options |
97 | - $integrations = get_option( 'optin-checkbox-init' , array() ); |
|
98 | - if( ! empty( $integrations ) && is_array( $integrations ) ) { |
|
97 | + $integrations = get_option( 'optin-checkbox-init', array() ); |
|
98 | + if ( ! empty( $integrations ) && is_array( $integrations ) ) { |
|
99 | 99 | // load our mail integrations class |
100 | 100 | require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations.php'; |
101 | 101 | // loop over selected classes and load them up! |
102 | - foreach( $integrations as $integration => $value ) { |
|
103 | - if( isset( $value['value'] ) && $value['value'] == 'on' ) { |
|
102 | + foreach ( $integrations as $integration => $value ) { |
|
103 | + if ( isset( $value[ 'value' ] ) && $value[ 'value' ] == 'on' ) { |
|
104 | 104 | // load our class extensions |
105 | - require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations/class.'.$integration.'-checkbox.php'; |
|
105 | + require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations/class.' . $integration . '-checkbox.php'; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @since 6.0.0 |
117 | 117 | */ |
118 | 118 | public function load_error_logging_class() { |
119 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
119 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
120 | 120 | // if error logging is enabled we should include our error logging class |
121 | 121 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
122 | 122 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging; |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | * @since 6.0.3.4 |
130 | 130 | */ |
131 | 131 | public function yikes_process_non_ajax_forms( $form_submitted ) { |
132 | - global $wpdb,$post; |
|
133 | - $form_id = ( ! empty( $_POST['yikes-mailchimp-submitted-form'] ) ) ? (int) $_POST['yikes-mailchimp-submitted-form'] : false; // store form id |
|
134 | - if( $form_id ) { |
|
132 | + global $wpdb, $post; |
|
133 | + $form_id = ( ! empty( $_POST[ 'yikes-mailchimp-submitted-form' ] ) ) ? (int) $_POST[ 'yikes-mailchimp-submitted-form' ] : false; // store form id |
|
134 | + if ( $form_id ) { |
|
135 | 135 | $form_settings = self::yikes_retrieve_form_settings( $form_id ); |
136 | - if( isset( $_POST ) && !empty( $_POST ) && isset( $form_id ) && $form_settings['submission_settings']['ajax'] == 0 ) { |
|
137 | - if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { // ensure we only process the form that was submitted |
|
136 | + if ( isset( $_POST ) && ! empty( $_POST ) && isset( $form_id ) && $form_settings[ 'submission_settings' ][ 'ajax' ] == 0 ) { |
|
137 | + if ( $_POST[ 'yikes-mailchimp-submitted-form' ] == $form_id ) { // ensure we only process the form that was submitted |
|
138 | 138 | |
139 | 139 | // Lets include our form processing file |
140 | 140 | include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' ); |
141 | - if( $form_settings['submission_settings']['redirect_on_submission'] == '1' ) { |
|
142 | - if( $form_submitted == 1 ) { |
|
141 | + if ( $form_settings[ 'submission_settings' ][ 'redirect_on_submission' ] == '1' ) { |
|
142 | + if ( $form_submitted == 1 ) { |
|
143 | 143 | // decode our settings |
144 | - $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 | + $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' ]; |
|
145 | 145 | wp_redirect( apply_filters( 'yikes-mailchimp-redirect-url', esc_url( $redirect_page ), $form_id, $post ) ); |
146 | 146 | exit; |
147 | 147 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public static function yikes_retrieve_form_settings( $form_id ) { |
171 | 171 | // if no form id, abort |
172 | - if( ! $form_id ) { |
|
172 | + if ( ! $form_id ) { |
|
173 | 173 | return array(); |
174 | 174 | } |
175 | 175 | |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | return; |
199 | 199 | } |
200 | 200 | // trim trailing period |
201 | - if ( isset( $form_settings['error_messages']['update-link'] ) && ! empty( $form_settings['error_messages']['update-link'] ) ) { |
|
202 | - $response_text = $form_settings['error_messages']['update-link']; |
|
201 | + if ( isset( $form_settings[ 'error_messages' ][ 'update-link' ] ) && ! empty( $form_settings[ 'error_messages' ][ 'update-link' ] ) ) { |
|
202 | + $response_text = $form_settings[ 'error_messages' ][ 'update-link' ]; |
|
203 | 203 | // extract the link text |
204 | 204 | preg_match( '/\[link].*?\[\/link\]/', $response_text, $link_text ); |
205 | 205 | if ( $link_text && ! empty( $link_text ) ) { |
206 | 206 | // Extract the custom link text ([link]*[/link]) |
207 | - $custom_link_text = str_replace( '[/link]', '', str_replace( '[link]', '', str_replace( 'click to send yourself an update link', $link_text[0], $link ) ) ); |
|
207 | + $custom_link_text = str_replace( '[/link]', '', str_replace( '[link]', '', str_replace( 'click to send yourself an update link', $link_text[ 0 ], $link ) ) ); |
|
208 | 208 | // Replace the link text, with our custom link text |
209 | 209 | $response_text = str_replace( $link_text, $custom_link_text, $response_text ); |
210 | 210 | } |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | // trim trailing period |
236 | - if ( isset( $form_settings['error_messages']['already-subscribed'] ) && ! empty( $form_settings['error_messages']['already-subscribed'] ) ) { |
|
237 | - $response_text = str_replace( '[email]', $email, $form_settings['error_messages']['already-subscribed'] ); |
|
236 | + if ( isset( $form_settings[ 'error_messages' ][ 'already-subscribed' ] ) && ! empty( $form_settings[ 'error_messages' ][ 'already-subscribed' ] ) ) { |
|
237 | + $response_text = str_replace( '[email]', $email, $form_settings[ 'error_messages' ][ 'already-subscribed' ] ); |
|
238 | 238 | } |
239 | 239 | // Return our new string |
240 | 240 | return $response_text; |
@@ -5,10 +5,10 @@ discard block |
||
5 | 5 | <div id="col-left"> |
6 | 6 | |
7 | 7 | <div class="col-wrap"> |
8 | - <h1><span class="dashicons dashicons-wordpress-alt support-page-wordpress-font"></span> <?php _e( 'WordPress.org Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
8 | + <h1><span class="dashicons dashicons-wordpress-alt support-page-wordpress-font"></span> <?php _e( 'WordPress.org Plugin Directory', 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
9 | 9 | <div class="inside"> |
10 | 10 | <p><?php _e( 'Use your WordPress.org username to submit support requests on the WordPress Directory support forum.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
11 | - <img class="support-page-logo" src="<?php echo YIKES_MC_URL; ?>includes/images/Support_Page/wordpress-issue-screenshot.png" title="<?php esc_attr_e( 'WordPress.org Issue Tracker Screenshot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
11 | + <img class="support-page-logo" src="<?php echo YIKES_MC_URL; ?>includes/images/Support_Page/wordpress-issue-screenshot.png" title="<?php esc_attr_e( 'WordPress.org Issue Tracker Screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
12 | 12 | <a href="https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender" target="_blank" class="button-secondary support-page-button"><?php _e( 'Submit a New WordPress.org Support Request', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
13 | 13 | </div> |
14 | 14 | </div> |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | printf( '<h2>' . esc_attr__( 'Popular Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ) . '</h2>' ); |
61 | 61 | printf( '<ol>' ); |
62 | 62 | foreach ( $knowledge_base_links as $kb_link ) { |
63 | - echo wp_kses_post( '<li><a href="' . esc_url( $kb_link['href'] ) . '" title="' . esc_attr( $kb_link['title'] ) . '" target="_blank">' . esc_attr( $kb_link['title'] ) . '</a></li>' ); |
|
63 | + echo wp_kses_post( '<li><a href="' . esc_url( $kb_link[ 'href' ] ) . '" title="' . esc_attr( $kb_link[ 'title' ] ) . '" target="_blank">' . esc_attr( $kb_link[ 'title' ] ) . '</a></li>' ); |
|
64 | 64 | } |
65 | 65 | printf( '</ol>' ); |
66 | 66 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | <h2 class="premium-support-title"><?php _e( 'Priority & Add-on Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
7 | 7 | |
8 | 8 | <?php |
9 | - if ( isset( $_POST['submit-premium-support-request'] ) ) { |
|
9 | + if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) { |
|
10 | 10 | ?> |
11 | 11 | <h4><?php _e( 'Success!', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
12 | 12 | <p><?php _e( 'We have received your support request and will get in touch shortly regarding your issue.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | ?> |
16 | 16 | |
17 | 17 | <!-- Premium Support Form --> |
18 | - <form id="premium-support-form" method="post" action="<?php echo esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#premium-support-form' ) ); ?>" <?php echo (isset($_POST['submit-premium-support-request'])) ? 'class="support-form-hidden"' : ''; ?>> |
|
18 | + <form id="premium-support-form" method="post" action="<?php echo esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#premium-support-form' ) ); ?>" <?php echo ( isset( $_POST[ 'submit-premium-support-request' ] ) ) ? 'class="support-form-hidden"' : ''; ?>> |
|
19 | 19 | |
20 | 20 | <label><?php _e( 'Add-On:', 'yikes-inc-easy-mailchimp-extender' ); ?> |
21 | 21 | <select name="license_key" id="license-key"> |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | // get the license for the respective extension |
26 | 26 | $options = get_option( 'yikes-mailchimp-' . $extension . '-settings', array() ); |
27 | 27 | |
28 | - if ( isset( $options['license'] ) && $options['status'] == 'valid' ) { |
|
29 | - echo '<option data-plugin-slug="' . esc_attr( $extension ) . '" data-plugin-name="' . esc_attr( ucwords( str_replace( '-', ' ', $extension ) ) ) . '" value="' . esc_attr( trim( $options['license'] ) ) . '">' . ucwords( str_replace( '-', ' ', $extension ) ) . ' ' . '</option>'; |
|
28 | + if ( isset( $options[ 'license' ] ) && $options[ 'status' ] == 'valid' ) { |
|
29 | + echo '<option data-plugin-slug="' . esc_attr( $extension ) . '" data-plugin-name="' . esc_attr( ucwords( str_replace( '-', ' ', $extension ) ) ) . '" value="' . esc_attr( trim( $options[ 'license' ] ) ) . '">' . ucwords( str_replace( '-', ' ', $extension ) ) . ' ' . '</option>'; |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | ?> |
33 | 33 | </select> |
34 | - <p class="description"><?php _e( 'Select the add-on that you are looking for help with.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
34 | + <p class="description"><?php _e( 'Select the add-on that you are looking for help with.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
35 | 35 | |
36 | 36 | <input type="hidden" name="plugin-slug" id="plugin-slug" value=""> |
37 | 37 | <input type="hidden" name="plugin-name" id="plugin-name" value=""> |
@@ -39,31 +39,31 @@ discard block |
||
39 | 39 | |
40 | 40 | <label><?php _e( 'Name:', 'yikes-inc-easy-mailchimp-extender' ); ?> |
41 | 41 | <input type="text" name="user-name" required> |
42 | - <p class="description"><?php _e( 'Enter your name.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
42 | + <p class="description"><?php _e( 'Enter your name.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
43 | 43 | </label> |
44 | 44 | |
45 | 45 | <label><?php _e( 'Contact Email:', 'yikes-inc-easy-mailchimp-extender' ); ?> |
46 | 46 | <input type="email" name="user-email" required> |
47 | - <p class="description"><?php _e( 'Enter the email address you would prefer to be contact at.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
47 | + <p class="description"><?php _e( 'Enter the email address you would prefer to be contact at.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
48 | 48 | </label> |
49 | 49 | |
50 | 50 | <label><?php _e( 'Topic:', 'yikes-inc-easy-mailchimp-extender' ); ?> |
51 | 51 | <input type="text" name="support-topic" required> |
52 | - <p class="description"><?php _e( 'Pleae enter the topic of your support request.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
52 | + <p class="description"><?php _e( 'Pleae enter the topic of your support request.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
53 | 53 | </label> |
54 | 54 | |
55 | 55 | <label><?php _e( 'Priority:', 'yikes-inc-easy-mailchimp-extender' ); ?> |
56 | 56 | <select name="support-priority"> |
57 | - <option value="1"><?php _e( 'Low' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
58 | - <option value="2"><?php _e( 'Medium' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
59 | - <option value="3"><?php _e( 'High' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
60 | - <option value="4"><?php _e( 'Urgent' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
57 | + <option value="1"><?php _e( 'Low', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
58 | + <option value="2"><?php _e( 'Medium', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
59 | + <option value="3"><?php _e( 'High', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
60 | + <option value="4"><?php _e( 'Urgent', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
61 | 61 | </select> |
62 | - <p class="description"><?php _e( 'Select the priority of this ticket.' , 'yikes-inc-easy-mailchimp-extender' ); ?><em><?php _e( 'Note: Please do not abuse "urgent".' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></p> |
|
62 | + <p class="description"><?php _e( 'Select the priority of this ticket.', 'yikes-inc-easy-mailchimp-extender' ); ?><em><?php _e( 'Note: Please do not abuse "urgent".', 'yikes-inc-easy-mailchimp-extender' ); ?></em></p> |
|
63 | 63 | </label> |
64 | 64 | <label><?php _e( 'Issue:', 'yikes-inc-easy-mailchimp-extender' ); ?> |
65 | 65 | <?php wp_editor( '', 'support-content', array( 'textarea_name' => 'support-content', 'media_buttons' => false ) ); ?> |
66 | - <p class="description"><?php _e( 'Enter as much detail about the issue you are encontering as possible. After we make initial contact you can attach any screenshots necessary.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
66 | + <p class="description"><?php _e( 'Enter as much detail about the issue you are encontering as possible. After we make initial contact you can attach any screenshots necessary.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
67 | 67 | </label> |
68 | 68 | |
69 | 69 | <input type="hidden" name="action" value="yikes-support-request"> |
@@ -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 ); |
@@ -181,19 +181,19 @@ |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
184 | - * Update a merge field for a particular list |
|
185 | - * |
|
186 | - * @author Kevin Utz |
|
187 | - * |
|
188 | - * @since 6.3.3 |
|
189 | - * |
|
190 | - * @param string | $list_id | The ID of the Mailchimp list |
|
191 | - * @param string | $field_id | The ID of the merge field |
|
192 | - * @param array | $field_data | An array of field data constituting the body of our API request |
|
193 | - * @param bool | $clear_transient | Flag whether we should delete the transients associated with this list |
|
194 | - * |
|
195 | - * @return array | WP_Error |
|
196 | - */ |
|
184 | + * Update a merge field for a particular list |
|
185 | + * |
|
186 | + * @author Kevin Utz |
|
187 | + * |
|
188 | + * @since 6.3.3 |
|
189 | + * |
|
190 | + * @param string | $list_id | The ID of the Mailchimp list |
|
191 | + * @param string | $field_id | The ID of the merge field |
|
192 | + * @param array | $field_data | An array of field data constituting the body of our API request |
|
193 | + * @param bool | $clear_transient | Flag whether we should delete the transients associated with this list |
|
194 | + * |
|
195 | + * @return array | WP_Error |
|
196 | + */ |
|
197 | 197 | public function update_merge_field( $list_id, $field_id, $field_data, $clear_transient = true ) { |
198 | 198 | $path = "{$this->base_path}/{$list_id}/merge-fields/{$field_id}"; |
199 | 199 | $field = $this->patch_to_api( $path, $field_data ); |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | * @returned_error |
123 | 123 | * @error_type - what was running when the error occured ie (new user subscription, remove user etc) |
124 | 124 | */ |
125 | - public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) { |
|
125 | + public function yikes_easy_mailchimp_write_to_error_log( $returned_error, $error_type, $page = '' ) { |
|
126 | 126 | |
127 | 127 | // confirm error logging is toggled on, else lets exit |
128 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) != '1' ) { |
|
128 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) != '1' ) { |
|
129 | 129 | return; |
130 | 130 | } |
131 | 131 | |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | public function yikes_easy_mailchimp_generate_error_log_table() { |
172 | 172 | |
173 | 173 | // ensure file_get_contents exists |
174 | - if( function_exists( 'file_get_contents' ) ) { |
|
174 | + if ( function_exists( 'file_get_contents' ) ) { |
|
175 | 175 | // confirm that our file exists |
176 | - if( file_exists( $this->error_log_file_path ) ) { |
|
176 | + if ( file_exists( $this->error_log_file_path ) ) { |
|
177 | 177 | $error_log_contents = file_get_contents( $this->error_log_file_path, true ); |
178 | - if( $error_log_contents === FALSE ) { |
|
179 | - return _e( 'File get contents not available' , 'yikes-inc-easy-mailchimp-extender' ); |
|
178 | + if ( $error_log_contents === FALSE ) { |
|
179 | + return _e( 'File get contents not available', 'yikes-inc-easy-mailchimp-extender' ); |
|
180 | 180 | } |
181 | 181 | if ( $error_log_contents != '' ) { |
182 | 182 | // return $error_log_contents; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | <tr class="error-log-tr"> |
188 | 188 | <td class="row-title colspanchange" colspan="2"> |
189 | 189 | <strong><span class='dashicons dashicons-no-alt'></span> <?php _e( 'No errors logged.', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
190 | - <?php if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '' ) { ?> |
|
190 | + <?php if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '' ) { ?> |
|
191 | 191 | <br /> |
192 | 192 | <p class="to-start-logging-errors-notice"><em><?php _e( "To start logging errors toggle on the 'Enable Debugging' option above.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p> |
193 | 193 | <?php } ?> |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | ); |
216 | 216 | ?> |
217 | 217 | <form id="create-error-log" method="POST" action="<?php echo $url; ?>"> |
218 | - <?php submit_button( __( 'Attempt to Create Error Log' , 'yikes-inc-easy-mailchimp-extender' ) , 'secondary' , '' , '' , array() ); ?> |
|
218 | + <?php submit_button( __( 'Attempt to Create Error Log', 'yikes-inc-easy-mailchimp-extender' ), 'secondary', '', '', array() ); ?> |
|
219 | 219 | </form> |
220 | 220 | |
221 | 221 | </p> |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes |
26 | 26 | * @author YIKES Inc. <[email protected]> |
27 | 27 | */ |
28 | -class Yikes_Inc_Easy_Mailchimp_Error_Logging { |
|
28 | +class Yikes_Inc_Easy_Mailchimp_Error_Logging { |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Whether we're doing debugging. |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @since 1.0.0 |
59 | 59 | */ |
60 | - public function __construct() { |
|
60 | + public function __construct() { |
|
61 | 61 | $this->is_debugging = WP_DEBUG || (string) get_option( 'yikes-mailchimp-debug-status', '' ) === '1'; |
62 | 62 | $this->error_log_file_path = $this->get_error_log_file_path(); |
63 | 63 | $this->error_log_folder_path = $this->get_error_log_folder(); |
@@ -78,35 +78,35 @@ discard block |
||
78 | 78 | * @param string $error_type The error type. |
79 | 79 | * @param string $page The page information. |
80 | 80 | */ |
81 | - public function maybe_write_to_log( $returned_error, $error_type, $page = '' ) { |
|
82 | - if ( ! $this->is_debugging ) { |
|
81 | + public function maybe_write_to_log( $returned_error, $error_type, $page = '' ) { |
|
82 | + if ( ! $this->is_debugging ) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
86 | 86 | $this->yikes_easy_mailchimp_write_to_error_log( $returned_error, $error_type, $page ); |
87 | 87 | } |
88 | 88 | |
89 | - public function create_error_log_folder() { |
|
89 | + public function create_error_log_folder() { |
|
90 | 90 | |
91 | 91 | // If our directory doesn't exist, make it. |
92 | - if ( ! file_exists( $this->get_error_log_folder() ) ) { |
|
92 | + if ( ! file_exists( $this->get_error_log_folder() ) ) { |
|
93 | 93 | mkdir( $this->get_error_log_folder() ); |
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | - public function create_error_log_file() { |
|
97 | + public function create_error_log_file() { |
|
98 | 98 | |
99 | 99 | // If our error log doesn't exist, make it. |
100 | - if ( ! file_exists( $this->error_log_file_path ) ) { |
|
100 | + if ( ! file_exists( $this->error_log_file_path ) ) { |
|
101 | 101 | file_put_contents( $this->error_log_file_path, '' ); |
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
105 | - private function get_error_log_folder() { |
|
105 | + private function get_error_log_folder() { |
|
106 | 106 | return WP_CONTENT_DIR . '/uploads/yikes-log/'; |
107 | 107 | } |
108 | 108 | |
109 | - private function get_error_log_file_path() { |
|
109 | + private function get_error_log_file_path() { |
|
110 | 110 | return WP_CONTENT_DIR . '/uploads/yikes-log/yikes-easy-mailchimp-error-log.txt'; |
111 | 111 | } |
112 | 112 | |
@@ -122,17 +122,17 @@ discard block |
||
122 | 122 | * @returned_error |
123 | 123 | * @error_type - what was running when the error occured ie (new user subscription, remove user etc) |
124 | 124 | */ |
125 | - public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) { |
|
125 | + public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) { |
|
126 | 126 | |
127 | 127 | // confirm error logging is toggled on, else lets exit |
128 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) != '1' ) { |
|
128 | + if( get_option( 'yikes-mailchimp-debug-status' , '' ) != '1' ) { |
|
129 | 129 | return; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $contents = file_get_contents( $this->error_log_file_path, true ); |
133 | 133 | |
134 | 134 | // if we pass in a custom page, don't set things up |
135 | - if ( empty( $page ) ) { |
|
135 | + if ( empty( $page ) ) { |
|
136 | 136 | |
137 | 137 | // get the current page, admin or front end? |
138 | 138 | $page = is_admin() ? __( 'Admin', 'yikes-inc-easy-mailchimp-extender' ) : __( 'Front End', 'yikes-inc-easy-mailchimp-extender' ); |
@@ -168,20 +168,20 @@ discard block |
||
168 | 168 | * |
169 | 169 | * @since 5.6 |
170 | 170 | */ |
171 | - public function yikes_easy_mailchimp_generate_error_log_table() { |
|
171 | + public function yikes_easy_mailchimp_generate_error_log_table() { |
|
172 | 172 | |
173 | 173 | // ensure file_get_contents exists |
174 | - if( function_exists( 'file_get_contents' ) ) { |
|
174 | + if( function_exists( 'file_get_contents' ) ) { |
|
175 | 175 | // confirm that our file exists |
176 | - if( file_exists( $this->error_log_file_path ) ) { |
|
176 | + if( file_exists( $this->error_log_file_path ) ) { |
|
177 | 177 | $error_log_contents = file_get_contents( $this->error_log_file_path, true ); |
178 | - if( $error_log_contents === FALSE ) { |
|
178 | + if( $error_log_contents === FALSE ) { |
|
179 | 179 | return _e( 'File get contents not available' , 'yikes-inc-easy-mailchimp-extender' ); |
180 | 180 | } |
181 | - if ( $error_log_contents != '' ) { |
|
181 | + if ( $error_log_contents != '' ) { |
|
182 | 182 | // return $error_log_contents; |
183 | 183 | print_r( $error_log_contents ); |
184 | - } else { |
|
184 | + } else { |
|
185 | 185 | ?> |
186 | 186 | <!-- table body --> |
187 | 187 | <tr class="error-log-tr"> |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | </tr> |
196 | 196 | <?php |
197 | 197 | } |
198 | - } else { |
|
198 | + } else { |
|
199 | 199 | ?> |
200 | 200 | <!-- table body --> |
201 | 201 | <tr class="error-log-tr"> |
@@ -223,7 +223,8 @@ discard block |
||
223 | 223 | </tr> |
224 | 224 | <?php |
225 | 225 | } |
226 | - } else { // if file_get_contents is disabled server side |
|
226 | + } else { |
|
227 | +// if file_get_contents is disabled server side |
|
227 | 228 | ?> |
228 | 229 | <!-- table body --> |
229 | 230 | <tr> |