feat(bulk-editor): exclude password-protected posts from bulk editing#23428
feat(bulk-editor): exclude password-protected posts from bulk editing#23428JorPV wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens what the Yoast SEO Bulk Editor surfaces by (1) excluding Elementor’s utility post type Floating Elements (e-floating-buttons) from the content-type navigation, and (2) excluding password-protected posts from bulk-editable post lists (both for the indexables-based collector and the WP_Query fallback).
Changes:
- Add a bulk-editor-scoped, filterable post-type exclusion list via
wpseo_bulk_editor_excluded_post_types(defaulting to['e-floating-buttons']). - Filter out password-protected content in both collectors (
is_protected = falseon indexables;has_password => falseinWP_Queryargs). - Extend unit tests to cover the new indexables filter and the excluded post type scenario.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/bulk-editor/infrastructure/content-types/content-types-collector.php |
Adds a filterable exclusion list to hide specific indexable post types (e.g., Elementor Floating Elements) from Bulk Editor navigation. |
src/bulk-editor/infrastructure/posts/indexable-posts-collector.php |
Excludes password-protected posts from the indexables-based Bulk Editor query via is_protected = false. |
src/bulk-editor/infrastructure/posts/post-meta-posts-collector.php |
Excludes password-protected posts from the WP_Query fallback using has_password => false. |
tests/Unit/Bulk_Editor/Infrastructure/Posts/Indexable_Posts_Collector/Get_Posts_Test.php |
Updates expectations to assert the new is_protected = false constraint is applied. |
tests/Unit/Bulk_Editor/Infrastructure/Content_Types/Content_Types_Collector/Get_Content_Types_Test.php |
Adds a dataset asserting excluded post types are skipped (but currently misses stubbing apply_filters). |
Coverage Report for CI Build 0Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage at 51.633% (no base build to compare)Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
thijsoo
left a comment
There was a problem hiding this comment.
As discussed we want to remove the excluded part and the filter. We do want to keep the pw protected part.
We decided to include Floating Elements (Elementor's e-floating-buttons) in the bulk editor after all, so remove the content-types exclusion and its filter. Only password-protected posts remain excluded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
leonidasmi
left a comment
There was a problem hiding this comment.
CR + Acceptance : Almost ✅ , a very minor and quick suggestion below
Context
Password-protected posts should not be offered for bulk editing. This implements that part of Yoast/reserved-tasks#1328. (Private and trashed posts were already excluded — see below.)
We initially also excluded Elementor's "Floating Elements" (
e-floating-buttons) from the content-types navigation, but decided that it should be Elementor's duty filter them (see 🧵 thread), so that exclusion is no longer part of this PR.Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
is_protected = false(Yoast setsis_protectedfrompost_password !== ''); the WP_Query fallback collector useshas_password => false.publish/draft/pending/future, enum-validated on the route) never includesprivateortrash, so those are already excluded.Test instructions
Test instructions for the acceptance test before the PR gets merged
Password-protected posts:
Private / trash (regression):
Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Documentation
Quality assurance
Innovation
innovationlabel.Fixes Yoast/reserved-tasks#1328