Changeset 2250533
- Timestamp:
- 02/26/2020 10:02:49 AM (6 years ago)
- Location:
- wp-performance-pack/trunk
- Files:
-
- 8 edited
-
admin/class.admin-renderer.php (modified) (1 diff)
-
modules/disable_widgets/class.wppp_disable_widgets.php (modified) (3 diffs)
-
modules/disable_widgets/class.wppp_disable_widgets_simple.php (modified) (2 diffs)
-
modules/dynamic_images/class.wppp_dynamic_images.php (modified) (2 diffs)
-
modules/l10n_improvements/class.wppp_mo_dynamic.php (modified) (3 diffs)
-
modules/wpfeatures/class.wppp_wpfeatures_simple.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
wp-performance-pack.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-performance-pack/trunk/admin/class.admin-renderer.php
r2228316 r2250533 112 112 113 113 public function render_options() { 114 wp_localize_script( 'wppp-admin-script', 'wpppData', array( json_encode( array() ) ) ); // to prevent javascript error localize "empty" data 114 115 ?> 115 116 <h3 class="title"><?php _e( 'Modules', 'wp-performance-pack' ); ?></h3> -
wp-performance-pack/trunk/modules/disable_widgets/class.wppp_disable_widgets.php
r2235673 r2250533 18 18 } 19 19 20 function early_init () {20 function early_init() { 21 21 $this->known_default_widgets = $this->wppp->get_option( 'wppp_known_default_widgets' ); 22 22 … … 25 25 // This action (function defined in "wp-includes/widgets.php") would try to register all widget classes from "default-widgets.php" 26 26 remove_action( 'init', 'wp_widgets_init', 1 ); 27 // by removing the original action the action "widgets_init" won't be fired28 // so always add the override which will at least fire "widgets_init"29 add_action( 'init', array( $this, 'init_wp_default_widgets' ), 1 );30 27 } 31 28 32 function init _wp_default_widgets() {33 // Fires after all default WordPress widgets have been registered.29 function init() { 30 // Load and register only the via WPPP enabled core widgets 34 31 foreach( $this->known_default_widgets as $widget => $files ) { 35 32 if ( !in_array( $widget, $this->wppp->options[ 'disabled_widgets' ] ) ) { … … 41 38 } 42 39 43 // because "load_default_widgets" in early_init did return false, the widget submenu wasn't added44 // so add the menu if any widget was added or if any other plugin or theme already has added a widget45 //if ( $this->default_widget_loaded ) 46 add_action( '_admin_menu', 'wp_widgets_add_menu' );47 48 do_action( 'widgets_init' ); 40 // Because "load_default_widgets" in early_init did return false, the widget submenu wasn't added yet 41 add_action( '_admin_menu', 'wp_widgets_add_menu' ); 42 43 // The "original" action "wp_widgets_init" normally fires the action "widgets_init". 44 // This hasn't happend yet (because the action was removed in early_init) do so now 45 do_action( 'widgets_init' ); 49 46 } 50 47 -
wp-performance-pack/trunk/modules/disable_widgets/class.wppp_disable_widgets_simple.php
r2214271 r2250533 12 12 13 13 public function render_options () { 14 ?> 14 wp_localize_script( 'wppp-admin-script', 'wpppData', array( json_encode( array() ) ) ); // to prevent javascript error localize "empty" data 15 ?> 15 16 <h3 class="title"><?php _e( 'Disable widgets', 'wp-performance-pack' );?></h3> 16 17 … … 20 21 21 22 <hr/> 22 <?php23 <?php 23 24 } 24 25 } -
wp-performance-pack/trunk/modules/dynamic_images/class.wppp_dynamic_images.php
r2240498 r2250533 55 55 56 56 function early_init () { 57 add_action( 'setup_theme', array( $this, 'replace_wp_rewrite' ) ); 57 if ( $this->wppp->is_network ) { 58 add_action( 'setup_theme', array( $this, 'replace_wp_rewrite' ) ); 59 } 58 60 } 59 61 … … 83 85 84 86 function replace_wp_rewrite() { 85 if ( $this->wppp->is_network ) { 86 include( sprintf( "%s/class.wppp_rewrite.php", dirname( __FILE__ ) ) ); 87 $rewrite = new WPPP_Rewrite(); 88 $rewrite->wppp = $this->wppp; 89 $GLOBALS['wp_rewrite'] = $rewrite; 90 } 87 include( sprintf( "%s/class.wppp_rewrite.php", dirname( __FILE__ ) ) ); 88 $rewrite = new WPPP_Rewrite(); 89 $rewrite->wppp = $this->wppp; 90 $GLOBALS['wp_rewrite'] = $rewrite; 91 91 } 92 92 -
wp-performance-pack/trunk/modules/l10n_improvements/class.wppp_mo_dynamic.php
r2235673 r2250533 9 9 * Author: Bjoern Ahrens <bjoern@ahrens.net> 10 10 * Author URI: http://www.bjoernahrens.de 11 * Version: 2.1. 211 * Version: 2.1.3 12 12 */ 13 13 … … 120 120 $current_url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 121 121 if ( ( $len = strlen( $_SERVER['QUERY_STRING'] ) ) > 0 ) { 122 $current_url = substr ( $current_url, 0, strlen($current_url) - $len - 1 );122 $current_url = substr( $current_url, 0, strlen($current_url) - $len - 1 ); 123 123 } 124 124 if ( substr( $current_url, -10 ) === '/wp-admin/' ) { … … 513 513 if ( $t !== false ) { 514 514 if ( false !== ( $i = strpos( $t, self::PLURAL_SEP ) ) ) { 515 return substr( $t, self::PLURAL_SEP, $i );515 return substr( $t, 0, $i ); 516 516 } else { 517 517 return $t; -
wp-performance-pack/trunk/modules/wpfeatures/class.wppp_wpfeatures_simple.php
r2209823 r2250533 12 12 13 13 public function render_options () { 14 ?> 14 wp_localize_script( 'wppp-admin-script', 'wpppData', array( json_encode( array() ) ) ); // to prevent javascript error localize "empty" data 15 ?> 15 16 <h3 class="title"><?php _e( 'WordPress features', 'wp-performance-pack' );?></h3> 16 17 … … 20 21 21 22 <hr/> 22 <?php23 <?php 23 24 } 24 25 } -
wp-performance-pack/trunk/readme.txt
r2241642 r2250533 4 4 Requires at least: 4.7 5 5 Tested up to: 5.3.2 6 Stable tag: 2.2. 46 Stable tag: 2.2.5 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 127 127 == Changelog == 128 128 129 = 2.2.5 = 130 * Fixed some JavaScript errors in options. 131 * [mo-dynamic] Fixed PHP notice (thanks @erwinbr) 132 * Some minor changes and improvements 133 129 134 = 2.2.4 = 130 135 * [dynimg] Delete rewrite rules on plugin deactivation (thanks @lucabarelli) -
wp-performance-pack/trunk/wp-performance-pack.php
r2241623 r2250533 4 4 Plugin URI: http://wordpress.org/plugins/wp-performance-pack 5 5 Description: Performance optimizations for WordPress. Improve localization performance and image handling, serve images through CDN. 6 Version: 2.2. 46 Version: 2.2.5 7 7 Text Domain: wp-performance-pack 8 8 Author: Björn Ahrens … … 25 25 */ 26 26 27 27 /** 28 * Base class for all WPPP modules 29 * @abstract 30 */ 28 31 abstract class WPPP_Module { 29 32 protected $wppp = NULL; 30 33 31 // return if module is available, i.e. can be activated 32 public function is_available() { return true; } 33 34 // validate options 35 // input contains actual input 36 // output contains the output so far 37 // unset processed options in input 34 /** 35 * Test is the module is available, i.e. are all requirements met in order for the 36 * module to get activated 37 * 38 * @return bool 39 */ 40 public function is_available() { return true; } 41 42 /** 43 * Validate options. Processed options should get unset in input 44 * 45 * @param array input Contains actual input values 46 * @param array output Contains the output so far 47 * @param array default Default values for this module 48 */ 38 49 public function validate_options( &$input, $output, $default ) { 39 50 foreach ( $default as $optname => $opt ) { … … 71 82 } 72 83 73 public function __construct ( $parent ) { $this->wppp = $parent; } 74 // initializations done at WPPP construction 84 public function __construct( $parent ) { $this->wppp = $parent; } 85 86 /** 87 * Override for initializations at WPPP construction 88 */ 75 89 public function early_init() {} 76 // initializations done at init action 90 91 /** 92 * Override for initializations at "init" action 93 */ 77 94 public function init() {} 78 // initializations done at admin_init action 95 96 /** 97 * Override for initializations at "admin_init" action 98 */ 79 99 public function admin_init() {} 80 100 81 101 // admin render functions 82 public function load_renderer () {}83 84 public function add_help_tab ( $renderer ) {102 public function load_renderer() {} 103 104 public function add_help_tab( $renderer ) { 85 105 $this->load_renderer( $renderer->view ); 86 106 if ( $this->renderer !== NULL ) { … … 88 108 } 89 109 } 90 public function render_options ( $renderer ) {110 public function render_options( $renderer ) { 91 111 $this->load_renderer( $renderer->view ); 92 112 if ( $this->renderer !== NULL ) { … … 97 117 98 118 class WP_Performance_Pack { 99 const cache_group = 'wppp1.0'; // WPPP cache group name = wppp + version of last change to cache. This way no cache conflicts occur while old cache entries just expire. 100 const wppp_version = '2.2.4'; 119 /** 120 * WPPP cache group name = wppp + version of last change to cache. This way no cache 121 * conflicts occur while old cache entries just expire. 122 * 123 * @const string 124 */ 125 const cache_group = 'wppp1.0'; 126 127 /** 128 * WPPP version 129 * 130 * @const string 131 */ 132 const wppp_version = '2.2.5'; 133 134 /** 135 * Name for WPPP options 136 * 137 * @const string 138 */ 101 139 const wppp_options_name = 'wppp_option'; 102 140 … … 233 271 } 234 272 } 235 273 236 274 // check that WPPP is loaded as first plugin 237 275 self::plugin_load_first(); … … 242 280 } 243 281 244 public function init () {282 public function init() { 245 283 // execute "late" updates 246 284 foreach ( $this->late_updates as $updatefunc ) {
Note: See TracChangeset
for help on using the changeset viewer.