Plugin Directory

Changeset 2374331


Ignore:
Timestamp:
09/03/2020 07:57:09 AM (6 years ago)
Author:
om4
Message:

Update to version 1.2.8 from GitHub

Location:
weatherzone
Files:
6 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • weatherzone/tags/1.2.8/readme.txt

    r1682377 r2374331  
    11=== WeatherZone Embed ===
    22Contributors: jamescollins, glenn-om4
    3 Donate link: https://om4.com.au/wordpress-plugins/#donate
    43Tags: weatherzone, weather, australia, shortcode, wp, multisite, wpmu
    54Requires at least: 3.5
    6 Tested up to: 4.8
    7 Stable tag: 1.2.7
     5Tested up to: 5.5
     6Stable tag: 1.2.8
    87License: GPLv2 or later
    98License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1514Allows you to easily embed Australian weather forecast and observation data on your website.
    1615
    17 Data is provided in the form of a [WeatherZone.com.au button](http://www.weatherzone.com.au/about/freeweatherbutton.jsp). 
     16Data is provided in the form of a [WeatherZone.com.au button](http://www.weatherzone.com.au/about/freeweatherbutton.jsp).
    1817
    1918Supports both weather forecast and current weather observations buttons.
     
    7776
    7877Yes. As of v1.0.1, you can use the [weatherzone] shortcode in a text widget.
    79  
     78
    8079
    8180== Screenshots ==
     
    8382
    8483== Changelog ==
     84
     85= 1.2.8=
     86* WordPress 5.5 compatibility.
    8587
    8688= 1.2.7=
     
    123125* Initial release.
    124126
    125 == Upgrade Notice == 
     127== Upgrade Notice ==
    126128
    127129= 1.2.2 =
  • weatherzone/tags/1.2.8/weatherzone.php

    r1682377 r2374331  
    22/*
    33Plugin Name: WeatherZone Embed
    4 Plugin URI: https://om4.com.au/plugins/weatherzone/
     4Plugin URI: https://om4.io/plugins/weatherzone/
    55Description: Allows you to embed WeatherZone.com.au weather buttons on your site. Supports both weather forecast and current weather observations buttons.
    6 Version: 1.2.7
     6Version: 1.2.8
    77Author: OM4
    8 Author URI: https://om4.com.au/plugins/
     8Author URI: https://om4.io/
    99Text Domain: om4-weatherzone
    1010License: GPLv2 or later
     
    3131
    3232class OM4_WeatherZone {
    33    
    34     var $version = '1.2.6';
    35    
     33
     34    var $version = '1.2.8';
     35
    3636    var $dbVersion = 1;
    37    
     37
    3838    var $installedVersion;
    39    
     39
    4040    var $dirname;
    41    
     41
    4242    var $url;
    43    
     43
    4444    var $optionName = 'om4_weatherzone_db_version';
    45    
     45
    4646    static $number = 1;
    47    
     47
    4848    /**
    4949     * Constructor
     
    5151     */
    5252    public function __construct() {
    53        
     53
    5454        // Store the name of the directory that this plugin is installed in
    5555        $this->dirname = str_replace('/weatherzone.php', '', plugin_basename(__FILE__));
    56        
     56
    5757        $this->url = plugins_url('weatherzone/');
    5858
    5959        register_activation_hook(__FILE__, array($this, 'Activate'));
    60        
     60
    6161        add_action('init', array($this, 'LoadDomain'));
    62        
     62
    6363        add_action('init', array($this, 'CheckVersion'));
    64        
     64
    6565        add_action('init', array($this, 'RegisterShortcode'));
    6666
    6767        $this->installedVersion = intval(get_option($this->optionName));
    6868    }
    69    
    70     /**
    71      * Intialise I18n
     69
     70    /**
     71     * Initialise I18n
    7272     *
    7373     */
    7474    public function LoadDomain() {
    75         load_plugin_textdomain('om4-weatherzone', false, WP_PLUGIN_DIR.'/'.dirname(plugin_basename(__FILE__)));
    76     }
    77    
     75        load_plugin_textdomain('om4-weatherzone', false, dirname(plugin_basename(__FILE__)));
     76    }
     77
    7878    /**
    7979     * Plugin Activation Tasks
     
    8787        }
    8888    }
    89    
     89
    9090    /**
    9191     * Performs any upgrade tasks if required
     
    101101        }
    102102    }
    103    
     103
    104104    /**
    105105     * Register the [weatherzone] shortcode
     
    107107    public function RegisterShortcode() {
    108108        add_shortcode('weatherzone', array($this, 'ShortcodeHandler'));
    109        
     109
    110110        // Parse shortcodes in text widgets
    111111        // Required until http://core.trac.wordpress.org/ticket/10457 is committed
    112112        add_filter('widget_text', 'do_shortcode');
    113113    }
    114    
    115    
     114
     115
    116116    /**
    117117     * [weatherzone] shortcode handler
    118118     */
    119119    public function ShortcodeHandler($atts, $content = null) {
    120    
     120
    121121        // List of supported shortcode attributes and their default values
    122122        $defaults = array(
     
    126126            'showradar' => 'true'
    127127        );
    128        
     128
    129129        // Combine the specified attributes with the default values
    130130        $atts = shortcode_atts( $defaults, $atts);
    131        
     131
    132132        // Valid values for each parameter
    133133        $validValues['mode'] = array('currentweather', 'forecast');
    134134        $validValues['showradar'] = array('true', 'false');
    135        
     135
    136136        // Validate each of the parameters
    137137        foreach ($atts as $key => $value) {
     
    144144            }
    145145        }
    146        
     146
    147147        // Ensure the required parameters have been specified
    148148        if (!strlen($atts['mode'])) return;
    149149        if (!strlen($atts['postcode'])) return;
    150150        if (!strlen($atts['showradar'])) return;
    151        
     151
    152152        $html = '<div id="weatherzone_' . self::$number . '" class="weatherzone ' . $atts['mode'] . '">';
    153153
     
    158158                    $params .= '&locality=' . urlencode($atts['locality']);
    159159                }
    160                
     160
    161161                $html .= <<<EOD
    162162<!--Weatherzone current weather button-->
     
    172172EOD;
    173173                break;
    174            
     174
    175175            case 'forecast':
    176176                $params = urlencode($atts['postcode']);
     
    178178                    $params .= '&locality=' . urlencode($atts['locality']);
    179179                }
    180                
     180
    181181                $html .= <<<EOD
    182182<!--Weatherzone forecast button-->
     
    193193                break;
    194194        }
    195        
     195
    196196        $html .= '</div>';
    197        
     197
    198198        self::$number++;
    199        
     199
    200200        return $html;
    201201    }
    202    
     202
    203203
    204204    private function SaveInstalledVersion() {
  • weatherzone/trunk/readme.txt

    r1682377 r2374331  
    11=== WeatherZone Embed ===
    22Contributors: jamescollins, glenn-om4
    3 Donate link: https://om4.com.au/wordpress-plugins/#donate
    43Tags: weatherzone, weather, australia, shortcode, wp, multisite, wpmu
    54Requires at least: 3.5
    6 Tested up to: 4.8
    7 Stable tag: 1.2.7
     5Tested up to: 5.5
     6Stable tag: 1.2.8
    87License: GPLv2 or later
    98License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1514Allows you to easily embed Australian weather forecast and observation data on your website.
    1615
    17 Data is provided in the form of a [WeatherZone.com.au button](http://www.weatherzone.com.au/about/freeweatherbutton.jsp). 
     16Data is provided in the form of a [WeatherZone.com.au button](http://www.weatherzone.com.au/about/freeweatherbutton.jsp).
    1817
    1918Supports both weather forecast and current weather observations buttons.
     
    7776
    7877Yes. As of v1.0.1, you can use the [weatherzone] shortcode in a text widget.
    79  
     78
    8079
    8180== Screenshots ==
     
    8382
    8483== Changelog ==
     84
     85= 1.2.8=
     86* WordPress 5.5 compatibility.
    8587
    8688= 1.2.7=
     
    123125* Initial release.
    124126
    125 == Upgrade Notice == 
     127== Upgrade Notice ==
    126128
    127129= 1.2.2 =
  • weatherzone/trunk/weatherzone.php

    r1682377 r2374331  
    22/*
    33Plugin Name: WeatherZone Embed
    4 Plugin URI: https://om4.com.au/plugins/weatherzone/
     4Plugin URI: https://om4.io/plugins/weatherzone/
    55Description: Allows you to embed WeatherZone.com.au weather buttons on your site. Supports both weather forecast and current weather observations buttons.
    6 Version: 1.2.7
     6Version: 1.2.8
    77Author: OM4
    8 Author URI: https://om4.com.au/plugins/
     8Author URI: https://om4.io/
    99Text Domain: om4-weatherzone
    1010License: GPLv2 or later
     
    3131
    3232class OM4_WeatherZone {
    33    
    34     var $version = '1.2.6';
    35    
     33
     34    var $version = '1.2.8';
     35
    3636    var $dbVersion = 1;
    37    
     37
    3838    var $installedVersion;
    39    
     39
    4040    var $dirname;
    41    
     41
    4242    var $url;
    43    
     43
    4444    var $optionName = 'om4_weatherzone_db_version';
    45    
     45
    4646    static $number = 1;
    47    
     47
    4848    /**
    4949     * Constructor
     
    5151     */
    5252    public function __construct() {
    53        
     53
    5454        // Store the name of the directory that this plugin is installed in
    5555        $this->dirname = str_replace('/weatherzone.php', '', plugin_basename(__FILE__));
    56        
     56
    5757        $this->url = plugins_url('weatherzone/');
    5858
    5959        register_activation_hook(__FILE__, array($this, 'Activate'));
    60        
     60
    6161        add_action('init', array($this, 'LoadDomain'));
    62        
     62
    6363        add_action('init', array($this, 'CheckVersion'));
    64        
     64
    6565        add_action('init', array($this, 'RegisterShortcode'));
    6666
    6767        $this->installedVersion = intval(get_option($this->optionName));
    6868    }
    69    
    70     /**
    71      * Intialise I18n
     69
     70    /**
     71     * Initialise I18n
    7272     *
    7373     */
    7474    public function LoadDomain() {
    75         load_plugin_textdomain('om4-weatherzone', false, WP_PLUGIN_DIR.'/'.dirname(plugin_basename(__FILE__)));
    76     }
    77    
     75        load_plugin_textdomain('om4-weatherzone', false, dirname(plugin_basename(__FILE__)));
     76    }
     77
    7878    /**
    7979     * Plugin Activation Tasks
     
    8787        }
    8888    }
    89    
     89
    9090    /**
    9191     * Performs any upgrade tasks if required
     
    101101        }
    102102    }
    103    
     103
    104104    /**
    105105     * Register the [weatherzone] shortcode
     
    107107    public function RegisterShortcode() {
    108108        add_shortcode('weatherzone', array($this, 'ShortcodeHandler'));
    109        
     109
    110110        // Parse shortcodes in text widgets
    111111        // Required until http://core.trac.wordpress.org/ticket/10457 is committed
    112112        add_filter('widget_text', 'do_shortcode');
    113113    }
    114    
    115    
     114
     115
    116116    /**
    117117     * [weatherzone] shortcode handler
    118118     */
    119119    public function ShortcodeHandler($atts, $content = null) {
    120    
     120
    121121        // List of supported shortcode attributes and their default values
    122122        $defaults = array(
     
    126126            'showradar' => 'true'
    127127        );
    128        
     128
    129129        // Combine the specified attributes with the default values
    130130        $atts = shortcode_atts( $defaults, $atts);
    131        
     131
    132132        // Valid values for each parameter
    133133        $validValues['mode'] = array('currentweather', 'forecast');
    134134        $validValues['showradar'] = array('true', 'false');
    135        
     135
    136136        // Validate each of the parameters
    137137        foreach ($atts as $key => $value) {
     
    144144            }
    145145        }
    146        
     146
    147147        // Ensure the required parameters have been specified
    148148        if (!strlen($atts['mode'])) return;
    149149        if (!strlen($atts['postcode'])) return;
    150150        if (!strlen($atts['showradar'])) return;
    151        
     151
    152152        $html = '<div id="weatherzone_' . self::$number . '" class="weatherzone ' . $atts['mode'] . '">';
    153153
     
    158158                    $params .= '&locality=' . urlencode($atts['locality']);
    159159                }
    160                
     160
    161161                $html .= <<<EOD
    162162<!--Weatherzone current weather button-->
     
    172172EOD;
    173173                break;
    174            
     174
    175175            case 'forecast':
    176176                $params = urlencode($atts['postcode']);
     
    178178                    $params .= '&locality=' . urlencode($atts['locality']);
    179179                }
    180                
     180
    181181                $html .= <<<EOD
    182182<!--Weatherzone forecast button-->
     
    193193                break;
    194194        }
    195        
     195
    196196        $html .= '</div>';
    197        
     197
    198198        self::$number++;
    199        
     199
    200200        return $html;
    201201    }
    202    
     202
    203203
    204204    private function SaveInstalledVersion() {
Note: See TracChangeset for help on using the changeset viewer.