Changeset 2339913
- Timestamp:
- 07/13/2020 07:31:50 PM (6 years ago)
- Location:
- coronavirus/trunk
- Files:
-
- 2 added
- 7 edited
-
README.txt (modified) (2 diffs)
-
admin/partials/coronavirus-settings.php (modified) (1 diff)
-
coronavirus.php (modified) (2 diffs)
-
includes/class-coronavirus-activator.php (modified) (1 diff)
-
includes/class-coronavirus-deactivator.php (modified) (1 diff)
-
includes/class-coronavirus-shared-functionality.php (modified) (1 diff)
-
public/class-coronavirus-public.php (modified) (1 diff)
-
public/partials (added)
-
public/partials/error.php (added)
Legend:
- Unmodified
- Added
- Removed
-
coronavirus/trunk/README.txt
r2290022 r2339913 2 2 Contributors: vohotv 3 3 Tags: coronavirus, virus 4 Tested up to: 5.4 4 Tested up to: 5.4.2 5 5 License: GPLv2 or later 6 6 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 55 55 == Changelog == 56 56 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 57 63 = 1.3.5 = 58 64 * Changed to different API endpoint to fix the issue of empty widgets. -
coronavirus/trunk/admin/partials/coronavirus-settings.php
r2281640 r2339913 71 71 <?php foreach ($checkbox_ids as $id => $display_value) : ?> 72 72 <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'; ?>> 74 74 <label class="custom-control-label" for="<?php echo esc_attr($id); ?>"><?php echo $display_value; ?></label> 75 75 </div> -
coronavirus/trunk/coronavirus.php
r2290022 r2339913 17 17 * Plugin URI: https://github.com/VoHoTv/coronavirus 18 18 * Description: Display data about the coronavirus. 19 * Version: 1.3.519 * Version: 2.0.0 20 20 * Author: Mike Zuidhoek 21 21 * Author URI: https://mikezuidhoek.com/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'CORONAVIRUS_VERSION', ' 1.3.5' );38 define( 'CORONAVIRUS_VERSION', '2.0.0' ); 39 39 40 40 /** -
coronavirus/trunk/includes/class-coronavirus-activator.php
r2281640 r2339913 31 31 */ 32 32 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 40 34 } 41 35 -
coronavirus/trunk/includes/class-coronavirus-deactivator.php
r2281640 r2339913 31 31 */ 32 32 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'); 34 40 } 35 41 -
coronavirus/trunk/includes/class-coronavirus-shared-functionality.php
r2290022 r2339913 36 36 37 37 // // If country attribute is omitted display global data. 38 $url = empty($country) ? "https://ev3klr6bchdcdowp.disease.sh/v 2/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"; 39 39 40 40 // Add unique user agent, requested by the COVID API team. -
coronavirus/trunk/public/class-coronavirus-public.php
r2281640 r2339913 128 128 $corona_data_options = get_option('corona_data_options'); 129 129 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 130 138 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'; 133 140 134 return $template;141 return ob_get_clean(); 135 142 } 136 143 }
Note: See TracChangeset
for help on using the changeset viewer.