Publishes a site's job openings as an oJobPub feed at /.well-known/ojobpub.json. Jobs can come from the plugin's own Jobs post type, from WP Job Manager or from Job Postings. Other plugins can add sources through the ojobpub_sources filter.
readme.txt is the user-facing description for wordpress.org. This file covers development.
Requirements: podman (or docker, with COMPOSE=docker compose CONTAINER=docker), make, curl and python3. A local PHP is not needed.
make up # WordPress on http://localhost:8080 (admin / admin)
make setup # install WordPress, WP Job Manager, Job Postings and Plugin Check, activate oJobPub
make seed # sample jobs in all three sources, including edge cases
make feed # print the feedThe plugin directory is mounted read-only into the container, so code changes are live.
make test # PHPUnit; validates generated documents against ../schema/v1/ojobpub.json
make phpcs # WordPress coding standards, PHP 7.4 compatibility
make plugin-check # wordpress.org Plugin Check, the same checks as the plugin review
make validate-all # switches through all sources and validates the served feed against the schema- Raise the version in
ojobpub.php(header andOJOBPUB_VERSION) and inreadme.txt(Stable tag), then add a changelog entry. - Run
make potif translatable strings changed. - Run
make zip. It buildsdist/ojobpub-<version>.zipand leaves out everything listed in.distignore.
On GitHub, pushing a tag v<version> (e.g. git tag v0.2.1 && git push origin v0.2.1) runs .github/workflows/release.yml:
- It checks that the tag matches all three version fields.
- It runs the unit tests and PHPCS.
- It runs Plugin Check on the contents of the ZIP. Any error stops the release.
- It publishes a GitHub release with
ojobpub-<version>.zipattached. The release notes are the matching changelog entry fromreadme.txt. - It commits the same ZIP contents to
trunk/of the wordpress.org SVN repository and copies them totags/<version>/. An existing SVN tag is never overwritten. This job can be re-run on its own if the SVN commit fails.
Every push to main also syncs trunk/ (.github/workflows/wordpress-org.yml). This sync does not run tests. Banners, icons and screenshots go in .wordpress-org/, which is published to the SVN assets/ directory. Both workflows use bin/svn-deploy.sh and need the repository secret SVN_PASSWORD, which is the SVN password of the wordpress.org user letsemploy (set under Account & Security in the wordpress.org profile).
wordpress.org serves tags/<Stable tag> as read from trunk/readme.txt. If main raises Stable tag before the matching tag exists, wordpress.org serves trunk/ in the meantime, so push the tag right after the version bump.
Releases: https://github.com/letsemploy/wordpress-plugin-ojobpub/releases
| Path | Purpose |
|---|---|
includes/Feed/ |
Normalizer, builder and country codes. No WordPress dependency, unit tested. |
includes/Sources/ |
Source interface and adapters: native, WP Job Manager, Job Postings. |
includes/Feed_Service.php |
Caching, invalidation and a lastUpdated that only changes when the content changes. |
includes/Endpoint.php |
Rewrite rule and HTTP delivery (ETag, 304, CORS). |
includes/Static_File.php |
Optional copy on disk, for hosts that serve /.well-known/ themselves. |
bin/seed.php |
Sample data for local testing. Not shipped. |