PluginProbe
wpForo Forum / 3.2.0
wpForo Forum v3.2.0
3.2.0 3.1.7 3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 All 140 releases
← All changes | wpforo.php +16 -5 3.1.1 → 3.2.0 View file →
@@ -4,9 +4,9 @@
4 4 * Plugin URI: https://wpforo.com
5 5 * Description: WordPress Forum plugin. wpForo is the only AI powered forum solution for your community. Modern design and 5 forum layouts.
6 6 * Author: gVectors Team
7 7 * Author URI: https://gvectors.com/
8 -* Version: 3.1.1
8 +* Version: 3.2.0
9 9 * Requires at least: 5.2
10 10 * Requires PHP: 7.1
11 11 * Text Domain: wpforo
12 12 * Domain Path: /languages
@@ -13,9 +13,9 @@
13 13 */
14 14
15 15 namespace wpforo;
16 16
17 -define( 'WPFORO_VERSION', '3.1.1' );
17 +define( 'WPFORO_VERSION', '3.2.0' );
18 18
19 19 //Exit if accessed directly
20 20 if( ! defined( 'ABSPATH' ) ) exit;
21 21
@@ -20,9 +20,10 @@
20 20 if( ! defined( 'ABSPATH' ) ) exit;
21 21
22 22 define( 'WPFORO_DIR', rtrim( plugin_dir_path( __FILE__ ), '/' ) );
23 23 define( 'WPFORO_URL', rtrim( plugins_url( '', __FILE__ ), '/' ) );
24 -define( 'WPFORO_BASENAME', plugin_basename( __FILE__ ) ); //wpforo/wpforo.php
24 +define( 'WPFORO_BASENAME', plugin_basename( __FILE__ ) ); // "wpforo/wpforo.php"
25 +define( 'WPFORO_BASEFOLDER', basename(WPFORO_DIR) ); // "wpforo"
25 26
26 27 require_once WPFORO_DIR . "/autoload.php";
27 28
28 29 use stdClass;
@@ -46,8 +47,9 @@
46 47 use wpforo\classes\Moderation;
47 48 use wpforo\classes\Notices;
48 49 use wpforo\classes\Permissions;
49 50 use wpforo\classes\Phrases;
51 +use wpforo\classes\PluginsOrdering;
50 52 use wpforo\classes\PostMeta;
51 53 use wpforo\classes\Posts;
52 54 use wpforo\classes\RamCache;
53 55 use wpforo\classes\SEO;
@@ -55,15 +57,17 @@
55 57 use wpforo\classes\TaskManager;
56 58 use wpforo\classes\EmailQueue;
57 59 use wpforo\classes\Template;
58 60 use wpforo\classes\Topics;
61 +use wpforo\classes\UserGroups;
59 62 use wpforo\classes\VectorStorageManager;
60 -use wpforo\classes\UserGroups;
61 63 use wpforo\modules\bookmarks\Bookmarks;
62 64 use wpforo\modules\reactions\Reactions;
63 65 use wpforo\modules\revisions\Revisions;
64 66 use wpforo\modules\subscriptions\Subscriptions;
65 67
68 +new PluginsOrdering( WPFORO_BASENAME );
69 +
66 70 final class wpforo {
67 71 private static $_instance = null;
68 72
69 73 /** @var wpdb * */
@@ -212,9 +216,9 @@
212 216 /** @var Topics */
213 217 public $topic;
214 218 /** @var UserGroups */
215 219 public $usergroup;
216 -
220 +
217 221 public static function instance() {
218 222 if( is_null( self::$_instance ) ) self::$_instance = new self();
219 223
220 224 return self::$_instance;
@@ -1291,9 +1295,16 @@
1291 1295 'period' => $period,
1292 1296 ];
1293 1297 } elseif( $this->current_object['template'] === 'tags' ) {
1294 1298 $current_object['items_per_page'] = wpforo_setting( 'tags', 'per_page' );
1299 + // Tag sort: whitelist the URL key, then map to orderby/order. Never pass raw input to get_tags().
1300 + $tag_sort_map = [ 'count' => [ 'count', 'DESC' ], 'az' => [ 'tag', 'ASC' ], 'za' => [ 'tag', 'DESC' ] ];
1301 + $tag_sort_key = sanitize_key( (string) wpfval( $_GET, 'wpf_tag_sort' ) );
1302 + if( ! isset( $tag_sort_map[ $tag_sort_key ] ) ) $tag_sort_key = 'count';
1303 + $current_object['tag_sort'] = $tag_sort_key;
1295 1304 $args = [
1305 + 'orderby' => $tag_sort_map[ $tag_sort_key ][0],
1306 + 'order' => $tag_sort_map[ $tag_sort_key ][1],
1296 1307 'offset' => ( $current_object['paged'] - 1 ) * $current_object['items_per_page'],
1297 1308 'row_count' => $current_object['items_per_page'],
1298 1309 ];
1299 1310 $current_object['tags'] = $this->topic->get_tags( $args, $current_object['items_count'] );