Skip to content

Move plugin Settings page under Parse.ly menu#3186

Merged
vaurdan merged 6 commits intoadd/traffic-boostfrom
update/move-settings-page-parsely-menu
Mar 14, 2025
Merged

Move plugin Settings page under Parse.ly menu#3186
vaurdan merged 6 commits intoadd/traffic-boostfrom
update/move-settings-page-parsely-menu

Conversation

@vaurdan
Copy link
Contributor

@vaurdan vaurdan commented Mar 13, 2025

Description

[This is a follow-up of the draft in #3183]

With this PR, we're moving the plugin's Settings page under the Parse.ly menu, removing the Parse.ly page from the Settings menu.

Motivation and context

Keep all things Parse.ly in a single place.

How has this been tested?

  • Manual testing.
  • Some tests that started failing after the move were updated and now pass.

Screenshots

Parse.ly Menu General Menu
image image

Summary by CodeRabbit

  • New Features

    • Introduced error message display on the settings page to provide immediate feedback during configuration.
    • Enhanced settings page organization by adding a submenu under the dashboard.
  • Refactor

    • Streamlined the admin settings registration and asset loading for a more consistent dashboard experience.
    • Adjusted the settings access path to enhance navigation and clarity.
  • Style

    • Updated interface styling to align with the new naming conventions for the settings views.

@vaurdan vaurdan added this to the 3.18.0 milestone Mar 13, 2025
@vaurdan vaurdan requested a review from a team as a code owner March 13, 2025 11:17
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2025

📝 Walkthrough

Walkthrough

This pull request updates various components within the Parse.ly plugin. The telemetry settings now use a revised action hook name, and the settings submenu registration has been relocated from the dashboard page to the settings page class. The settings assets are enqueued dynamically using an instance variable, the settings page now displays error messages via a new function call, and the plugin constant and CSS selector have been updated. Additionally, the initialization order has been adjusted so that the settings page is registered after the dashboard page.

Changes

File(s) Change Summary
src/Telemetry/telemetry-init.php Updated the action_hook value from load-settings_page_parsely to load-parse-ly_page_parsely-settings in the settings events array.
src/UI/class-dashboard-page.php,
src/UI/class-settings-page.php,
src/UI/settings-page.php
Removed direct settings submenu registration from Dashboard_Page, updated Settings_Page to use a dynamic hook suffix and register the submenu with add_submenu_page (with the menu title changed to "Settings"), and added a settings_errors() call to display error messages.
src/class-parsely.php Modified the MENU_SLUG constant from 'parsely' to 'parsely-settings'.
src/css/admin-settings.scss Changed the CSS class selector from .settings_page_parsely to .parse-ly_page_parsely-settings.
wp-parsely.php Reordered the settings page initialization to occur after registering the dashboard page.
src/UI/class-recommended-widget.php,
src/UI/class-site-health.php,
src/content-helper/common/class-content-helper-feature.php
Updated URLs to point to the new settings page path /wp-admin/admin.php?page=parsely-settings.
tests/Integration/UI/SettingsPageTest.php Updated the PARSELY_SETTINGS_URL constant and assertions to reflect the new settings page URL.
tests/e2e/specs/*.spec.ts Updated various test cases to navigate to the new settings page URL /wp-admin/admin.php?page=parsely-settings.

Suggested labels

Changelog: Changed, Feature: PCH

Suggested reviewers

  • acicovic

Possibly related PRs

  • Move Settings page to src/UI/ #2877: The changes in the main PR, which modify the action hook for the settings page, are related to the updates in the retrieved PR that involve moving the settings page to a new file location, as both pertain to the settings functionality of the Parsely plugin.

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5af1f8b and 74d6bd4.

⛔ Files ignored due to path filters (3)
  • build/admin-settings-rtl.css is excluded by !build/**
  • build/admin-settings.asset.php is excluded by !build/**
  • build/admin-settings.css is excluded by !build/**
📒 Files selected for processing (6)
  • tests/e2e/specs/activation-flow.spec.ts (2 hunks)
  • tests/e2e/specs/browse-logo-button.spec.ts (1 hunks)
  • tests/e2e/specs/front-end-metadata.spec.ts (2 hunks)
  • tests/e2e/specs/plugin-action-link.spec.ts (1 hunks)
  • tests/e2e/specs/settings-track-post-types-as.spec.ts (1 hunks)
  • tests/e2e/utils.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,ts,tsx,jsx}`: "Perform a detailed review of the pr...

**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:

  • Review the code to ensure it is well-structured and adheres to best practices.
  • Verify compliance with WordPress coding standards.
  • Ensure the code is well-documented.
  • Check for security vulnerabilities and confirm the code is secure.
  • Optimize the code for performance, removing any unnecessary elements.
  • Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
  • Ensure each line comment concludes with a period.
  • Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
  • Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
  • tests/e2e/specs/plugin-action-link.spec.ts
  • tests/e2e/specs/browse-logo-button.spec.ts
  • tests/e2e/utils.ts
  • tests/e2e/specs/front-end-metadata.spec.ts
  • tests/e2e/specs/activation-flow.spec.ts
  • tests/e2e/specs/settings-track-post-types-as.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: E2E against WordPress latest
🔇 Additional comments (8)
tests/e2e/specs/browse-logo-button.spec.ts (1)

47-47: URL path updated to match new menu location.

The URL path has been correctly updated to reflect the relocation of the Parse.ly settings page from the general Settings menu to the Parse.ly menu. This change is consistent with the PR objectives.

tests/e2e/specs/plugin-action-link.spec.ts (1)

28-28: URL path in waitForURL updated correctly.

The URL pattern in the waitForURL method has been properly updated to reflect the new location of the Parse.ly settings page. This ensures that the test correctly validates navigation after clicking the Settings link.

tests/e2e/utils.ts (1)

30-30: URL path updated while preserving query parameter logic.

The URL path has been updated to match the new settings page location while correctly maintaining the conditional query parameter for API validation bypass. The change is consistent with the PR objectives.

tests/e2e/specs/front-end-metadata.spec.ts (2)

38-38: URL path updated in beforeAll hook.

The URL path for accessing the Parse.ly settings page has been correctly updated in the test setup function. This ensures the test activates tracking for logged-in users through the new settings page location.


186-186: URL path updated in setMetadataFormat method.

The URL path in the visitAdminPage method has been properly updated to reflect the new location of the Parse.ly settings page. This ensures that metadata format settings are correctly configured through the new menu structure.

tests/e2e/specs/activation-flow.spec.ts (2)

33-33: URL path correctly updated to match new menu location.

The URL has been properly updated to reflect the new location of the Parse.ly settings page under the Parse.ly menu instead of the general Settings menu.


55-55: URL path correctly updated to match new menu location.

The URL has been properly updated to reflect the new location of the Parse.ly settings page under the Parse.ly menu instead of the general Settings menu.

tests/e2e/specs/settings-track-post-types-as.spec.ts (1)

222-222: URL path correctly updated to match new menu location.

The URL has been properly updated to reflect the new location of the Parse.ly settings page under the Parse.ly menu instead of the general Settings menu. This change maintains consistency with the menu reorganization throughout the codebase.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vaurdan vaurdan changed the title Move the settings page under the Parse.ly menu Move plugin Settings page under Parse.ly menu Mar 13, 2025
@acicovic acicovic removed their assignment Mar 14, 2025
Copy link
Collaborator

@acicovic acicovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this to completion. I gave it an additional manual test, and it works.

@vaurdan vaurdan merged commit a7b30f7 into add/traffic-boost Mar 14, 2025
39 checks passed
@vaurdan vaurdan deleted the update/move-settings-page-parsely-menu branch March 14, 2025 11:24
@acicovic acicovic modified the milestones: 3.18.0, 3.19.0 Apr 9, 2025
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.

2 participants