-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtootpress_reports.php
57 lines (48 loc) · 986 Bytes
/
tootpress_reports.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Reports
*
* @package TootPress
* @since 0.1
*/
// Security: Stops code execution if WordPress is not loaded
if (!defined('ABSPATH')) { exit; }
/**
*
* Get Amount of Mastodon API Requests
*
* @since 0.1
*
* @return int Amount of API Requests
*/
function tootpress_get_amount_of_api_requests(){
$amount_of_mastodon_api_requests=get_option('tootpress_mastodon_amount_of_requests');
return $amount_of_mastodon_api_requests;
}
/**
*
* Get Amount of Toots
*
* @since 0.1
*
* @return int Amount of Toots
*/
function tootpress_get_amount_of_toots() {
global $wpdb;
$table_name=$wpdb->prefix . 'tootpress_toots';
return $wpdb->get_var( "SELECT COUNT(*) FROM $table_name" );
}
/**
*
* Get Amount of Media
*
* @since 0.1
*
* @return int Amount of Media
*/
function tootpress_get_amount_of_media() {
global $wpdb;
$table_name=$wpdb->prefix . 'tootpress_media';
return $wpdb->get_var( "SELECT COUNT(*) FROM $table_name" );
}
?>