WordPress Popular Posts - Version 3.0.1

Version Description

  • Fixes bug on wpp_get_views.
  • Sustitutes WP_DEBUG with custom debugging constant.
  • Fixes bug that prevented disabling plugin's stylesheet.
Download this release

Release Info

Developer hcabrera
Plugin Icon 128x128 WordPress Popular Posts
Version 3.0.1
Comparing to
See all releases

Code changes from version 3.0.0 to 3.0.1

Files changed (3) hide show
  1. readme.txt +7 -2
  2. views/admin.php +3 -10
  3. wordpress-popular-posts.php +7 -6
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=hcabr
4
  Tags: popular, posts, widget, popularity, top
5
  Requires at least: 3.8
6
  Tested up to: 3.9.1
7
- Stable tag: 3.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -112,7 +112,7 @@ Copy your modified wpp.css file to your theme's folder, otherwise my plugin will
112
  Since this plugin does not include any predefined designs, it's up to you to style your most popular posts list as you like (you might need to hire someone for this if you don't know HTML/CSS, though). However, I've gathered a few [examples](https://github.com/cabrerahector/wordpress-popular-posts/wiki/6.-Styling-the-list) that should get you started.
113
 
114
  = I want to remove WPP's stylesheet. How can I do that? =
115
- Simply add the following code to your theme's functions.php file: `<?php wp_dequeue_style('wordpress-popular-posts') ?>` (or disable the stylesheet via *wp-admin > Settings > Wordpress Popular Posts > Tools*).
116
 
117
  = -OTHER STUFF THAT YOU (PROBABLY) WANT TO KNOW- =
118
 
@@ -142,6 +142,11 @@ For the time being, the [Support Forum](http://wordpress.org/support/plugin/word
142
  4. Wordpress Popular Posts Stats panel.
143
 
144
  == Changelog ==
 
 
 
 
 
145
  = 3.0.0 =
146
  * Plugin refactoring based on [@tikaszvince](https://github.com/tikaszvince)'s work (many thanks, Vince!).
147
  * Added WPML support.
4
  Tags: popular, posts, widget, popularity, top
5
  Requires at least: 3.8
6
  Tested up to: 3.9.1
7
+ Stable tag: 3.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
112
  Since this plugin does not include any predefined designs, it's up to you to style your most popular posts list as you like (you might need to hire someone for this if you don't know HTML/CSS, though). However, I've gathered a few [examples](https://github.com/cabrerahector/wordpress-popular-posts/wiki/6.-Styling-the-list) that should get you started.
113
 
114
  = I want to remove WPP's stylesheet. How can I do that? =
115
+ You can disable the stylesheet via *wp-admin > Settings > Wordpress Popular Posts > Tools*.
116
 
117
  = -OTHER STUFF THAT YOU (PROBABLY) WANT TO KNOW- =
118
 
142
  4. Wordpress Popular Posts Stats panel.
143
 
144
  == Changelog ==
145
+ = 3.0.1 =
146
+ * Fixes bug on wpp_get_views.
147
+ * Sustitutes WP_DEBUG with custom debugging constant.
148
+ * Fixes bug that prevented disabling plugin's stylesheet.
149
+
150
  = 3.0.0 =
151
  * Plugin refactoring based on [@tikaszvince](https://github.com/tikaszvince)'s work (many thanks, Vince!).
152
  * Added WPML support.
views/admin.php CHANGED
@@ -696,16 +696,9 @@ if (empty($wpp_rand)) {
696
  <h3><?php echo sprintf( __('About Wordpress Popular Posts %s', $this->plugin_slug), $this->version); ?></h3>
697
  <p><?php _e( 'This version includes the following changes', $this->plugin_slug ); ?>:</p>
698
  <ul>
699
- <li>- Plugin refactoring based on <a href="https://github.com/tikaszvince">@tikaszvince</a>'s work (many thanks, Vince!).</li>
700
- <li>- Added WPML support.</li>
701
- <li>- Added experimental Wordpress Multisite support.</li>
702
- <li>- Added bot detection.</li>
703
- <li>- Added ability to filter posts by freshness.</li>
704
- <li>- Added own data caching method.</li>
705
- <li>- Added filters <em>wpp_custom_html</em>, <em>wpp_post</em>.</li>
706
- <li>- Added action <em>wpp_update_views</em>.</li>
707
- <li>- Dropped support on Dutch and Persian languages since the translations were outdated.</li>
708
- <li>- Several minor fixes and improvements.</li>
709
  </ul>
710
  </div>
711
 
696
  <h3><?php echo sprintf( __('About Wordpress Popular Posts %s', $this->plugin_slug), $this->version); ?></h3>
697
  <p><?php _e( 'This version includes the following changes', $this->plugin_slug ); ?>:</p>
698
  <ul>
699
+ <li>Fixes bug on wpp_get_views.</li>
700
+ <li>Sustitutes WP_DEBUG with custom debugging constant.</li>
701
+ <li>Fixes bug that prevented disabling plugin's stylesheet.</li>
 
 
 
 
 
 
 
702
  </ul>
703
  </div>
704
 
wordpress-popular-posts.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Wordpress Popular Posts
4
  Plugin URI: http://wordpress.org/extend/plugins/wordpress-popular-posts
5
  Description: Wordpress Popular Posts is a highly customizable widget that displays the most popular posts on your blog
6
- Version: 3.0.0
7
  Author: Hector Cabrera
8
  Author URI: http://cabrerahector.com
9
  Author Email: hcabrerab@gmail.com
@@ -61,7 +61,7 @@ if ( !class_exists('WordpressPopularPosts') ) {
61
  * @since 1.3.0
62
  * @var string
63
  */
64
- private $version = '3.0.0';
65
 
66
  /**
67
  * Plugin identifier.
@@ -198,7 +198,6 @@ if ( !class_exists('WordpressPopularPosts') ) {
198
  'tools' => array(
199
  'ajax' => false,
200
  'css' => true,
201
- 'stylesheet' => true,
202
  'link' => array(
203
  'target' => '_self'
204
  ),
@@ -288,7 +287,9 @@ if ( !class_exists('WordpressPopularPosts') ) {
288
  add_action( 'admin_init', array( $this, 'thickbox_setup' ) );
289
 
290
  // Register site styles and scripts
291
- add_action( 'wp_enqueue_scripts', array( $this, 'register_widget_styles' ) );
 
 
292
  add_action( 'wp_enqueue_scripts', array( $this, 'register_widget_scripts' ) );
293
 
294
  // Add plugin settings link
@@ -2902,7 +2903,7 @@ if ( !class_exists('WordpressPopularPosts') ) {
2902
  */
2903
  private function __debug($v) {
2904
 
2905
- if ( !WP_DEBUG )
2906
  return;
2907
 
2908
  foreach (func_get_args() as $arg) {
@@ -2936,7 +2937,7 @@ if ( !class_exists('WordpressPopularPosts') ) {
2936
  function wpp_get_views($id = NULL, $range = NULL, $number_format = true) {
2937
 
2938
  // have we got an id?
2939
- if ( empty($id) || is_null($id) || !$this->__is_numeric($id) ) {
2940
  return "-1";
2941
  } else {
2942
  global $wpdb;
3
  Plugin Name: Wordpress Popular Posts
4
  Plugin URI: http://wordpress.org/extend/plugins/wordpress-popular-posts
5
  Description: Wordpress Popular Posts is a highly customizable widget that displays the most popular posts on your blog
6
+ Version: 3.0.1
7
  Author: Hector Cabrera
8
  Author URI: http://cabrerahector.com
9
  Author Email: hcabrerab@gmail.com
61
  * @since 1.3.0
62
  * @var string
63
  */
64
+ private $version = '3.0.1';
65
 
66
  /**
67
  * Plugin identifier.
198
  'tools' => array(
199
  'ajax' => false,
200
  'css' => true,
 
201
  'link' => array(
202
  'target' => '_self'
203
  ),
287
  add_action( 'admin_init', array( $this, 'thickbox_setup' ) );
288
 
289
  // Register site styles and scripts
290
+ if ( $this->user_settings['tools']['css'] )
291
+ add_action( 'wp_enqueue_scripts', array( $this, 'register_widget_styles' ) );
292
+
293
  add_action( 'wp_enqueue_scripts', array( $this, 'register_widget_scripts' ) );
294
 
295
  // Add plugin settings link
2903
  */
2904
  private function __debug($v) {
2905
 
2906
+ if ( !defined('WPP_DEBUG') || !WPP_DEBUG )
2907
  return;
2908
 
2909
  foreach (func_get_args() as $arg) {
2937
  function wpp_get_views($id = NULL, $range = NULL, $number_format = true) {
2938
 
2939
  // have we got an id?
2940
+ if ( empty($id) || is_null($id) || !is_numeric($id) ) {
2941
  return "-1";
2942
  } else {
2943
  global $wpdb;