Groups - Version 2.4.0

Version Description

  • Improved performance when filtering the users list by groups to avoid issues with large user bases.
  • Tested with the latest WordPress 4.9.
  • Updated the minimum required WordPress version to 4.6.
  • Fixed a missing Javascript resource when selecting an image in the customizer.
Download this release

Release Info

Developer itthinx
Plugin Icon 128x128 Groups
Version 2.4.0
Comparing to
See all releases

Code changes from version 2.3.1 to 2.4.0

changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  == Groups by itthinx - changelog.txt ==
2
 
 
 
 
 
 
 
3
  = 2.3.1 =
4
  * Fixed several points where warnings related to the use of count() and the Countable interface would occur due to changes in PHP 7.2.
5
  * Tested with WordPress 4.9.
1
  == Groups by itthinx - changelog.txt ==
2
 
3
+ = 2.4.0 =
4
+ * Improved performance when filtering the users list by groups to avoid issues with large user bases.
5
+ * Tested with the latest WordPress 4.9.
6
+ * Updated the minimum required WordPress version to 4.6.
7
+ * Fixed a missing Javascript resource when selecting an image in the customizer.
8
+
9
  = 2.3.1 =
10
  * Fixed several points where warnings related to the use of count() and the Countable interface would occur due to changes in PHP 7.2.
11
  * Tested with WordPress 4.9.
groups.php CHANGED
@@ -21,7 +21,7 @@
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
- * Version: 2.3.1
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
@@ -32,7 +32,7 @@
32
  if ( !defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
- define( 'GROUPS_CORE_VERSION', '2.3.1' );
36
  define( 'GROUPS_FILE', __FILE__ );
37
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
38
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
+ * Version: 2.4.0
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
32
  if ( !defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
+ define( 'GROUPS_CORE_VERSION', '2.4.0' );
36
  define( 'GROUPS_FILE', __FILE__ );
37
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
38
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
lib/access/class-groups-access-meta-boxes.php CHANGED
@@ -78,8 +78,13 @@ class Groups_Access_Meta_Boxes {
78
  */
79
  public static function admin_enqueue_scripts() {
80
  global $pagenow;
81
- if ( $pagenow == 'upload.php' ) {
82
- Groups_UIE::enqueue( 'select' );
 
 
 
 
 
83
  }
84
  }
85
 
78
  */
79
  public static function admin_enqueue_scripts() {
80
  global $pagenow;
81
+ if ( isset( $pagenow ) ) {
82
+ switch ( $pagenow ) {
83
+ case 'upload.php' :
84
+ case 'customize.php' :
85
+ Groups_UIE::enqueue( 'select' );
86
+ break;
87
+ }
88
  }
89
  }
90
 
lib/admin/class-groups-admin-users.php CHANGED
@@ -82,27 +82,17 @@ class Groups_Admin_Users {
82
  global $pagenow, $wpdb;
83
  if ( ( $pagenow == 'users.php' ) && empty( $_GET['page'] ) ) {
84
  if ( isset( $_REQUEST['group_ids'] ) && is_array( $_REQUEST['group_ids'] ) ) {
85
- $group_ids = array_map( array( 'Groups_Utility', 'id' ), array_map( 'trim', $_REQUEST['group_ids'] ) );
86
- $include = array();
87
- foreach ( $group_ids as $group_id ) {
88
- if ( Groups_Group::read( $group_id ) ) {
89
- $group = new Groups_Group( $group_id );
90
- $users = $group->users;
91
- if ( count( $users ) > 0 ) {
92
- foreach( $users as $user ) {
93
- $include[] = $user->user->ID;
94
- }
95
- } else { // no results
96
- $include[] = 0;
97
- }
98
- unset( $group );
99
- unset( $users );
100
  }
101
  }
102
- if ( count( $include ) > 0 ) {
103
- $include = array_unique( $include );
104
- $ids = implode( ',', wp_parse_id_list( $include ) );
105
- $user_query->query_where .= " AND $wpdb->users.ID IN ($ids)";
106
  }
107
  }
108
  }
82
  global $pagenow, $wpdb;
83
  if ( ( $pagenow == 'users.php' ) && empty( $_GET['page'] ) ) {
84
  if ( isset( $_REQUEST['group_ids'] ) && is_array( $_REQUEST['group_ids'] ) ) {
85
+ $group_ids = array();
86
+ foreach ( $_REQUEST['group_ids'] as $group_id ) {
87
+ $group_id = Groups_Utility::id( $group_id );
88
+ if ( $group_id !== false ) {
89
+ $group_ids[] = $group_id;
 
 
 
 
 
 
 
 
 
 
90
  }
91
  }
92
+ if ( count( $group_ids ) > 0 ) {
93
+ $user_group_table = _groups_get_tablename( 'user_group' );
94
+ $group_ids = implode( ',', esc_sql( $group_ids ) );
95
+ $user_query->query_where .= " AND $wpdb->users.ID IN ( SELECT DISTINCT user_id FROM $user_group_table WHERE group_id IN ( $group_ids ) ) ";
96
  }
97
  }
98
  }
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: itthinx, proaktion
3
  Donate link: http://www.itthinx.com/plugins/groups
4
  Tags: groups, access, access control, membership, memberships, member, members, capability, capabilities, content, download, downloads, file, file access, files, paypal, permission, permissions, subscription, subscriptions, woocommerce
5
- Requires at least: 4.0
6
  Tested up to: 4.9
7
  Requires PHP: 5.5.38
8
- Stable tag: 2.3.1
9
  License: GPLv3
10
 
11
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
@@ -190,6 +190,12 @@ See also the [Groups Documentation](http://docs.itthinx.com/document/groups/) pa
190
 
191
  == Changelog ==
192
 
 
 
 
 
 
 
193
  = 2.3.1 =
194
  * Fixed several points where warnings related to the use of count() and the Countable interface would occur due to changes in PHP 7.2.
195
  * Tested with WordPress 4.9.
@@ -286,4 +292,4 @@ See also the [Groups Documentation](http://docs.itthinx.com/document/groups/) pa
286
 
287
  == Upgrade Notice ==
288
 
289
- This release has been tested with WordPress 4.9 and contains several fixes for compatibility with PHP 7.2, fixes related to post filtering and an improved notice handling.
2
  Contributors: itthinx, proaktion
3
  Donate link: http://www.itthinx.com/plugins/groups
4
  Tags: groups, access, access control, membership, memberships, member, members, capability, capabilities, content, download, downloads, file, file access, files, paypal, permission, permissions, subscription, subscriptions, woocommerce
5
+ Requires at least: 4.6
6
  Tested up to: 4.9
7
  Requires PHP: 5.5.38
8
+ Stable tag: 2.4.0
9
  License: GPLv3
10
 
11
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
190
 
191
  == Changelog ==
192
 
193
+ = 2.4.0 =
194
+ * Improved performance when filtering the users list by groups to avoid issues with large user bases.
195
+ * Tested with the latest WordPress 4.9.
196
+ * Updated the minimum required WordPress version to 4.6.
197
+ * Fixed a missing Javascript resource when selecting an image in the customizer.
198
+
199
  = 2.3.1 =
200
  * Fixed several points where warnings related to the use of count() and the Countable interface would occur due to changes in PHP 7.2.
201
  * Tested with WordPress 4.9.
292
 
293
  == Upgrade Notice ==
294
 
295
+ This release has been tested with WordPress 4.9 and Groups now requires at least WordPress 4.6. It contains fixes related to performance and scripts.