Skip to content

Commit

Permalink
Only display network storage if it is in the cache, requires cron to …
Browse files Browse the repository at this point in the history
…run, otherwise du runs on every dashboard load
  • Loading branch information
cmurtagh committed Nov 11, 2021
1 parent 11eb173 commit 6edf808
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions inc/stats/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,8 @@ function display_network_storage() {
$storage = get_site_transient( get_network_storage_cache_key() );
if ( ! empty( $storage ) ) {
$cached = '<!-- CACHED -->';
} else {
$cached = '';
$storage = calculate_network_storage();
}
printf( '%1$s<p>%2$s: %3$s</p>', $cached, __( 'Network Storage', 'pressbooks-stats' ), $storage );
printf( '%1$s<p>%2$s: %3$s</p>', $cached, __( 'Network Storage', 'pressbooks-stats' ), $storage );
}
}

function calculate_network_storage() {
Expand Down

0 comments on commit 6edf808

Please sign in to comment.