[WordPress] 外掛分享: User Awards

前言介紹

  • 這款 WordPress 外掛「User Awards」是 2019-05-23 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2019-07-24,距離現在已有 2111 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 5.1.1 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

kwmartin |

外掛標籤

Awards | user engagement |

內容簡介

啟用此外掛現在意味著您能夠為使用者授予特定動作的獎勵。

注意:目前此功能僅能用於更新或新增使用者 meta 值的動作。

基礎層面上,啟用此外掛後,會發生以下事情:

獎勵自訂文章類型被新增到管理視窗。不過是常規文章類型視窗,但帶有一些附加的 meta 方塊,可提供存取此外掛核心行為的功能。

在 {wpdb_prefix}user_awards 名稱下新增了一個表格。其中包含使用者的所有獎勵分配參考。 User Awards 子選單提供介面,以協助在表格上執行管理動作。

還有一個 User Awards 子選單,提供所有分配給使用者的獎勵的表格檢視。可從 WordPress 管理區域的 Awards 管理選單中存取此功能。

使用方式

了解每個可用視窗中可執行的不同動作是使此外掛適用於您的關鍵。

獎勵列表視窗

此視窗顯示所有特定的「獎勵」文章類型。

您可以使用兩個不同的批次動作:

批次分配- 將多個獎勵指派給一個使用者

批量贈予 - 將多個獎勵贈予使用者

新獎勵/編輯獎勵視窗

這些管理視窗與三個 meta 方塊相關聯。以下是每個 metabox 的說明和包含原因。

獎勵觸發程序

文本輸入框。接受獎勵觸發字串,這將描述如何為使用者分配獎勵的行為。下方說明了獎勵觸發程序的文件。

範例

您擁有一個會員博客網站,因為您是個好人,您希望為您的會員獲得獎勵,因為他們參與您的網站並喜歡至少十篇博客文章!

一位先前的開發人員在您網站的每篇博客文章上都實現了一個喜歡按鈕,當使用者按下按鈕時,會在其上增加一個「post_likes」使用者 meta 值,(例如,如果會員喜歡 3 篇博客文章,則其「post_likes」meta 值為「3」)。

我們決定將我們的獎勵命名為「使用者參與度」獎勵。為了分配給符合先決條件的會員,您將在「獎勵觸發程序」輸入框中放入類似於此的內容:

CURRENT_USER_META ASSIGNED WHERE key=post_likes EQ 10

此字符串表示,如果當前使用者 meta 的「post_likes」值更新或創建為等於值「10」,則獎勵將自動分配給使用者。

自動贈送獎勵

勾選框輸入。勾選此框可自動將獎勵贈予使用者,而不是分配獎勵後再手動贈予。

對使用者申請/贈予獎勵

結合勾選方塊輸入的選擇輸入。選擇您的會員列表中的使用者,然後點擊指定提交按鈕來分配/贈予獎勵。

使用者獎勵視窗

此視窗允許管理員實際查看和更新指派給使用者的所有獎勵的狀態。

此視窗將允許您執行以下操作:

單個/批次將獎勵從會員身上刪除
個別地向會員頒發獎勵
編輯獎勵

文檔
獎勵觸發程序語法

解釋了構成我們觸發字串的每個項目,每個項目的接受值均在下方列出。

[ e

原文外掛簡介

Activating this plugin now means that you are able to award users for specific actions that they take.
NOTE: Currently this only works for actions that update or add to user meta values.
At a basic level, the following happens when you activate this plugin:

Awards custom post type is added to the administration window. Regular post type window but with a few additional meta boxes that provide access to the core behavior of this plugin.

A new table is created under the name of {wpdb_prefix}user_awards. This contains all award assignment references to users. The User Awards sub-menu provides an interface to help perform administrative actions on the table.

There is also a User Awards sub-menu which gives a tabular view of all the awards that are assigned to users. This is accessible from the Awards admin menu in your WordPress administration area.
Usage
Understanding the different actions you can take in each available window is key to having this plugin work for you.
Award List Window
This window displays all of the specific “Award” post types.
There are two different bulk actions available to you:

Bulk Assign – Assign multiple awards to a user

Bulk Give – Give multiple awards to a user

New Award / Edit Award Window
These administration windows have three meta boxes associated with them. Below are descriptions of each metabox and why it is included.
Awards Trigger
Text Input. Accepts an awards trigger string, which will describe the behavior of how an award will be assigned to users. Documentation for the awards trigger is shown below.
Example
You have a membership blog site, and because you’re a nice person, you want to award your members for being engaged with your site and liking at least ten blog posts!
A previous developer implemented a like button on each of your site’s blog posts that increments a post_likes user_meta value on the user that clicks it (e.g. If a member likes 3 blog posts, they will have a post_likes meta value of 3).
We’ve decided to name our award the “User Engagement” award. In order to assign it to a member based on the prerequisites, you would put something like this in the “Awards Trigger” input.
CURRENT_USER_META ASSIGNED WHERE key=post_likes EQ 10

This string tells the award to assign itself to the user if the post_likes value of the current user’s meta was updated or created to equal a value of 10.
Auto-Give Award
Checkbox input. Check this box to automatically have the award be given to a user when it would originally be assigned.
Apply/Give Award To User
Select Input combined with a checkbox input. Select a user from your member list to either assign/give an award by clicking on the Assign submit button.
User Awards Window
This window allows administrators to physically see and update the status of all of the awards that are assigned to users.
This window will allow you to perform the following actions:

Singular/Bulk remove awards from members
Singular give awards to members
Edit Awards

Documentation
Awards Trigger Syntax
Explanation of each of the items that make up our trigger string, with accepted values of each listed under.

[ entity ] — Used to scope your awards trigger to a specific action.

CURRENT_USER_META — Consider the meta value of the current user

[ trigger_type ] — Type of action that is performed to the current entity.

UPDATED — When entity value is updated (Listens to calls of the update_user_meta() function)
CREATED — When entity value is created (Listens to calls of the add_user_meta() function)
ASSIGNED — Listens to calls of both the update_user_meta() and add_user_meta() function.
~EXCLUDED~ — Not Implemented

[ trigger ] – Made up of three separate values itself, [ descriptor ] [ operator ] [ control ]

[ descriptor ]

[ entity_type ] = [ value ] ex: key = hours

[ operator ]

GT – greater than
LT – less than
EQ – equal to
GTEQ – greater than equal to
LTEQ – less than equal to

[ control ]

Value used to compare against. e.g. 2
NOTE: The control can also be a string, but in order for this to work, you must use the EQ operator, as shown above.

EXAMPLE:
CURRENT_USER_META UPDATED WHERE key=total_hours GT 600

This example creates a wp action handler that only applies when a user’s meta tags are updated.
In the handler, we will compare the meta tag being updated to the given comparitors in the [ trigger ].
i.e. we will look for a meta tag of the current user that is labeled “total_hours” and check to see if the value is
greater than 600. If that’s the case then the award will be assigned. If not then nothing happens.
$UserAward Global Object
The awards trigger syntax, while nice, is too limited in its current form. Our plugin provides a global $UserAward variable that allows developers to interact with the core API of the plugin in order to award items through methods that simply are not possible / too complex.
You will find documentation and usage for functions available to you below.
global $UserAward;
/**
* Check to see if a user already has a specific award
* @param int $user_id – WPUser_ID
* @param int $award_id – UserAward_ID (Post ID)
* @return bool Whether or not this user has an award with the current award id
*/
$UserAwards->UserHasAward( $user_id, $award_id );
/**
* Assigns multiple awards to users using AssignAward
* @param int $user_id – WPUser_ID
* @param array $award_ids – Array of UserAward_IDs (Post ID)
* @return bool – True if awards were assigned, false if there was an error with assigning awards
*/
$UserAwards->AssignAwards( $user_id, $award_ids );
/**
* Function that marks an award as assigned to a user.
* We insert a new record into our awards table that relates the award to the user.
*
* We do check to see if there is an auto-assignment of the award before we finish up our function though.
*
* @param int $user_id – ID of the user that we are “awarding” the award to
* @param int $award_id – ID of the award that we are “awarding”
* @return bool – True if award was assigned,
* False if:
* – User already has that award
* – Error with assigning our award
*/
$UserAwards->AssignAward( $user_id, $award_id );
/**
* Give multiple awards to users using GiveAward().
* @param int $user_id – WPUser_ID
* @param array $award_ids – Array of UserAward_IDs (Post ID)
* @return bool – True if awards were given, false if there was an error with giving awards
*/
$UserAwards->GiveAwards( $user_id, $award_ids );
/**
* Function that will mark an award as given to a user,
* which essentially means that we mark the “date_given” time with
* an actual date.
*
* Returns the return value of a db->update call
*
* @param int $user_id – ID of the user that we are “awarding” the award to
* @param int $award_id – ID of the award that we are “awarding”
* @return mixed – Return value of a $wpdb->update() call
*/
$UserAwards->GiveAward( $user_id, $award_id );
/**
* Removes awards from our database.
* If “$award_id” is null, then we are going to delete everything in the database with the specific “$user_id”
*
* @param int $user_id – ID of the user that we are “awarding” the award to
* @param int $award_id – ID of the award that we are “awarding”
* @return mixed – Return the value of a $wpdb->delete() call
*/
$UserAwards->RemoveUserAward( $user_id, $award_id = NULL );
/**
* Function that grabs as many awards assigned to the user as we can based on the parameters given.
* For example, if just a user_id is supplied, then we will return all of the awards with that user_id.
* If an award_id is supplied along with our user_id then we will probably get only one award. Hopefully
*
* @param int $user_id – ID of the user that we are “awarding” the award to
* @param int $award_id – ID of the award that we are “awarding”
* @return mixed – Returnes the value of a $wpdb->get_results() call
*/
$UserAwards->GetUserAward( $user_id, $award_id = NULL);
Attribution
This plugin’s icon is not an original piece of work. It was made by Freepik from Flaticon.com

各版本下載點

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

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


0.0.1 | 0.0.2 | 0.1.0 | 0.1.1 | trunk |

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

  • WordPoints 》功能, 此外掛可讓您創建一種或多種類型的點數,當您網站上發生某些事件時,您可以使用這些點數獎勵用戶。它還包括了Ranks組件,可以根據用戶擁有的點數來創建...。
  • GamiPress – WP PostRatings integration 》透過強大的遊戲化插件GamiPress,將你的WP PostRatings評分遊戲化!, 此外掛會自動將GamiPress與WP PostRatings連接,並新增新活動事件。, 新增事件, , 評分...。
  • Simple Badges 》BuddyPress 專用的成就插件可以讓您在 BuddyPress 社交環境中整合徽章。若您想為使用者授予可兌換物品的積分,CubePoints 就很適合。這個外掛專注於另一種情...。
  • Creative Force – WordPress Single Sign-On (SSO) 》對於在 WordPress 上建立網站的 Award Force 用戶,這個 WordPress 外掛允許您的註冊用戶使用其 WordPress 使用者帳戶自動登入 Award Force。一個 Award Forc...。
  • Afi.to – Integration 》這款外掛可以讓你獎勵顧客進行購買並在網店中推薦你的產品,是一種有效的方法來提高銷售額並保持忠誠的顧客。, 它是如何運作的?首先,你可以在Afi.to 網站免...。
  • Orbisius Resume Organizer 》支援, , 支援服務請前往我們的網站:http://club.orbisius.com/, 請勿使用 WordPress 論壇或其他網站查詢支援。, , Orbisius履歷組織者可讓您整理求職者的簡...。
  • Buzz for Video Game Award Programs 》將獎項提名程序納入您的文章工作流程中!在發布關於遊戲的新文章時,勾選相關類別,讓您的經驗及時記錄。。

文章
Filter
Apply Filters
Mastodon