Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/gin0115/stamp-maker/archive/refs/heads/main.zipProof of concept, not production code. A WooCommerce product with a stamp plate gets a designer on its page: the customer adds text boxes, moves them, picks one of three fonts, and sees a warning when the text is too big for its box or reaches outside the plate's safe area. Add to cart posts the design; the server lays it out again and refuses anything that does not fit. When the order is placed the design is rendered to SVG, PDF and PNG under uploads and linked from the order line, in the admin and on the customer's order page.
What is hardcoded
- Two plates, in
src/Plates.php: Small (38 × 14 mm) and Large (58 × 22 mm, rounded), each with bleed, safe area and a type size range. - Three fonts, in
src/Fonts.phpand thefontsfolder: Open Sans (sans), DejaVu Sans Mono (mono), Neonderthaw (cursive). Each has a{id}.jsonof metrics made byphp bin/fonts.php.
Setting up a product
Products › edit. On a simple product, "Stamp plate" is on the General tab. On a variable product it is on each variation. "None" means the product is sold as normal.
Running it
composer install
npm install
npm run build
npx wp-env start
npx wp-env run cli wp eval-file wp-content/plugins/stamp-maker/bin/seed.php
The site is on http://localhost:8971 (admin / password). The seed makes an "Address stamp" (simple, small plate) and a "Name stamp" (variable, Small and Large).
The zip
The Zip workflow builds the assets, installs the PHP dependencies and packs the plugin with wp-scripts plugin-zip. Every push to main and every manual run uploads stamp-maker.zip as a workflow artifact; a v* tag attaches it to a release.