@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | 45 | if ( ! defined( 'YIKES_MC_VERSION' ) ) { |
| 46 | - define( 'YIKES_MC_VERSION' , '6.1.3' ); |
|
| 46 | + define( 'YIKES_MC_VERSION', '6.1.3' ); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @return void |
| 54 | 54 | */ |
| 55 | 55 | if ( ! defined( 'YIKES_MC_PATH' ) ) { |
| 56 | - define( 'YIKES_MC_PATH' , plugin_dir_path( __FILE__ ) ); |
|
| 56 | + define( 'YIKES_MC_PATH', plugin_dir_path( __FILE__ ) ); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @return void |
| 64 | 64 | */ |
| 65 | 65 | if ( ! defined( 'YIKES_MC_URL' ) ) { |
| 66 | - define( 'YIKES_MC_URL' , plugin_dir_url( __FILE__ ) ); |
|
| 66 | + define( 'YIKES_MC_URL', plugin_dir_url( __FILE__ ) ); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | // include our ajax processing class |
| 57 | 57 | require_once( YIKES_MC_PATH . 'public/partials/ajax/class.public_ajax.php' ); |
| 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' , '' ); |
|
| 97 | - if( !empty( $integrations ) ) { |
|
| 96 | + $integrations = get_option( 'optin-checkbox-init', '' ); |
|
| 97 | + if ( ! empty( $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,18 +128,18 @@ 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 | // lets include our form processing file |
| 138 | 138 | include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' ); |
| 139 | - if( $form_settings['submission_settings']['redirect_on_submission'] == '1' ) { |
|
| 140 | - if( $form_submitted == 1 ) { |
|
| 139 | + if ( $form_settings[ 'submission_settings' ][ 'redirect_on_submission' ] == '1' ) { |
|
| 140 | + if ( $form_submitted == 1 ) { |
|
| 141 | 141 | // decode our settings |
| 142 | - $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']; |
|
| 142 | + $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 | 143 | wp_redirect( apply_filters( 'yikes-mailchimp-redirect-url', esc_url( $redirect_page ), $form_id, $post ) ); |
| 144 | 144 | exit; |
| 145 | 145 | } |
@@ -155,27 +155,27 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public static function yikes_retrieve_form_settings( $form_id ) { |
| 157 | 157 | // if no form id, abort |
| 158 | - if( ! $form_id ) { |
|
| 158 | + if ( ! $form_id ) { |
|
| 159 | 159 | return; |
| 160 | 160 | } |
| 161 | 161 | global $wpdb; |
| 162 | 162 | $form_results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms WHERE id = ' . $form_id . '', ARRAY_A ); // query for our form data |
| 163 | - if( $form_results ) { |
|
| 163 | + if ( $form_results ) { |
|
| 164 | 164 | // empty array, to populate with form settings |
| 165 | 165 | $form_settings = array(); |
| 166 | - $form_data = $form_results[0]; // store the results |
|
| 166 | + $form_data = $form_results[ 0 ]; // store the results |
|
| 167 | 167 | // store the settings in our array |
| 168 | - $form_settings['list_id'] = sanitize_key( $form_data['list_id'] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
| 169 | - $form_settings['form_name'] = esc_attr( $form_data['form_name'] ); // form name |
|
| 170 | - $form_settings['form_description'] = esc_attr( stripslashes( $form_data['form_description'] ) ); |
|
| 171 | - $form_settings['fields'] = json_decode( $form_data['fields'] , true ); |
|
| 172 | - $form_settings['styles'] = json_decode( stripslashes( $form_data['custom_styles'] ) , true ); |
|
| 173 | - $form_settings['send_welcome'] = $form_data['send_welcome_email']; |
|
| 174 | - $form_settings['submission_settings'] = json_decode( stripslashes( $form_data['submission_settings'] ) , true ); |
|
| 175 | - $form_settings['optin_settings'] = json_decode( stripslashes( $form_data['optin_settings'] ) , true ); |
|
| 176 | - $form_settings['error_messages'] = json_decode( $form_data['error_messages'] , true ); |
|
| 177 | - $form_settings['notifications'] = isset( $form_data['custom_notifications'] ) ? json_decode( stripslashes( $form_data['custom_notifications'] ) , true ) : ''; |
|
| 178 | - $form_settings['submissions'] = $form_data['submissions']; |
|
| 168 | + $form_settings[ 'list_id' ] = sanitize_key( $form_data[ 'list_id' ] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
| 169 | + $form_settings[ 'form_name' ] = esc_attr( $form_data[ 'form_name' ] ); // form name |
|
| 170 | + $form_settings[ 'form_description' ] = esc_attr( stripslashes( $form_data[ 'form_description' ] ) ); |
|
| 171 | + $form_settings[ 'fields' ] = json_decode( $form_data[ 'fields' ], true ); |
|
| 172 | + $form_settings[ 'styles' ] = json_decode( stripslashes( $form_data[ 'custom_styles' ] ), true ); |
|
| 173 | + $form_settings[ 'send_welcome' ] = $form_data[ 'send_welcome_email' ]; |
|
| 174 | + $form_settings[ 'submission_settings' ] = json_decode( stripslashes( $form_data[ 'submission_settings' ] ), true ); |
|
| 175 | + $form_settings[ 'optin_settings' ] = json_decode( stripslashes( $form_data[ 'optin_settings' ] ), true ); |
|
| 176 | + $form_settings[ 'error_messages' ] = json_decode( $form_data[ 'error_messages' ], true ); |
|
| 177 | + $form_settings[ 'notifications' ] = isset( $form_data[ 'custom_notifications' ] ) ? json_decode( stripslashes( $form_data[ 'custom_notifications' ] ), true ) : ''; |
|
| 178 | + $form_settings[ 'submissions' ] = $form_data[ 'submissions' ]; |
|
| 179 | 179 | // return the given form settings in an array |
| 180 | 180 | return $form_settings; |
| 181 | 181 | } |
@@ -202,13 +202,13 @@ discard block |
||
| 202 | 202 | return; |
| 203 | 203 | } |
| 204 | 204 | // trim trailing period |
| 205 | - if ( isset( $form_settings['error_messages']['update-link'] ) && ! empty( $form_settings['error_messages']['update-link'] ) ) { |
|
| 206 | - $response_text = $form_settings['error_messages']['update-link']; |
|
| 205 | + if ( isset( $form_settings[ 'error_messages' ][ 'update-link' ] ) && ! empty( $form_settings[ 'error_messages' ][ 'update-link' ] ) ) { |
|
| 206 | + $response_text = $form_settings[ 'error_messages' ][ 'update-link' ]; |
|
| 207 | 207 | // extract the link text |
| 208 | 208 | preg_match( '/\[link].*?\[\/link\]/', $response_text, $link_text ); |
| 209 | 209 | if ( $link_text && ! empty( $link_text ) ) { |
| 210 | 210 | // Extract the custom link text ([link]*[/link]) |
| 211 | - $custom_link_text = str_replace( '[/link]', '', str_replace( '[link]', '', str_replace( 'click to send yourself an update link', $link_text[0], $link ) ) ); |
|
| 211 | + $custom_link_text = str_replace( '[/link]', '', str_replace( '[link]', '', str_replace( 'click to send yourself an update link', $link_text[ 0 ], $link ) ) ); |
|
| 212 | 212 | // Replace the link text, with our custom link text |
| 213 | 213 | $response_text = str_replace( $link_text, $custom_link_text, $response_text ); |
| 214 | 214 | } |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | return; |
| 236 | 236 | } |
| 237 | 237 | // trim trailing period |
| 238 | - if ( isset( $form_settings['error_messages']['already-subscribed'] ) && ! empty( $form_settings['error_messages']['already-subscribed'] ) ) { |
|
| 239 | - $response_text = str_replace( '[email]', $email, $form_settings['error_messages']['already-subscribed'] ); |
|
| 238 | + if ( isset( $form_settings[ 'error_messages' ][ 'already-subscribed' ] ) && ! empty( $form_settings[ 'error_messages' ][ 'already-subscribed' ] ) ) { |
|
| 239 | + $response_text = str_replace( '[email]', $email, $form_settings[ 'error_messages' ][ 'already-subscribed' ] ); |
|
| 240 | 240 | } |
| 241 | 241 | // Return our new string |
| 242 | 242 | return $response_text; |
@@ -5,13 +5,13 @@ discard block |
||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | /* Get and Store Option Values */ |
| 8 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) === 'valid_api_key' ) { |
|
| 9 | - $api_connection = '<span id="connection-container" class="api-connected" title="' . __( "Your site is currently connected to the MailChimp API" , "yikes-inc-easy-mailchimp-extender" ) . '"><span class="dashicons dashicons-yes yikes-mc-api-connected"></span> ' . __( "Connected" , 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
|
| 8 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) === 'valid_api_key' ) { |
|
| 9 | + $api_connection = '<span id="connection-container" class="api-connected" title="' . __( "Your site is currently connected to the MailChimp API", "yikes-inc-easy-mailchimp-extender" ) . '"><span class="dashicons dashicons-yes yikes-mc-api-connected"></span> ' . __( "Connected", 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
|
| 10 | 10 | $api_error_response = ''; |
| 11 | 11 | } else { |
| 12 | - $api_connection = '<span id="connection-container" class="api-not-connected"><span class="dashicons dashicons-no-alt yikes-mc-api-not-connected"></span> ' . __( "Not Connected" , 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
|
| 13 | - if( get_option( 'yikes-mc-api-invalid-key-response' , '' ) != '' ) { |
|
| 14 | - $api_error_response = '<p><small><i class="dashicons dashicons-no-alt"></i> ' . get_option( 'yikes-mc-api-invalid-key-response' , '' ) . '</small></p>'; |
|
| 12 | + $api_connection = '<span id="connection-container" class="api-not-connected"><span class="dashicons dashicons-no-alt yikes-mc-api-not-connected"></span> ' . __( "Not Connected", 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
|
| 13 | + if ( get_option( 'yikes-mc-api-invalid-key-response', '' ) != '' ) { |
|
| 14 | + $api_error_response = '<p><small><i class="dashicons dashicons-no-alt"></i> ' . get_option( 'yikes-mc-api-invalid-key-response', '' ) . '</small></p>'; |
|
| 15 | 15 | } else { |
| 16 | 16 | $api_error_response = ''; |
| 17 | 17 | } |
@@ -25,15 +25,15 @@ discard block |
||
| 25 | 25 | <div class="wrap"> |
| 26 | 26 | |
| 27 | 27 | <!-- Freddie Logo --> |
| 28 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
| 28 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
| 29 | 29 | |
| 30 | - <h1>YIKES Easy Forms for MailChimp | <?php if ( isset( $_REQUEST['section'] ) ) { echo ucwords( str_replace( '-', ' ', $_REQUEST['section'] ) ); } else { echo __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ); } ?></h1> |
|
| 30 | + <h1>YIKES Easy Forms for MailChimp | <?php if ( isset( $_REQUEST[ 'section' ] ) ) { echo ucwords( str_replace( '-', ' ', $_REQUEST[ 'section' ] ) ); } else { echo __( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); } ?></h1> |
|
| 31 | 31 | |
| 32 | 32 | <!-- Settings Page Description --> |
| 33 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Easy Forms for MailChimp allows you to painlessly add MailChimp sign up forms to your WordPress site and track user activity with interactive reports.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 33 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Easy Forms for MailChimp allows you to painlessly add MailChimp sign up forms to your WordPress site and track user activity with interactive reports.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 34 | 34 | <?php |
| 35 | 35 | /* Success Messages on Options Updated */ |
| 36 | - if( isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated'] == 'true' ) { |
|
| 36 | + if ( isset( $_REQUEST[ 'settings-updated' ] ) && $_REQUEST[ 'settings-updated' ] == 'true' ) { |
|
| 37 | 37 | ?> |
| 38 | 38 | <div class="updated manage-form-admin-notice"> |
| 39 | 39 | <p><?php _e( 'Settings successfully updated.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | <?php |
| 42 | 42 | } |
| 43 | 43 | /* MailChimp API Cleared Successfully message */ |
| 44 | - if( isset( $_REQUEST['transient-cleared'] ) && $_REQUEST['transient-cleared'] == 'true' ) { |
|
| 44 | + if ( isset( $_REQUEST[ 'transient-cleared' ] ) && $_REQUEST[ 'transient-cleared' ] == 'true' ) { |
|
| 45 | 45 | ?> |
| 46 | 46 | <div class="updated manage-form-admin-notice"> |
| 47 | 47 | <p><?php _e( 'MailChimp API Cache successfully cleared.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | /* Error Log Clear Messages */ |
| 52 | 52 | /* Success Messages on Options Updated */ |
| 53 | - if( isset( $_REQUEST['error-log-cleared'] ) && $_REQUEST['error-log-cleared'] == 'true' ) { |
|
| 53 | + if ( isset( $_REQUEST[ 'error-log-cleared' ] ) && $_REQUEST[ 'error-log-cleared' ] == 'true' ) { |
|
| 54 | 54 | ?> |
| 55 | 55 | <div class="updated manage-form-admin-notice"> |
| 56 | 56 | <p><?php _e( 'Error log successfully cleared.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | <?php |
| 59 | 59 | } |
| 60 | 60 | /* MailChimp API Cleared Successfully message */ |
| 61 | - if( isset( $_REQUEST['error-log-cleared'] ) && $_REQUEST['error-log-cleared'] == 'false' ) { |
|
| 61 | + if ( isset( $_REQUEST[ 'error-log-cleared' ] ) && $_REQUEST[ 'error-log-cleared' ] == 'false' ) { |
|
| 62 | 62 | ?> |
| 63 | 63 | <div class="error manage-form-admin-notice"> |
| 64 | 64 | <p><?php _e( "Whoops! We've encountered an error while trying to clear the error log. Please refresh the page and try again. If the error persists please get in touch with the YIKES Inc. support team.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -67,28 +67,28 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /* Display a success message if our error log was sucessfully created, or display an error if not */ |
| 70 | - if( isset( $_GET['error_log_created'] ) && $_GET['error_log_created'] == 'true' ) { |
|
| 70 | + if ( isset( $_GET[ 'error_log_created' ] ) && $_GET[ 'error_log_created' ] == 'true' ) { |
|
| 71 | 71 | ?> |
| 72 | 72 | <div class="updated"> |
| 73 | 73 | <p><?php _e( 'Error log successfully created. You may now start logging errors.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
| 74 | 74 | </div> |
| 75 | 75 | <?php |
| 76 | - } else if( isset( $_GET['error_log_created'] ) && $_GET['error_log_created'] == 'false' ) { |
|
| 76 | + } else if ( isset( $_GET[ 'error_log_created' ] ) && $_GET[ 'error_log_created' ] == 'false' ) { |
|
| 77 | 77 | ?> |
| 78 | 78 | <div class="error"> |
| 79 | - <p><?php echo esc_attr( urldecode( $_GET['error_message'] ) , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 79 | + <p><?php echo esc_attr( urldecode( $_GET[ 'error_message' ] ), 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 80 | 80 | </div> |
| 81 | 81 | <?php |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /* Display a success message if the user successfully imported some forms */ |
| 85 | - if( isset( $_GET['section'] ) && $_GET['section'] == 'import-export-forms' && isset( $_GET['import-forms'] ) && $_GET['import-forms'] == 'true' ) { |
|
| 85 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'import-export-forms' && isset( $_GET[ 'import-forms' ] ) && $_GET[ 'import-forms' ] == 'true' ) { |
|
| 86 | 86 | ?> |
| 87 | 87 | <div class="updated"> |
| 88 | 88 | <p><?php printf( __( 'Opt-in forms successfully imported. <a href="%s" title="View Forms">View Forms</a>', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?></p> |
| 89 | 89 | </div> |
| 90 | 90 | <?php |
| 91 | - } elseif( isset( $_GET['section'] ) && $_GET['section'] == 'import-export-forms' && isset( $_GET['import-settings'] ) && $_GET['import-settings'] == 'true' ) { |
|
| 91 | + } elseif ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'import-export-forms' && isset( $_GET[ 'import-settings' ] ) && $_GET[ 'import-settings' ] == 'true' ) { |
|
| 92 | 92 | ?> |
| 93 | 93 | <div class="updated"> |
| 94 | 94 | <p><?php printf( __( 'YIKES Easy Forms for MailChimp settings successfully imported.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?></p> |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | <div class="postbox yikes-easy-mc-postbox"> |
| 111 | 111 | |
| 112 | - <?php if( !isset( $_REQUEST['section'] ) || $_REQUEST['section'] == '' ) { |
|
| 112 | + <?php if ( ! isset( $_REQUEST[ 'section' ] ) || $_REQUEST[ 'section' ] == '' ) { |
|
| 113 | 113 | include YIKES_MC_PATH . 'admin/partials/menu/options-sections/general-settings.php'; |
| 114 | 114 | } else { |
| 115 | - if( isset( $_REQUEST['addon'] ) && $_REQUEST['addon'] == 'true' ) { |
|
| 116 | - include apply_filters( 'yikes-mailchimp-'.$_REQUEST['section'].'-options-path' , '' ); |
|
| 115 | + if ( isset( $_REQUEST[ 'addon' ] ) && $_REQUEST[ 'addon' ] == 'true' ) { |
|
| 116 | + include apply_filters( 'yikes-mailchimp-' . $_REQUEST[ 'section' ] . '-options-path', '' ); |
|
| 117 | 117 | } else { |
| 118 | 118 | // White list a set of files that are allowed to be included here |
| 119 | 119 | $file_base = 'admin/partials/menu/options-sections/'; |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | $file_base . 'recaptcha-settings.php', |
| 127 | 127 | ); |
| 128 | 128 | // Ensure the included file is allowed and whitelisted above, before including it |
| 129 | - if ( 0 === validate_file( 'admin/partials/menu/options-sections/' . $_REQUEST['section'] . '.php', $acceptable_files ) ) { |
|
| 130 | - include YIKES_MC_PATH . 'admin/partials/menu/options-sections/' . $_REQUEST['section'] . '.php'; |
|
| 129 | + if ( 0 === validate_file( 'admin/partials/menu/options-sections/' . $_REQUEST[ 'section' ] . '.php', $acceptable_files ) ) { |
|
| 130 | + include YIKES_MC_PATH . 'admin/partials/menu/options-sections/' . $_REQUEST[ 'section' ] . '.php'; |
|
| 131 | 131 | } else { |
| 132 | 132 | wp_die( esc_attr__( 'Invalid file. If this error persists, please contact support.', 'yikes-inc-easy-mailchimp' ) ); |
| 133 | 133 | } |