Changeset 2459557
- Timestamp:
- 01/20/2021 10:14:33 AM (5 years ago)
- Location:
- e20r-members-list
- Files:
-
- 12 edited
- 1 copied
-
tags/7.0 (copied) (copied from e20r-members-list/trunk)
-
tags/7.0/README.txt (modified) (3 diffs)
-
tags/7.0/build_env/remove_update.sh (modified) (1 diff)
-
tags/7.0/class.e20r-members-list.php (modified) (3 diffs)
-
tags/7.0/class/members-list/class.members-list-page.php (modified) (1 diff)
-
tags/7.0/class/members-list/class.members-list.php (modified) (4 diffs)
-
tags/7.0/class/members-list/js/e20r-memberslist-page.js (modified) (3 diffs)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/build_env/remove_update.sh (modified) (1 diff)
-
trunk/class.e20r-members-list.php (modified) (3 diffs)
-
trunk/class/members-list/class.members-list-page.php (modified) (1 diff)
-
trunk/class/members-list/class.members-list.php (modified) (4 diffs)
-
trunk/class/members-list/js/e20r-memberslist-page.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
e20r-members-list/tags/7.0/README.txt
r2458480 r2459557 5 5 Tested up to: 5.4 6 6 Requires PHP: 7.1 7 Stable tag: 6.37 Stable tag: 7.0 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl … … 176 176 Example: `add_filter( 'e20r-members-list-db-type-header-map', 'e20r_add_to_db_header_map', 10, 2 );` 177 177 178 === e20r_memberslist_search_user_fields === 179 180 Modifies: Array (list) of fields included when performing a search 181 182 Purpose: Change the fields to include in the SQL query generated by the search operation. See Default for info about fields being included already. NOTE: There's a separate filter for wp_usermeta fields. It is NOT (currently) possible to search in member information fields beyond the end date/start date. 183 184 Default: The default wp_users table fields to search in (i.e. user_login, user_nicename, display_name, user_email) 185 186 Dependencies: N/A 187 188 Example: `add_filter( 'e20r_memberslist_search_user_fields', 'e20r_update_usertable_fields', 10, 1 );` 189 190 === e20r_memberslist_search_usermeta_fields === 191 192 Modifies: Array (list) of fields included when performing a search 193 194 Purpose: Change the fields to include in the SQL query generated by the search operation. See Default for info about fields being included already. NOTE: There's a separate filter for wp_users fields. It is NOT (currently) possible to search in member information fields beyond the end date/start date. 195 196 Default: The default wp_usermeta table fields to search in (i.e. meta_value) 197 198 Dependencies: N/A 199 200 Example: `add_filter( 'e20r_memberslist_search_usermeta_fields', 'e20r_update_usertable_fields', 10, 1 );` 178 201 179 202 == Actions == … … 190 213 191 214 == Changelog == 215 216 == 7.0 == 217 * ENH: Allow filtering of User table fields to search by 218 * ENH: Allow filtering of usermeta table fields to search by 219 * ENH: Allow filtering of sort order in export 220 * ENH: Deprecate use of FOUND_ROWS() in pagination 221 * BUG FIX: Syntax error in update removal action 222 * BUG FIX: Uncaught exception in autoLoader() 223 * BUG FIX: Didn't include all logical user table fields in search query 224 * BUG FIX: Didn't trigger search if typing the 'enter' key 192 225 193 226 == 6.3 == -
e20r-members-list/tags/7.0/build_env/remove_update.sh
r2458480 r2459557 30 30 echo "ℹ︎ Found unsupported external update script in utilities module. Removing" 31 31 grep -v "Utilities::configureUpdateServerV4" "trunk/class/utilities/${UTILS_FILE}" > "trunk/class/utilities/${UTILS_FILE}.new" 32 mv "trunk/class/utilities/${UTILS_FILE}.new" trunk/class/utilities/${UTILS_FILE}"32 mv "trunk/class/utilities/${UTILS_FILE}.new" "trunk/class/utilities/${UTILS_FILE}" 33 33 fi 34 35 34 36 35 if [[ -d trunk/class/utilities/inc/yahnis-elsts ]]; then -
e20r-members-list/tags/7.0/class.e20r-members-list.php
r2458480 r2459557 4 4 Plugin URI: https://wordpress.org/plugins/e20r-members-list 5 5 Description: Extensible, sortable & bulk action capable members listing + export to CSV tool for Paid Memberships Pro. 6 Version: 6.36 Version: 7.0 7 7 Author: Thomas Sjolshagen @ Eighty / 20 Results by Wicked Strong Chicks, LLC <[email protected]> 8 8 Author URI: https://eighty20results.com/thomas-sjolshagen/ … … 33 33 34 34 if ( ! defined( 'E20R_MEMBERSLIST_VER' ) ) { 35 define( 'E20R_MEMBERSLIST_VER', ' 6.3' );35 define( 'E20R_MEMBERSLIST_VER', '7.0' ); 36 36 } 37 37 … … 118 118 } ); 119 119 120 foreach ( new \ RecursiveIteratorIterator( $iterator ) as $f_filename => $f_file ) { 120 try { 121 foreach ( new \ RecursiveIteratorIterator( $iterator ) as $f_filename => $f_file ) { 121 122 122 $class_path = $f_file->getPath() . "/" . $f_file->getFilename();123 $class_path = $f_file->getPath() . "/" . $f_file->getFilename(); 123 124 124 if ( $f_file->isFile() && false !== strpos( $class_path, $filename ) ) { 125 require_once( $class_path ); 125 if ( $f_file->isFile() && false !== strpos( $class_path, $filename ) ) { 126 require_once( $class_path ); 127 } 126 128 } 129 } catch( \Exception $e ) { 130 error_log("Error loading ${class_name}: " . $e->getMessage() ); 131 return false; 127 132 } 128 133 } -
e20r-members-list/tags/7.0/class/members-list/class.members-list-page.php
r2458244 r2459557 417 417 <input type="hidden" name="page" value="e20r-memberslist"/> 418 418 <input id="post-search-input" type="text" value="<?php esc_attr_e( $search ); ?>" name="find"/> 419 <input class="button" type="submit" 419 <input class="button" type="submit" id="e20r-memberslist-search-data" 420 420 value="<?php _e( 'Search Members', 'paid-memberships-pro' ); ?>"/> 421 421 </p> -
e20r-members-list/tags/7.0/class/members-list/class.members-list.php
r2458244 r2459557 769 769 } 770 770 771 $s = esc_sql( sanitize_text_field( $user_search ) ); 772 $this->find = " ( u.user_login LIKE '%{$s}%' OR u.user_email LIKE '%{$s}%' OR um.meta_value LIKE '%{$s}%' "; 773 774 // Search for records that have a startdate or enddate 771 // Set up the search-for part of the query (i.e. user_login, usermeta, nicename, 772 // dispay_name and user_email) 773 $srch_str = esc_sql( sanitize_text_field( $user_search ) ); 774 775 $user_table_search = apply_filters( 776 'e20r_memberslist_search_user_fields', 777 array( 778 'user_login', 779 'user_nicename', 780 'display_name', 781 'user_email' 782 ) 783 ); 784 785 $meta_table_fields = apply_filters( 786 'e20r_memberslist_search_usermeta_fields', 787 array( 'meta_value' ) 788 ); 789 790 // Start the search portion of the SQL statement 791 $this->find = sprintf( " ( u.%s LIKE '%%%s%%'", 792 array_shift( $user_table_search), 793 $srch_str 794 ); 795 796 // Add all user table fields to search by 797 foreach( $user_table_search as $idx => $field_name ) { 798 $this->find .= "OR u.${field_name} LIKE '%{$srch_str}%' "; 799 } 800 801 // Handle SQL if there's no user table fields include 802 if ( ! empty($meta_table_fields) && 803 0 === preg_match( '/ OR /', $this->find ) && 804 0 === preg_match( '/\( ', $this->find ) 805 ) { 806 $this->find = sprintf( " ( um.%s LIKE '%%%s%%'", 807 array_shift( $meta_table_fields ), 808 $srch_str 809 ); 810 } else if ( ! empty($meta_table_fields) && 811 0 === preg_match( "/ OR /", $this->find ) && 812 1 === preg_match( '/\( ', $this->find ) 813 ) { 814 $this->find = sprintf( " ( um.%s LIKE \'%%%s%%\'", 815 array_shift( $meta_table_fields ), 816 $srch_str 817 ); 818 } 819 820 // Add all/any metadata fields to search by 821 // Frankly surprising if this is more than the meta_value field.. 822 foreach( $meta_table_fields as $field_name ) { 823 $this->find .= "OR um.meta_value LIKE '%{$srch_str}%' "; 824 } 825 826 // Search for records by start-date or end-date 775 827 if ( true === $is_time && 'desc' === strtolower( $order ) ) { 776 $this->find .= "OR mu.startdate >= '{$s } 00:00:00' OR mu.enddate >= '{$s} 00:00:00' ";828 $this->find .= "OR mu.startdate >= '{$srch_str} 00:00:00' OR mu.enddate >= '{$srch_str} 00:00:00' "; 777 829 } 778 830 779 831 if ( true === $is_time && 'asc' === strtolower( $order ) ) { 780 $this->find .= "OR mu.startdate <= '{$s } 00:00:00' OR mu.enddate <= '{$s} 23:59:59' ";832 $this->find .= "OR mu.startdate <= '{$srch_str} 00:00:00' OR mu.enddate <= '{$srch_str} 23:59:59' "; 781 833 } 782 834 … … 974 1026 * Calculate pagination data (number of records found (total) based on the SQL used) 975 1027 * 976 * FIXME: Implement https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows 1028 * @deprecated See https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows 1029 * 977 1030 * @credit https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows 978 1031 * … … 995 1048 * @param string $order_by 996 1049 * 1050 * @uses string e20r_memberslist_export_sort_order - Filter to return comma separated list of DB fields 1051 * 997 1052 * @return string 998 1053 */ 999 1054 public function export_order_by( $order_by ) { 1000 return 'mu.membership_id, u.user_email';1055 return apply_filters( 'e20r_memberslist_export_sort_order', 'mu.membership_id, u.user_email' ); 1001 1056 } 1002 1057 … … 1690 1745 1691 1746 if ( empty( $e20r_pmpro_statuses ) ) { 1692 $e20r_pmpro_statuses = $wpdb->get_col( "SELECT DISTINCT mu.status FROM {$wpdb->pmpro_memberships_users} AS mu" ); 1747 $e20r_pmpro_statuses = $wpdb->get_col( 1748 "SELECT DISTINCT mu.status FROM {$wpdb->pmpro_memberships_users} AS mu" 1749 ); 1693 1750 } 1694 1751 -
e20r-members-list/tags/7.0/class/members-list/js/e20r-memberslist-page.js
r2458244 r2459557 36 36 this.bulkUpdate = $('#doaction, #doaction2'); 37 37 this.updateListBtn = $('#e20r-update-list'); 38 38 this.search_field = $('#post-search-input'); 39 39 this.dateFields = $('.e20r-members-list-input-enddate, .e20r-members-list-input-startdate'); 40 this.dataSearchBtn = $('#e20r-memberslist-search-data'); 40 41 41 42 this.bulkActionSelectTop = $('select#bulk-action-selector-top'); … … 52 53 dateFormat: "yy-mm-dd" 53 54 }); 55 56 self.search_field.unbind('keydown').on('keydown', function(event){ 57 let keycode = parseInt((event.keyCode ? event.keyCode : event.which)); 58 if (13 === keycode) { 59 self.dataSearchBtn.click(); 60 } 61 }); 54 62 55 63 self.changed_input.unbind('blur').on('blur', function(ev) { … … 272 280 */ 273 281 }, 282 search_submit: function () { 283 284 }, 274 285 set_update: function( $element ) { 275 286 var self = this; -
e20r-members-list/trunk/README.txt
r2458480 r2459557 5 5 Tested up to: 5.4 6 6 Requires PHP: 7.1 7 Stable tag: 6.37 Stable tag: 7.0 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl … … 176 176 Example: `add_filter( 'e20r-members-list-db-type-header-map', 'e20r_add_to_db_header_map', 10, 2 );` 177 177 178 === e20r_memberslist_search_user_fields === 179 180 Modifies: Array (list) of fields included when performing a search 181 182 Purpose: Change the fields to include in the SQL query generated by the search operation. See Default for info about fields being included already. NOTE: There's a separate filter for wp_usermeta fields. It is NOT (currently) possible to search in member information fields beyond the end date/start date. 183 184 Default: The default wp_users table fields to search in (i.e. user_login, user_nicename, display_name, user_email) 185 186 Dependencies: N/A 187 188 Example: `add_filter( 'e20r_memberslist_search_user_fields', 'e20r_update_usertable_fields', 10, 1 );` 189 190 === e20r_memberslist_search_usermeta_fields === 191 192 Modifies: Array (list) of fields included when performing a search 193 194 Purpose: Change the fields to include in the SQL query generated by the search operation. See Default for info about fields being included already. NOTE: There's a separate filter for wp_users fields. It is NOT (currently) possible to search in member information fields beyond the end date/start date. 195 196 Default: The default wp_usermeta table fields to search in (i.e. meta_value) 197 198 Dependencies: N/A 199 200 Example: `add_filter( 'e20r_memberslist_search_usermeta_fields', 'e20r_update_usertable_fields', 10, 1 );` 178 201 179 202 == Actions == … … 190 213 191 214 == Changelog == 215 216 == 7.0 == 217 * ENH: Allow filtering of User table fields to search by 218 * ENH: Allow filtering of usermeta table fields to search by 219 * ENH: Allow filtering of sort order in export 220 * ENH: Deprecate use of FOUND_ROWS() in pagination 221 * BUG FIX: Syntax error in update removal action 222 * BUG FIX: Uncaught exception in autoLoader() 223 * BUG FIX: Didn't include all logical user table fields in search query 224 * BUG FIX: Didn't trigger search if typing the 'enter' key 192 225 193 226 == 6.3 == -
e20r-members-list/trunk/build_env/remove_update.sh
r2458480 r2459557 30 30 echo "ℹ︎ Found unsupported external update script in utilities module. Removing" 31 31 grep -v "Utilities::configureUpdateServerV4" "trunk/class/utilities/${UTILS_FILE}" > "trunk/class/utilities/${UTILS_FILE}.new" 32 mv "trunk/class/utilities/${UTILS_FILE}.new" trunk/class/utilities/${UTILS_FILE}"32 mv "trunk/class/utilities/${UTILS_FILE}.new" "trunk/class/utilities/${UTILS_FILE}" 33 33 fi 34 35 34 36 35 if [[ -d trunk/class/utilities/inc/yahnis-elsts ]]; then -
e20r-members-list/trunk/class.e20r-members-list.php
r2458480 r2459557 4 4 Plugin URI: https://wordpress.org/plugins/e20r-members-list 5 5 Description: Extensible, sortable & bulk action capable members listing + export to CSV tool for Paid Memberships Pro. 6 Version: 6.36 Version: 7.0 7 7 Author: Thomas Sjolshagen @ Eighty / 20 Results by Wicked Strong Chicks, LLC <[email protected]> 8 8 Author URI: https://eighty20results.com/thomas-sjolshagen/ … … 33 33 34 34 if ( ! defined( 'E20R_MEMBERSLIST_VER' ) ) { 35 define( 'E20R_MEMBERSLIST_VER', ' 6.3' );35 define( 'E20R_MEMBERSLIST_VER', '7.0' ); 36 36 } 37 37 … … 118 118 } ); 119 119 120 foreach ( new \ RecursiveIteratorIterator( $iterator ) as $f_filename => $f_file ) { 120 try { 121 foreach ( new \ RecursiveIteratorIterator( $iterator ) as $f_filename => $f_file ) { 121 122 122 $class_path = $f_file->getPath() . "/" . $f_file->getFilename();123 $class_path = $f_file->getPath() . "/" . $f_file->getFilename(); 123 124 124 if ( $f_file->isFile() && false !== strpos( $class_path, $filename ) ) { 125 require_once( $class_path ); 125 if ( $f_file->isFile() && false !== strpos( $class_path, $filename ) ) { 126 require_once( $class_path ); 127 } 126 128 } 129 } catch( \Exception $e ) { 130 error_log("Error loading ${class_name}: " . $e->getMessage() ); 131 return false; 127 132 } 128 133 } -
e20r-members-list/trunk/class/members-list/class.members-list-page.php
r2458244 r2459557 417 417 <input type="hidden" name="page" value="e20r-memberslist"/> 418 418 <input id="post-search-input" type="text" value="<?php esc_attr_e( $search ); ?>" name="find"/> 419 <input class="button" type="submit" 419 <input class="button" type="submit" id="e20r-memberslist-search-data" 420 420 value="<?php _e( 'Search Members', 'paid-memberships-pro' ); ?>"/> 421 421 </p> -
e20r-members-list/trunk/class/members-list/class.members-list.php
r2458244 r2459557 769 769 } 770 770 771 $s = esc_sql( sanitize_text_field( $user_search ) ); 772 $this->find = " ( u.user_login LIKE '%{$s}%' OR u.user_email LIKE '%{$s}%' OR um.meta_value LIKE '%{$s}%' "; 773 774 // Search for records that have a startdate or enddate 771 // Set up the search-for part of the query (i.e. user_login, usermeta, nicename, 772 // dispay_name and user_email) 773 $srch_str = esc_sql( sanitize_text_field( $user_search ) ); 774 775 $user_table_search = apply_filters( 776 'e20r_memberslist_search_user_fields', 777 array( 778 'user_login', 779 'user_nicename', 780 'display_name', 781 'user_email' 782 ) 783 ); 784 785 $meta_table_fields = apply_filters( 786 'e20r_memberslist_search_usermeta_fields', 787 array( 'meta_value' ) 788 ); 789 790 // Start the search portion of the SQL statement 791 $this->find = sprintf( " ( u.%s LIKE '%%%s%%'", 792 array_shift( $user_table_search), 793 $srch_str 794 ); 795 796 // Add all user table fields to search by 797 foreach( $user_table_search as $idx => $field_name ) { 798 $this->find .= "OR u.${field_name} LIKE '%{$srch_str}%' "; 799 } 800 801 // Handle SQL if there's no user table fields include 802 if ( ! empty($meta_table_fields) && 803 0 === preg_match( '/ OR /', $this->find ) && 804 0 === preg_match( '/\( ', $this->find ) 805 ) { 806 $this->find = sprintf( " ( um.%s LIKE '%%%s%%'", 807 array_shift( $meta_table_fields ), 808 $srch_str 809 ); 810 } else if ( ! empty($meta_table_fields) && 811 0 === preg_match( "/ OR /", $this->find ) && 812 1 === preg_match( '/\( ', $this->find ) 813 ) { 814 $this->find = sprintf( " ( um.%s LIKE \'%%%s%%\'", 815 array_shift( $meta_table_fields ), 816 $srch_str 817 ); 818 } 819 820 // Add all/any metadata fields to search by 821 // Frankly surprising if this is more than the meta_value field.. 822 foreach( $meta_table_fields as $field_name ) { 823 $this->find .= "OR um.meta_value LIKE '%{$srch_str}%' "; 824 } 825 826 // Search for records by start-date or end-date 775 827 if ( true === $is_time && 'desc' === strtolower( $order ) ) { 776 $this->find .= "OR mu.startdate >= '{$s } 00:00:00' OR mu.enddate >= '{$s} 00:00:00' ";828 $this->find .= "OR mu.startdate >= '{$srch_str} 00:00:00' OR mu.enddate >= '{$srch_str} 00:00:00' "; 777 829 } 778 830 779 831 if ( true === $is_time && 'asc' === strtolower( $order ) ) { 780 $this->find .= "OR mu.startdate <= '{$s } 00:00:00' OR mu.enddate <= '{$s} 23:59:59' ";832 $this->find .= "OR mu.startdate <= '{$srch_str} 00:00:00' OR mu.enddate <= '{$srch_str} 23:59:59' "; 781 833 } 782 834 … … 974 1026 * Calculate pagination data (number of records found (total) based on the SQL used) 975 1027 * 976 * FIXME: Implement https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows 1028 * @deprecated See https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows 1029 * 977 1030 * @credit https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows 978 1031 * … … 995 1048 * @param string $order_by 996 1049 * 1050 * @uses string e20r_memberslist_export_sort_order - Filter to return comma separated list of DB fields 1051 * 997 1052 * @return string 998 1053 */ 999 1054 public function export_order_by( $order_by ) { 1000 return 'mu.membership_id, u.user_email';1055 return apply_filters( 'e20r_memberslist_export_sort_order', 'mu.membership_id, u.user_email' ); 1001 1056 } 1002 1057 … … 1690 1745 1691 1746 if ( empty( $e20r_pmpro_statuses ) ) { 1692 $e20r_pmpro_statuses = $wpdb->get_col( "SELECT DISTINCT mu.status FROM {$wpdb->pmpro_memberships_users} AS mu" ); 1747 $e20r_pmpro_statuses = $wpdb->get_col( 1748 "SELECT DISTINCT mu.status FROM {$wpdb->pmpro_memberships_users} AS mu" 1749 ); 1693 1750 } 1694 1751 -
e20r-members-list/trunk/class/members-list/js/e20r-memberslist-page.js
r2458244 r2459557 36 36 this.bulkUpdate = $('#doaction, #doaction2'); 37 37 this.updateListBtn = $('#e20r-update-list'); 38 38 this.search_field = $('#post-search-input'); 39 39 this.dateFields = $('.e20r-members-list-input-enddate, .e20r-members-list-input-startdate'); 40 this.dataSearchBtn = $('#e20r-memberslist-search-data'); 40 41 41 42 this.bulkActionSelectTop = $('select#bulk-action-selector-top'); … … 52 53 dateFormat: "yy-mm-dd" 53 54 }); 55 56 self.search_field.unbind('keydown').on('keydown', function(event){ 57 let keycode = parseInt((event.keyCode ? event.keyCode : event.which)); 58 if (13 === keycode) { 59 self.dataSearchBtn.click(); 60 } 61 }); 54 62 55 63 self.changed_input.unbind('blur').on('blur', function(ev) { … … 272 280 */ 273 281 }, 282 search_submit: function () { 283 284 }, 274 285 set_update: function( $element ) { 275 286 var self = this;
Note: See TracChangeset
for help on using the changeset viewer.