About this plugin
OrioleOne Instant Copy enhances the standard WordPress Gutenberg Code block ( core/code ) by injecting a small, accessible “Copy” button into the top-right corner of every code block on your site — automatically, on every existing and future post.
No shortcodes. No block-editor changes. No database modifications.
Pure progressive enhancement.
How it works
wp-block-code element after the page loads and appends a lightweight Copy button. execCommand fallback for older browsers.
The stored post content is never touched. If you deactivate or uninstall the plugin, your posts are exactly as they were before.
Key Features
- Automatic — works on all existing and future posts without any editor involvement.
- Lightweight — small, self-hosted CSS and JavaScript assets. Zero dependencies.
- Accessible — keyboard navigable, aria-label support, focus-visible outlines, screen-reader text, reduced-motion aware, high-contrast mode support.
- Smart enqueueing — assets are loaded only on pages that actually contain a Gutenberg code block, not on every page of your site.
- Clipboard API with fallback — uses navigator.clipboard.writeText() on secure contexts and falls back to execCommand('copy') for legacy environments.
- Duplicate-proof — skips any code block that already has a copy button to avoid conflicts with other plugins.
- Theme-safe — uses currentColor and semi-transparent backgrounds; works with light and dark themes without hardcoding colours.
- No jQuery — vanilla JavaScript only.
- No tracking, no telemetry, no external requests — 100% self-hosted.
- Multisite compatible.
Settings
Find the settings under Settings → OrioleOne Instant Copy:
- Enable / Disable the button globally.
- Button text — customise the label shown on the button (default: “Copy”).
- Success text — customise the label shown after copying (default: “Copied!”).
- Position — Top Right (additional positions planned for v2).
Developer Notes
All settings use the WordPress Settings API with sanitize_callback and proper nonce handling via settings_fields(). No custom REST endpoints, no Gutenberg/React dependencies, no build tools required.
The plugin defines the following PHP constant and classes:
- ORIOLE_OIC_VERSION — current plugin version string.
- Oriole_OIC_Plugin — main bootstrap class (singleton).
- Oriole_OIC_Settings — settings page and storage class.
Option stored in wp_options: oriole_oic_settings (autoloaded, single serialised array).