Changeset 1908889
- Timestamp:
- 07/13/2018 04:57:15 PM (8 years ago)
- Location:
- varnish-http-purge
- Files:
-
- 1 deleted
- 6 edited
- 1 copied
-
assets/icon.svg (deleted)
-
tags/4.6.2 (copied) (copied from varnish-http-purge/trunk)
-
tags/4.6.2/readme.txt (modified) (2 diffs)
-
tags/4.6.2/settings.php (modified) (3 diffs)
-
tags/4.6.2/varnish-http-purge.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/settings.php (modified) (3 diffs)
-
trunk/varnish-http-purge.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
varnish-http-purge/tags/4.6.2/readme.txt
r1907307 r1908889 4 4 Requires at least: 4.7 5 5 Tested up to: 4.9 6 Stable tag: 4.6. 16 Stable tag: 4.6.2 7 7 Requires PHP: 5.6 8 8 … … 188 188 189 189 == 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) 190 201 191 202 = 4.6.0 = -
varnish-http-purge/tags/4.6.2/settings.php
r1907240 r1908889 67 67 */ 68 68 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' ); 80 78 } 81 79 … … 418 416 419 417 <?php 420 if ( ! is_multisite() || current_user_can( 'manage_network' )) {418 if ( ! is_multisite() ) { 421 419 ?> 422 420 <form action="options.php" method="POST" > … … 438 436 } else { 439 437 ?> 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 ?> 445 442 </div> 446 443 <?php -
varnish-http-purge/tags/4.6.2/varnish-http-purge.php
r1907307 r1908889 4 4 * Plugin URI: https://halfelf.org/plugins/varnish-http-purge/ 5 5 * Description: Automatically empty cached pages when content on your site is modified. 6 * Version: 4.6. 16 * Version: 4.6.2 7 7 * Author: Mika Epstein 8 8 * Author URI: https://halfelf.org/ … … 217 217 public function require_pretty_permalinks_notice() { 218 218 // 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>' ); 220 220 } 221 221 … … 243 243 $devmode = get_site_option( 'vhp_varnish_devmode', self::$devmode ); 244 244 $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 } 248 253 } 249 254 echo '<div class="notice notice-warning"><p>' . wp_kses_post( $message ) . '</p></div>'; … … 880 885 * @since 4.0 881 886 */ 882 require_once 'settings.php'; 887 // The settings PAGES aren't needed on the network admin page 888 if ( ! is_network_admin() ) { 889 require_once 'settings.php'; 890 } 883 891 require_once 'debug.php'; 884 892 -
varnish-http-purge/trunk/readme.txt
r1907307 r1908889 4 4 Requires at least: 4.7 5 5 Tested up to: 4.9 6 Stable tag: 4.6. 16 Stable tag: 4.6.2 7 7 Requires PHP: 5.6 8 8 … … 188 188 189 189 == 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) 190 201 191 202 = 4.6.0 = -
varnish-http-purge/trunk/settings.php
r1907240 r1908889 67 67 */ 68 68 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' ); 80 78 } 81 79 … … 418 416 419 417 <?php 420 if ( ! is_multisite() || current_user_can( 'manage_network' )) {418 if ( ! is_multisite() ) { 421 419 ?> 422 420 <form action="options.php" method="POST" > … … 438 436 } else { 439 437 ?> 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 ?> 445 442 </div> 446 443 <?php -
varnish-http-purge/trunk/varnish-http-purge.php
r1907307 r1908889 4 4 * Plugin URI: https://halfelf.org/plugins/varnish-http-purge/ 5 5 * Description: Automatically empty cached pages when content on your site is modified. 6 * Version: 4.6. 16 * Version: 4.6.2 7 7 * Author: Mika Epstein 8 8 * Author URI: https://halfelf.org/ … … 217 217 public function require_pretty_permalinks_notice() { 218 218 // 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>' ); 220 220 } 221 221 … … 243 243 $devmode = get_site_option( 'vhp_varnish_devmode', self::$devmode ); 244 244 $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 } 248 253 } 249 254 echo '<div class="notice notice-warning"><p>' . wp_kses_post( $message ) . '</p></div>'; … … 880 885 * @since 4.0 881 886 */ 882 require_once 'settings.php'; 887 // The settings PAGES aren't needed on the network admin page 888 if ( ! is_network_admin() ) { 889 require_once 'settings.php'; 890 } 883 891 require_once 'debug.php'; 884 892
Note: See TracChangeset
for help on using the changeset viewer.