@@ -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 _e( urldecode( $_GET['error_message'] ) , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
79 | + <p><?php _e( 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_e( 'Invalid file. If this error persists, please contact support.', 'yikes-inc-easy-mailchimp' ) ); |
133 | 133 | } |