Skip to content

Commit 8450fb5

Browse files
authored
Merge pull request #168 from itthinx/tested-3.7.0-6.8
Tested 3.7.0 6.8
2 parents d1d80ea + 5bd34bc commit 8450fb5

17 files changed

Lines changed: 803 additions & 133 deletions

COPYRIGHT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Groups
33

4-
Copyright 2011-2024 "kento" (Karim Rahimpur) www.itthinx.com
4+
Copyright 2011-2025 "kento" (Karim Rahimpur) www.itthinx.com
55

66
The files COPYRIGHT.txt and LICENSE.txt as well as ALL NOTICES IN THE
77
HEADERS OF ALL FILES MUST BE KEPT INTACT.

changelog.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
== Groups by itthinx - changelog.txt
22

3+
2025-09-08 - version 3.7.0
4+
* Update - WordPress 6.8 compatible.
5+
* Update - Requires at least WordPress 6.5.
6+
* Update - WooCommerce 10.2 compatible.
7+
* Update - Requires at least WooCommerce 8.5.
8+
* Update - Improved the row action rendering in the Groups admin screen.
9+
* Dev - Revised unused bits of code.
10+
* Dev - Added the groups_admin_groups_query filter.
11+
* Dev - Added the groups_admin_groups_results filter.
12+
* Dev - Added the groups_admin_groups_columns filter.
13+
* Dev - Added the groups_admin_groups_filters_fields_epilogue filter.
14+
* Dev - Added the groups_admin_groups_filters_html filter.
15+
* Dev - Added the groups_admin_groups_bulk_actions_fields_epilogue filter.
16+
* Dev - Added the groups_admin_groups_bulk_actions_html filter.
17+
* Dev - Added the groups_admin_groups_row_actions filter.
18+
* Dev - Added the groups_admin_groups_row_actions_html filter.
19+
* Dev - Added the groups_admin_groups_column_content filter.
20+
* Dev - Added the groups_admin_groups_handle_action action.
21+
* Dev - Added the groups_admin_groups_handle_action_submit filter.
22+
* Dev - Added the groups_admin_groups_handle_action_confirm action.
23+
* Dev - Added the groups_admin_groups_handle_action_reject action.
24+
* Dev - Added the groups_admin_groups_handle_bulk_action action.
25+
* Fix - Resolves performance issues with large sets of groups rendering using the group tree functions, as reported in https://github.com/itthinx/groups/issues/158
26+
* Fix - Legacy column for capabilities collapsing.
27+
* Add - Added info on contributing Bitcoin to support Groups development.
28+
329
2025-08-20 - version 3.6.0
430
* Update - WordPress 6.8 compatible.
531
* Dev - Removed superfluous spaces in several translations.

css/groups_admin.css

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,124 @@ div.capability.edit label {
258258
color: #f00;
259259
}
260260

261+
.groups-bitcoin-box {
262+
padding: 1em;
263+
margin: 1em;
264+
background-color: #fff;
265+
border-radius: 4px;
266+
color: #111;
267+
border: 1px solid #999;
268+
width: 256px;
269+
}
270+
.groups-bitcoin-box.options {
271+
position: relative;
272+
float: right;
273+
}
274+
.groups-bitcoin-box-inside {
275+
display: flex;
276+
flex-direction: column;
277+
text-align: center;
278+
}
279+
280+
.groups-bitcoin-box span {
281+
margin: 0.31em 0;
282+
flex-grow: 1;
283+
text-align: center;
284+
}
285+
.groups-bitcoin-box .groups-bitcoin-cta {
286+
font-weight: bold;
287+
padding-bottom: 16px;
288+
}
289+
.groups-bitcoin-box .groups-bitcoin-image img {
290+
width: 100%;
291+
}
292+
.groups-bitcoin-box.small .groups-bitcoin-image img {
293+
width: 128px;
294+
}
295+
.groups-bitcoin-box .groups-bitcoin-description {
296+
padding-top: 12px;
297+
}
298+
.groups-bitcoin-box .groups-bitcoin-description .groups-bitcoin-address {
299+
word-wrap: anywhere;
300+
vertical-align: middle;
301+
font-weight: bold;
302+
}
303+
.groups-bitcoin-box .groups-bitcoin-description .dashicons.dashicons-admin-page {
304+
opacity: 0.42;
305+
vertical-align: middle;
306+
}
307+
308+
.groups-bitcoin-box.horizontal {
309+
flex: auto;
310+
max-width: 384px;
311+
min-width: 256px;
312+
width: auto;
313+
padding: 8px;
314+
margin: 8px;
315+
}
316+
.groups-bitcoin-box.horizontal .groups-bitcoin-box-inside {
317+
display: grid;
318+
grid-template-rows: 25% 75%;
319+
grid-template-columns: 35% 65%;
320+
}
321+
.groups-bitcoin-box.horizontal .groups-bitcoin-cta {
322+
grid-column-start: 2;
323+
grid-row-start: 1;
324+
padding: 4px;
325+
}
326+
.groups-bitcoin-box.horizontal .groups-bitcoin-image {
327+
grid-row-start: 1;
328+
grid-column-start: 1;
329+
grid-row-end: span 2;
330+
}
331+
.groups-bitcoin-box.horizontal .groups-bitcoin-image img {
332+
width: 128px;
333+
}
334+
.groups-bitcoin-box.horizontal .groups-bitcoin-description {
335+
grid-row-start: 2;
336+
grid-column-start: 2;
337+
padding: 4px;
338+
}
339+
340+
.groups-bitcoin-box a.close {
341+
color: #999;
342+
line-height: 18px;
343+
position: absolute;
344+
right: 4px;
345+
text-decoration: none;
346+
top: 4px;
347+
font-family: sans;
348+
font-size: 12px;
349+
}
350+
.groups-bitcoin-box a.close::before {
351+
background: transparent;
352+
color: #ddd;
353+
content: "\f153";
354+
display: inline-block;
355+
font: normal 16px/20px dashicons;
356+
height: 20px;
357+
text-align: center;
358+
width: 20px;
359+
position: relative;
360+
top: 4px;
361+
right: 4px;
362+
transition: all .62s ease-in-out;
363+
}
364+
.groups-bitcoin-box a.close:hover::before {
365+
color: #f00;
366+
}
367+
261368
#groups-extensions-support {
262369
padding: 1em;
263370
margin: 0 0 24px 0;
264371
background-color: #fff;
265372
border-radius: 4px;
266373
color: #111;
267374
border: 2px solid #7494d1;
375+
display: flex;
376+
flex-direction: row;
377+
flex-wrap: wrap;
378+
justify-content: space-around;
268379
}
269380
#groups-extensions-support p {
270381
font-size: 14px;
@@ -283,7 +394,10 @@ div.capability.edit label {
283394
top: -4px;
284395
left: 4px;
285396
}
286-
397+
#groups-extensions-support-inside {
398+
flex: 1;
399+
min-width: 256px;
400+
}
287401
.groups-bulk-container {
288402
padding-bottom: 1em;
289403
}

groups.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* groups.php
44
*
5-
* Copyright (c) 2011-2024 "kento" Karim Rahimpur www.itthinx.com
5+
* Copyright (c) 2011-2025 "kento" Karim Rahimpur www.itthinx.com
66
*
77
* This code is released under the GNU General Public License.
88
* See COPYRIGHT.txt and LICENSE.txt.
@@ -21,11 +21,11 @@
2121
* Plugin Name: Groups
2222
* Plugin URI: https://www.itthinx.com/plugins/groups
2323
* Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24-
* Version: 3.6.0
25-
* Requires at least: 6.3
24+
* Version: 3.7.0
25+
* Requires at least: 6.5
2626
* Requires PHP: 7.4
27-
* WC requires at least: 8.2
28-
* WC tested up to: 9.6
27+
* WC requires at least: 8.5
28+
* WC tested up to: 10.2
2929
* Author: itthinx
3030
* Author URI: https://www.itthinx.com
3131
* Donate-Link: https://www.itthinx.com/shop/
@@ -36,7 +36,7 @@
3636
if ( !defined( 'ABSPATH' ) ) {
3737
exit;
3838
}
39-
define( 'GROUPS_CORE_VERSION', '3.6.0' );
39+
define( 'GROUPS_CORE_VERSION', '3.7.0' );
4040
define( 'GROUPS_FILE', __FILE__ );
4141
if ( !defined( 'GROUPS_CORE_DIR' ) ) {
4242
define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );

images/groups-bitcoin.png

144 KB
Loading
File renamed without changes.

lib/admin/class-groups-admin-notice.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,89 @@ public static function admin_notices() {
172172

173173
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
174174
}
175+
176+
/**
177+
* Provide the Bitcoin box markup.
178+
*
179+
* @return string
180+
*/
181+
public static function get_groups_bitcoin_box( $params = null ) {
182+
$type = '';
183+
$where = '';
184+
if ( is_array( $params ) ) {
185+
if ( isset( $params['type'] ) ) {
186+
switch ( $params['type'] ) {
187+
case 'vertical':
188+
case 'horizontal':
189+
$type = $params['type'];
190+
break;
191+
}
192+
}
193+
if ( isset( $params['where'] ) ) {
194+
switch ( $params['where'] ) {
195+
case 'options':
196+
case 'add-ons':
197+
$where = $params['where'];
198+
break;
199+
}
200+
}
201+
}
202+
$bitcoin_address = 'bc1q7klf9ge8gvtl4h4qlh6c73tgk0cdehfv5vcq0g';
203+
$bitcoin_box = sprintf( '<div id="groups-bitcoin-box" class="groups-bitcoin-box %s %s">', esc_attr( $type ), esc_attr( $where ) );
204+
$bitcoin_box .= '<div class="groups-bitcoin-box-inside">';
205+
$bitcoin_box .= '<div class="groups-bitcoin-cta">';
206+
$bitcoin_box .= esc_html__( 'Contribute Bitcoin to Groups', 'groups' );
207+
$bitcoin_box .= '</div>'; // .groups-bitcoin-cta
208+
$bitcoin_box .= '<div class="groups-bitcoin-image">';
209+
$bitcoin_box .= sprintf( '<img class="groups-bitcoin-address-image" src="%s"/>', esc_url( GROUPS_PLUGIN_URL .'images/groups-bitcoin.png' ) );
210+
$bitcoin_box .= '</div>'; // .groups-bitcoin-image
211+
$bitcoin_box .= '<div class="groups-bitcoin-description">';
212+
$bitcoin_box .= sprintf(
213+
esc_html__( 'Support the developers and contribute Bitcoin to %s', 'groups' ),
214+
'<span class="groups-bitcoin-address">' . esc_html( $bitcoin_address ) . '</span>' .
215+
'&ensp;' .
216+
'<span class="dashicons dashicons-admin-page pseudo-copy-icon" style="display:none"></span>'
217+
);
218+
$bitcoin_box .= '</div>'; // .groups-bitcoin-description
219+
$bitcoin_box .= '</div>'; // .groups-bitcoin-box-inside
220+
$bitcoin_box .= '</div>'; // .groups-bitcoin-box
221+
$bitcoin_box .= '<script type="text/javascript">';
222+
$bitcoin_box .= 'if ( typeof groups_bitcoin_box_address === "undefined" ) {';
223+
$bitcoin_box .= 'function groups_bitcoin_box_address( event ) {';
224+
$bitcoin_box .= 'if ( navigator.clipboard && window.isSecureContext ) {';
225+
$bitcoin_box .= 'try {';
226+
$bitcoin_box .= 'navigator.clipboard.writeText("' . esc_html( $bitcoin_address ) .'");';
227+
$bitcoin_box .= 'jQuery( event.target ).closest( ".groups-bitcoin-box-inside" ).fadeOut( 100 ).fadeIn( 100 );';
228+
$bitcoin_box .= '} catch (error) {';
229+
$bitcoin_box .= '}';
230+
$bitcoin_box .= '} else if ( document.queryCommandEnabled && document.queryCommandEnabled( "copy" ) ) {';
231+
$bitcoin_box .= 'let tmp = document.createElement("textarea");';
232+
$bitcoin_box .= sprintf( 'tmp.value="%s";', $bitcoin_address );
233+
$bitcoin_box .= 'tmp.setAttribute("style","display:none");';
234+
$bitcoin_box .= 'tmp.select();';
235+
$bitcoin_box .= 'try {';
236+
$bitcoin_box .= 'document.execCommand( "copy" );';
237+
$bitcoin_box .= 'jQuery( event.target ).closest( ".groups-bitcoin-box-inside" ).fadeOut( 100 ).fadeIn( 100 );';
238+
$bitcoin_box .= '} catch ( error ) {';
239+
$bitcoin_box .= '} finally {';
240+
$bitcoin_box .= 'tmp.remove();';
241+
$bitcoin_box .= '}';
242+
$bitcoin_box .= '}';
243+
$bitcoin_box .= '}';
244+
$bitcoin_box .= 'document.addEventListener( "DOMContentLoaded", function() {';
245+
$bitcoin_box .= 'if ( typeof jQuery !== "undefined" ) {';
246+
$bitcoin_box .= 'if ( navigator.clipboard && window.isSecureContext || document.queryCommandEnabled && document.queryCommandEnabled( "copy" ) ) {';
247+
$bitcoin_box .= 'jQuery( ".groups-bitcoin-box" ).click( groups_bitcoin_box_address );';
248+
$bitcoin_box .= 'jQuery( ".groups-bitcoin-box" ).css( "cursor", "pointer" );';
249+
$bitcoin_box .= 'jQuery( ".groups-bitcoin-box .pseudo-copy-icon" ).css( "display", "inline" );';
250+
$bitcoin_box .= '} else {';
251+
$bitcoin_box .= 'jQuery( ".groups-bitcoin-box .dashicons.dashicons-admin-page" ).remove();';
252+
$bitcoin_box .= '}';
253+
$bitcoin_box .= '}';
254+
$bitcoin_box .= '} );'; // DOMContentLoaded
255+
$bitcoin_box .= '}'; // typeof
256+
$bitcoin_box .= '</script>';
257+
return $bitcoin_box;
258+
}
175259
}
176260
Groups_Admin_Notice::init();

lib/admin/class-groups-admin-posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static function admin_head() {
121121
echo '.wp-list-table td { overflow: visible; }'; // idem for bulk actions
122122
echo 'label.groups-read-terms { vertical-align: middle; line-height: 28px; margin-right: 4px; }'; // Terms checkbox label
123123
echo 'label.groups-read-terms input[type="checkbox"] { height: 1rem; }'; // Terms checkbox
124-
echo 'th.column-groups, th.column-groups-read { width:10%; }';
124+
echo 'th.column-groups, th.column-groups-read, th.column-capabilities { width:10%; }';
125125
echo '</style>';
126126
}
127127
}

lib/admin/class-groups-admin.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ public static function admin_print_styles() {
8484
*/
8585
public static function admin_print_scripts() {
8686
global $groups_version;
87-
// this one's currently empty
88-
// wp_enqueue_script( 'groups_admin', GROUPS_PLUGIN_URL . 'js/groups_admin.js', array( ), $groups_version );
87+
// wp_enqueue_script( 'groups-admin', GROUPS_PLUGIN_URL . 'js/groups-admin.js', array( ), $groups_version );
8988
Groups_UIE::enqueue( 'select' );
9089
}
9190

lib/admin/groups-admin-add-ons.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function groups_admin_add_ons() {
3232
echo esc_html__( 'Add-Ons', 'groups' );
3333
echo '</h1>';
3434

35+
echo '<div class="groups-extensions-support-contribute">';
3536
$extensions_box = '<div id="groups-extensions-support">';
37+
$extensions_box .= '<div id="groups-extensions-support-inside">';
3638
$extensions_box .= '<h2>';
3739
$extensions_box .= esc_html__( 'Your support matters!', 'groups' );
3840
$extensions_box .= '</h2>';
@@ -43,8 +45,14 @@ function groups_admin_add_ons() {
4345
$extensions_box .= esc_html__( 'By getting an official extension, you fund the work that is necessary to maintain and improve Groups.', 'groups' );
4446
$extensions_box .= '</p>';
4547
$extensions_box .= '</div>';
48+
$extensions_box .= Groups_Admin_Notice::get_groups_bitcoin_box( array( 'type' => 'horizontal', 'where' => 'add-ons' ) );
49+
$extensions_box .= '</div>';
4650
echo $extensions_box; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
4751

52+
// echo Groups_Admin_Notice::get_groups_bitcoin_box( array( 'type' => 'horizontal', 'where' => 'add-ons' ) );
53+
54+
echo '</div>'; // .groups-extensions-support-contribute
55+
4856
groups_admin_add_ons_content();
4957
echo '</div>'; // .groups-admin-add-ons.wrap
5058
}

0 commit comments

Comments
 (0)