*/
class Active_User_Admin {
/**
* The ID of this plugin.
*
* @since 1.0.0
* @access private
* @var string $active_user The ID of this plugin.
*/
private $active_user;
/**
* The version of this plugin.
*
* @since 1.0.0
* @access private
* @var string $version The current version of this plugin.
*/
private $version;
/**
* Initialize the class and set its properties.
*
* @since 1.0.0
* @param string $active_user The name of this plugin.
* @param string $version The version of this plugin.
*/
public function __construct( $active_user, $version ) {
$this->active_user = $active_user;
$this->version = $version;
add_action( 'wp_loaded', array($this, 'process_deletions' ));
add_action( 'shutdown', array($this, 'process_messages' ));
}
/**
* Register the stylesheets for the admin area.
*
* @since 1.0.0
*/
public function enqueue_styles() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Active_User_Loader as all of the hooks are defined
* in that particular class.
*
* The Active_User_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
wp_enqueue_style( $this->active_user, plugin_dir_url( __FILE__ ) . 'css/active-user-admin.css', array(), $this->version, 'all' );
}
/**
* Register the JavaScript for the admin area.
*
* @since 1.0.0
*/
public function enqueue_scripts() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Active_User_Loader as all of the hooks are defined
* in that particular class.
*
* The Active_User_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
// wp_enqueue_script( $this->active_user, plugin_dir_url( __FILE__ ) . 'js/active-user-admin.js', array( 'jquery' ), $this->version, false );
}
/**
* Set up the admin page menu link.
*
* @since 1.0.0
*/
public function add_menu_page() {
$icon_svg = 'data:image/svg+xml;base64,' . base64_encode('');
add_menu_page(
__( 'Active User Settings', 'active-user' ),
__( 'Active User', 'active-user' ),
'manage_options',
'active-user',
array( $this, 'display_menu_page' ),
$icon_svg
);
add_submenu_page(
'active-user',
__( 'Settings', 'active-user' ),
__( 'Settings', 'active-user' ),
'manage_options',
'active-user',
array( $this, 'display_settings_page' )
);
add_submenu_page(
'active-user',
__( 'Active User Table', 'active-user' ),
__( 'Active User Table', 'active-user' ),
'manage_options',
'active-user-table',
array( $this, 'display_last_activity_page' )
);
}
/**
* Display the admin page.
*
* @since 1.0.0
*/
public function display_menu_page() {
}
/**
* Display the admin page.
*
* @since 1.0.0
*/
public function display_settings_page() { ?>
Upgrade now to the Pro Edition and receive a full suite of tools to deal with inactive users on your site.
The inactivity period function is the heart of the plugin. It allows you to set a point at which your users become 'inactive'. In this example, once a user has not logged in (or been active on a BuddyPress site) for 6 months, they fall into this category. Now, with a defined inactivity date, you can quickly filter who has been engaging with your site, shop or community, and who should be removed.
The grace period is another powerful feature of Active User Pro. Once enabled, as soon as a user becomes inactive, they enter a grace period. This is similar to a cooling-off period, or a function to give a user the benefit of the doubt by giving them a little bit more time to login, before you take further action.
The length of the grace period, like the inactive period can be set in days, months or years. We recommend setting this to no more than a month.
Another fantastic feature of the Active User Pro edition is the ability to notify a user once their grace period has commenced. The user is automatically sent an email explaining that they must login before the final date of the grace period, otherwise their account may be removed. Together with the grace period, this function provides another layer of protection to a site administrator, that they have done all they can to warn a user before they are ultimately removed.
To see all the Pro Edition features, head to the plugin homepage, or use the 'Upgrade' link in the menu to upgrade now.
The Deletion Queue allows a site administrator to immediately see a list of their inactive users, and remove them in one go. All your site's users are automatically checked to see if they have become inactive every day. If the grace period function is enabled, the user is not added tot he deletion queue until their grace period has expired. Imagine using this queue, once every couple of months, to clean up your inactive users. No more manual deletions. No more wasting time.
To see all the Pro Edition features, head to the plugin homepage, or use the 'Upgrade' link in the menu to upgrade now.
get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN($comma_separated) LIMIT 1 ") ) {
$users_have_content = true;
} elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN($comma_separated) LIMIT 1 " ) ) {
$users_have_content = true;
}
?>
Upgrade now to the Pro Edition and get an enhanced User Activity Table, with some fantastic features. Works directly with the other advanced funtions, such as the ability to set a date at which your users become inactive. You can then remove users who don't meet that criteria, directly from the User Activity Table.
Filter your results to see only users who are inactive, or who are in a grace period