Plugin Directory

Changeset 2323582


Ignore:
Timestamp:
06/13/2020 01:32:54 PM (6 years ago)
Author:
grfstudio
Message:

Fixed php warnings

Location:
wp-admin-cache/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-admin-cache/trunk/index.php

    r2323502 r2323582  
    55  Plugin URI: https://www.wpadmincache.com
    66  Description: The first cache plugin for WordPress admin area
    7   Version: 0.2.6
     7  Version: 0.2.7
    88  Author: Grf Studio
    99  Author URI: https://www.grfstudio.com
     
    5858    function init() {
    5959        add_options_page('WP Admin Cache', 'WP Admin Cache', 'manage_options', 'wp-admin-cache', array($this, 'options_page'));
    60         wp_enqueue_script('wp-admin-cache-script', plugin_dir_url(__FILE__) . 'index.js', array(), '0.2.6');
    61         wp_enqueue_style('wp-admin-cache-style', plugin_dir_url(__FILE__) . 'index.css', array(), '0.2.6');
     60        wp_enqueue_script('wp-admin-cache-script', plugin_dir_url(__FILE__) . 'index.js', array(), '0.2.7');
     61        wp_enqueue_style('wp-admin-cache-style', plugin_dir_url(__FILE__) . 'index.css', array(), '0.2.7');
    6262        $session = wp_get_session_token();
    6363        if (!isset($_COOKIE['wp-admin-cache-session']) || $_COOKIE['wp-admin-cache-session'] != $session) setcookie('wp-admin-cache-session', $session, 0, admin_url());
     
    108108
    109109    function purgeCache() {
    110         foreach ($this->getEnabledUrls() as $url) {
     110        $enabledUrls=$this->getEnabledUrls();
     111        if($enabledUrls==null)return;
     112        foreach ($enabledUrls as $url) {
    111113            delete_transient('wp-admin-cached-' . $this->getToken() . $url);
    112114        }
  • wp-admin-cache/trunk/readme.txt

    r2323502 r2323582  
    22Contributors: grfstudio
    33Tags: admin cache, admin performance, admin speed, slow admin, woocommerce performance, slow woocommerce
    4 Stable tag: 0.2.6
     4Stable tag: 0.2.7
    55Requires PHP: 5.6
    66Requires at least: 4.6
     
    4242
    4343== Changelog ==
     44
     45= 0.2.7 =
     46
     47* Fixed: some php warnings
    4448
    4549= 0.2.6 =
  • wp-admin-cache/trunk/settings.php

    r2323502 r2323582  
    22if (!isset($this)) die('');
    33if (!is_admin()) die('');
    4 $status='';
     4$status = '';
    55if (isset($_POST['wp_admin_cache_save'])) {
    66    check_admin_referer('wp_admin_cache_settings_n');
    77    $obj = array();
    88    $obj['enabled'] = sanitize_text_field($_POST['wp_admin_cache_enabled']);
    9     $this->enabled=$obj['enabled'];
     9    $this->enabled = $obj['enabled'];
    1010    if (isset($_POST['wp_admin_cache_url_enabled'])) {
    1111        $urlsEnabled = $_POST['wp_admin_cache_url_enabled'];
     
    2525    }
    2626    $this->purgeCache();
    27    
    28         $status= '<div class="updated notice"><p>'.__('Settings updated', 'wp-admin-cache').'</p></div>';
    29  
     27
     28    $status = '<div class="updated notice"><p>' . __('Settings updated', 'wp-admin-cache') . '</p></div>';
    3029}
    3130
     
    4948        foreach ($this->getPageHooks() as $url) {
    5049            $checked = '';
    51             if (in_array($url, $enabledUrls)) $checked = 'checked';
     50            if ($enabledUrls != null) {
     51                if (in_array($url, $enabledUrls)) $checked = 'checked';
     52            }
    5253            echo '<li><label><input type="checkbox" name="wp_admin_cache_url_enabled[]" value="' . $url . '" ' . $checked . ' > ' . $url . '</label></li>';
    5354        }
     
    5859        <?php echo __('The cache is regenerated after the specified time, or when certain events occur (adding or updating a post or a page, saving options, saving widgets, activating plugins).', 'wp-admin-cache') ?><br>
    5960        <?php echo __('Important: the cache is managed for each user; if more than one user is connected, not all users may have updated pages; in these cases, reduce the duration of the cache.', 'wp-admin-cache') ?>
    60    </p>
     61    </p>
    6162    <p>
    6263        <label><input type="checkbox" name="wp_admin_cache_show_label" value="1" <?php if ($settings['show-label'] == '1') echo 'checked' ?>> <?php echo __('Show a label on each cached page (shows which pages are actually cached)', 'wp-admin-cache') ?></label>   
Note: See TracChangeset for help on using the changeset viewer.