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

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/7126070581
  • Loading branch information
donnchawp authored and matticbot committed Dec 7, 2023
1 parent 4675740 commit 92993a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ This is an alpha version! The changes listed here are not final.
- General: update WordPress version requirements to WordPress 6.3.
- Updated package dependencies.

### Fixed
- Supercache: add "days" to "Next preload scheduled" message.

## [1.11.0] - 2023-11-08
### Added
- Super Cache: fix "accept header" check, and add new "wpsc_accept_headers" filter on accept header list [#33972]
Expand Down
6 changes: 4 additions & 2 deletions 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 92993a8

Please sign in to comment.