Skip to content
Julien Liabeuf edited this page Apr 20, 2016 · 6 revisions

This wiki contains the documentation for WP Review Me. While the library is extremely simple to use, it has a few advanced options that need clarification. Also, this doc will detail how the various integrations work.

Creating a Review Action

In its simplest form, the library only requires 2 parameters: the product type (plugin or theme) and the product slug.

The product slug must be exactly the same as is on WordPress.org.

Example

In this example, I will create a review action for one of my plugins called Awesome Support.

The plugin slug on WordPress.org is awesome-support, so this is how I will instantiate the class:

new WP_Review_Me( array( 'type' => 'plugin', 'slug' => 'awesome-support' ) );

That's it. In 10 days (default value) after installation, the plugin will ask the user to leave a review.

WP Review Me

Advanced Parameters

The WRM_WordPress class, and most extended classes, take a few optional parameters. Here is the full list of available parameters (including the 2 above).

  • $args (array)
    • slug (string)(mandatory): product slug exactly like it is on WordPress.org
    • type (string)(mandatory): type of product (either plugin or theme)
    • days_after (int): number of days after installation to trigger the review action
    • rating (int): number of stars the user review should default to (default is 5 stars)
    • message (string): the message to display in the admin notice to encourage the user to leave a review
    • link_label (string): label of the link that redirects the user to the review form on WordPress.org
    • cap (string): capability required for the notice to display (see WP Dismissible Notices Handler parameters)
    • scope (string): scope of the notice dismissal (see WP Dismissible Notices Handler parameters)

Example

new WP_Review_Me( array(
	'days_after' => 15,
	'type'       => 'plugin',
	'slug'       => 'awesome-support',
	'rating'     => 5,
	'message'    => 'Review me!',
	'link_label' => 'Click here to review'
) );
Clone this wiki locally