diff --git a/README.md b/README.md index fd11a7e..65656bb 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file +You can see the documentation on the wiki page: https://github.com/julien731/WP-Review-Me/wiki diff --git a/review.php b/review.php index 9eabba4..18a2d0f 100644 --- a/review.php +++ b/review.php @@ -13,17 +13,12 @@ * * @package WP Review Me * @author Julien Liabeuf - * @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' ) ) { } -} \ No newline at end of file +}