Changeset 3279485
- Timestamp:
- 04/23/2025 12:08:44 AM (11 months ago)
- Location:
- wpecounter
- Files:
-
- 28 added
- 4 edited
-
tags/2.0.3 (added)
-
tags/2.0.3/LICENSE (added)
-
tags/2.0.3/README.md (added)
-
tags/2.0.3/assets (added)
-
tags/2.0.3/assets/css (added)
-
tags/2.0.3/assets/css/settings.css (added)
-
tags/2.0.3/assets/js (added)
-
tags/2.0.3/assets/js/settings.js (added)
-
tags/2.0.3/includes (added)
-
tags/2.0.3/includes/class-views.php (added)
-
tags/2.0.3/includes/functions.php (added)
-
tags/2.0.3/includes/plugin-utils.php (added)
-
tags/2.0.3/includes/scripts.php (added)
-
tags/2.0.3/includes/settings.php (added)
-
tags/2.0.3/includes/version.php (added)
-
tags/2.0.3/includes/widget.php (added)
-
tags/2.0.3/index.php (added)
-
tags/2.0.3/languages (added)
-
tags/2.0.3/languages/wpecounter-en_US.pot (added)
-
tags/2.0.3/languages/wpecounter-es_ES.mo (added)
-
tags/2.0.3/languages/wpecounter-es_ES.po (added)
-
tags/2.0.3/languages/wpecounter-sr_RS.mo (added)
-
tags/2.0.3/languages/wpecounter-sr_RS.po (added)
-
tags/2.0.3/readme.txt (added)
-
tags/2.0.3/screenshot-1.png (added)
-
tags/2.0.3/screenshot-2.png (added)
-
tags/2.0.3/screenshot-3.png (added)
-
tags/2.0.3/wpecounter.php (added)
-
trunk/includes/class-views.php (modified) (1 diff)
-
trunk/includes/plugin-utils.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wpecounter.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpecounter/trunk/includes/class-views.php
r2789038 r3279485 295 295 public function views_column_orderby($query) { 296 296 global $pagenow, $post_type; 297 if ('edit.php' !== $pagenow || !is_admin() || !$query->is_main_query()) { 298 return; 299 } 300 297 301 $orderby = $query->get('orderby'); 298 // if ('edit.php' != $pagenow || empty($orderby) ) 299 // return; 300 switch ($orderby) { 301 case 'post_views': 302 303 $query->set('meta_query', array( 304 'sort_column' => 'post_views', 305 'relation' => 'OR', 306 'views_clause' => array( 307 'key' => $this->wpecounter_views_meta_key(), 308 'type' => 'numeric' 309 ), 310 'noviews_clause' => array( 311 'key' => $this->wpecounter_views_meta_key(), 312 'compare' => 'NOT EXISTS' 313 ) 314 )); 315 316 // $query->set('meta_key', $this->wpecounter_views_meta_key() ); 317 // $query->set('meta_type', 'NUMERIC'); 318 // $query->set('suppress_filters', false); 319 // $query->set('hide_empty', false); 302 $order = strtoupper($query->get('order')) === 'ASC' ? 'ASC' : 'DESC'; // Default to DESC if not set 303 304 if ('post_views' === $orderby) { 305 $query->set('meta_query', array( 306 'relation' => 'OR', 307 'views_clause' => array( 308 'key' => $this->wpecounter_views_meta_key(), 309 'type' => 'numeric' 310 ), 311 'noviews_clause' => array( 312 'key' => $this->wpecounter_views_meta_key(), 313 'compare' => 'NOT EXISTS', 314 'type' => 'numeric' 315 ) 316 )); 317 318 if($order == 'DESC'){ 319 $query->set('orderby', 'noviews_clause'); 320 }else{ 320 321 $query->set('orderby', 'meta_value_num'); 321 322 break; 323 324 default: 325 break; 322 } 326 323 } 327 324 } -
wpecounter/trunk/includes/plugin-utils.php
r2781621 r3279485 124 124 } 125 125 } 126 delete_option( self :: OPTION_KEY);126 delete_option('WPeCounter_Options'); 127 127 } 128 128 -
wpecounter/trunk/readme.txt
r3096106 r3279485 1 1 === WP Views Counter === 2 Contributors: etruel, khaztiel 2 Contributors: etruel, khaztiel, gerarjos14 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7267TH4PT3GSW 4 4 Tags: views, count visits, post views, post visits, ajax counter 5 5 Requires at least: 3.1 6 Tested up to: 6. 5.46 Tested up to: 6.8 7 7 Requires PHP: 5.6 8 Stable tag: 2.0. 28 Stable tag: 2.0.3 9 9 License: GPLv2 10 10 … … 64 64 == Changelog == 65 65 66 = 2.0.3 - Apr 22, 2025 = 67 > * Fixed incorrect posts order when clicking on the Views column header. 68 > * Fixed a fatal error occurring during plugin uninstallation. 69 > * Bump to WP 6.8 70 66 71 = 2.0.2 - Jun 01, 2024 = 67 72 * Bump to WP 6.5.4 … … 108 113 109 114 == Upgrade Notice == 110 1. MajorUpgrade.115 1. Recommended Upgrade. -
wpecounter/trunk/wpecounter.php
r3096106 r3279485 4 4 * Plugin URI: https://etruel.com/downloads/wpecounter 5 5 * Description: Counts visits on post lists, pages and/or custom post types. It also displays them in posts, pages or text widget content, shortcode [WPeCounter]. 6 * Version: 2.0. 26 * Version: 2.0.3 7 7 * Author: Etruel Developments LLC 8 8 * Author URI: https://etruel.com … … 15 15 // Plugin version 16 16 if (!defined('WPECOUNTER_VERSION')) 17 define('WPECOUNTER_VERSION', '2.0. 2');17 define('WPECOUNTER_VERSION', '2.0.3'); 18 18 19 19 if (!class_exists('WPeCounter')) :
Note: See TracChangeset
for help on using the changeset viewer.