Skip to content

Commit

Permalink
Merge branch 'release-3.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chesio committed Oct 28, 2024
2 parents 2b0dee0 + ca6667d commit 2c9dbfe
Show file tree
Hide file tree
Showing 14 changed files with 562 additions and 266 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
#fail-fast: false
matrix:
php-version:
- "8.4"
- "8.3"
- "8.2"
- "8.1"
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# BC Cache Changelog

## Version 3.4.0 (2024-10-28)

This release has been tested with PHP 8.4.

### Added

* Plugin has been tested with PHP 8.4 [#114](https://github.com/chesio/bc-security/issues/114).
* Plugin has been tested with WordPress 6.6 [#111](https://github.com/chesio/bc-cache/issues/111) and 6.7 [#113](https://github.com/chesio/bc-cache/issues/113).
* There is a new admin bar menu item that is linked to cache viewer and has a submenu that displays warm-up status, cache stats and features clear caches button [#115](https://github.com/chesio/bc-cache/issues/115).

### Changed

* Button to flush the cache has been removed from user-related toolbar menu (right side of admin bar) [#112](https://github.com/chesio/bc-cache/issues/112) and is now available in newly added site-related toolbar menu (left side of admin bar).

## Version 3.3.2 (2024-04-22)

### Fixed
Expand Down
113 changes: 92 additions & 21 deletions assets/toolbar.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,96 @@
/* Toolbar flush icon */
#wp-admin-bar-bc-cache {
display: list-item !important;
cursor: pointer;
/* Main toolbar item */

position: relative;
#wp-admin-bar-bc-cache.bc-cache-warm-up-finished > a > .ab-icon::before {
color: lawngreen;
}
#wp-admin-bar-bc-cache .ab-empty-item {
cursor: inherit;
position: relative;

#wp-admin-bar-bc-cache.bc-cache-warm-up-runs > a > .ab-icon::before {
color: yellow;
}
#wp-admin-bar-bc-cache .ab-icon {
margin:0 !important;

#wp-admin-bar-bc-cache.bc-cache-warm-up-stalled > a > .ab-icon::before {
color: red;
}

/* Subitems */
#wp-admin-bar-bc-cache .ab-submenu .ab-item {
height: auto !important;
line-height: 1 !important;
}
#wp-admin-bar-bc-cache .ab-icon:before {
content: "\f182";

/* Improve icons vertical alignment */
#wp-admin-bar-bc-cache .dashicons-html::before,
#wp-admin-bar-bc-cache .dashicons-trash::before {
top: 2px;
margin: 0;
}

/* Toolbar working icon (spinner) */
#wp-admin-bar-bc-cache .bc-cache-spinner {

/* Stats toolbar subitem */
#wp-admin-bar-bc-cache-stats {
padding-bottom: 10px !important;
}

#wp-admin-bar-bc-cache-stats table * {
font-size: 12px;
line-height: 1;
}

#wp-admin-bar-bc-cache-stats table td,
#wp-admin-bar-bc-cache-stats table th {
border: 0;
padding: 0.25em 0.5em;
}

#wp-admin-bar-bc-cache-stats table td:first-child,
#wp-admin-bar-bc-cache-stats table th:first-child {
padding-left: 0;
}

#wp-admin-bar-bc-cache-stats table td:last-child,
#wp-admin-bar-bc-cache-stats table th:last-child {
padding-right: 0;
}

#wp-admin-bar-bc-cache-stats table th {
font-weight: bold;
}

#wp-admin-bar-bc-cache.bc-cache-warm-up-finished td.bc-cache-warm-up-status {
color: lawngreen;
}

#wp-admin-bar-bc-cache.bc-cache-warm-up-runs td.bc-cache-warm-up-status {
color: yellow;
}

#wp-admin-bar-bc-cache.bc-cache-warm-up-stalled td.bc-cache-warm-up-status {
color: red;
}


/* Clear cache button (including spinner) */
#wp-admin-bar-bc-cache-clear-button .ab-empty-item {
padding-left: 0 !important;
padding-right: 0 !important;
}

#bc-cache-clear {
border: none;
background: #464b50;
padding: 0 10px;

width: calc(100% - 20px);

cursor: pointer;
}

#bc-cache-clear:focus,
#bc-cache-clear:hover {
background: #000000;
}

#bc-cache-clear .bc-cache-spinner {
display: none;

height: 10px;
Expand All @@ -31,32 +102,32 @@

position: absolute;
left: 50%; top: 50%;
margin-left: -8px; margin-top: -8px;
margin-left: -8px; margin-top: -5px;
}

#wp-admin-bar-bc-cache.bc-cache-is-working {
#bc-cache-clear.bc-cache-is-working {
cursor: default;
}

#wp-admin-bar-bc-cache.bc-cache-is-working .ab-icon {
#bc-cache-clear.bc-cache-is-working .ab-icon::before {
opacity: 0;
}

#wp-admin-bar-bc-cache.bc-cache-is-working .bc-cache-spinner {
#bc-cache-clear.bc-cache-is-working .bc-cache-spinner {
display: block;

-webkit-animation: 1s linear 0s infinite bc_cache_rotate;
animation: 1s linear 0s infinite bc_cache_rotate;
}

#wp-admin-bar-bc-cache.bc-cache-success .bc-cache-spinner {
border-color: #02CA02;
#bc-cache-clear.bc-cache-success .bc-cache-spinner {
border-color: lawngreen;

-webkit-animation: none;
animation: none;
}

#wp-admin-bar-bc-cache.bc-cache-error .bc-cache-spinner {
#bc-cache-clear.bc-cache-error .bc-cache-spinner {
border-color: red;

-webkit-animation: none;
Expand Down
13 changes: 12 additions & 1 deletion assets/toolbar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function($, bc_cache_ajax_object, location) {
$(function() {
// Register click handler.
$('#wp-admin-bar-bc-cache').on('click', function() {
$('#bc-cache-clear').on('click', function() {

var $button = $(this);

Expand All @@ -28,6 +28,17 @@
if (response.success) {
// Update cache size (in "At a Glance" box).
$('#bc-cache-size').text(bc_cache_ajax_object.empty_cache_text);
// Remove warm-up status class from toolbar item.
$('#wp-admin-bar-bc-cache')
.removeClass('bc-cache-warm-up-finished')
.removeClass('bc-cache-warm-up-runs')
.removeClass('bc-cache-warm-up-stalled')
.removeClass('bc-cache-warm-up-off')
;
// Update toolbar info stats.
$('#bc-cache-toolbar-warm-up-status').text(bc_cache_ajax_object.warm_up_reset_text);
$('#bc-cache-toolbar-cache-size').text(bc_cache_ajax_object.zero_size_text);
$('#bc-cache-toolbar-cache-age').text(bc_cache_ajax_object.zero_age_text);
}
},
complete : function() {
Expand Down
4 changes: 2 additions & 2 deletions bc-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* Plugin Name: BC Cache
* Plugin URI: https://github.com/chesio/bc-cache
* Description: Simple full page cache plugin inspired by Cachify.
* Version: 3.3.2
* Version: 3.4.0
* Author: Česlav Przywara <ceslav@przywara.cz>
* Author URI: https://www.chesio.com
* Requires PHP: 8.1
* Requires at least: 6.2
* Tested up to: 6.5
* Tested up to: 6.7
* Text Domain: bc-cache
* GitHub Plugin URI: https://github.com/chesio/bc-cache
* Update URI: https://github.com/chesio/bc-cache
Expand Down
Loading

0 comments on commit 2c9dbfe

Please # to comment.