Linux 软件免费装
Banner图

Optimize Scripts & Styles

开发者 seismicpixels
更新时间 2024年5月8日 10:04
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 6.5
版权: GPLv2 or later
版权网址: 版权信息

标签

performance seo combine optimization styles optimize scripts compress minify

下载

1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 1.9.2 1.8.1 1.9.4 1.9.3 1.9.5

详情介绍:

Optimize Scripts & Styles optimizes your site's JavaScript and CSS files by combining, minifying and caching them. This will help your site's overall performance and user experience by reducing the number of files served up and the overall size of these files. For developers, this allows you to maintain uncompressed versions for development themes or plugins, while compressing them for a production environment. For you SEO buffs, it cleans up the number of scripts that get included and downloaded to your site visitors, helping your overall PageSpeed score. Header and footer script locations are maintained as well as any localized data used for the scripts and the minified files are stored in the /cache folder, making it friendly for plugins like WP Super Cache. Media attributes are also maintained for print stylesheets. Features

安装:

  1. Upload the plugin files to the /plugins/ directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. Configure the plugin through 'Settings' > 'Optimization'

屏幕截图:

  • Cached Files List
  • Pre-Optimized Header
  • Optimized Header
  • Pre-Optimized Footer
  • Optimized Footer

升级注意事项:

1.8 This update fixes the way the plugin keeps track of already processed scripts. You should be using at least this version.

常见问题:

Will this work with caching plugins?

This plugin was born out of a frustration with the method of combining scripts in W3 Total Cache. Simply disable the minification portion of W3 and use this plugin to manage it instead. Clearing the cache will also clear these scripts for you. It has also been tested with WP Super Cache. When you clear the cache in WP Super Cache, the contents of the optimized scripts and styles folders are also removed, triggering the creation of new versions.

How are scripts and styles found in the site?

All local scripts and styles registered via wp_register_script, wp_enqueue_script, wp_register_style, wp_enqueue_style will be included in the optimized and versions. Plugins or themes that add scripts directly will not have their scripts or styles included. This plugin ignores off-site scripts and styles. Those will load as they normally would.

Why are some scripts or styles not included?

Certain custom implementations of scripts or styles that do not use the WordPress standard methods may not be included. The administrative interface provides you a quick way of tracking down exactly what is in each file so that you can make tweaks if needed.

Can I ignore certain scripts or styles?

Yes! You can provide a comma separated list of script or style handles to ignore them. View the Cached files section to get the handles you need. jQuery is always ignored as many components rely on jQuery being available.

Where can I see what scripts are included?

Each file that is generated has a matching .txt file in the cache folder which gives details about what was included. The content of these files is listed in the admin area as well. = Why does it look like my site is broken after optimizing styles? Theme and plugin developers can include their styles in multiple ways, some correct, some a bit hacky. You may need to use the Ignore Settings to ignore certain stylesheets if they are not cascading correctly. Use the Cached files section to discover which styles are included and add the handles in the Ignore styles area, separated by commas. Ignored stylesheets will load after the compressed version used by this plugin. This can be helpful if you want one file with some overrides in it. = Does this include PHP scripts that masquerade as JavaScript or CSS? The plugin checks for .css and .js file extensions before including them in the optimized files. If you have a theme that uses php files that masquerade as JavaScript or CSS, those PHP files will be ignored and load after the compressed scripts or styles used in the plugin. If you have a CSS file that needs to override the styles from the PHP generated styles, you may need to add that stylesheet to the ignore list so that it can load in the correct order.

Does this plugin combine and minimize Admin scripts?

No.

Why does this not work while logged in?

Optimization may be disabled for logged in users. Check your plugin settings. It is recommended to leave this option off.

更新日志:

1.9.5 1.9.4 1.9.3 1.9.2 1.9.1 1.9.0 1.8.9 1.8.8 1.8.7 1.8.6 1.8.5 1.8.4 1.8.3 1.8.2 1.8.1 1.8 1.7 1.6 1.5 1.4 1.3 Added check for file_get_contents http wrapper 1.2 Added in support for conditional stylesheets