[WordPress] 外掛分享: cbnet Ping Optimizer

前言介紹

  • 這款 WordPress 外掛「cbnet Ping Optimizer」是 2010-01-06 上架。
  • 目前有 2000 個安裝啟用數。
  • 上一次更新是 2017-11-28,距離現在已有 2714 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.9 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

chipbennett |

外掛標籤

cbnet | Ping Optimizer |

內容簡介

您好!您可能會想知道為什麼您正在閱讀這篇文章,而不是查看外掛程式的設置。原因是,這個外掛程式已經沒有任何功能和設置了。

這是因為這個外掛程式的功能已經不再需要,實際上,這個外掛程式的功能可能從一開始就沒有必要。但不管怎麼樣,現在確實不再需要它。

讓我來解釋為什麼。首先,我們可以看一下WordPress中諸如ping等功能是如何運作的。簡單介紹一下,當一篇文章被創建、更新、插入或修改時,最終要通過wp_insert_post()進行處理。

wp_insert_post()調用wp_transition_post_status(),然後wp_transition_post_status()進行各種操作,其中最重要的是他調用以下方法:do_action("{$new_status}_{$post->post_type}", $post->ID, $post);這樣就會觸發new-status和new-post-type操作,而在這裡我們感興趣的是“publish”狀態,在"publish_post"上執行,因此publish_post就是我們需要的操作。

在wp-includes/default-filters.php中,我們可以看到以下代碼:

add_action( 'publish_post', '_publish_post_hook', 5, 1 );

這意味著publish_post會調用_publish_post_hook()。_publish_post_hook()會執行將“_pingme”post_meta添加到文章中,並為一次cron調用安排do_pings操作,在下一個頁面加載時(因為它是對time()進行掛鉤的定時任務),就會進行操作。

再看一下wp-includes/default-filters.php,我們可以看到以下代碼:

add_action( 'do_pings', 'do_all_pings' );

do_all_pings()函數將該時刻需要pings的所有文章的標記設置為已完成。

關於草稿、預定(future)和已編輯的文章:

草稿文章的發佈狀態為“draft”,即wp_transition_post_status()調用draft_post而不是publish_post;預定文章的發佈狀態為“future”,意味著wp_transition_post_status()調用future_post,而不是publish_post,因此,除非草稿或預定文章實際上發佈,否則它們不會發送ping,因為這是發佈文章操作才會啟動publish_post。

關於編輯文章:編輯現有文章會向博客發送ping,但do_all_pings()是智能的。它調用pingback() 函数向博客發送ping,然後該函數調用get_pung() 函数以獲取文章中已經成功ping過的URL。這是非常舊的代碼,事實上,已經被ping過的博客列表實際上是wp_posts表的主列(pinged)之一。

因此,考慮一下這個外掛程式的說明:

"Do you know your WordPress blog pings unnecessarily every time you edit a post? Think how many times you click on "Save and Continue Editing" or "Save" button. Your blog will ping unnecessarily that many times you click on those buttons.

Save your blog from getting tagged as ping spammer by installing this plugin.

After you install cbnet Ping Optimizer:

- When you create a new post, your blog will ping and notify all the ping services that it has been updated. This encourages search engines and different blog directories/services to index your updated blog properly.
- When you edit an existing post, it won't send any unnecessary ping to ping services and saves your blog from getting flagged as ping spammer."

現在我們已經了解了WordPress中ping的運作方式,可以看出,Ping Optimizer外掛程式已經不再需要了。

原文外掛簡介

Hello there! You may be wondering why you’re reading this, instead of looking at Plugin settings. Well, the reason that you’re not looking at Plugin settings is because there aren’t any Plugin settings anymore. In fact, this Plugin doesn’t have any functionality anymore.
Why? Because this Plugin’s functionality is no longer needed. In fact, this Plugin’s functionality may never have been needed in the first place. But regardless of that, it certainly isn’t needed now.
How Pings Work in WordPress
Let me explain why, starting with a walkthrough of how pings work in WordPress, courtesy of @Otto42:

When a post gets created, updated, inserted, modified, etc., eventually, it always goes through wp_insert_post().
wp_insert_post() calls wp_transition_post_status().
wp_transition_post_status() does various actions, but importantly it does this:
do_action(“{$new_status}_{$post->post_type}”, $post->ID, $post);
So the action of new-status and new-post-type is called. In this case, we’re interested in the publish status on the post post-type, so publish_post is the action hook.
In wp-includes/default-filters.php, we have this:
** add_action( ‘publish_post’, ‘_publish_post_hook’, 5, 1 );
** So that causes publish_post to call _publish_post_hook().
_publish_post_hook(), among other things, adds the ‘_pingme’ post meta to the post, and schedules the do_pings action for a one-time cron call, which will happen on the next page load (because it’s hooked to time() for the schedule).
Again in wp-includes/default-filters.php, we have this:
** add_action( ‘do_pings’, ‘do_all_pings’ );
The do_all_pings() function does all the pings for all the posts that are marked as needing them done at the moment.

Regarding draft, scheduled (future), and edited posts:

Draft posts have a post_status of draft, meaning that wp_transition_post_status() calls do_action() on draft_post rather than on publish_post. Scheduled posts have a post_status of future, meaning that wp_transition_post_status() calls do_action() on future_post rather than on publish_post. Thus, neither draft nor scheduled posts get pings sent for them until they actually transistion to publish, since that is when the publish_post action will get fired.
Editing posts: editing an existing post will send pings for the post, but do_all_pings() is smart. It calls the pingback() function to send pingbacks to blogs, and that in turn calls the get_pung() function to get the URLs in the post that have already been successfully pinged once before. This is very old code – so old, in fact, that the list of pinged blogs is actually a primary column (pinged) in the wp_posts table.

Why the Ping Optimizer Plugin Isn’t Needed
So consider again the Plugin description:

Do you know your WordPress blog pings unnecessarily every time you edit a post? Think how many times you click on “Save and Continue Editing” or “Save” button. Your blog will ping unnecessarily that many times you click on those buttons.
Save your blog from getting tagged as ping spammer by installing this plugin.
After you install cbnet Ping Optimizer:

When you create a new post, your blog will ping and notify all the ping services that it has been updated. This encourages search engines and different blog directories/services to index your updated blog properly.
When you edit an existing post, it won’t send any unnecessary ping to ping services and saves your blog from getting banned by such services.
When you post a future post by editing the time stamp, it will ping only when your post appears in future. It won’t unnecessarily ping many times when you schedule posts as WordPress does by default.

It should be obvious that most of that just isn’t true anymore.

Think how many times you click on “Save and Continue Editing” or “Save” button. Your blog will ping unnecessarily that many times you click on those buttons.

As you see above, this isn’t true. Saving a draft post does not fire the publish_post action; therefore, no pings are triggered.

When you create a new post, your blog will ping and notify all the ping services that it has been updated.

WordPress core functionality does this already.

When you edit an existing post, it won’t send any unnecessary ping to ping services and saves your blog from getting banned by such services.

As you see above, WordPress intelligently fires pings when a post is edited, by keeping track of previous successful pings and not re-pinging them.

When you post a future post by editing the time stamp, it will ping only when your post appears in future. It won’t unnecessarily ping many times when you schedule posts as WordPress does by default.

As you see above, scheduling a post fires the future_post action, and not the publish_post action. Thus, until a scheduled post actually transitions to publish, thereby firing the publish_post action, no pings are triggered.
So, none of this Plugin’s functionality is needed. You can safely deactivate and uninstall it, with the understanding of why the core WordPress handling of pings works just fine.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「cbnet Ping Optimizer」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


2.3 | 3.0 | 2.3.1 | 2.3.2 | 2.3.3 | trunk |

延伸相關外掛(你可能也想知道)

  • cbnet Multi Author Comment Notification 》這個外掛可以輕鬆地啟用對除了文章作者以外的使用者的新留言電子郵件通知。, 透過管理後台 -> 設定 -> 討論,您可以啟用電子郵件通知到網站管理員、使...。
  • cbnet Different Posts Per Page 》這個外掛可以讓您自訂所有索引頁面的文章數量,排序方式和排序參數,包括部落格文章索引頁面、搜尋索引頁面和所有存檔索引頁面(類別、標籤、分類系統、作者...。
  • cbnet Favicon 》從 WordPress 4.3 開始,此外掛已不再需要。下一個更新將把此外掛整合到核心網站圖示功能中,以實現外掛的優雅逐步退出。, 將一個網站圖示添加到您的網站。沒...。
  • cbnet Twitter Widget 》注意:Twitter 1.1 API 破壞了此小工具。儘管我可能會在未來某個時間再回來解決它,但修復它是非常低的優先級。, 此外掛是一個小工具,可添加 Twitter 工具小...。
  • cbnet MBP Auto-Activate 》此外掛仍與 WordPress 的最新版本相容,但我不再跟進任何 MBP 插件。, MaxBlogPress 插件需要進行兩步驟的註冊/啟用程序,以及強制訂閱電子郵件列表,才能使...。
  • cbnet Social Menu 》這個外掛程式新增了一個自定義小工具,讓你可以使用自定義導覽選單將社交網路的連結列表添加到任何佈景主題中。這樣,你就可以將社交資料從一個佈景主題轉換...。
  • cbnet Manage Plugins Donate Link 》這個 WordPress 外掛提供了一個快速方便的方式,讓你可以在「管理外掛」頁面的每一個外掛的 plugin_row_meta 中加上「贊助」連結,將外掛作者的贊助連結輕鬆...。

文章
Filter
Apply Filters
Mastodon