|
:
|
---|---|
|
* if directory is not writable for some reason, this feature will not work; requires the DOMDocument XML DOM Parser to be enabled in PHP (which it is by default) for maximum performance
style="opacity: 1;" style="opacity: 0.4;">
Note: When a file is added to a combined group of files, the CDATA as well as any other inline content (e.g. added via
:
: /wp-includes/js/admin-bar.min.js
To be 100% sure everything works fine after activation, consider using the checkbox option above to apply the changes only for logged-in administrator (yourself). If all looks good, you can later uncheck so the changes will apply to everyone. Any scripts having "defer" or "async" attributes (which are there for a reason) will be combined in their own groups and not together with other render-blocking scripts. This feature will not work IF:
|
|
. You can choose automatic inlining for JS files smaller than a specific size (in KB) or manually place the relative paths to the files (e.g. in case there is an exception for a larger file you wish to inline or just don't want to use the automatic inlining).
style="opacity: 1;" style="opacity: 0.4;">
Please be extra careful if you decide to use this feature as inlining JavaScript files can be trickier than inlining CSS ones due to the more complex syntax and various attributes that might set to the external JS file such as "async" & "defer" (the content of any JS having this attribute will be wrapped between
():
Note: Please input the sources to the original JavaScript files (one per line) like in the examples below, not to the cached/optimized ones (which are usually located in ). RegExes are accepted. Note that the hash (#) is automatically used as delimiter so you don't need to add it below. Examples (you don't have to add the full URL, as it's recommended to use relative paths, especially if you use dev/staging environments or change the domain name of your website): /wp-content/plugins/plugin-title/scripts/small-file.js
|
. |
The option should be enabled if any of the following applies:
|
. |
<SCRIPT> tags (inline & external) right after the <BODY> opening tag', 'wp-asset-clean-up'); ?>.
The option could be enabled if any of the following applies:
In case there is JavaScript that you wish to keep in the HEAD, you can add a unique string from the SCRIPT tag(s) in the textarea below (one per line): Note: A situation when SCRIPT tags should be loaded in the |
. |
/?custom-javascript=value_here, or /wp-content/plugins/plugin-name-here/js/generate-script-output.php?ver=1 ', 'wp-asset-clean-up'); ?>
e.g. Some plugins and themes have options to create your own layout / customise specific functionality settings and save the changes from the Dashboard. Instead of creating static JS files from the saved settings, the changes you made are retrieved from the database and the JavaScript content is created "on the fly", thus using more resources by loading the whole WP environment and make MySQL (or whatever database type if used) requests in order to print the JavaScript content. detects such requests and caches the output for faster retrieval. This very important especially if your website has lots of visits (imagine WordPress loading several times only from one visitor) and you're on a shared environment with limited resources. This will also make the user experience better by decreasing the page rendering time. |