Skip to content

1.x - #7

Merged
nlemoine merged 32 commits into
mainfrom
1.x
May 8, 2026
Merged

1.x#7
nlemoine merged 32 commits into
mainfrom
1.x

Conversation

@nlemoine

Copy link
Copy Markdown
Owner

No description provided.

- Implement tests for Lifecycle, Menu Highlighting, Plugin, Query, Rewrite Manager, and Settings Validator.
- Enhance Api and PostType tests with data providers for better coverage.
- Validate slug options and ensure rewrite rules are flushed correctly on updates.
- Ensure proper handling of non-existent posts and non-public post types.
- Verify caching mechanisms for page slugs and transient data.
- Confirm that admin hooks and frontend hooks are registered as expected.
@mrleblanc101 mrleblanc101 mentioned this pull request Mar 23, 2026
…lds, Autodescription, Polylang, and WordPressSeo integrations

- Removed unnecessary backslashes from function calls to improve code readability and maintain consistency across the codebase.
- Updated function calls in various classes including AdvancedCustomFields, Autodescription, Polylang, and WordPressSeo.
- Ensured that all instances of function calls are consistent with WordPress coding standards.
- Added "slevomat/coding-standard" to composer.json for enhanced coding standards.
- Updated phpcs.xml.dist to include additional Slevomat coding rules.
- Refactored code across multiple files to use fully qualified function calls (e.g., \is_string, \array_slice) for better clarity and adherence to coding standards.
- Ensured consistent use of function calls and improved readability in various classes including Admin, SettingsValidator, Api, and others.
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@nlemoine
nlemoine marked this pull request as ready for review March 23, 2026 22:12
losted and others added 3 commits March 30, 2026 08:06
---------

Co-authored-by: Luc Lapierre <luc.lapierre@libeo.com>
Co-authored-by: Nicolas Lemoine <nico.lemoine@gmail.com>
The post_updated handler only flushed when the assigned page's own slug
changed. It missed parent changes and slug/parent changes on ancestors,
which also alter the page's URL and the CPT rewrite base when "use page
slug" is enabled.

Renames onSlugChange to onPageUpdated, also detects post_parent changes,
and walks ancestors so updates to any page in the chain trigger a flush.
nlemoine added 6 commits May 8, 2026 12:28
When a page is assigned as the home for a custom post type with "Use
page slug as CPT base" enabled, its slug drives the URL prefix for
every published item of that CPT. Changing it silently breaks all
those URLs with no auto-redirect.

Two warning surfaces:
- Block editor: inline notice + checkbox in the document sidebar,
  locking the Save button until acknowledged. Reads slug state from
  the core/editor store so it stays accurate across saves.
- Quick Edit on the pages list: native confirm() gating the AJAX
  save when the slug differs from the saved value.

Both fire only when "use page slug" is on for the assigned CPT.

Introduces a JS build pipeline via @wordpress/scripts (pnpm). Build
artefacts are committed so the plugin is ready to install from a git
clone or Composer pull without a build step.
Reformats with 4-space indentation and alphabetised require-dev
entries. Adds the changelog field under support pointing at GitHub
releases.
Adds wp-cli/i18n-command (plus the wp-cli runner) as dev dependencies
for generating the translation template, with an `i18n:pot` composer
script. The plugin is distributed outside wordpress.org so translation
auto-loading doesn't apply; load_plugin_textdomain is wired on init,
pointing at the bundled languages/ directory.

The initial languages/pfcpt.pot is generated and committed so
translators can submit PRs without setting up the dev tooling.
Adds a release-please-driven workflow on push to main: opens a release
PR with version bumps and a generated CHANGELOG, creates the GitHub
release and tag on merge, then builds a self-installable plugin zip
and attaches it as a release asset.

- release-please-config.json + .release-please-manifest.json track
  the version. plugin.php gets release-please block markers around
  the Version: header so the generic updater bumps it (block style
  rather than inline so WP's plugin header parser doesn't capture
  the marker into the version string).
- Release zip is built via `git archive` filtered through
  .gitattributes (export-ignore for tests, agent docs, dev configs,
  etc.), with a copy of vendor/ from `composer install --no-dev
  --optimize-autoloader --classmap-authoritative`.
- plugin.php has a `// @bundle-autoload` marker that's sed-replaced
  with `require_once __DIR__ . '/vendor/autoload.php';` only in the
  release zip, so the source stays clean for Composer-managed
  installs (Bedrock-style) while the zip works as a drop-in plugin
  for vanilla WP.
- Tags are emitted without the `v` prefix.
Replaces tag references (@v2, @V3, @main) with full commit SHAs and a
trailing version comment for every third-party action and reusable
workflow. Mitigates tag-rewriting attacks against popular GitHub
Actions. First-party actions (actions/checkout, actions/setup-node)
are left at tag references since GitHub controls those repos.
Adds uninstall.php so deleting the plugin via the Plugins screen
removes every option and transient it created. Walks the aggregated
mapping to call delete_option / delete_transient on known per-CPT
keys (cache-safe), then bulk-deletes any orphaned rows in wp_options
via prepared SQL with esc_like'd LIKE patterns.

Covers:
- pages_for_custom_post_type (aggregated)
- page_for_<cpt> and page_for_<cpt>_use_slug per CPT
- page_for_<cpt>_slug transients (object cache + DB rows)
nlemoine added 2 commits May 8, 2026 13:05
The pre-1.0 plugin always used the assigned page's slug as the CPT
URL base. As of 1.0.0 it's opt-in via the per-CPT use_slug option.
Without a migration, existing sites would silently switch from
/<page-slug>/<post> to /<cpt-default>/<post> on upgrade — breaking
every published URL.

Adds a Migrator that runs once on plugins_loaded (via Plugin::init):
walks the page-for-CPT mapping and enables use_slug for every CPT
that doesn't already have an explicit value. Tracked through a
pfcpt_db_version option so it short-circuits on subsequent loads.
Cleaned up by uninstall.php.
- Document the slug-change protection (block editor + Quick Edit)
- Add WPML to the integrations list
- Add a manual zip-install path alongside Composer
- Add an "Upgrading from 0.x" section explaining the use_slug
  opt-in flip and the auto-migration that preserves existing URLs
- Bump the WordPress requirement to 6.0+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants