[WordPress] 外掛分享: WP247 Extension Notification Server

首頁外掛目錄 › WP247 Extension Notification Server
全新外掛
安裝啟用
尚無評分
3002 天前
最後更新
問題解決
WordPress 4.0+ PHP 5.6.31+ v1.0.1 上架:2017-12-11

內容簡介

概述:
WordPress 的強項在於透過擴充套件(外掛和佈景主題)的使用來自定義。WP247 擴充套件通知系統提供標準介面,供 WordPress 外掛開發者與他們的使用者溝通重要的外掛資訊。在設定頁面中,您可以完全控制 WP247 擴充套件通知系統會與哪些外掛溝通,以及哪些通知將繼續顯示。

通知:
WP247 擴充套件通知系統會一直顯示通知,直到被關閉。外掛開發者將每個通知分配為下列三種消失類型中的其中一種:
1. None 表示通知是不可關閉的,關閉按鈕不會出現。
2. Temporary 表示當您點擊關閉按鈕時暫時關閉通知。關閉後,該通知直到下次刷新管理頁面時才會顯示。
3. Permanent 表示當您點擊關閉按鈕後,通知將永久消失。不論外掛開發者選擇的消失設定為何,您都可以透過在 WP247擴充套件通知系統的設定中勾選通知標題旁的核取方塊或點擊通知底部右側的「永久消失」鏈接,完全消除任何通知。

設定:
WP247 擴充套件通知伺服器設置頁面是您向 WP247 擴充套件通知伺服器介紹您的擴充套件和通知的地方。
1. 擴充套件:此處是識別您的擴充套件的地方,這也將用在您的擴充套件代碼中(有關更多資訊,請參閱 API 說明主題),用以告訴 WP247 擴充套件通知客戶端外掛哪些擴充套件參與了擴充套件通知。擴充套件設定包括:
- 擴充套件名稱:您的外掛名稱。
- 擴充套件 ID:您的外掛網址中的識別字串。此應匹配您的外掛的目錄名稱。
- 擴充套件類型:套件類型(外掛或佈景主題)。
- 伺服器網址:這個網址將回應 WP247 擴充套件通知客戶端外掛的通知更新查詢。
- 頻率: WP247 擴充套件通知客戶端外掛查詢新通知更新的頻率。
2. 通知:這裡是您撰寫分發給您的外掛使用者的通知消息的地方。通知設定包括:
- 狀態:指示通知是否當 WP247 擴充套件通知客戶端外掛查詢任何通知更新時應該分發。
- 通知標題:通知標題。此將出現在顯示通知時的第一行。
- 通知類型:通知類型。這將確定通知出現的位置以及側邊框的顏色。
- 可消失性:通知是否可關閉,如果可以,是暫時還是永久關閉。不論此設定如何, WP247 擴充套件通知客戶端外掛都會允許客戶端網站永久關閉任何通知。
- 持續時間:識別應該顯示該通知多長時間。
- 通知內容:您要發送的消息。

API:
為了使用 WP247 擴充套件通知系統,您必須先配置您的擴充套件資訊。然後,這將用於您的擴充套件,以告訴 WP247 擴充套件通知系統,您的擴充套件參與了擴充套件通知。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.1) 或搜尋安裝

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

原文外掛簡介

OVERVIEW
The strength of WordPress is in it’s ability to be customized through the use of extensions (plugins and themes).
The WP247 Extension Notification System provides a standard interface for WordPress extension developers to communicate important information about their extension to their extension users.
The Settings page provides you with complete control over which extensions the WP247 Extension Notification System will communicate with and which notices will continue to be displayed.
NOTICES
The WP247 Extension Notification System will display notices until they are dismissed. The extension developer assigns one of three dismissibility types to each notice they send:

None indicates that the notice is not dismissible. The dismiss button will not appear.
Temporary indicates that the notice will be temporarily dismissed when you click the dismiss button. Once dismissed, the notice will not appear until the next time the Admin page is refreshed.
Permanent indicates that the notice will be permanently dismissed when you click the dismiss button. Once dismissed, the notice will not appear again.

Regardless of the dimissibility setting chosen by the extension developer, you can permanently dismiss any notice by clicking the Permanently Dismiss link at the lower right of the notice or by checking the checkbox next to the notice title in the WP247 Extension Notification System‘s Settings section.
SETTINGS
The WP247 Extension Notification Server Settings page is where you tell the WP247 Extension Notification Server about your extension and notices.
Extension
The Extension section is where you identify your extension. This information will also be used in your extension’s code (see the API help topic for more information) when polled by the WP247 Extension Notification Client plugin to see which extensions are participating in Extension Notifications. The Extension settings are:

Extension Name: The name your extension is known as.
Extension Id: The slug used by your extension. This should match the directory name your extension get installed into.
Extension Type: The type of extention (Plugin or Theme).
Server URL: The URL that will respond to the WP247 Extension Notification Client plugin’s notice update inquiries.
Frequency: How often should the WP247 Extension Notification Client plugin’s inquire about new notice updates.

Notice
The Notice section is where you compose the notification message that is to be distributed to your extension’s users. The Notice settings are:

Status indicates whether or not the notice should currently be distributed when the WP247 Extension Notification Client plugin inquires about any notice updates.
Notice Title: The title of your notice. This will appear on the first line when the notice is displayed.
Notice Type: The type of notice. This will determine where the notice appears and what color the side border will be.
Dismissability: Whether or not the notice is dismissible and if so, temporarily or permanently. Regardless of this setting, the WP247 Extension Notification Client plugin will allow the client site to permanently dismiss any notice.
Duration: Identifies how long should this notice be displayed to the client.
Notice Content: The message you desire to send.

=API=
In order to use the WP247 Extension Notification System you must first configure your extension information. This will then be used in your extension to tell the WP247 Extension Notification System that your extension is participting in extension notifications.
You will then need to modify your extension so that it reaponds to the wp247xns_client_extension_poll filter.
First, you must modify your extension to tell WordPress that you are responding to the wp247xns_client_extension_poll filter:
add_filter( "wp247xns_client_extension_poll_{extension_type}_{extension_id}", "my_routine" );

Then you must create a function in your extension to respond to the filter:
function my_routine( $extensions ) {
return array(
"name" => "Your Extension name",
"id" => "your-extension-id",
"type" => "plugin",
"version" => "", // your extension's version number (not required)
"server_url" => "http://your-extension-wordpress-url/wp-admin/admin-ajax.php",
"frequency" => "1 day", // (not required) defaults to "1 day"
);
}

That’s it. The WP247 Extension Notification System will take care of the rest!
Co-requisite
One final note. In order for your users to receive your notices, they must have installed and activated the WP247 Extension Notification Client plugin. You may want to prompt your users to install and activate this plugin if it is not active at the time your extension is loaded. For your convenience, we have provided a standardized method for accomplishing this.
First, copy the /wp-content/plugins/wp247-extension-notification-server/admin/wp247xns-client-corequisite-notice folder to your extension’s Admin folder.
Next, modify your extension to instantiate the WP247XNS_Client_Corequisite_Notice class. Something like:
require_once 'wp247xns-client-corequisite-notice/wp247xns-client-corequisite-notice.php';
$my_wp247xns_client_corequisite_notice
= new WP247XNS_Client_Corequisite_Notice( 'Your extension name' );

The WP247XNS_Client_Corequisite_Notice class constructor takes from one to three parameters:
WP247XNS_Client_Corequisite_Notice(
$extension_name,
$nag_frequency = '30 days',
$text_domain = 'wp247xns-client-corequisite-notice'
);

This will result in a notice being displayed to your extension’s users when either the WP247 Extension Notification Client plugin is not activated or your particular extension is not enabled to participate in the WP247 Extension Notification System. They will be able to dismiss the nottice, but it will be re-displayed after the nag frequency has passed.
Privacy Policy
Rest assured that the WP247 Extension Notification System does not capture any information about your site and does not send any information about your site when servers are polled for new notices.
In addition, the WP247 Extension Notification System does not capture any information from the client’s site.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon