內容簡介
此外掛可讓您從媒體庫中優化圖片,從而提高網站的 SEO 效能。
此外掛基於 JPEGOPTIM 實用程式和 PNGQUANT 實用程式,必須安裝在您的主機上。
本插件的精髓在於開始時,它會瀏覽您 WP 網站的所有文章附件
並在其所在的位置進行處理。
處理完成後,將附件標記為已處理,以防止重複處理。
在管理頁面中,您可以查看圖片總數和處理的圖片數量,
以及選擇在一個週期內處理的圖片數量。
目前,優化程式的腳本是以標準的 wp-action 的形式製作的(其名稱為“startklar_image_optimizer_process”)
可以從另一個地方調用。
以下是調用此操作的示例:
do_action ( ‘startklar_image_optimizer_process’ );
例如,對於簡單的實現,您可以使用 “WP Crontrol” 插件(https://ru.wordpress.org/plugins/wp-crontrol/)
通過此插件,您可以創建一個 cron 任務,可以優化每分鐘一個圖像。
採取這種策略是為了在不對站點施加過多負載的情況下處理網站的所有文件
(因為 WP 中的原生 cron 是通過點擊啟動的,並且具有運行時間限制,就像此主機的類似 http 會話一樣)。
截圖 #1 顯示了設置 cron 任務的簡單方法。
外掛標籤
開發者團隊
原文外掛簡介
This plugin allows you to optimize images from your media library and thus improve the SEO performance of your site.
This plugin is based on the JPEGOPTIM utility and PNGQUANT utility which must be installed on your host.
The essence of our plugin is that when it starts, it sorts through all the attachments for the articles of your WP-site
and processes them right at the place where they are located.
After that, the attachment is marked as processed, which prevents it from being processed again.
In the admin page you can view the total number of your images and the number of processed images,
as well as select the number of images to be processed in one cycle.
At the moment, the script for optimization is made in the form of a standard wp-action (its name is “startklar_image_optimizer_process”)
that can be called from another place.
Here is an example of how to call this action:
do_action( ‘startklar_image_optimizer_process’ );
For example, for a simple implementation, you can use the “WP Crontrol” plugin (https://ru.wordpress.org/plugins/wp-crontrol/)
by which you can create a cron task that can optimize one image every minute.
This tactic was chosen in order to process all the files of the site without introducing excessive load to the site
(since the native cron in WP is activated by hits and has a runtime limit, like similar http sessions of this host).
Screenshot #1 shows how easy it is to set up a cron-task.
