WordPress Popular Posts - Version 3.0.2

Version Description

  • Fixes an introduced bug on wpp_get_views().
  • Fixes bug where thumbnail size was cached for multiple instances.
  • Adds back stylesheet detection.
  • Removes unused widget.js file.
  • Other minor bug fixes.
Download this release

Release Info

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

Code changes from version 3.0.1 to 3.0.2

Files changed (3) hide show
  1. js/widget.js +0 -6
  2. readme.txt +13 -9
  3. wordpress-popular-posts.php +14 -22
js/widget.js DELETED
@@ -1,6 +0,0 @@
1
- (function ($) {
2
- "use strict";
3
- $(function () {
4
- // Place your public-facing JavaScript here
5
- });
6
- }(jQuery));
 
 
 
 
 
 
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.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -116,6 +116,9 @@ You can disable the stylesheet via *wp-admin > Settings > Wordpress Popular Post
116
 
117
  = -OTHER STUFF THAT YOU (PROBABLY) WANT TO KNOW- =
118
 
 
 
 
119
  = I want to translate your plugin into my language / help you update a translation. What do I need to do? =
120
  First thing you need to do is get a [gettext](http://www.gnu.org/software/gettext/) editor like [Poedit](http://www.poedit.net/) to translate all texts into your language. When you're done with it, you'll find several .PO files bundled with the plugin under the *lang* folder. If you're planning to add a new language, go grab *wordpress-popular-posts.po* and rename it to add the proper suffix for your language (eg. wordpress-popular-posts*-es_ES*.po, for Spanish). In any case, open the PO file using Poedit (or your preferred gettext editor) and update the strings there. It sounds complicated, I know, but it's not. Check this handy [guide](http://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/ "Translating WordPress Plugins & Themes"), in case you get lost at some point. If you're interested in sharing your translation with others (or just helped update a current translation), please [let me know](http://wordpress.org/support/plugin/wordpress-popular-posts).
121
 
@@ -142,6 +145,13 @@ 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.1 =
146
  * Fixes bug on wpp_get_views.
147
  * Sustitutes WP_DEBUG with custom debugging constant.
@@ -363,11 +373,5 @@ All translations are community made: people who are nice enough to share their t
363
 
364
  == Upgrade Notice ==
365
 
366
- = 3.0.0 =
367
- This version requires PHP 5.2+ and Wordpress 3.8 or greater.
368
-
369
- = 2.3.3 =
370
- This version requires PHP 5.2+ and Wordpress 3.0.0 or greater to enable post thumbnails.
371
-
372
- = 2.0.0 =
373
- From version 2.0 and on, Wordpress Popular Posts requires Wordpress 2.8 at least in order to function correctly. If you're not running Wordpress 2.8 (or newer) please use WPP v.1.5.1 instead. Also, if you are upgrading from any version prior to WPP v1.4.6, please update to v1.4.6 first!
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.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
116
 
117
  = -OTHER STUFF THAT YOU (PROBABLY) WANT TO KNOW- =
118
 
119
+ = Does Wordpress Popular Posts support other languages than english? =
120
+ Yes, check the [Other Notes](http://wordpress.org/plugins/wordpress-popular-posts/other_notes/) section for more information.
121
+
122
  = I want to translate your plugin into my language / help you update a translation. What do I need to do? =
123
  First thing you need to do is get a [gettext](http://www.gnu.org/software/gettext/) editor like [Poedit](http://www.poedit.net/) to translate all texts into your language. When you're done with it, you'll find several .PO files bundled with the plugin under the *lang* folder. If you're planning to add a new language, go grab *wordpress-popular-posts.po* and rename it to add the proper suffix for your language (eg. wordpress-popular-posts*-es_ES*.po, for Spanish). In any case, open the PO file using Poedit (or your preferred gettext editor) and update the strings there. It sounds complicated, I know, but it's not. Check this handy [guide](http://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/ "Translating WordPress Plugins & Themes"), in case you get lost at some point. If you're interested in sharing your translation with others (or just helped update a current translation), please [let me know](http://wordpress.org/support/plugin/wordpress-popular-posts).
124
 
145
  4. Wordpress Popular Posts Stats panel.
146
 
147
  == Changelog ==
148
+ = 3.0.2 =
149
+ * Fixes an introduced bug on wpp_get_views().
150
+ * Fixes bug where thumbnail size was cached for multiple instances.
151
+ * Adds back stylesheet detection.
152
+ * Removes unused widget.js file.
153
+ * Other minor bug fixes.
154
+
155
  = 3.0.1 =
156
  * Fixes bug on wpp_get_views.
157
  * Sustitutes WP_DEBUG with custom debugging constant.
373
 
374
  == Upgrade Notice ==
375
 
376
+ = 3.0.2 =
377
+ This version requires PHP 5.2+ and Wordpress 3.8 or greater. Also, backup the wpp.css file first if you modified it!
 
 
 
 
 
 
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.1
7
  Author: Hector Cabrera
8
  Author URI: http://cabrerahector.com
9
  Author Email: hcabrerab@gmail.com
@@ -13,7 +13,7 @@ Network: false
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
16
- Copyright 2013 Hector Cabrera (hcabrerab@gmail.com)
17
 
18
  This program is free software; you can redistribute it and/or modify
19
  it under the terms of the GNU General Public License, version 2, as
@@ -61,7 +61,7 @@ if ( !class_exists('WordpressPopularPosts') ) {
61
  * @since 1.3.0
62
  * @var string
63
  */
64
- private $version = '3.0.1';
65
 
66
  /**
67
  * Plugin identifier.
@@ -289,8 +289,6 @@ if ( !class_exists('WordpressPopularPosts') ) {
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
296
  add_filter( 'plugin_action_links', array( $this, 'add_plugin_settings_link' ), 10, 2 );
@@ -632,7 +630,7 @@ if ( !class_exists('WordpressPopularPosts') ) {
632
  function replace_thickbox_text($translated_text, $text, $domain) {
633
 
634
  if ('Insert into Post' == $text) {
635
- $referer = strpos( wp_get_referer(), $this->plugin_slug );
636
  if ( $referer != '' ) {
637
  return __('Upload', $this->plugin_slug );
638
  }
@@ -648,17 +646,17 @@ if ( !class_exists('WordpressPopularPosts') ) {
648
  * @since 1.0.0
649
  */
650
  public function register_widget_styles() {
651
- wp_enqueue_style( $this->plugin_slug, plugins_url( 'style/wpp.css', __FILE__ ), array(), $this->version );
652
- } // end register_widget_styles
 
653
 
654
- /**
655
- * Registers and enqueues widget-specific scripts.
656
- *
657
- * @since 1.0.0
658
- */
659
- public function register_widget_scripts() {
660
- wp_enqueue_script( $this->plugin_slug .'-script', plugins_url( 'js/widget.js', __FILE__ ), array('jquery'), $this->version );
661
- } // end register_widget_scripts
662
 
663
  /**
664
  * Register the administration menu for this plugin into the WordPress Dashboard menu.
@@ -1875,12 +1873,6 @@ if ( !class_exists('WordpressPopularPosts') ) {
1875
  return '';
1876
  }
1877
 
1878
- $cache = &$this->__cache(__FUNCTION__, array());
1879
-
1880
- if ( isset($cache[$p->id]) ) {
1881
- return $cache[$p->id];
1882
- }
1883
-
1884
  $tbWidth = $instance['thumbnail']['width'];
1885
  $tbHeight = $instance['thumbnail']['height'];
1886
  $permalink = get_permalink($p->id);
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.2
7
  Author: Hector Cabrera
8
  Author URI: http://cabrerahector.com
9
  Author Email: hcabrerab@gmail.com
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
16
+ Copyright 2014 Hector Cabrera (hcabrerab@gmail.com)
17
 
18
  This program is free software; you can redistribute it and/or modify
19
  it under the terms of the GNU General Public License, version 2, as
61
  * @since 1.3.0
62
  * @var string
63
  */
64
+ private $version = '3.0.2';
65
 
66
  /**
67
  * Plugin identifier.
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 plugin settings link
294
  add_filter( 'plugin_action_links', array( $this, 'add_plugin_settings_link' ), 10, 2 );
630
  function replace_thickbox_text($translated_text, $text, $domain) {
631
 
632
  if ('Insert into Post' == $text) {
633
+ $referer = strpos( wp_get_referer(), 'wpp_admin' );
634
  if ( $referer != '' ) {
635
  return __('Upload', $this->plugin_slug );
636
  }
646
  * @since 1.0.0
647
  */
648
  public function register_widget_styles() {
649
+
650
+ $theme_file = get_stylesheet_directory() . '/wpp.css';
651
+ $plugin_file = plugin_dir_path(__FILE__) . 'style/wpp.css';
652
 
653
+ if ( @file_exists($theme_file) ) { // user stored a custom wpp.css on theme's directory, so use it
654
+ wp_enqueue_style( $this->plugin_slug, get_stylesheet_directory_uri() . "/wpp.css", array(), $this->version );
655
+ } elseif ( @file_exists($plugin_file) ) { // no custom wpp.css, use plugin's instead
656
+ wp_enqueue_style( $this->plugin_slug, plugins_url( 'style/wpp.css', __FILE__ ), array(), $this->version );
657
+ }
658
+
659
+ } // end register_widget_styles
 
660
 
661
  /**
662
  * Register the administration menu for this plugin into the WordPress Dashboard menu.
1873
  return '';
1874
  }
1875
 
 
 
 
 
 
 
1876
  $tbWidth = $instance['thumbnail']['width'];
1877
  $tbHeight = $instance['thumbnail']['height'];
1878
  $permalink = get_permalink($p->id);