前言介紹
- 這款 WordPress 外掛「Catenis API Client for WordPress」是 2019-01-02 上架。 目前已經下架不再更新,不建議安裝使用。
- 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
- 上一次更新是 2022-10-06,距離現在已有 940 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 5.8 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
Catenis | blockchain | Catenis API | Blockchain of Things |
內容簡介
Catenis API 客戶端是一款 WordPress 外掛,可讓 WordPress 頁面上的 JavaScript 代碼與 Catenis API 進行交互。
啟用 Catenis API 客戶端
要啟用特定 WordPress 頁面的 Catenis API 客戶端,請前往該頁面的編輯頁面,尋找位於主編輯面板下方的名稱為「Catenis API 客戶端」的區域(元框),確保該區域已展開,並勾選「載入 Catenis API 客戶端」勾選框。
然後,您可以選擇覆寫全域設置,使用不同的設備 ID 和其相關的 API 訪問密鑰在該給定頁面上實例化 Catenis API 客戶端。否則,將會使用插件全域設置中配置的設置,其在「設置」|「Catenis API 客戶端」下配置。
使用 Catenis API 客戶端
啟用後,全域 JavaScript 變數 ctnApiClient 會在該頁面上被加載,該變數保存實例化的 Catenis API 客戶端對象。
使用 ctnApiClient 變數調用 Catenis API 方法,通過在該對象上調用相應的方法來實現。
有關可用方法的參考,請參閱 Catenis API JavaScript 客戶端,它與 WordPress 的 Catenis API 客戶端在功能上幾乎相同,除了通知支持和錯誤處理。
通知支持
WordPress 的 Catenis API 客戶端的通知功能與 Catenis API JavaScript 客戶端上的功能幾乎相同。兩個明顯的不同點是:
Catenis API 對象可以發出 comm-error 事件。
WebSocket 通知通道對象發出的 open 事件可能會返回錯誤。
有關如何在 WordPress 頁面中接收 Catenis 通知的詳細信息,請參閱下面的「接收通知」部分。
錯誤處理
調用 Catenis API 方法時發生的錯誤將以標準 JavaScript 錯誤對象的形式返回。
接收通知
=實例化 WebSocket 通知通道對象
為特定的 Catenis 通知事件創建一個 WebSocket 通知通道。
var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName);
添加事件監聽器
添加事件監聽器以監測通知通道上的活動。
ctnApiClient.on('comm-error', function (error) {
// 與 Catenis 通知過程通信時出現錯誤
});
wsNotifyChannel.on('open', function (error) {
if (error) {
// 確立基礎 WebSocket 連接時出現錯誤
}
else {
// 通知通道成功開啟
}
});
wsNotifyChannel.on('error', function (error) {
// 基礎 WebSocket 連接出現錯誤
});
wsNotifyChannel.on('close', function (code, reason) {
// 基礎 WebSocket 連接已關閉
});
wsNotifyChannel.on('notify', function (eventData) {
// 收到通知
});
注意: 「comm-error」事件由 Catenis API 對象發出,而所有其他事件由 WebSocket 通知通道對象發出。
開啟通知通道
打開 WebSocket 通知通道以開始接收通知。
wsNotifyChannel.open(function (error) {
if (err) {
// 發送打開通知指令時出錯
}
});
原文外掛簡介
Catenis API Client for WordPress enables (JavaScript) code on WordPress pages to interact with the Catenis API.
Enabling the Catenis API client
To enable the Catenis API client for a given WordPress page, go to the page’s edit page and look for a section (meta box) named “Catenis API Client” below the page’s main editing panel. Make sure the section is expanded, and check the Load Catenis API Client checkbox.
You can then choose to override the global settings used for instantiating the Catenis API client on that given page, like using a different device ID and its associated API access secret. Otherwise, whatever is configured in the plugin’s global settings — configured under “Settings” | “Catenis API Client” — is going to be used.
Using the Catenis API client
Once enabled, a global JavaScript variable named ctnApiClient is made available on the page. That variable holds the instantiated Catenis API client object.
Use the ctnApiClient variable to call the Catenis API methods by invoking the corresponding method on that object.
For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally identical to the Catenis API Client for WordPress, except for notifications support and error handling.
Notifications support
The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client. The two noticeable differences are:
The Catenis API client object can emit a comm-error event.
The open event emitted by the WebSocket notification channel object may return an error.
Please refer to the “Receiving Notifications” section below for detailed information on how to receive Catenis notifications from within WordPress pages.
Error handling
Errors that take place while calling the Catenis API methods are returned as standard JavaScript Error objects.
Receiving Notifications
= Instantiate WebSocket notification channel object
Create a WebSocket notification channel for a given Catenis notification event.
var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName);
Add listeners
Add event listeners to monitor activity on the notification channel.
ctnApiClient.on('comm-error', function (error) {
// Error communicating with Catenis notification process
});
wsNotifyChannel.on('open', function (error) {
if (error) {
// Error establishing underlying WebSocket connection
}
else {
// Notification channel successfully open
}
});
wsNotifyChannel.on('error', function (error) {
// Error in the underlying WebSocket connection
});
wsNotifyChannel.on('close', function (code, reason) {
// Underlying WebSocket connection has been closed
});
wsNotifyChannel.on('notify', function (eventData) {
// Received notification
});
Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object.
Open the notification channel
Open the WebSocket notification channel to start receiving notifications.
wsNotifyChannel.open(function (error) {
if (err) {
// Error sending command to open notification channel
}
});
Close the notification channel
Close the WebSocket notification channel to stop receiving notifications.
wsNotifyChannel.close(function (error) {
if (err) {
// Error sending command to close notification channel
}
});
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Catenis API Client for WordPress」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0.0 | 1.1.0 | 1.1.1 | 1.1.2 | 2.0.0 | 2.1.0 | 2.2.0 | 3.0.0 | 4.0.0 | trunk |
延伸相關外掛(你可能也想知道)
Catenis Blocks 》Catenis Blocks 包含一組 Gutenberg 方塊,可通過 Catenis 服務,用於與比特幣區塊鏈集成。, 目前提供以下方塊:, , 存儲消息 - 用於將文本消息存儲到比特幣區...。
Crypto Market Price Inserter 》這個外掛讓你可以輕鬆地在頁面底部加入 javascript,然後就可以自動完成其餘工作。它會連接到 executium websocket 網路,通過查找加密貨幣單詞出現次數並在...。
Web3Press – Decentralize Publishing with Writing NFT 》對於你的粉絲來說,最好的產品就是你的創意。Web3Press 將你的文章發佈到區塊鏈上,讓你可以像平常一樣寫作但以不同的方式發佈。, Web3Press 提供一種創意的...。
WordProof Timestamp 》WordProof:在區塊鏈上將您的 WordPress 內容進行時間戳記, 使用 WordProof Timestamp,您可以輕鬆地在 EOSIO 區塊鏈上時間戳記您的 WordPress 內容,無需任...。
Chainwire Integration 》Chainwire 是您在加密貨幣和區塊鏈領域的一站式廣播商店。使用保證報導和詳細 analytics 自動將您的新聞稿發佈到主要的出版物。, 此外掛程式允許您直接與我們...。
SteemPress 》SteemPress 是一個 WordPress 外掛,可將任何網誌與 Hive 區塊鏈相連接。, Hive 是一個區塊鏈,使用者可透過按讚獲得基於 Hive 區塊鏈上的加密貨幣 HIVE 的獎...。
Exxp 》Exxp 讓你的博客連接到 Hive 區塊鏈。, 它會自動將你的文章備份到 Hive 區塊鏈,透過反向鏈接提高你的 SEO,同時還能讓你賺取代幣。, 你還可以從由 Hive 提供...。
Kredeum NFTs, the easiest way to sell your NFTs directly on your WordPress site 》s.kredeum.tech/sell-your-nfts-on-your-sites., , WordPress 的 Kredeum NTFs 外掛程式,讓您可以:, * 免費儲存所有媒體到 IPFS(分散式儲存技術),保障您...。
Crypto Tool 》讓使用者透過 Metamask 登入您的網站。, 自動註冊功能消除了使用者記憶網站密碼的需求。, [crypto-connect] – 將此短代碼放在任何一個頁面上,就可以...。
CardanoPress – Cardano Blockchain Integration for WordPress 》CardanoPress透過Blockfrost API將所有重型和集成工作完全處理,讓您能夠透過喜愛的Web3錢包與Cardano區塊鏈互動。, 我們已經完成所有的技術和困難工作,讓建...。
NFT Galleries 》在您的網站上展示 NFT 畫廊。只需連接您的錢包,自定義設計,選擇要展示的 NFT,並將畫廊嵌入 WordPress 網站上的任何頁面或文章。, 查看 NFT 畫廊演示 | 我...。
Chainium – Blockchain Integrations & Web3 Crypto Wallet Authenticator 》總結:Chainium 是一個適用於 WordPress 的 Web3 錢包身分驗證器和區塊鏈連接外掛程式。通過 Chainium,您可以輕鬆將您的網站連接到區塊鏈,並使用用戶的 Web...。
WordThree – Easily Login & Register Using Your MetaMask Wallet 》WordThree 將與您的 WordPress 網站整合,輕鬆允許用戶使用他們的 MetaMask 錢包進行登錄或註冊。激活後,一個 MetaMask 登錄按鈕會自動添加到默認的 WordPre...。
Token / NFT / Blockchain Page Gating 》透過 Lit Protocol,根據區塊鏈條件(例如NFT擁有權或 DAO 成員資格)對 WordPress 頁面進行門禁管理。支援以太坊和大多數 EVM 鏈。, 提醒!您必須停用“AMP” ...。
WazirX – Free Cryptocurrency Widgets | Price Ticker & Coin List 》WazirX 推薦計劃 是一種輕鬆賺取 passsive income(被動收入)的方式。使用 WX Crypto Shortcodes 在您的網站中顯示加密貨幣的指數、圖表、價格表和計算器。,...。