Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [4.1.1] (2026-11-25)

### Changed
* Promotional banners now appear in a full-width bar above the plugin header, with a countdown to the end of the offer.
* Promotional banner text is now limited to links and basic formatting.

### Fixed
* Fixed welcome and announcement banners no longer appearing on the plugin's admin screens, and dismissing a banner
only hiding it until the next page load.
* Fixed admin pages failing to load when a release date in the changelog could not be read.
* Fixed snippets that were deactivated or deleted while file-based execution was turned off running again once it was
turned back on, as the file index is now rebuilt from the active snippets.
* Fixed an `Undefined array key "condition_id"` warning on sites with a file index written by an earlier version.
* Fixed snippets no longer running with file-based execution after the site's security keys and salts change.
* Fixed saved settings not being read back correctly on sites with a persistent object cache.
* Fixed warnings on the Welcome screen when its content feed lists fewer than four articles or partners.
* Fixed the plugin failing to uninstall when Complete uninstall is enabled.
* Improved validation of the importer selected on the Import screen. Thanks to crow (via Wordfence) for responsibly
disclosing this issue.

## [4.1.0] (2026-11-05)

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "code-snippets",
"description": "Manage code snippets running on a WordPress-powered site through a graphical interface.",
"homepage": "https://codesnippets.pro",
"version": "4.1.0",
"version": "4.1.1",
"main": "src/dist/edit.js",
"directories": {
"test": "tests"
Expand Down
6 changes: 3 additions & 3 deletions src/code-snippets.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* License: GPL-2.0-or-later
* License URI: license.txt
* Text Domain: code-snippets
* Version: 4.1.0
* Version: 4.1.1
* Requires PHP: 7.4
* Requires at least: 5.5
*
* @version 4.1.0
* @version 4.1.1
* @package Code_Snippets
* @author Shea Bunge <shea@codesnippets.pro>
* @copyright 2012-2026 Code Snippets Pro
Expand All @@ -37,7 +37,7 @@
*
* @const string
*/
define( 'CODE_SNIPPETS_VERSION', '4.1.0' );
define( 'CODE_SNIPPETS_VERSION', '4.1.1' );

/**
* The full path to the main file of this plugin.
Expand Down
138 changes: 138 additions & 0 deletions src/css/common/_promo-banner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
.code-snippets-has-promo-banner {
--cs-promo-banner-block-size: 50px;
}

.code-snippets-promo-banner {
--cs-promo-banner-background: #1d4a47;
--cs-promo-banner-grid: rgb(255 255 255 / 6%);
--cs-promo-banner-text: #fff;
--cs-promo-banner-text-muted: rgb(255 255 255 / 72%);
--cs-promo-banner-chip: rgb(255 255 255 / 12%);
--cs-promo-banner-label: #f0c24b;
--cs-promo-banner-action: var(--cs-color-secondary);
--cs-promo-banner-action-hover: #bd5c3b;

position: relative;
display: flex;
flex: none;
align-items: center;
justify-content: center;
gap: 22px;
box-sizing: border-box;
min-block-size: 50px;
padding-block: 8px;
padding-inline: 56px;
color: var(--cs-promo-banner-text);
background-color: var(--cs-promo-banner-background);
background-image:
linear-gradient(var(--cs-promo-banner-grid) 1px, transparent 1px),
linear-gradient(90deg, var(--cs-promo-banner-grid) 1px, transparent 1px);
background-size: 18px 18px;
font-size: 15px;
line-height: 1.4;
white-space: nowrap;
}

.code-snippets-promo-banner-label {
color: var(--cs-promo-banner-label);
font-size: 14px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
}

.code-snippets-promo-banner-text {
min-inline-size: 0;
font-weight: 600;
white-space: normal;

a {
color: inherit;
}
}

.code-snippets-promo-banner-countdown {
display: flex;
gap: 6px;

span {
padding-block: 3px;
padding-inline: 7px;
border-radius: 4px;
background: var(--cs-promo-banner-chip);
font-size: 13px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
}

.code-snippets-promo-banner-action {
padding-block: 6px;
padding-inline: 14px;
border-radius: var(--cs-control-radius);
color: var(--cs-promo-banner-text);
background: var(--cs-promo-banner-action);
font-weight: 600;
text-decoration: none;

&:hover,
&:focus {
color: var(--cs-promo-banner-text);
background: var(--cs-promo-banner-action-hover);
}
}

.code-snippets-promo-banner-secondary {
padding-inline-start: 22px;
border-inline-start: 1px solid var(--cs-promo-banner-chip);
color: var(--cs-promo-banner-text-muted);
font-size: 14px;

a {
color: var(--cs-promo-banner-text);
font-weight: 600;
}
}

.code-snippets-promo-banner-dismiss {
position: absolute;
inset-inline-end: 16px;
display: flex;
color: var(--cs-promo-banner-text-muted);
text-decoration: none;

&:hover,
&:focus {
color: var(--cs-promo-banner-text);
}
}

.code-snippets-promo-banner a:focus-visible {
outline: 2px solid var(--cs-color-accent);
outline-offset: 2px;
box-shadow: none;
}

@media (width <= 1280px) {
.code-snippets-promo-banner-secondary {
display: none;
}
}

@media (width <= 960px) {
.code-snippets-promo-banner-countdown {
display: none;
}
}

@media (width <= 600px) {
.code-snippets-promo-banner {
justify-content: flex-start;
gap: 12px;
padding-inline: 16px 48px;
}

.code-snippets-promo-banner-label {
display: none;
}
}
1 change: 1 addition & 0 deletions src/css/common/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
--cs-cloud-status-pro-verified-color: #41a269;
--cs-tooltip-background-color: rgb(19 18 18 / 90%);
--cs-toolbar-block-size: 136px;
--cs-promo-banner-block-size: 0px;
--cs-wpcontent-inline-start-indent: 20px;
--cs-sidebar-width: 320px;
--cs-sidebar-gap: 30px;
Expand Down
7 changes: 4 additions & 3 deletions src/css/common/_toolbar.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@use 'promo-banner';
@use 'upsell';
@use 'universal-search';

#wpbody {
padding-block-start: var(--cs-toolbar-block-size);
padding-block-start: calc(var(--cs-toolbar-block-size) + var(--cs-promo-banner-block-size));
}

.code-snippets-toolbar {
Expand All @@ -12,7 +13,7 @@
margin-inline-start: calc(-1 * var(--cs-wpcontent-inline-start-indent) - 2px);
position: absolute;
inline-size: calc(100% + var(--cs-wpcontent-inline-start-indent));
block-size: var(--cs-toolbar-block-size);
block-size: calc(var(--cs-toolbar-block-size) + var(--cs-promo-banner-block-size));
inset-block-start: 0;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -470,7 +471,7 @@
// padding the body rather than the page, so the toolbar has to clear it itself.
@media (width <= 600px) {
#wpbody {
padding-block-start: calc(var(--cs-toolbar-block-size) + 46px);
padding-block-start: calc(var(--cs-toolbar-block-size) + var(--cs-promo-banner-block-size) + 46px);
}

.code-snippets-toolbar {
Expand Down
4 changes: 2 additions & 2 deletions src/css/common/_upsell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@
// Bleed the upsell to the full width of the admin content area and fill the
// remaining viewport height, so it reads as a full page rather than a small
// boxed card floating in the subpage. 168px accounts for the WP admin bar
// (32px) plus the plugin toolbar (136px).
// (32px) plus the plugin toolbar (136px), which grows by any promotional banner.
.code-snippets-upsell-page {
box-sizing: border-box;
margin-inline-start: -22px;
inline-size: calc(100% + 42px);
min-block-size: calc(100vh - 168px);
min-block-size: calc(100vh - 168px - var(--cs-promo-banner-block-size));
border-radius: 0;
justify-content: center;
}
Expand Down
Loading
Loading