Piwigo Plugin Engineering
Use When
Use for Piwigo host integration and plugin lifecycle work. Compose with php-engineering, javascript-typescript-engineering, css-scss-styling, internationalization-localization, security-review, applicable SQL skills, and php-testing-quality rather than duplicating their mechanics.
Repository And Host Discovery
Start every workflow by discovering the target Piwigo release, supported PHP range, incumbent plugin, core event/API usage, plugin metadata, asset pipeline, Smarty conventions, localization layout, database adapter, and existing test/deployment fixture. The legacy tutorial below is architectural evidence only: confirm target-version APIs before copying event names, database helpers, asset registration, or lifecycle signatures.
Plugin Lifecycle
Keep host-compatible entry guards. Keep main.inc.php bootstrap-only. Place install, activate, upgrade, deactivate, and uninstall transitions in the target release’s maintenance mechanism, including maintain.inc.php where the target version uses it. Make upgrades idempotent and preserve user data unless an explicit uninstall policy says otherwise.
Hooks, Events, And Entry Points
Register behavior through supported Piwigo events/actions instead of core patches. Namespace or uniquely prefix global symbols. The following is schematic legacy syntax, not a current API contract; replace both placeholders from the target Piwigo source/version before implementation:
add_event_handler('<verified-event>', '<uniquely-prefixed-handler>');
Do not name a current event, asset helper, database helper, or maintenance class without target-version evidence.
Host Compatibility
Treat the plugin metadata’s Piwigo and PHP support promises as test obligations. Do not assume core APIs, Smarty behavior, database adapters, assets, or maintenance signatures are stable across host releases. Test each promised Piwigo/PHP combination with a real supported fixture when compatibility metadata makes the promise.
PHP, Smarty, HTML, CSS, And JavaScript Composition
PHP validates authorization, CSRF, input, domain behavior, and persistence. Presenters assign escaped, localization-ready view data. Smarty/HTML owns semantic markup; CSS owns presentation; JavaScript/TypeScript progressively enhances through finite data-*, JSON, or supported API contracts. Do not interpolate raw PHP or Smarty values into executable JavaScript. Use context-aware escaping and target-version asset-loading conventions.
Localization
Discover the host catalog paths, translation helpers, and Smarty integration for the target release. Keep message design, formatting, fallback, bidi, pseudolocalization, and localization testing in internationalization-localization; this skill owns Piwigo catalog layout, helper integration, and compatibility.
Database And Security Routing
Use the target-version database adapter and route schema/query design to the applicable SQL skill. Use security-review for admin and event-handler authorization, CSRF, request validation, templates, uploads, paths, deserialization, outbound requests, secrets, and exception/log disclosure.
Test Levels
Unit-test plugin policy without the host. Integration-test event registration/handler behavior, permissions, localization, templates, database changes, and install/upgrade/uninstall against a real supported Piwigo fixture. Browser-test admin and gallery workflows through public UI with playwright-e2e. Use digital-asset-management for media-catalog domain changes.
Completion Checklist
- Target Piwigo release, PHP range, and host APIs are evidenced.
- No core patch or unverified lifecycle/hook signature is introduced.
- Bootstrap, maintenance, namespacing, data preservation, templates/assets, catalogs, and permissions follow target conventions.
- Declared compatibility combinations and user-visible workflows have proportionate verification.
References
- Piwigo wiki: https://github.com/Piwigo/Piwigo/wiki — consulted 2026-08-17; discover target-version source/docs before implementation.
- Piwigo Plugin Tutorial: Hello world! — legacy architectural evidence, consulted 2026-08-17; not authoritative for current signatures.