Code Block Enhancer
A lightweight WordPress plugin to supercharge the native Code block with headers, copy buttons, and smart wrapping. ⚡
by Dhanush R S · github.com/dhanushrs1/code-block-enhancer · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/dhanushrs1/code-block-enhancer/archive/refs/heads/master.zipReadme
Code Block Enhancer
Code Block Enhancer is a lightweight WordPress plugin that supercharges the default Gutenberg core/code block. It adds essential developer-friendly features like headers, file names, copy-to-clipboard functionality, and smart line wrapping—all without replacing the native block or locking your content.
🚀 Features
- Native Extension: Works directly with the core WordPress Code block. No new blocks to manage.
- Zero Lock-in: Deactivate the plugin, and your code blocks revert gracefully to standard WordPress blocks. Your content remains safe.
- Header & Filenames: Add a sleek header bar to your code snippets. Perfect for displaying filenames (e.g.,
style.css,app.js). - Copy to Clipboard: One-click copy button with visual "Copied!" feedback.
- Smart Word Wrap:
- Desktop: Toggle text wrapping on the fly with a dedicated "Wrap" button.
- Smart Visibility: The "Wrap" button only appears when code lines are actually too long for the container.
- Mobile Optimized: Horizontal scrolling for code safety, with accessible wrap controls.
- VS Code Aesthetic: Beautiful, dark-themed styling inspired by modern IDEs (
#1e1e1ebackground, Fira Code font stack). - Performance: minimal footprint. No heavy libraries. Just pure, clean JS and CSS.
📸 Screenshots
(Add screenshots of the plugin in action here)
🔧 Installation
- Download the plugin
.zipfile. - Go to your WordPress Admin Dashboard -> Plugins -> Add New.
- Click Upload Plugin and select the zip file.
- Activate Code Block Enhancer.
📖 Usage
- Open the Block Editor (Gutenberg) and insert a standard Code block.
- Look at the Block Settings sidebar (Inspector).
- Find the Code Block Enhancer panel.
- Toggle Show Header to add a title bar.
- Enter a Header Text (e.g., "functions.php").
- Toggle Enable Copy Button to show the copy icon.
- Publish your post!
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📝 Author
Dhanush R S
📄 License
This project is licensed under the GPL-2.0+ License.
Read the full README on GitHub →
Releases
| Tag | Published |
|---|---|
| v1.0.0 | Jan 28, 2026 |
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.