CodeColorer highlights code snippets in posts, comments, and RSS feeds with the bundled GeSHi syntax highlighter. It supports block and inline code, themes, line numbers, and comment-safe shortcode handling.
See the plugin page on WordPress.org.
Use [cc]...[/cc] for block code, [cci]...[/cci] for inline code, or
<code>...</code> for compatibility with existing content.
[cc lang="php" line_numbers="true"]
<?php
echo "Hello, world!";
?>
[/cc]
Inline example: [cci lang="php"]$answer = 42;[/cci]
You can also use suffix shortcodes such as [cc_php]...[/cc_php] or
[cci_javascript]...[/cci_javascript].
lang: language slug such asphp,javascript,ruby, orcss.line_numbers: show or hide line numbers.tab_size: spaces per tab character.linesandheight: control when vertical scrolling starts.widthandrss_width: set block width on the site and in feeds.theme: choose a bundled theme such asblackboardorsolarized-dark.highlight: highlight specific lines or ranges such as1,5,8-11.escaped: decode HTML entities before highlighting.class: append custom CSS classes to the wrapper element.file: load code from a path relative to the WordPress uploads directory for trusted content.
Always quote attribute values. Boolean attributes accept true/false,
on/off, or 1/0. See readme.txt for the full parameter
reference and WordPress.org readme content.
Local development is pinned with mise and the CI matrix runs on GitHub Actions.
mise trust
mise install
composer install
pnpm install
mise run test
bin/install-wp-tests.sh codecolorer_test root root localhost 6.9
mise run test-wp
pnpm run wp-env:startmise run test runs the fast PHP-only suite.
mise run test-wp runs WordPress integration tests against the official WordPress test suite after bin/install-wp-tests.sh has set up WordPress core/tests and a MySQL database.
The wp-env setup provides a local WordPress instance for plugin development and manual testing.
WordPress.org releases are tag-driven. Create a plain Git tag such as 0.11.0; do not use a v prefix.
The GitHub release workflow builds from the tag, applies .distignore,
publishes the plugin to WordPress.org SVN trunk/, and creates the matching SVN
tag.
Manual workflow_dispatch runs preflight by default. Set perform_deploy only when you want the workflow to commit to WordPress.org SVN.
Plugin-directory assets live in .wordpress-org/assets
and are synced from main to WordPress.org SVN assets/ whenever
.wordpress-org/ changes land on main. Release runs only
publish trunk/ and the matching SVN tag. Source PSD files stay in Git for
editing, but are not published to WordPress.org SVN.
CodeColorer vendors GeSHi 1.0.9.0 in lib/geshi.php
(GESHI_VERSION). Repository history records the 1.0.9 vendor refresh and a
later PHP 8 compatibility backport, so treat lib/geshi/ as upstream GeSHi
plus a small set of project-local maintenance patches.
