Bonsai Popup self-updates
Displays a randomly selected promotional popup on the homepage on every visit
by The Bonsai Digital Collective · github.com/the-bonsai-digital-collective/bonsai-pop-up · 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/the-bonsai-digital-collective/bonsai-pop-up/archive/refs/heads/main.zipShips its own WordPress updater (Plugin Update Checker), so new versions show up under Dashboard → Updates.
Readme
Bonsai Popup
A lightweight WordPress plugin by The Bonsai Digital Collective that displays a randomly selected promotional popup on the homepage on every visit. Manage multiple popups from the WordPress backend with per-popup active toggles and global display settings.
Features
- Custom post type — create as many popups as you need
- Each popup supports: title, body content (basic HTML), CTA button with optional new-tab, and an image
- Per-popup Active toggle — disable without deleting
- Popup shows on every homepage visit — no session suppression
- Show on mobile setting — hide below 480px when unticked (tablets and above always see the popup)
- Configurable show delay and overlay opacity via Settings page
- Keyboard accessible — Escape to close, focus moves to modal on open
- Neutral default styling — easily overridden in your theme CSS
Requirements
- WordPress 5.8+
- PHP 7.4+
Installation
- Clone or download this repository into
/wp-content/plugins/bonsai-popup/ - Activate Bonsai Popup in WordPress Admin → Plugins
- Go to Popups in the admin sidebar
- Click Add New Popup and fill in the details
- Publish the popup
- Visit the homepage — the popup appears after the configured delay
Usage
Adding a Popup
| Field | Description |
|---|---|
| Title | Headline shown inside the popup |
| Active | Uncheck to disable without deleting |
| Content | Body text — supports <strong>, <em>, <br>, <a> |
| Link URL | CTA button destination — leave blank for no button |
| Link Text | Button label, defaults to "Find Out More" |
| Open in new tab | Adds target="_blank" rel="noopener noreferrer" to the CTA |
| Image | Optional. Recommended size: 800 × 450 px |
Settings (Popups → Settings)
| Setting | Description |
|---|---|
| Delay | Milliseconds before popup appears. Default: 2000 (2 s) |
| Show on mobile | Tick to show on screens narrower than 480px. Unticked by default |
| Overlay opacity | Background dimmer intensity — 0 = transparent, 1 = solid black |
Customising Styles
The plugin outputs neutral styles from assets/popup.css. Override in your theme:
/* Example: theme-specific accent colour */
#bdc-popup-modal .bdc-popup-cta {
background: #your-colour;
}
#bdc-popup-modal .bdc-popup-title {
color: #your-heading-colour;
}
Key selectors:
| Selector | Element |
|---|---|
#bdc-popup-overlay |
Background dimmer |
#bdc-popup-modal |
Modal container |
.bdc-popup-title |
Heading |
.bdc-popup-content |
Body text |
.bdc-popup-cta |
CTA button |
.bdc-popup-close |
Close (×) button |
.bdc-popup-image |
Optional image |
Updates
Ships with YahnisElsts/plugin-update-checker (installed via Composer, vendor/ committed) pointed at the private repo github.com/Bonsai-Systems/bonsai-pop-up, tracking the main branch.
Because the repo is private, the update checker needs a GitHub token to fetch releases. Add this to the site's wp-config.php (never commit it to the plugin):
define( 'BDC_POPUP_GITHUB_TOKEN', 'github_pat_xxxxxxxxxxxxxxxxxxxxxxxx' );
Use a fine-grained token scoped to Contents: read-only on the bonsai-pop-up repo only. Without this constant defined, the plugin still works — it just won't check for updates.
To ship a new version:
- Bump the
Version:header andBDC_POPUP_VERSIONconstant inbonsai-popup.php, and add aCHANGELOG.mdentry. - Commit and push to
main. - 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 on the default schedule, or immediately if an admin clicks "Check again" on the Plugins screen.
Project Structure
bonsai-popup/
├── bonsai-popup.php # Main plugin file — CPT, meta box, settings, enqueue, update checker
├── assets/
│ ├── popup.css # Frontend styles
│ └── popup.js # Frontend popup logic
├── vendor/ # Composer dependencies (plugin-update-checker), committed
├── composer.json
├── CHANGELOG.md
└── README.md
Changelog
See CHANGELOG.md for full version history.
License
GPL-2.0+
Read the full README on GitHub →
Releases
| Tag | Published |
|---|---|
| 1.0.0 | May 8, 2026 |
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.