[WordPress] 外掛分享: Unlock Protocol

首頁外掛目錄 › Unlock Protocol
WordPress 外掛 Unlock Protocol 的封面圖片
70+
安裝啟用
★★★★★
5/5 分(4 則評價)
960 天前
最後更新
問題解決
WordPress 5.1+ PHP 7.0+ v4.0.2 上架:2019-09-10

內容簡介

Unlock 是一個會員制協議,讓任何作者都可以自由地將其內容付費化。

您可以在此網站上嘗試範例,在該範例中,訪客會員與否將會影響文章的內容。

要成為會員,訪客需要使用支援 web3 的錢包,例如 MetaMask 或者支援嵌入錢包的瀏覽器,例如Opera,並且需要有加密貨幣的餘額來購買會員資格。

開始

若想要在您的網站上添加 Unlock 的鎖定功能,請先參考如何部署鎖定功能。

當鎖定功能部署進行中時,您可以從 WordPress 網站下載此外掛程式。接著,在您 WordPress.org 網站的管理頁面中,在「插件」選項中,點擊「新增」並選擇「上傳外掛程式」來上傳此外掛程式。

注意:若要允許新用戶使用 Ethereum 錢包一鍵登入,請確認設定中「設定 > 一般 > 允許任何人進行註冊(單一網站)」或「網路設定 > 允許新使用者註冊 > 可以註冊使用者帳戶(多站點)」均已啟用。無論這項設定是否啟用,現有用戶都可以將其錢包連結至 WordPress 用戶帳戶。

撰寫被鎖定的文章

此外掛程式提供了一個區塊,可在 Gutenberg 編輯器中用於文章和頁面中。

Unlock Protocol 區塊用於在頁面/文章內容中添加鎖定功能。若要將此區塊添加至您的頁面/文章中,請參考以下步驟:

點擊「發佈文章 > 新增文章」
只需要在編輯器中點擊「+」來添加區塊。
在搜尋欄中輸入「Unlock Protocol」。
找到 Unlock Protocol 區塊,並點擊即可添加。
您可以在右側區塊設定中查看區塊設定。請至少添加一個鎖定功能,選擇正確的網路並輸入其地址。

當您的頁面或文章包含所需的內容時,您可以像任何其他 WordPress 文章或頁面一樣預覽其內容。我們建議使用支援多個帳戶的 web3 錢包,這樣您可以輕鬆切換已成為會員和尚未成為會員的帳戶!

貢獻

此外掛程式像所有 Unlock 代碼一樣是開源的,我們鼓勵您對其進行分支和進行任何更改!若您認為這些更改對他人有益,我們也鼓勵您開啟 Pull Request,以便將其添加至在 wordpress.org 網站上發佈的主要分支上!

本地開發

若要使用 Lando 本地開發環境建立此外掛程式,可簡單地從GitHub複製該存儲庫並運行以下命令

lando start

有關現場編輯,從 assets 目錄开始,編輯 main.scss 時,您可以運行:

lando npm run start

編輯與區塊相關的 JS 或 CSS 時,使用:

lando npm run start:blocks

外掛標籤

開發者團隊

⬇ 下載最新版 (v4.0.2) 或搜尋安裝

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

原文外掛簡介

Unlock is a protocol for memberships that lets any creator monetize their content permissionless.
In order to become members, visitors may need to be using a web3-enabled wallet such as MetaMask or a web browser with an embedded wallet, such as Opera. They also need a balance of crypto-currency to purchase the memberships.
The plugin enables “full-post” locking, or just block-level level locking, using the Gutemberg Editor.
The plugin uses Unlock’s default checkout UI, which means it lets users who do not have wallet create an Unlock account or even pay using credit card, if your lock supports this.
Getting Started
If you’d like to add a lock to your site, start by [deploying your first lock]https://app.unlock-protocol.com/locks/create). We strongly recommend starting with a test network such as Goerli.
While the lock is deploying, you should download this plugin from the WordPress site. Then, from the administration of your WordPress.org website, in the Plugins section, click on the Add New button and then on theUpload Plugin` button to upload the plugin.
Note: To allow new users to log in using their Ethereum wallet with a single click, make sure that Settings > General > Anyone can register (for single sites) or Network Settings > Allow new registrations > User accounts may be registered (for multisites) is enabled. Your existing users can link their wallets to their WordPress accounts regardless of this setting.
Writing locked stories
You can either choose to lock the whole post, using the post-level settings, or to lock specific Blocks in the UI with the Gutenberg Editor, for posts and pages.
To add the Unlock Protocol block inside the page/post please follow the below steps:

Click on Post -> Add New
To add a block you just need to click on “+” in the editor.
Enter Unlock Protocol in the search.
Unlock Protocol block will be shown. Click on the block, the block gets added.
You will be able to see block settings on the right side. From block settings, add at least one lock, select the right network and, enter its address.

Once your page or post includes the content you need, you can preview its content like any other WordPress post or page. We recommend the use of a web3 wallet which supports multiple accounts so that you can easily toggle between accounts which are already members and accounts which are not members yet!
Contributing
This plugin is, like all of the Unlock code, open source. You’re encouraged to fork it and make any changes you’d like! If you believe these changes would be beneficial to others, we encourage you to also open a Pull Request so that we could add these to the main branch released on the wordpress.org website!
Local Development
To setup local development environment for the plugin using we recommend using Localwp. To get started, simply clone the repo from GitHub.
The repo includes a unlock-wordpress-plugin which has the required .php files and in which asset files (javascript, CSS and images) are added at build time.
You can package the whole plugin by using yarn run release and install it in your local WordPress instance. Alternatively, you can add a symbolic link in the local WordPress’s wp-content/plugins folder that points to the unlock-wordpress-plugin.
Publishing the plugin
In order to update the plugin, check out the current subversion state with
svn co https://plugins.svn.wordpress.org/unlock-protocol

Then, from the GitHub repo clone, inside the assets folder, write
yarn run release

This will generate a zip file in dist directory, unzip that file and copy the content to trunk directory in svn repo and commit the changes into svn with
svn ci -m "commit message"

Then, tag the new version (replace X and Y!) to release it:
svn cp trunk tags/X.Y
svn ci -m "tagging version X.Y"

Additionally, please make sure you tag the version on Github:
git tag -a X.Y -m "tagging version X.Y"
git push origin X.Y

And finally, create the release on Github’si UI

延伸相關外掛

文章
Filter
Apply Filters
Mastodon