refactor: SeoPress capabilities for Redirections and Broken links#70
Open
mvdhoek1 wants to merge 1 commit into
Open
refactor: SeoPress capabilities for Redirections and Broken links#70mvdhoek1 wants to merge 1 commit into
mvdhoek1 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts how SEOPress Pro admin access is gated so non-admin roles can access Redirections and Broken Links screens via the edit_redirections / edit_broken_links capabilities (instead of requiring manage_options).
Changes:
- Lowers the SEOPress main menu capability from
manage_optionstoedit_redirections(admin-only context). - Removes SEOPress Dashboard/License submenu pages for users who don’t have
manage_options. - Remaps the
seopress_botCPT list capability toedit_broken_linksand ensures theseopress_404CPT is registered early enough on relevant admin requests.
Comments suppressed due to low confidence (1)
src/SEOPress.php:13
- The PR description mentions adding
edit_broken_links/edit_redirectionsto thewpseocap group, but this change set only touches SEOPress hooks (seopress_capability, CPT args, menu adjustments). If the goal is specifically about awpseogroup in the user-roles config, either update the PR description to match the implemented SEOPress approach, or add the missingwpseo-group change (if that’s still required).
#[Plugin('wp-seopress-pro/seopress-pro.php')]
class SEOPress
{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+113
to
+123
| $redirectionPages = ['edit.php', 'post.php', 'post-new.php']; | ||
|
|
||
| if ( | ||
| ! is_admin() | ||
| || ! in_array($pagenow, $redirectionPages, true) | ||
| || ('edit.php' === $pagenow && isset($_GET['post_type']) && 'seopress_404' !== $_GET['post_type']) | ||
| || post_type_exists('seopress_404') | ||
| || ! function_exists('seopress_404_fn') | ||
| ) { | ||
| return; | ||
| } |
041787d to
30ca8e8
Compare
Comment on lines
+49
to
52
| // Lower the main SEO menu cap from manage_options to edit_redirections so roles without manage_options can access it. | ||
| if ('menu' === $context && 'manage_options' === $cap) { | ||
| return 'edit_redirections'; | ||
| } |
30ca8e8 to
13cf673
Compare
13cf673 to
520dd50
Compare
Rovasch
approved these changes
Jun 10, 2026
rivanuff
reviewed
Jun 10, 2026
| return; | ||
| } | ||
|
|
||
| if (post_type_exists('seopress_404') || ! function_exists('seopress_404_fn')) { |
There was a problem hiding this comment.
|| ! function_exists('seopress_404_fn') kan evt aan de if statement hierboven toegevoegd worden toch?
Contributor
Author
There was a problem hiding this comment.
Ik vind de 2 if statements nu goed verdeeld, eerst de admin checks en daarna die van SeoPress.
rivanuff
approved these changes
Jun 10, 2026
Contributor
|
Voordat je merget, ik heb deze change doorgevoerd #76 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 'edit_broken_links' and 'edit_redirections' capability needs to be added to the 'wpseo' cap group for this to work inside the user-roles config.

The following functionalities are still missing from this PR: