@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | return ''; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - $form = ( ! empty( $attributes['form'] ) ) ? str_replace( '"', '', $attributes['form'] ) : false; |
|
| 30 | - $list_id = ( ! empty( $attributes['list'] ) ) ? $attributes['list'] : false; |
|
| 29 | + $form = ( ! empty( $attributes[ 'form' ] ) ) ? str_replace( '"', '', $attributes[ 'form' ] ) : false; |
|
| 30 | + $list_id = ( ! empty( $attributes[ 'list' ] ) ) ? $attributes[ 'list' ] : false; |
|
| 31 | 31 | |
| 32 | 32 | /* If no list ID was passed into the shortcode - bail */ |
| 33 | 33 | if ( ! $list_id && ! $form ) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | return ''; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $list_id = sanitize_key( $form_data['list_id'] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
| 55 | + $list_id = sanitize_key( $form_data[ 'list_id' ] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // object buffer |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /* type cast the returned value as an integer */ |
| 74 | - echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $list_data['stats']['member_count'] ); |
|
| 74 | + echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $list_data[ 'stats' ][ 'member_count' ] ); |
|
| 75 | 75 | |
| 76 | 76 | return ob_get_clean(); |
| 77 | 77 | |
@@ -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 | } |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * @since 6.2.2 |
| 24 | 24 | * |
| 25 | 25 | */ |
| 26 | - if ( isset( $_REQUEST['section'] ) ) { |
|
| 27 | - $_REQUEST['section'] = preg_replace('/[^\w-]/', '', strip_tags ( $_REQUEST['section'] ) ); |
|
| 26 | + if ( isset( $_REQUEST[ 'section' ] ) ) { |
|
| 27 | + $_REQUEST[ 'section' ] = preg_replace( '/[^\w-]/', '', strip_tags( $_REQUEST[ 'section' ] ) ); |
|
| 28 | 28 | } |
| 29 | 29 | ?> |
| 30 | 30 | <!-- Actual Settings Form |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | <div class="wrap"> |
| 33 | 33 | |
| 34 | 34 | <!-- Freddie Logo --> |
| 35 | - <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" /> |
|
| 35 | + <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" /> |
|
| 36 | 36 | |
| 37 | - <h1>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> |
|
| 37 | + <h1>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> |
|
| 38 | 38 | |
| 39 | 39 | <!-- Settings Page Description --> |
| 40 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Manage the overall settings for Easy forms for MailChimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 40 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Manage the overall settings for Easy forms for MailChimp.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 41 | 41 | <?php |
| 42 | 42 | /* Success Messages on Options Updated */ |
| 43 | - if( isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated'] == 'true' ) { |
|
| 43 | + if ( isset( $_REQUEST[ 'settings-updated' ] ) && $_REQUEST[ 'settings-updated' ] == 'true' ) { |
|
| 44 | 44 | ?> |
| 45 | 45 | <div class="updated manage-form-admin-notice"> |
| 46 | 46 | <p><?php _e( 'Settings successfully updated.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | <?php |
| 49 | 49 | } |
| 50 | 50 | /* MailChimp API Cleared Successfully message */ |
| 51 | - if( isset( $_REQUEST['transient-cleared'] ) && $_REQUEST['transient-cleared'] == 'true' ) { |
|
| 51 | + if ( isset( $_REQUEST[ 'transient-cleared' ] ) && $_REQUEST[ 'transient-cleared' ] == 'true' ) { |
|
| 52 | 52 | ?> |
| 53 | 53 | <div class="updated manage-form-admin-notice"> |
| 54 | 54 | <p><?php _e( 'MailChimp API Cache successfully cleared.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | /* Error Log Clear Messages */ |
| 59 | 59 | /* Success Messages on Options Updated */ |
| 60 | - if( isset( $_REQUEST['error-log-cleared'] ) && $_REQUEST['error-log-cleared'] == 'true' ) { |
|
| 60 | + if ( isset( $_REQUEST[ 'error-log-cleared' ] ) && $_REQUEST[ 'error-log-cleared' ] == 'true' ) { |
|
| 61 | 61 | ?> |
| 62 | 62 | <div class="updated manage-form-admin-notice"> |
| 63 | 63 | <p><?php _e( 'Error log successfully cleared.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | <?php |
| 66 | 66 | } |
| 67 | 67 | /* MailChimp API Cleared Successfully message */ |
| 68 | - if( isset( $_REQUEST['error-log-cleared'] ) && $_REQUEST['error-log-cleared'] == 'false' ) { |
|
| 68 | + if ( isset( $_REQUEST[ 'error-log-cleared' ] ) && $_REQUEST[ 'error-log-cleared' ] == 'false' ) { |
|
| 69 | 69 | ?> |
| 70 | 70 | <div class="error manage-form-admin-notice"> |
| 71 | 71 | <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> |
@@ -74,28 +74,28 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /* Display a success message if our error log was sucessfully created, or display an error if not */ |
| 77 | - if( isset( $_GET['error_log_created'] ) && $_GET['error_log_created'] == 'true' ) { |
|
| 77 | + if ( isset( $_GET[ 'error_log_created' ] ) && $_GET[ 'error_log_created' ] == 'true' ) { |
|
| 78 | 78 | ?> |
| 79 | 79 | <div class="updated"> |
| 80 | 80 | <p><?php _e( 'Error log successfully created. You may now start logging errors.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
| 81 | 81 | </div> |
| 82 | 82 | <?php |
| 83 | - } else if( isset( $_GET['error_log_created'] ) && $_GET['error_log_created'] == 'false' ) { |
|
| 83 | + } else if ( isset( $_GET[ 'error_log_created' ] ) && $_GET[ 'error_log_created' ] == 'false' ) { |
|
| 84 | 84 | ?> |
| 85 | 85 | <div class="error"> |
| 86 | - <p><?php echo esc_attr( urldecode( $_GET['error_message'] ) , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 86 | + <p><?php echo esc_attr( urldecode( $_GET[ 'error_message' ] ), 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 87 | 87 | </div> |
| 88 | 88 | <?php |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /* Display a success message if the user successfully imported some forms */ |
| 92 | - if( isset( $_GET['section'] ) && $_GET['section'] == 'import-export-forms' && isset( $_GET['import-forms'] ) && $_GET['import-forms'] == 'true' ) { |
|
| 92 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'import-export-forms' && isset( $_GET[ 'import-forms' ] ) && $_GET[ 'import-forms' ] == 'true' ) { |
|
| 93 | 93 | ?> |
| 94 | 94 | <div class="updated"> |
| 95 | 95 | <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> |
| 96 | 96 | </div> |
| 97 | 97 | <?php |
| 98 | - } elseif( isset( $_GET['section'] ) && $_GET['section'] == 'import-export-forms' && isset( $_GET['import-settings'] ) && $_GET['import-settings'] == 'true' ) { |
|
| 98 | + } elseif ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'import-export-forms' && isset( $_GET[ 'import-settings' ] ) && $_GET[ 'import-settings' ] == 'true' ) { |
|
| 99 | 99 | ?> |
| 100 | 100 | <div class="updated"> |
| 101 | 101 | <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> |
@@ -116,11 +116,11 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | <div class="postbox yikes-easy-mc-postbox"> |
| 118 | 118 | |
| 119 | - <?php if( !isset( $_REQUEST['section'] ) || $_REQUEST['section'] == '' ) { |
|
| 119 | + <?php if ( ! isset( $_REQUEST[ 'section' ] ) || $_REQUEST[ 'section' ] == '' ) { |
|
| 120 | 120 | include YIKES_MC_PATH . 'admin/partials/menu/options-sections/general-settings.php'; |
| 121 | 121 | } else { |
| 122 | - if( isset( $_REQUEST['addon'] ) && $_REQUEST['addon'] == 'true' ) { |
|
| 123 | - include apply_filters( 'yikes-mailchimp-'.$_REQUEST['section'].'-options-path' , '' ); |
|
| 122 | + if ( isset( $_REQUEST[ 'addon' ] ) && $_REQUEST[ 'addon' ] == 'true' ) { |
|
| 123 | + include apply_filters( 'yikes-mailchimp-' . $_REQUEST[ 'section' ] . '-options-path', '' ); |
|
| 124 | 124 | } else { |
| 125 | 125 | // White list a set of files that are allowed to be included here |
| 126 | 126 | $file_base = 'admin/partials/menu/options-sections/'; |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | $file_base . 'recaptcha-settings.php', |
| 134 | 134 | ); |
| 135 | 135 | // Ensure the included file is allowed and whitelisted above, before including it |
| 136 | - if ( 0 === validate_file( 'admin/partials/menu/options-sections/' . $_REQUEST['section'] . '.php', $acceptable_files ) ) { |
|
| 137 | - include YIKES_MC_PATH . 'admin/partials/menu/options-sections/' . $_REQUEST['section'] . '.php'; |
|
| 136 | + if ( 0 === validate_file( 'admin/partials/menu/options-sections/' . $_REQUEST[ 'section' ] . '.php', $acceptable_files ) ) { |
|
| 137 | + include YIKES_MC_PATH . 'admin/partials/menu/options-sections/' . $_REQUEST[ 'section' ] . '.php'; |
|
| 138 | 138 | } else { |
| 139 | 139 | wp_die( esc_attr__( 'Invalid file. If this error persists, please contact support.', 'yikes-inc-easy-mailchimp' ) ); |
| 140 | 140 | } |
@@ -7,12 +7,12 @@ |
||
| 7 | 7 | <div class="wrap"> |
| 8 | 8 | |
| 9 | 9 | <!-- Freddie Logo --> |
| 10 | - <img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
| 10 | + <img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
| 11 | 11 | |
| 12 | - <h1>Easy Forms for MailChimp | <?php echo esc_attr__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="https://yikesplugins.com/plugins/?plugins=MailChimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1> |
|
| 12 | + <h1>Easy Forms for MailChimp | <?php echo esc_attr__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="https://yikesplugins.com/plugins/?plugins=MailChimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1> |
|
| 13 | 13 | |
| 14 | 14 | <!-- Addons Page Description --> |
| 15 | - <p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find all free and paid add-ons available for Easy Forms for MailChimp. Each add-on extends the functionality of the free plugin." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 15 | + <p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find all free and paid add-ons available for Easy Forms for MailChimp. Each add-on extends the functionality of the free plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 16 | 16 | |
| 17 | 17 | <!-- Add-On Container --> |
| 18 | 18 | <section id="add-ons"> |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // If the API gave an error or there are no more lists, break. |
| 82 | - if ( isset( $response['error'] ) ) { |
|
| 83 | - return new WP_Error( $response['title'], $response['detail'] ); |
|
| 82 | + if ( isset( $response[ 'error' ] ) ) { |
|
| 83 | + return new WP_Error( $response[ 'title' ], $response[ 'detail' ] ); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | if ( empty( $response[ $item_key ] ) ) { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // Update the total number of items if it's still zero. |
| 91 | 91 | if ( 0 === $total ) { |
| 92 | - $total = intval( $response['total_items'] ); |
|
| 92 | + $total = intval( $response[ 'total_items' ] ); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Store each new list. |
@@ -196,16 +196,16 @@ discard block |
||
| 196 | 196 | return $response; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - if ( isset( $response['error'] ) ) { |
|
| 200 | - $title = isset( $response['title'] ) ? $response['title'] : $response['name']; |
|
| 201 | - $detail = isset( $response['detail'] ) ? $response['detail'] : $response['error']; |
|
| 202 | - $data = isset( $response['errors'] ) ? $response['errors'] : array(); |
|
| 199 | + if ( isset( $response[ 'error' ] ) ) { |
|
| 200 | + $title = isset( $response[ 'title' ] ) ? $response[ 'title' ] : $response[ 'name' ]; |
|
| 201 | + $detail = isset( $response[ 'detail' ] ) ? $response[ 'detail' ] : $response[ 'error' ]; |
|
| 202 | + $data = isset( $response[ 'errors' ] ) ? $response[ 'errors' ] : array(); |
|
| 203 | 203 | |
| 204 | 204 | return new WP_Error( |
| 205 | 205 | $title, |
| 206 | 206 | $detail, |
| 207 | 207 | array( |
| 208 | - 'status' => (int) $response['status'], |
|
| 208 | + 'status' => (int) $response[ 'status' ], |
|
| 209 | 209 | 'data' => $data, |
| 210 | 210 | ) |
| 211 | 211 | ); |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | // MailChimp uses the application/problem+json type for errors |
| 236 | 236 | $headers = wp_remote_retrieve_headers( $response ); |
| 237 | - if ( isset( $headers['content-type'] ) ) { |
|
| 238 | - if ( false !== strpos( $headers['content-type'], 'application/problem+json' ) ) { |
|
| 239 | - $body['error'] = true; |
|
| 237 | + if ( isset( $headers[ 'content-type' ] ) ) { |
|
| 238 | + if ( false !== strpos( $headers[ 'content-type' ], 'application/problem+json' ) ) { |
|
| 239 | + $body[ 'error' ] = true; |
|
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @return array|WP_Error |
| 104 | 104 | */ |
| 105 | 105 | public function patch( $path = '', $headers = array(), $params = array() ) { |
| 106 | - if ( ! isset( $params['body'] ) ) { |
|
| 106 | + if ( ! isset( $params[ 'body' ] ) ) { |
|
| 107 | 107 | return new WP_Error( |
| 108 | 108 | 'yikesinc_eme_missing_body', |
| 109 | 109 | sprintf( |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * @return array|WP_Error |
| 131 | 131 | */ |
| 132 | 132 | public function post( $path = '', $headers = array(), $params = array() ) { |
| 133 | - if ( ! isset( $params['body'] ) ) { |
|
| 133 | + if ( ! isset( $params[ 'body' ] ) ) { |
|
| 134 | 134 | return new WP_Error( |
| 135 | 135 | 'yikesinc_eme_missing_body', |
| 136 | 136 | sprintf( |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @return array|WP_Error |
| 158 | 158 | */ |
| 159 | 159 | public function put( $path = '', $headers = array(), $params = array() ) { |
| 160 | - if ( ! isset( $params['body'] ) ) { |
|
| 160 | + if ( ! isset( $params[ 'body' ] ) ) { |
|
| 161 | 161 | return new WP_Error( |
| 162 | 162 | 'yikesinc_eme_missing_body', |
| 163 | 163 | sprintf( |
@@ -288,13 +288,13 @@ discard block |
||
| 288 | 288 | $authorized_args = $this->get_authorized_args(); |
| 289 | 289 | |
| 290 | 290 | // If we have body data, maybe convert it to JSON. |
| 291 | - if ( isset( $params['body'] ) && ( is_array( $params['body'] ) || is_object( $params['body'] ) ) ) { |
|
| 292 | - $params['body'] = json_encode( wp_parse_args( $authorized_args['body'], $params['body'] ) ); |
|
| 293 | - $headers['Content-Type'] = 'application/json'; |
|
| 291 | + if ( isset( $params[ 'body' ] ) && ( is_array( $params[ 'body' ] ) || is_object( $params[ 'body' ] ) ) ) { |
|
| 292 | + $params[ 'body' ] = json_encode( wp_parse_args( $authorized_args[ 'body' ], $params[ 'body' ] ) ); |
|
| 293 | + $headers[ 'Content-Type' ] = 'application/json'; |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | // Combine the given headers and auth headers |
| 297 | - $headers = wp_parse_args( $authorized_args['headers'], $headers ); |
|
| 297 | + $headers = wp_parse_args( $authorized_args[ 'headers' ], $headers ); |
|
| 298 | 298 | /** |
| 299 | 299 | * Filter the headers used for a request to the MailChimp API. |
| 300 | 300 | * |
@@ -358,12 +358,12 @@ discard block |
||
| 358 | 358 | |
| 359 | 359 | // Version 2.0 uses body authorization |
| 360 | 360 | if ( version_compare( '3.0', $this->api_version, '>' ) ) { |
| 361 | - $args['body'] = $this->get_auth_body(); |
|
| 361 | + $args[ 'body' ] = $this->get_auth_body(); |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | // Version 3.0 uses authorization headers. |
| 365 | 365 | if ( version_compare( '3.0', $this->api_version, '<=' ) ) { |
| 366 | - $args['headers'] = $this->get_auth_headers(); |
|
| 366 | + $args[ 'headers' ] = $this->get_auth_headers(); |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | return $args; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | if ( $network_wide ) {
|
| 35 | 35 | $old_blog = $wpdb->blogid; |
| 36 | 36 | // Get all blog ids |
| 37 | - $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
|
|
| 37 | + $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); |
|
| 38 | 38 | foreach ( $blogids as $blog_id ) {
|
| 39 | 39 | switch_to_blog( $blog_id ); |
| 40 | 40 | self::_activate_yikes_easy_mailchimp( $wpdb ); |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | custom_fields TEXT NOT NULL, |
| 91 | 91 | UNIQUE KEY id (id) |
| 92 | 92 | ) $charset_collate;"; |
| 93 | - require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
| 94 | - dbDelta($sql); |
|
| 93 | + require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
| 94 | + dbDelta( $sql ); |
|
| 95 | 95 | |
| 96 | 96 | // create an option for the date that the user initially activated the plugin |
| 97 | 97 | // used to display a two week notice, asking for a review or to upgrade |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | if ( ! empty( $all_forms ) ) {
|
| 107 | 107 | // build an array to pass to our javascript |
| 108 | 108 | foreach ( $all_forms as $id => $form ) {
|
| 109 | - $lists[ $form['form_name'] ] = $id; |
|
| 109 | + $lists[ $form[ 'form_name' ] ] = $id; |
|
| 110 | 110 | } |
| 111 | 111 | } else {
|
| 112 | 112 | $lists[ __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ) ] = '-'; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @return type The collection of actions and filters registered with WordPress. |
| 87 | 87 | */ |
| 88 | 88 | private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
|
| 89 | - $hooks[] = array( |
|
| 89 | + $hooks[ ] = array( |
|
| 90 | 90 | 'hook' => $hook, |
| 91 | 91 | 'component' => $component, |
| 92 | 92 | 'callback' => $callback, |
@@ -102,10 +102,10 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function run() {
|
| 104 | 104 | foreach ( $this->filters as $hook ) {
|
| 105 | - add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 105 | + add_filter( $hook[ 'hook' ], array( $hook[ 'component' ], $hook[ 'callback' ] ), $hook[ 'priority' ], $hook[ 'accepted_args' ] ); |
|
| 106 | 106 | } |
| 107 | 107 | foreach ( $this->actions as $hook ) {
|
| 108 | - add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 108 | + add_action( $hook[ 'hook' ], array( $hook[ 'component' ], $hook[ 'callback' ] ), $hook[ 'priority' ], $hook[ 'accepted_args' ] ); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | \ No newline at end of file |
@@ -9,33 +9,33 @@ discard block |
||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | // enqueue the styles for our migration page.. |
| 12 | - wp_enqueue_style( 'yikes_mc_migrate_option_styles' , YIKES_MC_URL . 'admin/css/yikes-inc-easy-mailchimp-migrate-option-styles.css' ); |
|
| 13 | - wp_enqueue_style( 'animate-css' , YIKES_MC_URL . 'admin/css/animate.min.css' ); |
|
| 12 | + wp_enqueue_style( 'yikes_mc_migrate_option_styles', YIKES_MC_URL . 'admin/css/yikes-inc-easy-mailchimp-migrate-option-styles.css' ); |
|
| 13 | + wp_enqueue_style( 'animate-css', YIKES_MC_URL . 'admin/css/animate.min.css' ); |
|
| 14 | 14 | |
| 15 | 15 | // store our old options |
| 16 | 16 | $old_plugin_options = get_option( 'ykseme_storage' ); |
| 17 | 17 | |
| 18 | 18 | $global_error_messages = array( |
| 19 | - 'success' => __( $old_plugin_options['single-optin-message'] , 'yikes-inc-easy-mailchimp-extender' ), |
|
| 20 | - 'general-error' => __( "Whoops! It looks like something went wrong. Please try again." , 'yikes-inc-easy-mailchimp-extender' ), |
|
| 21 | - 'email-exists-error' => __( "The email you entered is already a subscriber to this list." , 'yikes-inc-easy-mailchimp-extender' ), |
|
| 22 | - 'success-single-optin' => __( 'Thank you for subscribing!' , 'yikes-inc-easy-mailchimp-extender' ), |
|
| 19 | + 'success' => __( $old_plugin_options[ 'single-optin-message' ], 'yikes-inc-easy-mailchimp-extender' ), |
|
| 20 | + 'general-error' => __( "Whoops! It looks like something went wrong. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), |
|
| 21 | + 'email-exists-error' => __( "The email you entered is already a subscriber to this list.", 'yikes-inc-easy-mailchimp-extender' ), |
|
| 22 | + 'success-single-optin' => __( 'Thank you for subscribing!', 'yikes-inc-easy-mailchimp-extender' ), |
|
| 23 | 23 | 'success-resubscribed' => __( 'Thank you for already being a subscriber! Your profile info has been updated.', 'yikes-inc-easy-mailchimp-extender' ), |
| 24 | 24 | 'update-link' => __( "To update your MailChimp profile, please [link]click to send yourself an update link[/link].", 'yikes-inc-easy-mailchimp-extender' ), |
| 25 | 25 | 'email-subject' => __( 'MailChimp Profile Update', 'yikes-inc-easy-mailchimp-extender' ), |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | 28 | // if old options are defined... |
| 29 | - if( $old_plugin_options ) { |
|
| 29 | + if ( $old_plugin_options ) { |
|
| 30 | 30 | |
| 31 | 31 | // Verify the NONCE is valid |
| 32 | - check_admin_referer( 'yikes-mc-migrate-options' , 'migrate_options_nonce' ); |
|
| 32 | + check_admin_referer( 'yikes-mc-migrate-options', 'migrate_options_nonce' ); |
|
| 33 | 33 | |
| 34 | 34 | ?> |
| 35 | 35 | |
| 36 | 36 | <div class="wrap" style="text-align:center;"> |
| 37 | - <h3><?php _e( 'Migrating old plugin options' , 'yikes-inc-easy-mailchimp-extender' ); ?><span class="upgrading-ellipse-one">.</span><span class="upgrading-ellipse-two">.</span><span class="upgrading-ellipse-three">.</h3> |
|
| 38 | - <p><?php _e( 'please be patient while your options are updated and the process has completed' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 37 | + <h3><?php _e( 'Migrating old plugin options', 'yikes-inc-easy-mailchimp-extender' ); ?><span class="upgrading-ellipse-one">.</span><span class="upgrading-ellipse-two">.</span><span class="upgrading-ellipse-three">.</h3> |
|
| 38 | + <p><?php _e( 'please be patient while your options are updated and the process has completed', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 39 | 39 | <!-- empty list, populate when options get updated --> |
| 40 | 40 | <ul id="options-updated" class="yikes-easy-mc-hidden"> |
| 41 | 41 | <hr /> |
@@ -49,82 +49,82 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // loop over our old options, and store them in a new option value |
| 51 | 51 | $do_not_migrate_options = array( |
| 52 | - 'ssl_verify_peer', 'api_validation' , 'widget_yikes_mc_widget' , 'flavor' , 'single-optin-message' , 'double-optin-message' , |
|
| 53 | - 'mailchimp-optIn-default-list' , 'version' , 'yks-mailchimp-jquery-datepicker' , 'ssl_verify_peer' , 'optIn-checkbox' , 'yks-mailchimp-optin-checkbox-text', |
|
| 54 | - 'yks-mailchimp-required-text' , 'optin' |
|
| 52 | + 'ssl_verify_peer', 'api_validation', 'widget_yikes_mc_widget', 'flavor', 'single-optin-message', 'double-optin-message', |
|
| 53 | + 'mailchimp-optIn-default-list', 'version', 'yks-mailchimp-jquery-datepicker', 'ssl_verify_peer', 'optIn-checkbox', 'yks-mailchimp-optin-checkbox-text', |
|
| 54 | + 'yks-mailchimp-required-text', 'optin' |
|
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | - foreach( $old_plugin_options as $option_name => $option_value ) { |
|
| 57 | + foreach ( $old_plugin_options as $option_name => $option_value ) { |
|
| 58 | 58 | |
| 59 | - if( ! in_array( $option_name , $do_not_migrate_options ) ) { |
|
| 59 | + if ( ! in_array( $option_name, $do_not_migrate_options ) ) { |
|
| 60 | 60 | // ajax request to update our options one by one.. |
| 61 | 61 | // if its an array, we need to json encode it |
| 62 | - if( is_array( $option_value ) ) { |
|
| 62 | + if ( is_array( $option_value ) ) { |
|
| 63 | 63 | |
| 64 | - if( $option_name == 'lists' ) { |
|
| 64 | + if ( $option_name == 'lists' ) { |
|
| 65 | 65 | |
| 66 | - if( ! empty( $option_value ) ) { |
|
| 66 | + if ( ! empty( $option_value ) ) { |
|
| 67 | 67 | $settings = 1; |
| 68 | 68 | $form_length = count( $option_value ); |
| 69 | - foreach( $option_value as $mailchimp_form ) { |
|
| 69 | + foreach ( $option_value as $mailchimp_form ) { |
|
| 70 | 70 | // update and pass our placeholder value |
| 71 | 71 | reset( $mailchimp_form ); |
| 72 | - $form_id = $mailchimp_form['id']; |
|
| 72 | + $form_id = $mailchimp_form[ 'id' ]; |
|
| 73 | 73 | |
| 74 | - $fields = $mailchimp_form['fields']; |
|
| 74 | + $fields = $mailchimp_form[ 'fields' ]; |
|
| 75 | 75 | reset( $fields ); |
| 76 | 76 | $first_field_key = key( $fields ); |
| 77 | 77 | $array_keys = array_keys( $fields ); |
| 78 | 78 | |
| 79 | 79 | $x = 1; |
| 80 | 80 | |
| 81 | - foreach( $array_keys as $parent_key ) { |
|
| 81 | + foreach ( $array_keys as $parent_key ) { |
|
| 82 | 82 | |
| 83 | 83 | // alter the field keys so they show up after an import |
| 84 | 84 | $split_parent_key = explode( '-', $parent_key ); |
| 85 | 85 | |
| 86 | - $new_parent_key = ( isset( $split_parent_key[1] ) ) ? strtoupper( $split_parent_key[1] ) : $parent_key; |
|
| 86 | + $new_parent_key = ( isset( $split_parent_key[ 1 ] ) ) ? strtoupper( $split_parent_key[ 1 ] ) : $parent_key; |
|
| 87 | 87 | |
| 88 | - $mailchimp_form['fields'][$new_parent_key] = $mailchimp_form['fields'][$parent_key]; |
|
| 88 | + $mailchimp_form[ 'fields' ][ $new_parent_key ] = $mailchimp_form[ 'fields' ][ $parent_key ]; |
|
| 89 | 89 | |
| 90 | - unset( $mailchimp_form['fields'][$parent_key] ); |
|
| 90 | + unset( $mailchimp_form[ 'fields' ][ $parent_key ] ); |
|
| 91 | 91 | |
| 92 | 92 | // update our placeholder key to be 'placeholder' |
| 93 | - $mailchimp_form['fields'][$new_parent_key]['placeholder'] = isset( $mailchimp_form['fields'][$new_parent_key]['placeholder-'.$form_id.'-'.$x] ) ? $mailchimp_form['fields'][$new_parent_key]['placeholder-'.$form_id.'-'.$x] : ''; |
|
| 93 | + $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'placeholder' ] = isset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'placeholder-' . $form_id . '-' . $x ] ) ? $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'placeholder-' . $form_id . '-' . $x ] : ''; |
|
| 94 | 94 | // update field classes |
| 95 | - $mailchimp_form['fields'][$new_parent_key]['additional-classes'] = isset( $mailchimp_form['fields'][$new_parent_key]['custom-field-class-'.$form_id.'-'.$x] ) ? $mailchimp_form['fields'][$new_parent_key]['custom-field-class-'.$form_id.'-'.$x] : ''; |
|
| 95 | + $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'additional-classes' ] = isset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'custom-field-class-' . $form_id . '-' . $x ] ) ? $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'custom-field-class-' . $form_id . '-' . $x ] : ''; |
|
| 96 | 96 | // update help field - populate description |
| 97 | - $mailchimp_form['fields'][$new_parent_key]['description'] = isset( $mailchimp_form['fields'][$new_parent_key]['help'] ) ? $mailchimp_form['fields'][$new_parent_key]['help'] : ''; |
|
| 97 | + $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'description' ] = isset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'help' ] ) ? $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'help' ] : ''; |
|
| 98 | 98 | // remove the old placeholder structure |
| 99 | - unset( $mailchimp_form['fields'][$new_parent_key]['placeholder-'.$form_id.'-'.$x] ); |
|
| 99 | + unset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'placeholder-' . $form_id . '-' . $x ] ); |
|
| 100 | 100 | // remove old custom class structure |
| 101 | - unset( $mailchimp_form['fields'][$new_parent_key]['custom-field-class-'.$form_id.'-'.$x] ); |
|
| 101 | + unset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'custom-field-class-' . $form_id . '-' . $x ] ); |
|
| 102 | 102 | // remove old help/description |
| 103 | - unset( $mailchimp_form['fields'][$new_parent_key]['help'] ); |
|
| 103 | + unset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'help' ] ); |
|
| 104 | 104 | |
| 105 | 105 | // check if choices is set, and encode them |
| 106 | - if( isset( $mailchimp_form['fields'][$new_parent_key]['choices'] ) && ! empty( $mailchimp_form['fields'][$new_parent_key]['choices'] ) ) { |
|
| 107 | - $mailchimp_form['fields'][$new_parent_key]['choices'] = addslashes( addslashes( json_encode( $mailchimp_form['fields'][$new_parent_key]['choices'] ) ) ); |
|
| 106 | + if ( isset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'choices' ] ) && ! empty( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'choices' ] ) ) { |
|
| 107 | + $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'choices' ] = addslashes( addslashes( json_encode( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'choices' ] ) ) ); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | // update 'default' to 'default-choice' for radio/dropdown |
| 111 | - if( isset( $mailchimp_form['fields'][$new_parent_key]['type'] ) && in_array( $mailchimp_form['fields'][$new_parent_key]['type'], array( 'radio', 'dropdown' ) ) ) { |
|
| 112 | - $mailchimp_form['fields'][$new_parent_key]['default_choice'] = $mailchimp_form['fields'][$new_parent_key]['default']; |
|
| 113 | - unset( $mailchimp_form['fields'][$new_parent_key]['default'] ); |
|
| 111 | + if ( isset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'type' ] ) && in_array( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'type' ], array( 'radio', 'dropdown' ) ) ) { |
|
| 112 | + $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'default_choice' ] = $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'default' ]; |
|
| 113 | + unset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'default' ] ); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // update 'date_format' on 'birthday' and 'date' fields |
| 117 | - if( isset( $mailchimp_form['fields'][$new_parent_key]['type'] ) && in_array( $mailchimp_form['fields'][$new_parent_key]['type'], array( 'date', 'birthday' ) ) ) { |
|
| 118 | - if( $mailchimp_form['fields'][$new_parent_key]['type'] == 'date' ) { // date |
|
| 119 | - $mailchimp_form['fields'][$new_parent_key]['date_format'] = 'MM/DD'; // mailchimp default (can be altered) |
|
| 117 | + if ( isset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'type' ] ) && in_array( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'type' ], array( 'date', 'birthday' ) ) ) { |
|
| 118 | + if ( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'type' ] == 'date' ) { // date |
|
| 119 | + $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'date_format' ] = 'MM/DD'; // mailchimp default (can be altered) |
|
| 120 | 120 | } else { // birthday |
| 121 | - $mailchimp_form['fields'][$new_parent_key]['date_format'] = 'MM/DD/YYYY'; // mailchimp default (can be altered) |
|
| 121 | + $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'date_format' ] = 'MM/DD/YYYY'; // mailchimp default (can be altered) |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | // update 'phone_format' on 'phone' |
| 126 | - if( isset( $mailchimp_form['fields'][$new_parent_key]['type'] ) && in_array( $mailchimp_form['fields'][$new_parent_key]['type'], array( 'phone' ) ) ) { |
|
| 127 | - $mailchimp_form['fields'][$new_parent_key]['phone_format'] = 'phone_format '; // phone format |
|
| 126 | + if ( isset( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'type' ] ) && in_array( $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'type' ], array( 'phone' ) ) ) { |
|
| 127 | + $mailchimp_form[ 'fields' ][ $new_parent_key ][ 'phone_format' ] = 'phone_format '; // phone format |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | $x++; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $.post( ajaxurl, mc_data, function(response) { |
| 143 | 143 | jQuery( '#options-updated' ).show(); |
| 144 | - jQuery( '#options-updated' ).append( '<li class="animated fadeInDown"><?php echo '<strong>'; ?>' + response.form_name + '<?php echo '</strong> ' . __( "successfully imported." , 'yikes-inc-easy-mailchimp-extender' ); ?></li>' ); |
|
| 144 | + jQuery( '#options-updated' ).append( '<li class="animated fadeInDown"><?php echo '<strong>'; ?>' + response.form_name + '<?php echo '</strong> ' . __( "successfully imported.", 'yikes-inc-easy-mailchimp-extender' ); ?></li>' ); |
|
| 145 | 145 | if( response.completed_import ) { |
| 146 | 146 | setTimeout( function() { |
| 147 | 147 | // finished with the loop...lets let the user know....and then redirect them.... |
@@ -150,13 +150,13 @@ discard block |
||
| 150 | 150 | jQuery( '.upgrading-ellipse-two' ).remove(); |
| 151 | 151 | jQuery( '.upgrading-ellipse-three' ).remove(); |
| 152 | 152 | jQuery( '.wrap' ).find( 'h3' ).next().fadeOut(); |
| 153 | - jQuery( '#options-updated' ).append( '<li class="animated fadeInDown migration-complete-notification"><em><?php _e( "Migration Complete. Please wait..." , 'yikes-inc-easy-mailchimp-extender' ); ?> </em> <img src="<?php echo esc_url_raw( admin_url( "images/wpspin_light.gif" ) ); ?>" /></li>' ); |
|
| 153 | + jQuery( '#options-updated' ).append( '<li class="animated fadeInDown migration-complete-notification"><em><?php _e( "Migration Complete. Please wait...", 'yikes-inc-easy-mailchimp-extender' ); ?> </em> <img src="<?php echo esc_url_raw( admin_url( "images/wpspin_light.gif" ) ); ?>" /></li>' ); |
|
| 154 | 154 | // redirect our user to the main plugin page... |
| 155 | 155 | setTimeout( function() { |
| 156 | 156 | <?php |
| 157 | 157 | // migrate options that didnt make it (they were never stored in the 'ykseme_storage' options array) |
| 158 | - add_option( 'yikes-mc-api-validation' , get_option( 'api_validation' , 'invalid_api_key' ) ); |
|
| 159 | - add_option( 'yikes-mc-error-messages' , $global_error_messages ); |
|
| 158 | + add_option( 'yikes-mc-api-validation', get_option( 'api_validation', 'invalid_api_key' ) ); |
|
| 159 | + add_option( 'yikes-mc-error-messages', $global_error_messages ); |
|
| 160 | 160 | // delete our old options after a successful migration (and some new ones that are no longer needed) |
| 161 | 161 | delete_option( 'widget_yikes_mc_widget' ); |
| 162 | 162 | delete_option( 'api_validation' ); |
@@ -177,26 +177,26 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | /* Rename our ReCaptcha Options */ |
| 179 | 179 | /* Public Site Key */ |
| 180 | - if( $option_name == 'recaptcha-api-key' ) { |
|
| 180 | + if ( $option_name == 'recaptcha-api-key' ) { |
|
| 181 | 181 | $option_name = 'recaptcha-site-key'; |
| 182 | 182 | } |
| 183 | 183 | /* Private Key */ |
| 184 | - if( $option_name == 'recaptcha-private-api-key' ) { |
|
| 184 | + if ( $option_name == 'recaptcha-private-api-key' ) { |
|
| 185 | 185 | $option_name = 'recaptcha-secret-key'; |
| 186 | 186 | } |
| 187 | 187 | /* Change 'recaptcha-setting' to 'recaptcha-status' */ |
| 188 | 188 | /* Status */ |
| 189 | - if( $option_name == 'recaptcha-setting' ) { |
|
| 189 | + if ( $option_name == 'recaptcha-setting' ) { |
|
| 190 | 190 | $option_name = 'recaptcha-status'; |
| 191 | 191 | } |
| 192 | 192 | /* End re-name ReCaptcha options */ |
| 193 | 193 | |
| 194 | 194 | |
| 195 | - if( is_array( $option_value ) ) { |
|
| 195 | + if ( is_array( $option_value ) ) { |
|
| 196 | 196 | $option_value = json_encode( $option_value ); |
| 197 | 197 | } |
| 198 | 198 | // do noit migrate the lists option, it's not useful to us |
| 199 | - if( $option_name != 'lists' ) { |
|
| 199 | + if ( $option_name != 'lists' ) { |
|
| 200 | 200 | ?> |
| 201 | 201 | var data = { |
| 202 | 202 | 'action': 'migrate_old_plugin_settings', |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | $.post( ajaxurl, data, function(response) { |
| 208 | 208 | jQuery( '#options-updated' ).show(); |
| 209 | - jQuery( '#options-updated' ).append( '<li class="animated fadeInDown"><?php echo '<strong>' . ucwords( str_replace( '_' , ' ' , str_replace( '-' , ' ' , $option_name ) ) ) . '</strong> ' . __( "successfully imported." , 'yikes-inc-easy-mailchimp-extender' ); ?></li>' ); |
|
| 209 | + jQuery( '#options-updated' ).append( '<li class="animated fadeInDown"><?php echo '<strong>' . ucwords( str_replace( '_', ' ', str_replace( '-', ' ', $option_name ) ) ) . '</strong> ' . __( "successfully imported.", 'yikes-inc-easy-mailchimp-extender' ); ?></li>' ); |
|
| 210 | 210 | }); |
| 211 | 211 | <?php |
| 212 | 212 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | }, 2000 ); |
| 231 | 231 | </script> |
| 232 | 232 | <?php |
| 233 | - wp_die( '<strong>' . __( 'Old plugin options do not exist. Redirecting you...' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>' , 500 ); |
|
| 233 | + wp_die( '<strong>' . __( 'Old plugin options do not exist. Redirecting you...', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>', 500 ); |
|
| 234 | 234 | ?> |
| 235 | 235 | </div> |
| 236 | 236 | <?php |