Repository navigation
Releases
Releases · WebberZone/webberzone-code-block-highlighting
v1.3.0
Changelog
Release date: 11 October 2026
Release post: https://webberzone.com/announcements/code-block-highlighting-v1-3/
Added
- Convert Code Blocks screen, linked from the settings page banner, and
wp wzcbh migrate-code-blocksWP-CLI command to convert code blocks saved by earlier versions in bulk. - Per-block color scheme option to override the global color scheme for a single code block, also stored by Save as default.
- Language detection for code blocks with no language set, in server-side mode. Turn on Detect Language in the settings; blocks that do not clearly match a language stay plain.
Changed
- Save as default now also stores the block's download button setting.
Fixed
- Code blocks with a language, file name, highlighted lines, max height or custom start line showed "This block contains unexpected or invalid content" after the plugin was deactivated. Blocks saved by earlier versions convert when their post is updated.
- In server-side mode, a custom start line was ignored when the block also had a max height or a spacing style.
- Code blocks inside synced patterns, widgets or templates were not highlighted when the post content itself had no code block.
- Opening a post in the editor applied the saved block defaults to its existing code blocks and marked the post as changed. Defaults now apply only to newly inserted blocks.
Full Changelog: v1.2.3...v1.3.0
v1.2.3
Changelog
Release date: 3 October 2026
Fixed
- Code blocks saved by the older Code Syntax Block plugin showed "This block contains unexpected content" in the block editor. They now open normally and switch to the current format when the post is saved.
- Setting names on the settings screen and setup wizard were not linked to their fields, so clicking a name did not focus the field and screen readers did not announce it.
- Saving the default language or line numbers from the block editor caused a fatal error on PHP 8 when the stored settings option was not an array.
- Deprecation notices on PHP 8.6 from
spl_object_hash().
Full Changelog: v1.2.2...v1.2.3
v1.2.2
Changelog
Release date: 10 September 2026
Changed
- Server-side highlighting is faster on pages with several code blocks, and very large blocks now fall back to unhighlighted text rather than stalling the page — the threshold is filterable with the new
wzcbh_server_highlight_max_bytes. - Settings screens and per-block help text now use American English.
Security
- Hardened settings sanitization so every field type is sanitized before it is stored, with choice fields validated against the options they register.
- Hardened textarea sanitization in the settings framework.
- The color scheme setting is now validated everywhere it is used to build a file path.
Fixed
- A file name containing
$0,$1or\0was written into the block's markup as the surrounding tag text instead of the name itself; line ranges and download file names were affected the same way. - Copying a code block in server-side mode added a blank line after every highlighted line.
- Server-side mode repeated the language class the block had already saved, and could add an empty
classattribute. data-title,data-lineanddata-startwere written twice on every code block.- With line highlighting on, server-side mode could render one line more than the line-number gutter showed, and the extra line could pick up the highlight.
- A "Highlight lines" value spanning a very large range, such as
1-999999999, exhausted memory while the page was rendering. - The "Settings" link in the admin banner, and the redirect at the end of the setup wizard, pointed at an address that returned a permissions error.
- Code blocks stopped the page rendering when a theme or plugin made the main query return post IDs rather than posts.
- Deprecation notices on PHP 8.6 from calling
trim()without an explicit second argument.
Full Changelog: v1.2.1...v1.2.2
v1.2.1
Changelog
Release Date - 20 August 2026
- Improvement: Setting defaults are now resolved from a single lightweight list instead of building every settings field, so reading an option early in the page load no longer risks a "translation loading triggered too early" notice.
- Fix: Fixed settings on a multisite network reading another site's values in the same request after a
switch_to_blog()call. - Fix: Fixed the settings wizard silently dropping repeater field rows on save.
Full Changelog: v1.2.0...v1.2.1
v1.2.0
Changelog
Release Date - 6 August 2026
Release post: https://webberzone.com/announcements/code-block-highlighting-v1-2-0/
- New: File name tab. The file name set on a block now renders as an editor-style tab above the code block, coloured to match the active Prism theme. Works identically in client-side and server-side modes.
- New: "File Name Style" setting to choose between the new tab and the previous toolbar label.
- New:
wzcbh_file_tab_htmlfilter to customise the file name tab markup. - New: Download snippet button. A "Download" button now appears next to "Copy" in the code block toolbar, saving the snippet as a file named after the block's file name, or
snippet.{ext}derived from its language. Enabled by default; it can be turned off globally with the new "Download Snippet" setting, or per block from the "Download button" control in the block sidebar. - New:
wzcbh_download_extensionsfilter to customise the language-to-file-extension map used for downloads. - Fix: File names saved by the older Code Syntax Block plugin (stored as a
titleattribute on the<pre>) are now displayed on the frontend without needing the post to be re-saved. - Fix: The block editor canvas no longer picked up
background: windowfrom the forced-colors media query in several themes, which left the editor code block unstyled.
Full Changelog: v1.1.0...v1.2.0
v1.1.0
Changelog
Release Date - 10 June 2026
Release post: https://webberzone.com/announcements/code-block-highlighting-v1-1-0/
- New: Server-side highlighting mode powered by highlight.php — syntax is pre-rendered on the server with no JavaScript required for highlighting.
- New: All 21 Prism themes work identically in both client-side and server-side modes. Server mode now outputs Prism-compatible token classes and loads the same theme CSS, so switching modes produces no visual difference.
- New: Added "Plain Text" language option to the language picker. Renders with Prism theme styling but no syntax highlighting.
- Fix: Duplicate
language-*class on<code>elements in client mode when the saved block HTML already carried the class.
Full Changelog: v1.0.0...v1.1.0
1.0.0
- Initial release.
- Extends
core/codewith Prism.js syntax highlighting — no block replacement, no block validation errors. - 40 supported languages with per-block language selection.
- 21 built-in Prism themes selectable from the settings page.
- Per-block controls: language, line numbers, start line, word wrap, title, highlight lines, and max height.
- Expand/collapse toolbar button for blocks with a max-height set.
- Smart asset loading — Prism CSS and JS only enqueued on pages containing code blocks.
- Copy-to-clipboard and show-language toolbar buttons (configurable globally).
- Global settings page for colour scheme, default language, and more.
- Developer filters:
wzcbh_languages,wzcbh_color_scheme_css_url,wzcbh_force_load_assets. - GDPR-friendly: no data collection, no external requests.