Hello
I have looked in your code and found that you log user by your specifically set roles.. which are based on common WordPress roles but are not taken from the current WordPress instance it self.
And so while I changed your code in class-aal-activity-log-list-table.php
from this:
foreach ( $this->_get_allow_caps() as $cap ) {
$output[ $cap ] = __( ucwords( $cap ), 'aryo-aal' );
}
if ( ! empty( $output ) ) {
echo '<select name="capshow" id="hs-filter-capshow">';
printf( '<option value="">%s</option>', __( 'All Roles', 'aryo-aal' ) );
foreach ( $output as $key => $value ) {
printf( '<option value="%s"%s>%s</option>', $key, selected( $_REQUEST['capshow'], $key, false ), $value );
}
echo '</select>';
}
to this:
global $wp_roles;
$output = $wp_roles->roles;
if ( ! empty( $output ) ) {
echo '<select name="capshow" id="hs-filter-capshow">';
printf( '<option value="">%s</option>', __( 'All Roles', 'aryo-aal' ) );
printf( '<option value="guest">%s</option>', __( 'Guest', 'aryo-aal' ) );
foreach ( $output as $key => $val) {
printf( '<option value="%s"%s>%s</option>', $key, selected( $_REQUEST['capshow'], $val['name'], false ), $val['name'] );
}
echo '</select>';
}
it populates all he registered roles well, but the logs with roles which are not
'administrator', 'editor', 'author', 'contributor', 'guest'
are not in the log by their right role, but are logged as Users instead (or in my case)
(what I’ve done is surely a hack, as the roles should be done thru your permission check _get_allow_caps first .) but it proves that the integration is not complete )
Could you please check you log function where you save group names to the log along the records that they are set correctly by their real roles? .)
btw: what would be also awesome is to have a negative filter.. meaning.. if you set a role administrator and set the filter to negative (filter out) it will show you all logs except the administrators records. .. the implementation would only requires to chage the sql for $where_caps query from OR to NOT LIKE .. I guess ??