Skip to content

Commit

Permalink
Super Cache: Add "days" time to the "next preload scheduled" notice (#…
Browse files Browse the repository at this point in the history
…34509)

* Add days count to "next preload" message

* changelog
  • Loading branch information
donnchawp authored Dec 7, 2023
1 parent 8654e59 commit 793fbdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Supercache: add "days" to "Next preload scheduled" message.
6 changes: 4 additions & 2 deletions projects/plugins/super-cache/js/preload-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jQuery( document ).ready( function () {
const seconds = diff % 60;
const minutes = Math.floor( diff / 60 ) % 60;
const hours = Math.floor( diff / 3600 ) % 24;
const days = Math.floor( diff / 86400 );

// If we're preloading within the next minute, start loading faster.
if ( minutes + hours === 0 ) {
Expand All @@ -89,11 +90,12 @@ jQuery( document ).ready( function () {
p.append(
jQuery( '<b>' ).html(
sprintf(
/* Translators: 1: Number of hours, 2: Number of minutes, 3: Number of seconds */
/* Translators: 1: Number of days, 2: Number of hours, 3: Number of minutes, 4: Number of seconds */
__(
'<b>Next preload scheduled</b> in %1$s hours, %2$s minutes and %3$s seconds.',
'<b>Next preload scheduled</b> in %1$s days, %2$s hours, %3$s minutes and %4$s seconds.',
'wp-super-cache'
),
days,
hours,
minutes,
seconds
Expand Down

0 comments on commit 793fbdc

Please sign in to comment.