| Server IP : 219.234.31.115 / Your IP : 216.73.217.134 Web Server : Apache System : Linux ebs-140924 5.10.0-30-amd64 #1 SMP Debian 5.10.218-1 (2024-06-01) x86_64 User : vndaystarftp ( 67432) PHP Version : 7.3.33 Disable Function : link,symlink,passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server,pcntl_fork,pcntl_rfork MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/wwwroot/vndaystarftp/wwwroot/wp-content/plugins/nodeinfo/includes/ |
Upload File : |
<?php
function nodeinfo_get_active_users( $duration = '1 month ago' ) {
// get all distinct authors that have published a post in the last 30 days
$posts = get_posts(
array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'post_count',
'order' => 'DESC',
'posts_per_page' => 4,
'date_query' => array(
array(
'after' => $duration,
),
),
)
);
if ( ! $posts ) {
return 0;
}
// get all distinct ID from $posts
return count(
array_unique(
wp_list_pluck(
$posts,
'post_author'
)
)
);
}
/**
* Get the masked WordPress version to only show the major and minor version.
*
* @return string The masked version.
*/
function nodeinfo_get_masked_version() {
// only show the major and minor version
$version = get_bloginfo( 'version' );
// strip the RC or beta part
$version = preg_replace( '/-.*$/', '', $version );
$version = explode( '.', $version );
$version = array_slice( $version, 0, 2 );
return implode( '.', $version );
}