
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.
Understanding the different actions you can take in each available window is key to having this plugin work for you.
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
These administration windows have three meta boxes associated with them. Below are descriptions of each metabox and why it is included.
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.
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.
Checkbox input. Check this box to automatically have the award be given to a user when it would originally be assigned.
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.
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:
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.
[ trigger_type ] — Type of action that is performed to the current entity.
[ trigger ] – Made up of three separate values itself, [ descriptor ] [ operator ] [ control ]
[ descriptor ]
[ operator ]
[ control ]
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.
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);
This plugin’s icon is not an original piece of work. It was made by Freepik from Flaticon.com
Starting from $0 per month.
Rating
Reviewers
No reviews
Tags
Developed By
kwmartin
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Add a customizable leaderboard to your site to display rankings, track scores, and encourage friendly competition.
Add interactive two-sided cards with flip effects to present front and back content in a compact, engaging format.
Show inspiring quotes with a quotes carousel that rotates messages, enhances design, and keeps visitors engaged.
Show LinkedIn posts with a slider that auto updates, presents content in a smooth layout, and keeps visitors engaged.
Use tilted image effects to rotate visuals, add creative style, and keep visitors engaged with dynamic images on your site.
Show Medium articles in a Medium feed that keeps content fresh, improves readability, and helps visitors discover more posts.
Show trust badges that highlight security and reliability, build customer confidence, and help visitors feel safe making purchases on your site.
Show alerts and updates with a notification popup that grabs attention, delivers important messages, and improves user experience.
Use a payment button for secure PayPal or Stripe checkout to simplify online payments and help increase sales.
Use flip cards to present information interactively, improve visual design, and guide visitors toward clearer decisions that support conversions.
Use right click protection to prevent copying by disabling right click actions, protecting your content and reducing unauthorized reuse on your site.
Create real estate listings with a listings widget that displays properties clearly, supports customization, and helps visitors explore homes more easily.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
