WP Manifestindependent plugin directory
manifest / developer / bonsai-code-injector

Bonsai Code Injector WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

A minimal WordPress plugin for pasting tracking and verification code into a site's <head> and immediately after <body> — without editing theme files.

★ 0stars
20release downloads
≈10active sites
1.3.1latest · 18d ago

Install

Download bonsai-code-injector.zip From the 1.3.1 release on GitHub, Oct 5, 2026

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/bonsai-systems/bonsai-code-injector/releases/download/1.3.1/bonsai-code-injector.zip
Updates itself. It ships its own updater (Plugin Update Checker), so new versions appear under Dashboard → Updates.

A minimal WordPress plugin for pasting tracking and verification code into a site's <head> and immediately after <body> — without editing theme files.

Features

  • Settings page under Settings → Code Injector
  • Header Code field — printed as early as possible inside <head> on every front-end page (wp_head, priority 1). Use for the GA4 gtag.js snippet, the Google Tag Manager `` install snippet into Header Code.
  • Paste the `` install snippet into Body Code.

GA4 (gtag.js, no GTM)

  • Paste the full gtag.js snippet into Header Code. No Body Code entry is needed.

Security Note

This plugin intentionally outputs the saved code unescaped on the front end — that is its purpose. Access is restricted to users who can manage_options (site administrators). Do not lower this capability without understanding that anyone who can edit these fields can run arbitrary JavaScript on every page of the site.

Data Structure

Two options are stored:

  • bci_header_code (string)
  • bci_body_code (string)

Both are deleted when the plugin is uninstalled.

Updates

Ships with YahnisElsts/plugin-update-checker (installed via Composer, vendor/ committed) pointed at github.com/The-Bonsai-Digital-Collective/bonsai-code-injector. Sites with the plugin installed will see updates in Plugins in wp-admin, same as bonsai-maintenance.

To ship a new version:

  1. Bump the Version: header in bonsai-code-injector.php and add a CHANGELOG.md entry.
  2. Commit and push to main.
  3. Publish a GitHub Release tagged with the new version (release-assets mode is enabled, so attach a zip of the plugin folder — plain source-archive tags won't be picked up).

Sites check for updates every 6 hours ($checkPeriod argument to buildUpdateChecker()), or immediately if an admin clicks "Check again" on the Plugins screen.

Releases

7 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
1.3.1 latest
Oct 5, 2026 18d ago
bonsai-code-injector.zip
12
Oct 3, 2026 20d ago
bonsai-code-injector.zip cohort
5
Sep 30, 2026 23d ago
bonsai-code-injector.zip
3
Sep 24, 2026 29d ago
tag only
—
Jul 23, 2026 3mo ago
tag only
—
Jul 20, 2026 3mo ago
tag only
—
v.1
Jul 20, 2026 3mo ago
tag only
—

Active-site estimate ≈10 comes from the 1.3.0 cohort. Method.

A grade

Security

Bonsai Code Injector 1.3.1 · audited by WP Registry

No security issues found.

Audited release
1.3.1
Findings
none
Worst severity
—
Content hash
7ad45aade273914b51e43576…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.