Plugin Directory

Changeset 2339913


Ignore:
Timestamp:
07/13/2020 07:31:50 PM (6 years ago)
Author:
vohotv
Message:

Version 2.0.0 of the coronavirus plugin.

Location:
coronavirus/trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • coronavirus/trunk/README.txt

    r2290022 r2339913  
    22Contributors: vohotv
    33Tags: coronavirus, virus
    4 Tested up to: 5.4
     4Tested up to: 5.4.2
    55License: GPLv2 or later
    66License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5555== Changelog ==
    5656
     57= 2.0.0 =
     58* Upgraded to the v3 API endpoint.
     59* Front-end now shows error when country is not found.
     60* Added a check around the corona_data_options which fixes the errors being displayed besides the checkboxes on the admin page when activating the plugin for the first time.
     61* If you decide to uninstall the coronavirus plugin :( It now deletes all options you chose on the admin page.
     62
    5763= 1.3.5 =
    5864* Changed to different API endpoint to fix the issue of empty widgets.
  • coronavirus/trunk/admin/partials/coronavirus-settings.php

    r2281640 r2339913  
    7171                <?php foreach ($checkbox_ids as $id => $display_value) : ?>
    7272                    <div class="custom-control custom-checkbox">
    73                         <input type="checkbox" class="custom-control-input" id="<?php echo esc_attr($id); ?>" name="<?php echo esc_attr($id); ?>" <?php if ($corona_data_options[$id] === 'on') echo 'checked'; ?>>
     73                        <input type="checkbox" class="custom-control-input" id="<?php echo esc_attr($id); ?>" name="<?php echo esc_attr($id); ?>" <?php if (!empty($corona_data_options) && $corona_data_options[$id] === 'on') echo 'checked'; ?>>
    7474                        <label class="custom-control-label" for="<?php echo esc_attr($id); ?>"><?php echo $display_value; ?></label>
    7575                    </div>
  • coronavirus/trunk/coronavirus.php

    r2290022 r2339913  
    1717 * Plugin URI:        https://github.com/VoHoTv/coronavirus
    1818 * Description:       Display data about the coronavirus.
    19  * Version:           1.3.5
     19 * Version:           2.0.0
    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.5' );
     38define( 'CORONAVIRUS_VERSION', '2.0.0' );
    3939
    4040/**
  • coronavirus/trunk/includes/class-coronavirus-activator.php

    r2281640 r2339913  
    3131     */
    3232    public static function activate() {
    33         delete_option('display_flag');
    34         delete_option('corona_data_options');
    35         delete_option('header_background_color');
    36         delete_option('header_text_color');
    37         delete_option('general_background_color');
    38         delete_option('general_text_color');
    39         delete_option('border_color');
     33
    4034    }
    4135
  • coronavirus/trunk/includes/class-coronavirus-deactivator.php

    r2281640 r2339913  
    3131     */
    3232    public static function deactivate() {
    33 
     33        delete_option('display_flag');
     34        delete_option('corona_data_options');
     35        delete_option('header_background_color');
     36        delete_option('header_text_color');
     37        delete_option('general_background_color');
     38        delete_option('general_text_color');
     39        delete_option('border_color');
    3440    }
    3541
  • coronavirus/trunk/includes/class-coronavirus-shared-functionality.php

    r2290022 r2339913  
    3636       
    3737        // // If country attribute is omitted display global data.
    38         $url = empty($country) ? "https://ev3klr6bchdcdowp.disease.sh/v2/all" : "https://ev3klr6bchdcdowp.disease.sh/v2/countries/$country_slug";
     38        $url = empty($country) ? "https://ev3klr6bchdcdowp.disease.sh/v3/covid-19/all" : "https://ev3klr6bchdcdowp.disease.sh/v3/covid-19/countries/$country_slug";
    3939
    4040        // Add unique user agent, requested by the COVID API team.
  • coronavirus/trunk/public/class-coronavirus-public.php

    r2281640 r2339913  
    128128        $corona_data_options = get_option('corona_data_options');
    129129
     130        // Display error when a message is in the response, usually caused by using a wrong country name.
     131        if(!empty($country_data->message)) {
     132            ob_start();
     133            require plugin_dir_path( __FILE__ ) . 'partials/error.php';
     134           
     135            return ob_get_clean();
     136        }
     137
    130138        ob_start();
    131             require plugin_dir_path( dirname( __FILE__ ) ) . 'includes/shared-partials/coronavirus-info.php';
    132         $template = ob_get_clean();
     139        require plugin_dir_path( dirname( __FILE__ ) ) . 'includes/shared-partials/coronavirus-info.php';
    133140
    134         return $template;
     141        return ob_get_clean();
    135142    }
    136143}
Note: See TracChangeset for help on using the changeset viewer.