Plugin Directory

Changeset 2290022


Ignore:
Timestamp:
04/23/2020 10:41:37 AM (6 years ago)
Author:
vohotv
Message:

Changed to different API endpoint.

Location:
coronavirus/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • coronavirus/trunk/README.txt

    r2285634 r2290022  
    5555== Changelog ==
    5656
     57= 1.3.5 =
     58* Changed to different API endpoint to fix the issue of empty widgets.
     59
    5760= 1.3.4 =
    5861* Updated the API to the v2 endpoint. All data should now be displayed again.
  • coronavirus/trunk/coronavirus.php

    r2285634 r2290022  
    1717 * Plugin URI:        https://github.com/VoHoTv/coronavirus
    1818 * Description:       Display data about the coronavirus.
    19  * Version:           1.3.4
     19 * Version:           1.3.5
    2020 * Author:            Mike Zuidhoek
    2121 * Author URI:        https://mikezuidhoek.com/
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'CORONAVIRUS_VERSION', '1.3.4' );
     38define( 'CORONAVIRUS_VERSION', '1.3.5' );
    3939
    4040/**
  • coronavirus/trunk/includes/class-coronavirus-shared-functionality.php

    r2285634 r2290022  
    3636       
    3737        // // If country attribute is omitted display global data.
    38         $url = empty($country) ? "https://corona.lmao.ninja/v2/all" : "https://corona.lmao.ninja/v2/countries/$country_slug?strict=true";
     38        $url = empty($country) ? "https://ev3klr6bchdcdowp.disease.sh/v2/all" : "https://ev3klr6bchdcdowp.disease.sh/v2/countries/$country_slug";
    3939
    40         $response = wp_remote_get( $url );
     40        // Add unique user agent, requested by the COVID API team.
     41        $response = wp_remote_get( $url, array(
     42            'user-agent' => 'Coronavirus/1.0.0'
     43        ));
     44       
    4145        $body = json_decode(wp_remote_retrieve_body( $response ));
    4246
Note: See TracChangeset for help on using the changeset viewer.