开发者 | greencp |
---|---|
更新时间 | 2022年9月25日 22:02 |
PHP版本: | 5.3 及以上 |
WordPress版本: | 6.0.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
Caching only works when using alternative MO implementation. To check if the cache works, activate WPPP debugging (requires Debug Bar) Plugin). This adds the panel WP Performance Pack to the Debug Bar. Textdomains using MO_dynamic implementation show information about translations loaded from cache. If no translations are getting loaded from cache, cache persistence isn't working.
Any persisten object cache will do, but it has to be supported in your hosting environment. Check if any caches like APC, XCache, Memcache, etc. are installed on your webserver and select a suitable cache plugin respectively. File based object caches should work always and might improve performance, same goes for data base based caches. Performance gains depend on the available caching method and its configuration.
Localization improvements are supported on multisite installations. When installed network wide only the network admin can see and edit WPPP options. Image handling improvements are only available if WPPP is network activated
In previous versions, WPPPs dynamic image resizing feature was based on Dynamic Image Resizer, at first with only some improvements. The first big change was a completely different way to serve the dynamically created images (using rewrite rules instead of the 404 handler), including support for the latest WordPress features. Since WPPP version 1.8 the way how creation of intermediate images at upload works also changed completely. Dynamic Image Resizer did prevent this by using different hooks called at upload. WPPP now overrides the registered image editors (those didn't exist when Dynamic Image Resizer was written) to only create the necessary metadata. This is way more robust and also works when editing images with WordPress. According to its author, Dynamic Image Resizer is intended only as a proof of concept. You might say, WPPPs dynamic image feature is the working implementation of that proof of concept.
Your first try should be the button "Restore static links" in WPPP settigns advanced view. That function will also be executed on deactivation of WPPP. If any errors occur (please post them in the support forums so I can try to improve the restore function), you can execute the following SQL query manually to restore the static links: UPDATE wp_posts SET post_content = REPLACE ( post_content, '{{wpppdynamic}}', 'http://your.base-url/wp-content/uploads/' ) You have to change the base URL (third parameter of REPLACE) to your uploads URL!
WPPP overrides WordPress' default implementation by using the override_load_textdomain hook. The fastest way for translations is using the native gettext implementation. This requires the PHP Gettext extension to be installed on the server. WPPPs Gettext implementation is based on Bernd Holzmuellers Translate_GetText_Native implementation. Gettext support is still a bit tricky and having the gettext extension installed doesn't mean it will work. As second option WPPP features a complete rewrite of WordPress' MO imlementation: MO_dynamic (the alternative MO reader). The default WordPress implementaion loads the complete mo file right after a call to load_textdomain, whether any transaltions from this textdomain are needed or not. This needs quite some time and even more memory. Mo_dynamic features on demand loading. It doesn't load a mo file until the first translation call to that specific textdomain. And it doesn't load the entire mo file either, only the requested translation. Though the (highly optimized) search for an individual translation is slower, the vastly improved loading time and reduced memory foot print result in an overall performance gain. Caching can further improve performance. When using MO_dynamic with activated caching, translations get cached using WordPress Object Cache API. Frontend pages usually don't use many translations, so for all Frontend pages one cache is used per textdomain. Backend pages on the other hand use many translations. So Backend pages get each their own individual translation cache with one base cache for each textdomain. This base cache consists of those translations that are used on all Backend pages (i.e. they have been used up to admin_init hook). Later used translations are cached for each page. All this is to reduce cache size, which is very limited on many caching methods like APC. To even further reduce cache size, the transaltions get compressed before being saved to cache.
Images don't get resized on upload. Instead intermediate images and respective meta data are created on demand. WPPP extends all registered image editors to prevent creation of intermediate image sizes by overriding the multi_resize function. As the classes get extended dynamically this should work with any image editor implementation. Serving the intermediate sizes is done using rewrite rules. Requests to none existent intermediate images are redirected to a special PHP file which loads only a minimum of necessary WordPress code to improve performance. Redirection is done via htaccess. If the requested file does exists it is served directly. When a none existend image is requested WPPP checks if the requested image size corresponds to a registered image size (either one of the default sizes "thumbnail", "medium" or "large" or any other sizes registered by themes or plugins). This check also tells WPPP if to crop the image while resizing. Only if this check passes the intermediate image is created. This prevents unwanted creation of thumbnails.
Most other plugins which allow you to disable widgets just unset the respective widgets in WordPress' global widget list. This doesn't prevent the widgets' code to be loaded. WPPP disables default loading of widgets completely and only loads those files required to create the enabled widgets. Available widgets are detected when the modules settings page is displayed by scanning the wp-includes/widgets folder for any classes extending WP_Widget. It only has a small impact on performance and memory usage but many small improvements can become quite big.