duckdev/wp-review-notice

Simple library class to gently ask for a wp.org plugin review after a few days of plugin usage.

v1.0.2 2022-01-29 06:59 UTC

This package is auto-updated.

Last update: 2024-05-07 16:48:57 UTC


README

68747470733a2f2f6475636b6465762e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032302f31322f63726f707065642d6475636b6465762d6c6f676f2d6d69642e706e67

WP Review Notice

Simple library class to gently ask for a wp.org plugin review after a few days of plugin usage.

Installation

WP Review Notice can be installed using composer:

$ composer require duckdev/wp-review-notice

Usage 📖

Initialize

Initialize one notice per plugin.

// Setup notice.
$notice = \DuckDev\Reviews\Notice::get(
	'my-plugin', // Plugin slug on wp.org (eg: hello-dolly).
	'My Plugin', // Plugin name (eg: Hello Dolly).
	array(
		'days'          => 7, // default: 7 days.
		'message'       => 'My custom message asking for review', // If you want to use different review notice message.
		'action_labels' => array(
			'review'  => 'Please review me', // Change review link label.
			'later'   => 'I will review later', // Change review extension link.
			'dismiss' => 'Nope', // No review label :(.
		),
	)
);

// Render notice.
$notice->render();

Options

You can customize the notice behaviour using options. All these options are optional.

Option Type Description
days int No. of days after the review is shown.
screens array WordPress admin page screen IDs to show notice. If you leave this empty the notice will be added to add admin pages. Strongly recommended to use this option to limit the review notices only within your plugin's admin pages, especially if you are showing notice using admin_notices action.
cap string WordPres user capability to show notice to. Notice will be visible only to user with this capability. Also only users with this capability can dismiss/extend notice.
classes array Additional class names for notice.
domain string Text domain string for internationalization.
message string Notice main message (to override default message).
action_labels array To use different labels for action links. Available items are: review, later, dismiss. Remember to escape.
prefix string To override plugin option and other key prefixes. By default it's plugin slug with dashes replaces with underscores.

Credits

Author - Joel James