v1.7.1
This commit is contained in:
parent
4402f3570d
commit
7b7fff5246
36 changed files with 610 additions and 31 deletions
|
|
@ -7,6 +7,10 @@
|
|||
|
||||
namespace MediaRightsAudit\Admin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use MediaRightsAudit\Admin\AlertsPage;
|
||||
use MediaRightsAudit\Admin\AttachmentDetailPage;
|
||||
use MediaRightsAudit\External\ExternalScanner;
|
||||
|
|
@ -928,6 +932,11 @@ class AuditPage {
|
|||
* @return int
|
||||
*/
|
||||
private static function get_alert_attachment_count(): int {
|
||||
$cached = get_transient( 'mra_alert_count' );
|
||||
if ( is_int( $cached ) ) {
|
||||
return $cached;
|
||||
}
|
||||
|
||||
global $wpdb;
|
||||
|
||||
// phpcs:ignore WordPress.DB.DirectDatabaseQuery
|
||||
|
|
@ -937,6 +946,7 @@ class AuditPage {
|
|||
);
|
||||
|
||||
if ( ! is_array( $rows ) ) {
|
||||
set_transient( 'mra_alert_count', 0, HOUR_IN_SECONDS );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -983,6 +993,7 @@ class AuditPage {
|
|||
}
|
||||
}
|
||||
|
||||
set_transient( 'mra_alert_count', $alert_count, HOUR_IN_SECONDS );
|
||||
return $alert_count;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue