Plugin Directory

Changeset 2172631


Ignore:
Timestamp:
10/14/2019 02:40:18 AM (5 years ago)
Author:
ChrisMKindred
Message:

Deploy version 2.8

Location:
usgs-stream-flow-data
Files:
31 added
5 edited

Legend:

Unmodified
Added
Removed
  • usgs-stream-flow-data/trunk/README.txt

    r1955204 r2172631  
    44Tags: USGS, River Flow, Stream Flow, Fly Fishing, Water Level
    55Requires at least: 3.7
    6 Tested up to: 4.9.8
    7 Stable tag: 2.7
     6Tested up to: 5.3
     7Stable tag: 2.8
    88License: GPLv2 or later
    99License URI: //www.gnu.org/licenses/gpl-2.0.html
     
    6666
    6767== Changelog ==
     68= 2.8 =
     69Tested plugin up to 5.3.
     70
     71= 2.7.1 =
     72Adds additional tests and allows for more trusted call to API Url.
     73
    6874= 2.7 =
    6975Tested with WordPress 4.9.8
  • usgs-stream-flow-data/trunk/admin/class-kwc-usgs-admin.php

    r1876522 r2172631  
    3131
    3232    /**
    33      * Slug of the plugin screen.
    34      *
    35      * @since    1.0.0
    36      *
    37      * @var      string
    38      */
    39     protected $plugin_screen_hook_suffix = null;
    40 
    41     /**
    4233     * Initialize the plugin by loading admin scripts & styles and adding a
    4334     * settings page and menu.
     
    4637     */
    4738    private function __construct() {
    48         /*
    49          * Call $plugin_slug from public plugin class.
    50          */
    5139        $this->plugin_slug = Kwc_Usgs::get_instance()->get_plugin_slug();
    52 
    53         // Load admin style sheet and JavaScript.
    5440        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
    5541        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
    56 
    57         // Add the options page and menu item.
    5842        add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
    5943
    60         // Add an action link pointing to the options page.
    6144        $plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_slug . '.php' );
    6245        add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );
     
    7356     */
    7457    public static function get_instance() {
    75         // If the single instance hasn't been set, set it now.
    7658        if ( null == self::$instance ) {
    7759            self::$instance = new self;
    7860        }
    79 
    8061        return self::$instance;
    8162    }
     
    8465     * Register and enqueue admin-specific style sheet.
    8566     *
    86      * @since     1.0.0
    87      *
    88      * @return    null    Return early if no settings page is registered.
     67     * @since 1.0.0
     68     * @return void
    8969     */
    9070    public function enqueue_admin_styles() {
    91 
    92         if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
    93             return;
    94         }
    95 
    9671        $screen = get_current_screen();
    97         if ( $this->plugin_screen_hook_suffix == $screen->id ) {
     72        if ( 'settings_page_kwcusgs' == $screen->id ) {
    9873            wp_enqueue_style( $this->plugin_slug . '-admin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array(), kwc_usgs::VERSION );
    9974        }
    100 
    10175    }
    10276
     
    10478     * Register and enqueue admin-specific JavaScript.
    10579     *
    106      * @since     1.0.0
    107      *
    108      * @return    null    Return early if no settings page is registered.
     80     * @since 1.0.0
     81     * @return void
    10982     */
    11083    public function enqueue_admin_scripts() {
    111 
    112         if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
    113             return;
    114         }
    115 
    11684        $screen = get_current_screen();
    117         if ( $this->plugin_screen_hook_suffix == $screen->id ) {
     85        if ( 'settings_page_kwcusgs' == $screen->id ) {
    11886            wp_enqueue_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery' ), Kwc_Usgs::VERSION );
    11987        }
    120 
    12188    }
    12289
     
    12794     */
    12895    public function add_plugin_admin_menu() {
    129         $this->plugin_screen_hook_suffix = add_options_page(
     96        add_options_page(
    13097            __( 'USGS Stream Flow Data', 'kwc_usgs' ),
    13198            __( 'Stream Flow Data', 'kwc_usgs' ),
     
    134101            array( $this, 'display_plugin_admin_page' )
    135102        );
    136 
    137103    }
    138104
     
    150116     *
    151117     * @since 1.0.0
    152      * @param array $links      The links array.
     118     * @param array $links The links array.
    153119     */
    154120    public function add_action_links( $links ) {
    155 
    156121        return array_merge(
    157122            array(
     
    160125            $links
    161126        );
    162 
    163127    }
    164128
     
    169133     */
    170134    public function kwcusgsajax_javascript() {
    171 ?>
     135        ?>
    172136        <script type="text/javascript" >
    173137        $j=jQuery.noConflict();
     
    187151        });
    188152        </script>
    189     <?php
     153        <?php
    190154    }
    191155    /**
  • usgs-stream-flow-data/trunk/admin/views/admin.php

    r1876522 r2172631  
    2626    <h2 class="nav-tab-wrapper">
    2727    <?php
    28     foreach ( $usgs_tabs as $usgs_tab => $name ) {
     28    foreach ( $usgs_tabs as $usgs_tab => $usgs_name ) {
    2929        $usgs_class = ( $usgs_tab == $usgs_active_tab ) ? ' nav-tab-active' : '';
    30         echo "<a class='nav-tab$usgs_class' href='?page=kwcusgs&tab=$usgs_tab'>$name</a>";
     30        echo "<a class='nav-tab$usgs_class' href='?page=kwcusgs&tab=$usgs_tab'>$usgs_name</a>";
    3131    }
    3232    ?>
     
    116116
    117117        case 'home-settings':
    118         ?>
     118            ?>
    119119            <h3 class="">Using USGS Steam Flow Data</h3>
    120120            <p class="">This plugin uses short codes to allow you to include the USGS infromation for a location on any post or in a Text Widget.</p>
     
    133133
    134134        default:
    135         ?>
     135            ?>
    136136            <center><a href="https://www.kindredwebconsulting.com/"><img src="<?php echo plugins_url( '../assets/kwc-logo.png', __FILE__ ); ?>" alt="Kindred Web Consulting Logo" border="0" /></a><p>Development by: <a href="https://www.kindredwebconsulting.com">Kindred Web Consulting</a></p></center>
    137137            <div class="sidebar">
     
    170170            break;
    171171    }
    172 ?>
     172    ?>
    173173</div>
  • usgs-stream-flow-data/trunk/kwcusgs.php

    r1955204 r2172631  
    1313 * Plugin URI:        //wordpress.org/plugins/usgs-stream-flow-data/
    1414 * Description:       USGS Stream Flow Data
    15  * Version:           2.7
     15 * Version:           2.8
    1616 * Author:            Chris Kindred
    1717 * Author URI:        //www.kindredwebconsulting.com
  • usgs-stream-flow-data/trunk/public/class-kwc-usgs.php

    r1955204 r2172631  
    2828     * @var     string
    2929     */
    30     const VERSION = '2.7';
     30    const VERSION = '2.7.1';
    3131
    3232    /**
     
    5959     */
    6060    private function __construct() {
    61 
    6261        add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
    6362        add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
     
    8180     * Return an instance of this class.
    8281     *
    83      * @since     1.0.0
    84      *
    85      * @return    object    A single instance of this class.
     82     * @since 1.0.0
     83     * @return object
    8684     */
    8785    public static function get_instance() {
    88 
    89         // If the single instance hasn't been set, set it now.
    90         if ( null == self::$instance ) {
     86        if ( null === self::$instance ) {
    9187            self::$instance = new self;
    9288        }
    93 
    9489        return self::$instance;
    9590    }
     
    123118
    124119    /**
     120     * Fired for each blog when the plugin is activated.
     121     *
     122     * @since 2.7
     123     */
     124    private static function single_activate() {
     125        return;
     126    }
     127
     128    /**
     129     * Fired for each blog when the plugin is deactivated.
     130     *
     131     * @since 2.7
     132     * @return void
     133     */
     134    private static function single_deactivate() {
     135
     136    }
     137    /**
    125138     * Fired when the plugin is deactivated.
    126139     *
    127140     * @since    1.0.0
    128      *
    129141     * @param boolean $network_wide True if WPMU superadmin uses
    130142     *                                       "Network Deactivate" action, false if
     
    133145     */
    134146    public static function deactivate( $network_wide ) {
    135 
    136147        if ( function_exists( 'is_multisite' ) && is_multisite() ) {
    137 
    138148            if ( $network_wide ) {
    139149                $blog_ids = self::get_blog_ids();
     
    154164     * Fired when a new site is activated with a WPMU environment.
    155165     *
    156      * @since    1.0.0
    157      *
     166     * @since 1.0.0
    158167     * @param int $blog_id ID of the new blog.
    159168     */
    160169    public function activate_new_site( $blog_id ) {
    161 
    162170        if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
    163171            return;
    164172        }
    165 
    166173        switch_to_blog( $blog_id );
    167174        self::single_activate();
    168175        restore_current_blog();
    169 
    170176    }
    171177
     
    176182     * - not deleted
    177183     *
    178      * @since    1.0.0
    179      *
    180      * @return   array|false    The blog ids, false if no matches.
     184     * @since 1.0.0
     185     * @return array|false    The blog ids, false if no matches.
    181186     */
    182187    private static function get_blog_ids() {
     
    186191
    187192    /**
    188      * Fired for each blog when the plugin is activated.
    189      *
    190      * @since    1.0.0
    191      */
    192     private static function single_activate() {
    193 
    194     }
    195 
    196     /**
    197      * Fired for each blog when the plugin is deactivated.
    198      *
    199      * @since    1.0.0
    200      */
    201     private static function single_deactivate() {
    202 
    203     }
    204 
    205     /**
    206193     * Load the plugin text domain for translation.
    207194     *
     
    209196     */
    210197    public function load_plugin_textdomain() {
    211 
    212198        $domain = $this->plugin_slug;
    213199        $locale = apply_filters( 'kwc_usgs_plugin_locale', get_locale(), $domain );
    214 
    215200        load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
    216 
    217201    }
    218202
     
    220204     * Register and enqueue public-facing style sheet.
    221205     *
    222      * @since    1.0.0
     206     * @since 1.0.0
    223207     */
    224208    public function enqueue_styles() {
    225 
    226209        wp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'assets/css/public.css', __FILE__ ), array(), self::VERSION );
    227 
    228210    }
    229211
     
    231213     * Register and enqueues public-facing JavaScript files.
    232214     *
    233      * @since    1.0.0
     215     * @since 1.0.0
    234216     */
    235217    public function enqueue_scripts() {
    236 
    237218        wp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'assets/js/public.js', __FILE__ ), array( 'jquery' ), self::VERSION );
    238 
    239219    }
    240220
     
    365345    public function get_usgs( $location ) {
    366346        $url      = "https://waterservices.usgs.gov/nwis/iv?site=$location&parameterCd=00010,00060,00065&format=waterml";
    367         $response = wp_remote_get( $url );
     347        $args     = array(
     348            'sslverify' => false,
     349        );
     350        $response = wp_remote_get( $url, $args );
    368351        if ( is_wp_error( $response ) ) {
    369352            return $response;
Note: See TracChangeset for help on using the changeset viewer.