OikoFree WP plugins
Oiko / boilerplate

Get the boilerplate.

Every Oiko plugin starts from the same secure-by-default scaffold — and it's public on GitHub. Build your own plugin on the same standard.

A one-line generator (npx create-oiko-plugin) is coming next — this page updates the moment it ships.

terminal
$ git clone https://github.com/BuiltByGo/oiko-plugin-boilerplate.git my-plugin
What's included

Not a starting point. A finished scaffold.

Everything a real Oiko plugin's own CI checks for, already wired up before you write a single feature.

01

PHP 8.3+, PHPUnit 9.6, WP_Mock

Fast unit tests with no WordPress install required — WP_Mock stubs core functions so the test suite runs in milliseconds, not against a real database.

02

PHPCS and PHPStan

wp-coding-standards/wpcs enforces WordPress's own coding standard; szepeviktor/phpstan-wordpress adds WordPress-aware type checking at PHPStan level 6 — both run via `composer run lint` and `composer run stan`.

03

CI on every push

A GitHub Actions workflow runs PHPCS, PHPStan and PHPUnit across a PHP 8.3/8.4 matrix on every push and pull request, plus a separate job that runs wp.org's own Plugin Check action against the real plugin source.

04

A Sanitizer class, ready to rename

One chokepoint for every $_POST/$_GET/$_REQUEST read, matched to type: text(), textarea(), email(), key() — each wrapping wp_unslash() plus the matching WordPress sanitize function, so a sanitize-function/data-type mismatch is a one-place-to-check problem instead of one per handler.

05

A shared admin-UI helper class

Ui::header()/footer(), card_open()/card_close(), text_field(), toggle_field(), primary_button() — the rendering helpers every Oiko plugin's settings screens are built from, so every plugin's admin screens share the same markup and CSS scope instead of each reinventing form rendering.

06

A real uninstall.php from the start

Guarded by `defined( 'WP_UNINSTALL_PLUGIN' )`, deleting every option and clearing every scheduled cron hook the plugin created — the pattern every shipped Oiko plugin's own uninstall.php extends as it adds tables, transients and user meta.

Folder structure

Nothing to guess at.

oiko-plugin-boilerplate/
	├── assets/
	│   ├── admin/{css,images,js}
	│   └── frontend/css
	├── languages/
	├── src/
	│   ├── Admin/         Settings_Page.php, Ui.php
	│   ├── Api/           Rest_Controller.php
	│   ├── Frontend/      Shortcodes.php
	│   ├── Lifecycle/     Activator.php, Deactivator.php
	│   ├── Support/       Sanitizer.php
	│   └── Plugin.php
	├── tests/
	│   ├── Unit/{Admin,Api,Frontend,Lifecycle,Support}
	│   └── bootstrap.php
	├── composer.json
	├── example-plugin.php
	├── uninstall.php
	└── .github/workflows/ci.yml
Getting started

Clone it, then run it.

terminal
$ git clone https://github.com/BuiltByGo/oiko-plugin-boilerplate.git my-plugin
terminal
$ composer install$ composer run lint$ composer run stan$ composer run test