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. 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 ## How It Works



View file

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


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

if ( ! class_exists( 'WP_Review_Me' ) ) { if ( ! class_exists( 'WP_Review_Me' ) ) {


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


/** /**
* Required version of PHP. * Required version of PHP.
@ -238,14 +233,14 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
*/ */
public function is_time() { 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(); $this->setup_date();
$installed = time(); $installed = time();
} }


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


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


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


switch ( $this->type ) { switch ( $this->type ) {


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


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


} }


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


return $link; return $link;