Plugin Directory

Changeset 1908889


Ignore:
Timestamp:
07/13/2018 04:57:15 PM (8 years ago)
Author:
Ipstenu
Message:

REL 4.6.2 - Fix for Multisite. No functional code changes.

Location:
varnish-http-purge
Files:
1 deleted
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • varnish-http-purge/tags/4.6.2/readme.txt

    r1907307 r1908889  
    44Requires at least: 4.7
    55Tested up to: 4.9
    6 Stable tag: 4.6.1
     6Stable tag: 4.6.2
    77Requires PHP: 5.6
    88
     
    188188
    189189== Changelog ==
     190
     191= 4.6.2 =
     192
     193* July 2018
     194* Fixing some translation output.
     195* Multisite fixes for settings pages.
     196
     197= 4.6.1 =
     198
     199* July 2018
     200* Fix situation where purging wasn't (props @carlalexander)
    190201
    191202= 4.6.0 =
  • varnish-http-purge/tags/4.6.2/settings.php

    r1907240 r1908889  
    6767     */
    6868    public function register_settings() {
    69         if ( ! is_multisite() || current_user_can( 'manage_network' ) ) {
    70             // Development Mode Settings.
    71             register_setting( 'vhp-settings-devmode', 'vhp_varnish_devmode', array( &$this, 'settings_devmode_sanitize' ) );
    72             add_settings_section( 'vhp-settings-devmode-section', __( 'Development Mode Settings', 'varnish-http-purge' ), array( &$this, 'options_settings_devmode' ), 'varnish-devmode-settings' );
    73             add_settings_field( 'varnish_devmode', __( 'Development Mode', 'varnish-http-purge' ), array( &$this, 'settings_devmode_callback' ), 'varnish-devmode-settings', 'vhp-settings-devmode-section' );
    74 
    75             // IP Settings.
    76             register_setting( 'vhp-settings-ip', 'vhp_varnish_ip', array( &$this, 'settings_ip_sanitize' ) );
    77             add_settings_section( 'vhp-settings-ip-section', __( 'Configure Custom IP', 'varnish-http-purge' ), array( &$this, 'options_settings_ip' ), 'varnish-ip-settings' );
    78             add_settings_field( 'varnish_ip', __( 'Set Custom IP', 'varnish-http-purge' ), array( &$this, 'settings_ip_callback' ), 'varnish-ip-settings', 'vhp-settings-ip-section' );
    79         }
     69        // Development Mode Settings.
     70        register_setting( 'vhp-settings-devmode', 'vhp_varnish_devmode', array( &$this, 'settings_devmode_sanitize' ) );
     71        add_settings_section( 'vhp-settings-devmode-section', __( 'Development Mode Settings', 'varnish-http-purge' ), array( &$this, 'options_settings_devmode' ), 'varnish-devmode-settings' );
     72        add_settings_field( 'varnish_devmode', __( 'Development Mode', 'varnish-http-purge' ), array( &$this, 'settings_devmode_callback' ), 'varnish-devmode-settings', 'vhp-settings-devmode-section' );
     73
     74        // IP Settings.
     75        register_setting( 'vhp-settings-ip', 'vhp_varnish_ip', array( &$this, 'settings_ip_sanitize' ) );
     76        add_settings_section( 'vhp-settings-ip-section', __( 'Configure Custom IP', 'varnish-http-purge' ), array( &$this, 'options_settings_ip' ), 'varnish-ip-settings' );
     77        add_settings_field( 'varnish_ip', __( 'Set Custom IP', 'varnish-http-purge' ), array( &$this, 'settings_ip_callback' ), 'varnish-ip-settings', 'vhp-settings-ip-section' );
    8078    }
    8179
     
    418416
    419417            <?php
    420             if ( ! is_multisite() || current_user_can( 'manage_network' ) ) {
     418            if ( ! is_multisite() ) {
    421419                ?>
    422420                <form action="options.php" method="POST" >
     
    438436            } else {
    439437                ?>
    440                 <p><?php esc_html_e( 'Your account does not have access to configure settings. Please contact your site administrator.', 'varnish-http-purge' ); ?></p>
    441                 <?php
    442             }
    443             ?>
    444 
     438                <p><?php esc_html_e( 'Editing these settings via the Dashboard is disabled on Multisite as incorrect edits can prevent your network from loading entirely. You can toggle debug mode globally using the admin toolbar option, and you should define your Varnish IP directly into your wp-config file for best results.', 'varnish-http-purge' ); ?></p>
     439                <?php
     440            }
     441            ?>
    445442        </div>
    446443        <?php
  • varnish-http-purge/tags/4.6.2/varnish-http-purge.php

    r1907307 r1908889  
    44 * Plugin URI: https://halfelf.org/plugins/varnish-http-purge/
    55 * Description: Automatically empty cached pages when content on your site is modified.
    6  * Version: 4.6.1
     6 * Version: 4.6.2
    77 * Author: Mika Epstein
    88 * Author URI: https://halfelf.org/
     
    217217    public function require_pretty_permalinks_notice() {
    218218        // translators: The URL should link to the permalinks page.
    219         echo "<div id='message' class='error'><p>" . sprintf( esc_html__( 'Varnish HTTP Purge requires you to use custom permalinks. Please go to the <a href="%1$s">Permalinks Options Page</a> to configure them.', 'varnish-http-purge' ), esc_url( admin_url( 'options-permalink.php' ) ) ) . '</p></div>';
     219        echo wp_kses_post( '<div id="message" class="error"><p>' . sprintf( __( 'Varnish HTTP Purge requires you to use custom permalinks. Please go to the <a href="%1$s">Permalinks Options Page</a> to configure them.', 'varnish-http-purge' ), esc_url( admin_url( 'options-permalink.php' ) ) ) . '</p></div>' );
    220220    }
    221221
     
    243243            $devmode = get_site_option( 'vhp_varnish_devmode', self::$devmode );
    244244            $time    = human_time_diff( current_time( 'timestamp' ), $devmode['expire'] );
    245             // translators: %1$s is the time until dev mode expires.
    246             // translators: %2$s is a link to the Varnish settings pages.
    247             $message = sprintf( __( 'Varnish HTTP Purge Development Mode is active for the next %1$s. You can disable this at the <a href="%2$s">Varnish Settings Page</a>.', 'varnish-http-purge' ), $time, esc_url( admin_url( 'admin.php?page=varnish-page' ) ) );
     245            if ( ! is_multisite() ) {
     246                // translators: %1$s is the time until dev mode expires.
     247                // translators: %2$s is a link to the Varnish settings pages.
     248                $message = sprintf( __( 'Varnish HTTP Purge Development Mode is active for the next %1$s. You can disable this at the <a href="%2$s">Varnish Settings Page</a>.', 'varnish-http-purge' ), $time, esc_url( admin_url( 'admin.php?page=varnish-page' ) ) );
     249            } else {
     250                // translators: %1$s is the time until dev mode expires.
     251                $message = sprintf( __( 'Varnish HTTP Purge Development Mode is active for the next %1$s.', 'varnish-http-purge' ), $time );
     252            }
    248253        }
    249254        echo '<div class="notice notice-warning"><p>' . wp_kses_post( $message ) . '</p></div>';
     
    880885 * @since 4.0
    881886 */
    882 require_once 'settings.php';
     887// The settings PAGES aren't needed on the network admin page
     888if ( ! is_network_admin() ) {
     889    require_once 'settings.php';
     890}
    883891require_once 'debug.php';
    884892
  • varnish-http-purge/trunk/readme.txt

    r1907307 r1908889  
    44Requires at least: 4.7
    55Tested up to: 4.9
    6 Stable tag: 4.6.1
     6Stable tag: 4.6.2
    77Requires PHP: 5.6
    88
     
    188188
    189189== Changelog ==
     190
     191= 4.6.2 =
     192
     193* July 2018
     194* Fixing some translation output.
     195* Multisite fixes for settings pages.
     196
     197= 4.6.1 =
     198
     199* July 2018
     200* Fix situation where purging wasn't (props @carlalexander)
    190201
    191202= 4.6.0 =
  • varnish-http-purge/trunk/settings.php

    r1907240 r1908889  
    6767     */
    6868    public function register_settings() {
    69         if ( ! is_multisite() || current_user_can( 'manage_network' ) ) {
    70             // Development Mode Settings.
    71             register_setting( 'vhp-settings-devmode', 'vhp_varnish_devmode', array( &$this, 'settings_devmode_sanitize' ) );
    72             add_settings_section( 'vhp-settings-devmode-section', __( 'Development Mode Settings', 'varnish-http-purge' ), array( &$this, 'options_settings_devmode' ), 'varnish-devmode-settings' );
    73             add_settings_field( 'varnish_devmode', __( 'Development Mode', 'varnish-http-purge' ), array( &$this, 'settings_devmode_callback' ), 'varnish-devmode-settings', 'vhp-settings-devmode-section' );
    74 
    75             // IP Settings.
    76             register_setting( 'vhp-settings-ip', 'vhp_varnish_ip', array( &$this, 'settings_ip_sanitize' ) );
    77             add_settings_section( 'vhp-settings-ip-section', __( 'Configure Custom IP', 'varnish-http-purge' ), array( &$this, 'options_settings_ip' ), 'varnish-ip-settings' );
    78             add_settings_field( 'varnish_ip', __( 'Set Custom IP', 'varnish-http-purge' ), array( &$this, 'settings_ip_callback' ), 'varnish-ip-settings', 'vhp-settings-ip-section' );
    79         }
     69        // Development Mode Settings.
     70        register_setting( 'vhp-settings-devmode', 'vhp_varnish_devmode', array( &$this, 'settings_devmode_sanitize' ) );
     71        add_settings_section( 'vhp-settings-devmode-section', __( 'Development Mode Settings', 'varnish-http-purge' ), array( &$this, 'options_settings_devmode' ), 'varnish-devmode-settings' );
     72        add_settings_field( 'varnish_devmode', __( 'Development Mode', 'varnish-http-purge' ), array( &$this, 'settings_devmode_callback' ), 'varnish-devmode-settings', 'vhp-settings-devmode-section' );
     73
     74        // IP Settings.
     75        register_setting( 'vhp-settings-ip', 'vhp_varnish_ip', array( &$this, 'settings_ip_sanitize' ) );
     76        add_settings_section( 'vhp-settings-ip-section', __( 'Configure Custom IP', 'varnish-http-purge' ), array( &$this, 'options_settings_ip' ), 'varnish-ip-settings' );
     77        add_settings_field( 'varnish_ip', __( 'Set Custom IP', 'varnish-http-purge' ), array( &$this, 'settings_ip_callback' ), 'varnish-ip-settings', 'vhp-settings-ip-section' );
    8078    }
    8179
     
    418416
    419417            <?php
    420             if ( ! is_multisite() || current_user_can( 'manage_network' ) ) {
     418            if ( ! is_multisite() ) {
    421419                ?>
    422420                <form action="options.php" method="POST" >
     
    438436            } else {
    439437                ?>
    440                 <p><?php esc_html_e( 'Your account does not have access to configure settings. Please contact your site administrator.', 'varnish-http-purge' ); ?></p>
    441                 <?php
    442             }
    443             ?>
    444 
     438                <p><?php esc_html_e( 'Editing these settings via the Dashboard is disabled on Multisite as incorrect edits can prevent your network from loading entirely. You can toggle debug mode globally using the admin toolbar option, and you should define your Varnish IP directly into your wp-config file for best results.', 'varnish-http-purge' ); ?></p>
     439                <?php
     440            }
     441            ?>
    445442        </div>
    446443        <?php
  • varnish-http-purge/trunk/varnish-http-purge.php

    r1907307 r1908889  
    44 * Plugin URI: https://halfelf.org/plugins/varnish-http-purge/
    55 * Description: Automatically empty cached pages when content on your site is modified.
    6  * Version: 4.6.1
     6 * Version: 4.6.2
    77 * Author: Mika Epstein
    88 * Author URI: https://halfelf.org/
     
    217217    public function require_pretty_permalinks_notice() {
    218218        // translators: The URL should link to the permalinks page.
    219         echo "<div id='message' class='error'><p>" . sprintf( esc_html__( 'Varnish HTTP Purge requires you to use custom permalinks. Please go to the <a href="%1$s">Permalinks Options Page</a> to configure them.', 'varnish-http-purge' ), esc_url( admin_url( 'options-permalink.php' ) ) ) . '</p></div>';
     219        echo wp_kses_post( '<div id="message" class="error"><p>' . sprintf( __( 'Varnish HTTP Purge requires you to use custom permalinks. Please go to the <a href="%1$s">Permalinks Options Page</a> to configure them.', 'varnish-http-purge' ), esc_url( admin_url( 'options-permalink.php' ) ) ) . '</p></div>' );
    220220    }
    221221
     
    243243            $devmode = get_site_option( 'vhp_varnish_devmode', self::$devmode );
    244244            $time    = human_time_diff( current_time( 'timestamp' ), $devmode['expire'] );
    245             // translators: %1$s is the time until dev mode expires.
    246             // translators: %2$s is a link to the Varnish settings pages.
    247             $message = sprintf( __( 'Varnish HTTP Purge Development Mode is active for the next %1$s. You can disable this at the <a href="%2$s">Varnish Settings Page</a>.', 'varnish-http-purge' ), $time, esc_url( admin_url( 'admin.php?page=varnish-page' ) ) );
     245            if ( ! is_multisite() ) {
     246                // translators: %1$s is the time until dev mode expires.
     247                // translators: %2$s is a link to the Varnish settings pages.
     248                $message = sprintf( __( 'Varnish HTTP Purge Development Mode is active for the next %1$s. You can disable this at the <a href="%2$s">Varnish Settings Page</a>.', 'varnish-http-purge' ), $time, esc_url( admin_url( 'admin.php?page=varnish-page' ) ) );
     249            } else {
     250                // translators: %1$s is the time until dev mode expires.
     251                $message = sprintf( __( 'Varnish HTTP Purge Development Mode is active for the next %1$s.', 'varnish-http-purge' ), $time );
     252            }
    248253        }
    249254        echo '<div class="notice notice-warning"><p>' . wp_kses_post( $message ) . '</p></div>';
     
    880885 * @since 4.0
    881886 */
    882 require_once 'settings.php';
     887// The settings PAGES aren't needed on the network admin page
     888if ( ! is_network_admin() ) {
     889    require_once 'settings.php';
     890}
    883891require_once 'debug.php';
    884892
Note: See TracChangeset for help on using the changeset viewer.