
內容簡介
優化所包含的 JavaScript 和 CSS 文件可能是一個非常重要的事情,如果您想要更快的網站。許多 WordPress 插件帶有多個第三方和/或自己的 JavaScript 文件,這些文件通常會在您網站的每個頁面上包含。在最糟糕的情況下,您的網站上可能會包含多個相同的文件。這會使您的網站變慢!
但是,“渲染阻塞”也很容易使網站變慢。在您的網站標頭中包含的每個外部 JavaScript 或 CSS 文件都會阻止網站渲染,直到所有文件完全處理完畢。通常會將所有這些腳本和樣式(除了關鍵 CSS)移至您網站的頁腳,以便不再阻止渲染並加快網站加載速度。
這就是 WP Script Optimizer 的用途!它使您能夠控制每個註冊的 JavaScript 或 CSS 文件的輸出。您可以輕鬆創建規則或完全停用文件。您還可以將文件移至您網站的標頭或頁腳。
請查看以下列表以了解所有目前可用的和計劃中的功能。如果您喜歡此插件,請投票並留言。這將非常有幫助。
您目前可以使用 WP Script Optimizer 做什麼
獲取您網站包含的所有前端 JavaScript 和 CSS 文件的概述(按類別劃分)
為您想要控制的多個單獨頁面或全局設置腳本和樣式
更改特定 JavaScript 或 CSS 或全部通過位置(標頭/頁腳)
如不需要,完全停用特定的 JavaScript 或 CSS 文件
通過使用 wordpress 的條件標籤輕鬆創建邏輯規則,以控制是否包含文件
您未來可以使用 WP Script Optimizer 做什麼(計劃中但目前未實現)
縮小和/或加密 JavaScript 和 CSS 文件
包含您自己的 JavaScript/CSS 文件或 JavaScript/CSS 內聯代碼,而不需要通過 functions.php 手動執行
將額外代碼添加到任何已註冊的 JavaScript 或 CSS 文件中
將一種類型(JS 或 CSS)的兩個或更多(或所有)文件連接起來,以加快加載時間
更好地瞭解相關方和其相關性
…歡迎提出建議 :)
重要 – 請閱讀:
該插件無法決定特定情況下是否需要文件。您的設置有可能破壞您網站的功能。如果是這種情況,您可以輕鬆通過管理面板更改或刪除您的設置,以便一切恢復到以前的狀態。
簡而言之:您必須知道自己在做什麼😉
如果您在使用此插件時遇到任何問題,請與我聯繫,以便我修復問題。請勿在未給我矯正問題的機會下給予負面評論。謝謝。
外掛標籤
開發者團隊
② 後台搜尋「WP Scripts & Styles Optimizer」→ 直接安裝(推薦)
原文外掛簡介
Optimization of included JavaScript- and CSS-files can be a very important thing, if you want a faster site. Many WordPress plugins comes with multiple third-party and/or own JavaScript-files that are then often be included on every page of your site. In worst cases you have more than one of the same file included on your site. That slows down your site!
But also “Render blocking” can easily slow down a website. Every external JavaScript- or CSS-file, that is included in the head of your site, blocks the site from rendering, until all files are completely processed. It’s a common practice to move all these Scripts and Styles (except critical CSS) to the footer of your site, so the rendering is no longer blocked and your website loads faster.
This is where WP Script Optimizer helps you! It makes it possible to control the output of every registered JavaScript or CSS-file. You can easily create rules for it or deactivate files completely. You can also move files to the footer of your site or vice versa.
Check out the following lists for all currently avaiable and planned features. If you like this plugin, please upvote and comment. That would be really helpful.
What you can currently do with WP Script Optimizer
Get an overview of all frontend JavaScript and CSS files, that are included on your site (divided in categories)
Control scripts and styles for as many single pages as you want or simply globally
Change the positioning (Header/Footer) of specific JavaScripts / CSS or all at once
Deactivate specific Javascripts or CSS-files completely, if not needed
Easily create logical rules to control under which conditions a file is included or not (by use of wordpress’s conditional tags)
What you can do in future with WP Script Optimizer (planned, but not currently implemented)
Minify and/or encrypt JavaScript- and CSS-files
Include your own JavaScript/CSS files or JavaScript/CSS inline code, without do it manually through functions.php
Add extra code to any registered JavaScript or CSS-file
Concatenate two or more (or all) files of one type (JS or CSS) to speed up loading times
Better overview of dependents and its dependencys
… feel free to make suggestions 🙂
IMPORTANT – Please read:
This plugin can not decide if a file is needed or not needed in a specific situation. Your settings have the potential to break features and functions of your site. If that is the case, you can easily change or delete your settings via the admin panel, so everything will be like it was before.
tl;dr: you have to know what you’re doing 😉
If You had any problems with this plugin, please contact me, so i could fix it. Please don’t write a negative review without gave me the chance to correct any issues. Thanks.
