Plugin Directory

Changeset 3128431


Ignore:
Timestamp:
07/31/2024 02:20:42 AM (18 months ago)
Author:
ryviu
Message:

Check connect Ryviu

Location:
ryviu/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ryviu/trunk/includes/main-class.php

    r2922607 r3128431  
    99    public static function check_connect_ryviu($check = false) {
    1010        $mes = 'Connection failed, please contact Ryviu support for help.';
     11        $mes_eor = 'Success';
    1112        delete_option( 'ryviu_client_settings' );
    1213        $settings = get_option( 'ryviu_client_settings' );
     
    1516            try{
    1617                $settings_info = wp_remote_get( $url, ['timeout' => 3] );
     18                $mes_eor = $settings_info;
    1719                if ( is_wp_error( $settings_info ) ) {
    1820                    $settings = '';
     21                    $mes = 'Request failed: ' . $settings_info->get_error_message();
    1922                } else {
    20                     if(isset($settings_info['body'])){
     23                    $response_code = wp_remote_retrieve_response_code($settings_info);
     24                   
     25                    if ($response_code == 502) {
     26                        $mes = 'Bad Gateway: The server received an invalid response. Please try again later or contact Ryviu support.';
     27                    } else if (isset($settings_info['body'])) {
    2128                        $settings_body = json_decode($settings_info['body']);
    2229                        if($settings_body->status != 'error'){
     
    3037                                    ]);
    3138                                }
    32                                
    3339                            }
    34                         }
     40                        }else{
     41                            $mes = 'Your store has not been linked to Ryviu, or the connected WordPress address is incorrect. Please login to your Ryviu account and check the settings page.';
     42                        }   
    3543                    }
    3644                }
    37                 $mes = 'Your store has not been linked to Ryviu, or the connected WordPress address is incorrect. Please login your Ryviu account and check in the settings page.';
    3845            }catch(Exception $e){
    39                 //handle exception
     46                $mes_eor = $e->getMessage();
     47                $mes = 'An error occurred: ' . $mes_eor;
    4048            }
    4149        }
     
    4351            wp_send_json([
    4452                'status' => 'error',
     53                'mes_eor' => $mes_eor,
    4554                'mes' => $mes
    4655            ]);
  • ryviu/trunk/readme.txt

    r3112310 r3128431  
    44Tags: reviews, dropshiping, woocommerce reviews, fake reviews, manage reviews
    55Requires at least: 4.0
    6 Tested up to: 6.5
     6Tested up to: 6.6
    77WC requires at least: 3.0
    8 WC tested up to: 8.9
     8WC tested up to: 9.1
    99Stable tag: 3.1.25
    1010License: GPLv2 or later
  • ryviu/trunk/ryviu.php

    r3112296 r3128431  
    1818 * Version:           3.1.25
    1919 * Requires at least: 4.0
    20  * Tested up to:      6.5
     20 * Tested up to:      6.6
    2121 * WC requires at least: 3.0
    22  * WC tested up to:   8.9
     22 * WC tested up to:   9.1
    2323 * Author:            Ryviu
    2424 * Author URI:        https://www.ryviu.com
Note: See TracChangeset for help on using the changeset viewer.