[WordPress] 外掛分享: Efficient Related Posts

首頁外掛目錄 › Efficient Related Posts
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
900+
安裝啟用
★★★★
4.1/5 分(17 則評價)
3679 天前
最後更新
問題解決
WordPress 2.8+ v0.5 上架:2009-06-15

內容簡介

與相關文章外掛有一個 問題,Efficient Related Posts 透過不同的方式解決了這個問題,並提供了非常不同的解決方案。

基本上,目前的相關文章外掛是在用戶需要查看它時才會即時建立相關文章清單。由於博客的瀏覽次數遠比更新頻繁(通常會多出數倍以上),因此這些查詢運行的次數遠遠超出需要運行的次數。這不僅浪費了 CPU 周期,而且如果查詢速度很慢(如果您有數千篇文章和標籤,則速度肯定會很慢),那麼用戶將會經歷緩慢的頁面加載,體驗非常糟糕。

Efficient Related Posts 將所有的工作都轉移到管理部分,在用戶查看文章之前就在保存文章時就找到相關的文章。優點在於如果查詢速度很慢,它發生的次數會減少,而等待的時間是文章撰寫者,而不是用戶(我認為這更好)。

當然也有限制。例如,由於相關文章是作為文章元數據存儲的,因此我們只存儲一定數量的相關文章(默認為 10,但您可以將其設置為您想要的任何數量)。這意味著如果您決定需要顯示超過 10 篇相關文章,您需要重複處理所有文章。我通常只顯示最多 5 篇相關文章,但存儲 10 篇,以防萬一我決定在某些區域顯示更多相關文章。此外,由於相關文章是在保存文章時計算的,通過數據庫手動添加標籤將不會對相關文章產生影響,盡管我建議不要這樣做。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.5) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Efficient Related Posts」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

There is a problem
with related posts plugins, and Efficient Related Posts is fixing that by
approaching the problem from a different direction and offering a very different
solution.
Basically, current related post plugins build the list of related posts on the
fly when the user needs to view it. Since blogs tend to be viewed far more
often than they are updated (often hundreds of times more often), these queries
are run way more times than they need to be. This not only wastes CPU cycles,
but if the queries are slow (which they will be if you have 1000s of posts and
tags) then the user gets a poor experience from slow page loads.
Efficient Related Posts moves all this effort into the admin section, finding
related posts when a post is saved rather than when the user views it. The
advantage is that if the query is slow it happens less often and the post writer
is the one that waits rather than the user (which I think is WAY better).
There are limitations. For example, since the related posts are stored as post
meta data, we only store a certain number of them (10 by default, but you can
set it to whatever you want). This means that if you decide you need to display
more than 10, you need to have the plugin re-process all posts. I generally
display up to 5 related posts, but store 10 just in case I decide to display
more in some areas. Also, since the related posts are calculated when a post is
saved, manually adding a tag through the database will have no effect on the
related posts, although I recommend not doing that anyway.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon