Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
d883ad1
Update build
LC43 Jun 20, 2026
1b2ec66
infra(project): migrate build from Grunt to Composer workflow
LC43 Jun 20, 2026
462408f
feature(renamer): introduce plugin rebranding engine
LC43 Jun 20, 2026
69afa6e
refactor(core): modernise core internals
LC43 Jun 20, 2026
0291b95
style(models): migrate from short to long array syntax
LC43 Jun 20, 2026
6f17465
test(renamer): add unit tests for plugin rebranding pipeline
LC43 Jun 20, 2026
4bb2704
docs(readme): document modern Composer-based workflow
LC43 Jun 20, 2026
3e3d332
refactor(core): Remove framework dependency from Core constructor
LC43 Jun 20, 2026
409d5e0
fix(renamer): Clean output buffers before ZIP download
LC43 Jun 20, 2026
d30e8e9
fix(renamer): Preserve uppercase letters in package name conversion
LC43 Jun 20, 2026
567f7c3
test(renamer): Add test for PLUGIN_VERSION constant replacement
LC43 Jun 20, 2026
0d05194
test(renamer): Add test for package name replacement
LC43 Jun 20, 2026
0e6aebd
Optimizations
LC43 Jun 21, 2026
b009105
fix(renamer): guard GET param against array input
LC43 Jun 21, 2026
12b498c
fix(renamer): validate URLs before esc_url_raw sanitization
LC43 Jun 21, 2026
786796b
fix(renamer): check ZipArchive return values for errors
LC43 Jun 21, 2026
8c39c71
test(renamer): restore bootstrap stubs
LC43 Jun 21, 2026
a371a48
Update phpcs
LC43 Jun 21, 2026
6703517
Pass error msg by transient
LC43 Jun 21, 2026
197f2e6
Include saltus by packagist
LC43 Jun 21, 2026
b8078ae
Replace func
LC43 Jun 21, 2026
5e66a93
fix(renamer): guard nonce check behind error parameter
LC43 Jun 21, 2026
2733e51
fix(assets): scope admin styles to plugin pages
LC43 Jun 21, 2026
321ebd1
infra(phpcs): update testVersion to 8.3
LC43 Jun 21, 2026
19d5d7f
fix(renamer): harden ZIP builder against edge cases
LC43 Jun 21, 2026
9ed5155
fix(identity): guard string cast against array input
LC43 Jun 21, 2026
90be4cc
fix(assets): migrate strpos to str_contains
LC43 Jun 21, 2026
b4f5838
fix(post-type): guard against null global post
LC43 Jun 21, 2026
e13ecd5
fix(path): use substr for reliable path stripping
LC43 Jun 22, 2026
d71a4f6
fix(renamer): fallback vendor name for non-ASCII author names
LC43 Jun 22, 2026
e5232ba
fix(renamer): guard ob_end_clean failure to prevent infinite loop
LC43 Jun 22, 2026
f6b65d7
fix(identity): remove redundant validation call in from_request
LC43 Jun 22, 2026
e5a172c
fix(post-type): correct post_schedulled to post_scheduled message key
LC43 Jun 22, 2026
12fc771
fix(post-type): correct permanetly to permanently in message
LC43 Jun 22, 2026
71dd2b5
fix(i18n): use plugin_basename for load_plugin_textdomain path
LC43 Jun 22, 2026
ec9cdaa
feature(renamer): always use plugin_slug as text domain
LC43 Jun 22, 2026
c3b5fab
refactor: reorder plugin bootstrap autoload after PHP version check
LC43 Jun 28, 2026
f106759
refactor: standardize comparison style in Renamer module
LC43 Jun 28, 2026
9e504a1
fix(renamer): harden plugin renamer input processing
LC43 Jun 28, 2026
a9af57c
infra(build): Add Strauss namespace prefixing to release pipeline
LC43 Jun 28, 2026
2eb0470
feature(renamer): Rewrite plugin header via docblock replacement
LC43 Jun 28, 2026
1489d01
feature(admin): Add direct plugin activation delivery modes
LC43 Jun 28, 2026
40987a5
feature(css): Style renamer form guide sidebar layout
LC43 Jun 28, 2026
7c48f64
i18n: Update translation template for rebrand strings
LC43 Jun 28, 2026
60bc6de
test(renamer): Cover header replacement autoloader prefixing
LC43 Jun 28, 2026
324c24a
docs(readme): Update for rebrand UI changes
LC43 Jun 28, 2026
8e338c5
fix(renamer): Strip */ from URI header fields preventing comment brea…
LC43 Jun 28, 2026
23d6915
fix(renamer): Add composerRequire to renamed autoloader patterns
LC43 Jun 28, 2026
fbb304f
fix(admin): Check WP_PLUGIN_DIR writability before zip extraction
LC43 Jun 28, 2026
0110cc6
fix(renamer): Strip PHP close/open tags from identity comment fields
LC43 Jul 2, 2026
b878fa6
infra(build): add CSS minification via PostCSS cssnano
LC43 Jul 2, 2026
28d6b79
infra(build): add composer build scripts
LC43 Jul 2, 2026
fd365fe
infra(build): add text domain validation script
LC43 Jul 2, 2026
1de8984
infra(build): add version bump git-tagging script
LC43 Jul 2, 2026
cb5a2bb
infra(ci): add GitHub Actions CI workflow
LC43 Jul 2, 2026
d399914
infra(build): add npm lockfile for reproducible CI installs
LC43 Jul 2, 2026
5c3d790
fix(renamer): Translate validation field labels via i18n map
LC43 Jul 2, 2026
c11bbfc
fix(admin): Use unique slug for tools submenu page
LC43 Jul 2, 2026
ce7a62f
fix(renamer): Include .js files in text file detection
LC43 Jul 2, 2026
0710095
Fix CS
LC43 Jul 3, 2026
7296edb
Detect case for dangerous tokens
LC43 Jul 3, 2026
5b114d3
Use empty array when registering asset
LC43 Jul 3, 2026
2d78684
Detect empty content before running
LC43 Jul 3, 2026
5c8b939
Fix(i18n): migrate textdomain checker from regex to token_get_all
LC43 Jul 3, 2026
160e002
fix(renamer): correct wp_tempnam() failure check
LC43 Jul 3, 2026
143aac0
fix(check-textdomains): add defensive guards in token parsing
LC43 Jul 3, 2026
d2b24df
fix(renamer-page): suppress cleanup exceptions to avoid masking prima…
LC43 Jul 3, 2026
92ff29c
fix: address PHPCS lint errors in defensive fixes
LC43 Jul 3, 2026
c6ea12f
Add all command
LC43 Jul 3, 2026
390a9d2
Add all command
LC43 Jul 3, 2026
45142b0
Fix test calls
LC43 Jul 4, 2026
e97c6d9
fix(assets): use dynamic slug for admin style hook
LC43 Jul 4, 2026
30887eb
feature(renamer): rewrite composer.json author fields
LC43 Jul 4, 2026
997b402
test(renamer): cover composer.json author replacements
LC43 Jul 4, 2026
9d2d360
infra(build): encapsulate release packaging into PackageBuilder class
LC43 Jul 4, 2026
a86c66d
fix(renamer): exclude build artifacts from renamed plugin zip
LC43 Jul 4, 2026
15d0f92
Ignore wp checks on tool
LC43 Jul 4, 2026
6d43b87
Add extra checks on user data
LC43 Jul 4, 2026
65bee7d
Use native wp func for encoding
LC43 Jul 4, 2026
cd83e76
Add mock for missing wp funcs
LC43 Jul 4, 2026
96b74c2
Fix build
LC43 Jul 4, 2026
d8cd2d9
Correct more details in bin tools
LC43 Jul 4, 2026
7c06cb2
fix(renamer): validate before sanitize, guard array input, flush plug…
LC43 Jul 4, 2026
aab6b4a
fix(renamer): restrict URL validation to HTTP/HTTPS schemes
LC43 Jul 4, 2026
46679e7
fix: remove dead string comparisons in PHP token parsing
LC43 Jul 4, 2026
77a8126
Fix complexity
LC43 Jul 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- main
- 'feature/**'
- 'fix/**'
pull_request:

jobs:
ci:
name: Validate, lint, test, and build
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.3', '8.4']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Validate composer.json
run: composer validate --strict

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: composer-${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('composer.lock') }}

- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress

- name: Install Node dependencies
run: npm ci

- name: Lint
run: composer test:lint

- name: Test
run: composer test:unit

- name: Check i18n text domains
run: composer check-i18n

- name: Build release ZIP
run: composer build

- name: Upload ZIP artifact
uses: actions/upload-artifact@v4
with:
name: framework-demo-${{ matrix.php }}
path: dist/*.zip
27 changes: 16 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@

# Composer
vendor/*
!vendor/.gitkeep
# Dependencies
/vendor/
/vendor-prefixed/
/node_modules/
/build/node_modules/

# dev
bower_components
node_modules
npm-debug.log
yarn-error.log
vendor
# Generated artifacts
/dist/
/release/
/build/dist/
/build/release/
/*.zip
*.map
*.log
reports/
dist/
release/
npm-debug.log
yarn-error.log
.phpunit.cache/
.phpunit.result.cache
.phpcs-cache

# Editor
.vscode
Expand Down
87 changes: 61 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,77 @@
This is the development repository of a demo plugin for WordPress built using the Saltus Framework for WordPress.
# Saltus Framework Demo

The following are needed to work with this project:
1. [Composer](https://getcomposer.org/) to manage PHP dependencies
2. [Node.js](https://nodejs.org/en/) to handle release tasks using [grunt](https://gruntjs.com/)
This is a modern demo plugin for building WordPress plugins with the Saltus Framework.

## How to use this Demo Plugin to create your own:
It shows how to register custom post types, taxonomies, admin columns, filters, meta boxes, settings pages, assets, and translations using Saltus model configuration files.

1. Download, fork or clone this repository
2. Make the necessary name changes to the folder and main file ( framework-demo.php )
3. Edit the header of the main file, so that the plugin has the proper information
4. Replace the text domain used by the plugin ( You can do a find/replace for `‘framework-demo’` )
5. Replace Namespace used (optional) ( You can do a find/replace for `PluginFrameworkDemo` for example)
6. Optionally create a git repository for your project
## Requirements

## To start development:
- PHP 8.3 or newer
- WordPress with Composer-installed plugin dependencies
- Composer 2

1. Open the build folder in the terminal and run: `composer install` and `npm install`
2. And now the fun part: edit the files in src/models to create your own model. Check [Saltus Framework Documentation](https://github.com/SaltusDev/saltus-framework) to understand how to use models.
## Setup

We are working on providing a more simple way to start using this demo for less experienced developers.
From the plugin directory:

```bash
composer install
```

## Available Grunt Tasks
Then activate **Saltus Framework Demo** in WordPress.

All grunt tasks run inside the build folder.
The demo models live in `src/models`:

**Main Release Tasks:**
- `post-type-basic.php` registers a small `movie` post type.
- `post-type-all.php` registers the larger `book` demo, including meta fields and settings.
- `taxonomy-multiple.php` registers demo taxonomies for books and posts.

## Rebrand This Demo

`grunt bump` - Will do a minor increase in the plugin version
The plugin includes a generator UI for creating your own branded copy of the demo plugin. In wp-admin, open **Tools > Rebrand This Demo** or use the **Rebrand This Demo** quick action on the plugin row.

Fill in the form with the identity your new plugin should use:

`grunt release` - Runs multiple tasks to prepare your plugin for release, creating in the end a release folder and zip file inside the build/release folder. These files should be ready for distribution.
- **Plugin Name**: the public name shown in WordPress.
- **Plugin Slug**: a lowercase folder-safe slug, such as `my-saltus-plugin`.
- **Main Plugin File**: the main PHP file, usually matching the slug, such as `my-saltus-plugin.php`.
- **Namespace Segment**: a PHP namespace segment like `MySaltusPlugin`.
- **Description**: the plugin summary shown in wp-admin.
- **Author details**: the author name and optional author/plugin URLs.
- **Version**: a semver value such as `1.0.0`.
- **Code Prefix**: a lowercase PHP-safe prefix like `my_saltus_plugin`.

After filling in the form, choose one of two install paths:

**Other Development tasks:**
`grunt bs` - browser sync
`grunt i18n` - internationalization
`grunt build` - compiles files
`grunt dev` - compiles files
`grunt prod` - compiles files
- **Download Rebranded Plugin ZIP**: download the ZIP, then upload it from **Plugins > Add New > Upload Plugin** and activate it.
- **Copy & Activate Plugin**: copy the generated plugin directly into this WordPress site's plugins directory and activate it automatically.

The generated plugin is a separate copy. The installed demo plugin is not modified.

## Development Commands

```bash
composer validate --strict
vendor/bin/phpcs
vendor/bin/phpunit
composer package
```

`composer package` creates `dist/framework-demo-<version>.zip`.

`composer make-pot` uses WP-CLI to rebuild `languages/framework-demo.pot` when WP-CLI is available.

## Releasing

Build the release ZIP with:

```bash
composer install --no-dev --optimize-autoloader
composer package
```

The package script excludes development-only directories such as `.git`, `node_modules`, `build`, `dist`, `release`, and reports.

## Notes

This repository is intentionally a demo and starter. Keep the Saltus model files that help explain framework capabilities, and delete or rename demo models when generating a production plugin.
41 changes: 41 additions & 0 deletions assets/css/admin-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.framework-demo-renamer__layout {
display: grid;
grid-template-columns: minmax(0, 1fr) 360px;
gap: 24px;
align-items: start;
max-width: 1180px;
}

.framework-demo-renamer__form,
.framework-demo-renamer__guide {
background: #fff;
border: 1px solid #c3c4c7;
box-sizing: border-box;
padding: 16px 20px;
}

.framework-demo-renamer__form .form-table {
margin-top: 0;
}

.framework-demo-renamer__guide h2 {
margin-top: 0;
}

.framework-demo-renamer__guide h3 {
margin: 18px 0 8px;
}

.framework-demo-renamer__guide ol {
margin-left: 20px;
}

.framework-demo-renamer__guide li {
margin-bottom: 8px;
}

@media (max-width: 960px) {
.framework-demo-renamer__layout {
grid-template-columns: 1fr;
}
}
Loading
Loading