Plugin Directory

Changeset 2459557


Ignore:
Timestamp:
01/20/2021 10:14:33 AM (5 years ago)
Author:
eighty20results
Message:

Update to version 7.0 from GitHub

Location:
e20r-members-list
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • e20r-members-list/tags/7.0/README.txt

    r2458480 r2459557  
    55Tested up to: 5.4
    66Requires PHP: 7.1
    7 Stable tag: 6.3
     7Stable tag: 7.0
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl
     
    176176Example: `add_filter( 'e20r-members-list-db-type-header-map', 'e20r_add_to_db_header_map', 10, 2 );`
    177177
     178=== e20r_memberslist_search_user_fields ===
     179
     180Modifies: Array (list) of fields included when performing a search
     181
     182Purpose: 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
     184Default: The default wp_users table fields to search in (i.e. user_login, user_nicename, display_name, user_email)
     185
     186Dependencies: N/A
     187
     188Example: `add_filter( 'e20r_memberslist_search_user_fields', 'e20r_update_usertable_fields', 10, 1 );`
     189
     190=== e20r_memberslist_search_usermeta_fields ===
     191
     192Modifies: Array (list) of fields included when performing a search
     193
     194Purpose: 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
     196Default: The default wp_usermeta table fields to search in (i.e. meta_value)
     197
     198Dependencies: N/A
     199
     200Example: `add_filter( 'e20r_memberslist_search_usermeta_fields', 'e20r_update_usertable_fields', 10, 1 );`
    178201
    179202== Actions ==
     
    190213
    191214== 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
    192225
    193226== 6.3 ==
  • e20r-members-list/tags/7.0/build_env/remove_update.sh

    r2458480 r2459557  
    3030        echo "ℹ︎ Found unsupported external update script in utilities module. Removing"
    3131        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}"
    3333    fi
    34 
    3534
    3635    if [[ -d trunk/class/utilities/inc/yahnis-elsts ]]; then
  • e20r-members-list/tags/7.0/class.e20r-members-list.php

    r2458480 r2459557  
    44Plugin URI: https://wordpress.org/plugins/e20r-members-list
    55Description: Extensible, sortable & bulk action capable members listing + export to CSV tool for Paid Memberships Pro.
    6 Version: 6.3
     6Version: 7.0
    77Author: Thomas Sjolshagen @ Eighty / 20 Results by Wicked Strong Chicks, LLC <[email protected]>
    88Author URI: https://eighty20results.com/thomas-sjolshagen/
     
    3333
    3434if ( ! defined( 'E20R_MEMBERSLIST_VER' ) ) {
    35     define( 'E20R_MEMBERSLIST_VER', '6.3' );
     35    define( 'E20R_MEMBERSLIST_VER', '7.0' );
    3636}
    3737
     
    118118            } );
    119119
    120             foreach ( new \ RecursiveIteratorIterator( $iterator ) as $f_filename => $f_file ) {
     120            try {
     121                foreach ( new \ RecursiveIteratorIterator( $iterator ) as $f_filename => $f_file ) {
    121122
    122                 $class_path = $f_file->getPath() . "/" . $f_file->getFilename();
     123                    $class_path = $f_file->getPath() . "/" . $f_file->getFilename();
    123124
    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                    }
    126128                }
     129            } catch( \Exception $e ) {
     130                error_log("Error loading ${class_name}: " . $e->getMessage() );
     131                return false;
    127132            }
    128133        }
  • e20r-members-list/tags/7.0/class/members-list/class.members-list-page.php

    r2458244 r2459557  
    417417                        <input type="hidden" name="page" value="e20r-memberslist"/>
    418418                        <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"
    420420                               value="<?php _e( 'Search Members', 'paid-memberships-pro' ); ?>"/>
    421421                    </p>
  • e20r-members-list/tags/7.0/class/members-list/class.members-list.php

    r2458244 r2459557  
    769769            }
    770770
    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
    775827            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' ";
    777829            }
    778830
    779831            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' ";
    781833            }
    782834
     
    9741026     * Calculate pagination data (number of records found (total) based on the SQL used)
    9751027     *
    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     *
    9771030     * @credit https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows
    9781031     *
     
    9951048     * @param string $order_by
    9961049     *
     1050     * @uses string e20r_memberslist_export_sort_order - Filter to return comma separated list of DB fields
     1051     *
    9971052     * @return string
    9981053     */
    9991054    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' );
    10011056    }
    10021057
     
    16901745
    16911746        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            );
    16931750        }
    16941751
  • e20r-members-list/tags/7.0/class/members-list/js/e20r-memberslist-page.js

    r2458244 r2459557  
    3636            this.bulkUpdate = $('#doaction, #doaction2');
    3737            this.updateListBtn = $('#e20r-update-list');
    38 
     38            this.search_field = $('#post-search-input');
    3939            this.dateFields = $('.e20r-members-list-input-enddate, .e20r-members-list-input-startdate');
     40            this.dataSearchBtn = $('#e20r-memberslist-search-data');
    4041
    4142            this.bulkActionSelectTop = $('select#bulk-action-selector-top');
     
    5253                dateFormat: "yy-mm-dd"
    5354            });
     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            });
    5462
    5563            self.changed_input.unbind('blur').on('blur', function(ev) {
     
    272280            */
    273281        },
     282        search_submit: function () {
     283
     284        },
    274285        set_update: function( $element ) {
    275286            var self = this;
  • e20r-members-list/trunk/README.txt

    r2458480 r2459557  
    55Tested up to: 5.4
    66Requires PHP: 7.1
    7 Stable tag: 6.3
     7Stable tag: 7.0
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl
     
    176176Example: `add_filter( 'e20r-members-list-db-type-header-map', 'e20r_add_to_db_header_map', 10, 2 );`
    177177
     178=== e20r_memberslist_search_user_fields ===
     179
     180Modifies: Array (list) of fields included when performing a search
     181
     182Purpose: 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
     184Default: The default wp_users table fields to search in (i.e. user_login, user_nicename, display_name, user_email)
     185
     186Dependencies: N/A
     187
     188Example: `add_filter( 'e20r_memberslist_search_user_fields', 'e20r_update_usertable_fields', 10, 1 );`
     189
     190=== e20r_memberslist_search_usermeta_fields ===
     191
     192Modifies: Array (list) of fields included when performing a search
     193
     194Purpose: 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
     196Default: The default wp_usermeta table fields to search in (i.e. meta_value)
     197
     198Dependencies: N/A
     199
     200Example: `add_filter( 'e20r_memberslist_search_usermeta_fields', 'e20r_update_usertable_fields', 10, 1 );`
    178201
    179202== Actions ==
     
    190213
    191214== 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
    192225
    193226== 6.3 ==
  • e20r-members-list/trunk/build_env/remove_update.sh

    r2458480 r2459557  
    3030        echo "ℹ︎ Found unsupported external update script in utilities module. Removing"
    3131        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}"
    3333    fi
    34 
    3534
    3635    if [[ -d trunk/class/utilities/inc/yahnis-elsts ]]; then
  • e20r-members-list/trunk/class.e20r-members-list.php

    r2458480 r2459557  
    44Plugin URI: https://wordpress.org/plugins/e20r-members-list
    55Description: Extensible, sortable & bulk action capable members listing + export to CSV tool for Paid Memberships Pro.
    6 Version: 6.3
     6Version: 7.0
    77Author: Thomas Sjolshagen @ Eighty / 20 Results by Wicked Strong Chicks, LLC <[email protected]>
    88Author URI: https://eighty20results.com/thomas-sjolshagen/
     
    3333
    3434if ( ! defined( 'E20R_MEMBERSLIST_VER' ) ) {
    35     define( 'E20R_MEMBERSLIST_VER', '6.3' );
     35    define( 'E20R_MEMBERSLIST_VER', '7.0' );
    3636}
    3737
     
    118118            } );
    119119
    120             foreach ( new \ RecursiveIteratorIterator( $iterator ) as $f_filename => $f_file ) {
     120            try {
     121                foreach ( new \ RecursiveIteratorIterator( $iterator ) as $f_filename => $f_file ) {
    121122
    122                 $class_path = $f_file->getPath() . "/" . $f_file->getFilename();
     123                    $class_path = $f_file->getPath() . "/" . $f_file->getFilename();
    123124
    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                    }
    126128                }
     129            } catch( \Exception $e ) {
     130                error_log("Error loading ${class_name}: " . $e->getMessage() );
     131                return false;
    127132            }
    128133        }
  • e20r-members-list/trunk/class/members-list/class.members-list-page.php

    r2458244 r2459557  
    417417                        <input type="hidden" name="page" value="e20r-memberslist"/>
    418418                        <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"
    420420                               value="<?php _e( 'Search Members', 'paid-memberships-pro' ); ?>"/>
    421421                    </p>
  • e20r-members-list/trunk/class/members-list/class.members-list.php

    r2458244 r2459557  
    769769            }
    770770
    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
    775827            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' ";
    777829            }
    778830
    779831            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' ";
    781833            }
    782834
     
    9741026     * Calculate pagination data (number of records found (total) based on the SQL used)
    9751027     *
    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     *
    9771030     * @credit https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows
    9781031     *
     
    9951048     * @param string $order_by
    9961049     *
     1050     * @uses string e20r_memberslist_export_sort_order - Filter to return comma separated list of DB fields
     1051     *
    9971052     * @return string
    9981053     */
    9991054    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' );
    10011056    }
    10021057
     
    16901745
    16911746        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            );
    16931750        }
    16941751
  • e20r-members-list/trunk/class/members-list/js/e20r-memberslist-page.js

    r2458244 r2459557  
    3636            this.bulkUpdate = $('#doaction, #doaction2');
    3737            this.updateListBtn = $('#e20r-update-list');
    38 
     38            this.search_field = $('#post-search-input');
    3939            this.dateFields = $('.e20r-members-list-input-enddate, .e20r-members-list-input-startdate');
     40            this.dataSearchBtn = $('#e20r-memberslist-search-data');
    4041
    4142            this.bulkActionSelectTop = $('select#bulk-action-selector-top');
     
    5253                dateFormat: "yy-mm-dd"
    5354            });
     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            });
    5462
    5563            self.changed_input.unbind('blur').on('blur', function(ev) {
     
    272280            */
    273281        },
     282        search_submit: function () {
     283
     284        },
    274285        set_update: function( $element ) {
    275286            var self = this;
Note: See TracChangeset for help on using the changeset viewer.