Compare commits

...

17 commits

Author SHA1 Message Date
Julien Liabeuf
8c3a084e10
Merge pull request #6 from mallardduck/patch-1
Fix comparison within is_time() method
2018-11-20 19:56:19 +07:00
Dan
c9bae4c60f
Update review.php 2018-11-16 17:49:38 -05:00
Julien Liabeuf
8df8feafa4
Merge pull request #11 from Mte90/patch-1
Improve composer loading
2018-08-15 08:34:30 +07:00
Daniele Scasciafratte
a9efc4fb2d
Update review.php 2018-08-13 22:10:27 +02:00
Dan
a47a0fc6fa Fix comparison within is_time() method
Using false here is causing the check to ALWAYS evaluate as false since the value is being cast to an int. A check of `bool === int` can never be true, so updating this to comparing for 0 is the best solution.
2017-04-09 17:34:56 -04:00
Julien Liabeuf
cb43e768e0 Bump version number again. Actually forgot to do it when releasing 2.0. 2016-09-27 11:04:50 +07:00
Julien Liabeuf
0f616f7edd Update review URLs - fixes #4 2016-09-27 11:02:43 +07:00
Julien Liabeuf
973892a9a0 Bump version number 2016-09-27 11:02:12 +07:00
Julien Liabeuf
4f9d9633a1 Fix calculation error 2016-09-27 11:01:36 +07:00
Julien Liabeuf
66baf1dbd9 Typecast var 2016-09-27 11:01:06 +07:00
Julien Liabeuf
1e24fa8a8f Update image src 2016-07-03 21:31:46 +07:00
Julien Liabeuf
686edccb6e Merge branch 'develop' of github.com:julien731/WP-Review-Me into develop 2016-04-20 19:38:24 +07:00
Julien Liabeuf
25598778fc Finish integrationless 2016-04-20 19:35:44 +07:00
Julien Liabeuf
db6090587d Add info note about dropping integrations 2016-04-20 19:35:18 +07:00
Julien Liabeuf
ca9d11a379 Update instructions in readme.md 2016-04-20 08:39:28 +07:00
Julien Liabeuf
5688afde4e Remove integrations - closes #3 closes #2 2016-04-20 08:37:23 +07:00
Julien Liabeuf
73c551ebe6 Track the develop branch on Scrutinizer 2016-04-19 01:01:37 +07:00
2 changed files with 13 additions and 18 deletions

View file

@ -10,7 +10,7 @@ The bad thing with reviews is that, while unhappy users love to let the world kn

How can you get more good reviews? Simply ask your users.

![WP Review Me](http://i.imgur.com/iZk4Bgu.png)
![WP Review Me](http://i.imgur.com/9oNGvm2.png)

## How It Works

@ -38,4 +38,4 @@ new WP_Review_Me( array( 'days_after' => 10, 'type' => 'plugin', 'slug' => 'my-p

This is the simplest way of creating a review prompt. If you want to customize it further, a few advanced parameters are available.

You can see the documentation on the wiki page: https://github.com/julien731/WP-Review-Me/wiki
You can see the documentation on the wiki page: https://github.com/julien731/WP-Review-Me/wiki

View file

@ -13,17 +13,12 @@
*
* @package WP Review Me
* @author Julien Liabeuf <julien@liabeuf.fr>
* @version 1.0
* @version 2.0.1
* @license GPL-2.0+
* @link https://julienliabeuf.com
* @copyright 2016 Julien Liabeuf
*/

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}

if ( ! class_exists( 'WP_Review_Me' ) ) {

class WP_Review_Me {
@ -34,7 +29,7 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
* @since 1.0
* @var string
*/
public $version = '1.0';
public $version = '2.0.1';

/**
* Required version of PHP.
@ -238,14 +233,14 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
*/
public function is_time() {

$installed = get_option( $this->key, false );
$installed = (int) get_option( $this->key, 0 );

if ( false === $installed ) {
if ( 0 === $installed ) {
$this->setup_date();
$installed = time();
}

if ( $installed + ( $this->days + 86400 ) > time() ) {
if ( $installed + ( $this->days * 86400 ) > time() ) {
return false;
}

@ -271,23 +266,23 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
*/
protected function get_review_link() {

$link = 'https://wordpress.org/support/view/';
$link = 'https://wordpress.org/support/';

switch ( $this->type ) {

case 'theme':
$link .= 'theme-reviews/';
$link .= 'theme/';
break;

case 'plugin':
$link .= 'plugin-reviews/';
$link .= 'plugin/';
break;

}

$link .= $this->slug;
$link .= $this->slug . '/reviews';
$link = add_query_arg( 'rate', $this->rating, $link );
$link = esc_url( $link . '#postform' );
$link = esc_url( $link . '#new-post' );

return $link;

@ -423,4 +418,4 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {

}

}
}