Skip to content

Conversation

arifulhoque7
Copy link
Contributor

@arifulhoque7 arifulhoque7 commented Sep 26, 2025

Close issue , Related PRO PR

feat: Add SEO Settings module for WP User Frontend Pro

This commit introduces a brand-new SEO Settings module to WPUF Pro,
providing advanced control over how user profiles and directories are
indexed by search engines. The module is designed to give site owners
flexibility in managing visibility while preventing conflicts with other
SEO plugins or WordPress global SEO settings.

Key Features

  • SEO Settings Tab in WPUF Settings:
    A dedicated section to configure SEO-related options directly within
    the plugin, keeping all customization centralized.

  • User Directory SEO Section:
    Includes the ability to set noindex for user profile pages,
    ensuring sensitive or duplicate content can be hidden from
    search engines when required.

  • Conflict Detection:
    Warns administrators if WordPress global SEO settings conflict with
    WPUF’s SEO options, reducing the risk of misconfiguration.

  • Extended Compatibility:
    Supports shortcodes, Gutenberg blocks, and pretty URLs so that SEO
    configurations work consistently across different page builders and
    frontend display modes.

  • Meta Tag Management:
    Uses WordPress’s wp_robots filter for proper and reliable meta tag
    injection, ensuring that search engines respect indexing preferences.

  • Documentation & UI Assets:
    Added a dedicated thumbnail for module recognition and linked
    documentation to guide users in setting up SEO options effectively.


This module represents a major step in making WPUF more SEO-friendly
out of the box, empowering site owners to control search visibility
without needing third-party tools for common scenarios.

Summary by CodeRabbit

  • New Features
    • Added a new “SEO Settings” section visible in the settings as a Pro preview (with crown icon).
    • Displayed a Pro-only “Avoid indexing profiles” checkbox within the SEO Settings preview.
    • Included an informational HTML block for user directory SEO within the preview.
    • Surfaced a new SEO module in the modules list with name, description, thumbnail, and link.
    • Enhanced UI to clearly denote SEO-related Pro options and assets.

@arifulhoque7 arifulhoque7 self-assigned this Sep 26, 2025
@arifulhoque7 arifulhoque7 added needs: testing needs: dev review This PR needs review by a developer labels Sep 26, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 26, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • assets/images/modules/wpuf-seo.png is excluded by !**/*.png

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds a new Pro-only “SEO Settings” module to the Free UI bridge: registers a pro section entry, defines preview-only settings fields (including an avoid_indexing_profiles checkbox), and extends the pro modules metadata and listing to surface the SEO module with name, description, URI, and thumbnail.

Changes

Cohort / File(s) Summary
Pro SEO settings bridge
includes/Free/Free_Loader.php
- Adds "SEO Settings" to pro_sections with crown icon and pro-preview status
- Registers pro_settings under wpuf_seo_settings (HTML block and avoid_indexing_profiles checkbox)
- Extends pro_modules_info with SEO module metadata (name, description, plugin URI, thumbnail)
- Integrates SEO module into modules listing

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A bunny taps the changelog drum,
“A crown for SEO—oh, here it comes!”
Profiles hush with noindex grace,
Directory paths keep a tidy face.
With shiny thumbs and URIs neat,
The Pro preview hops complete. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the primary change, namely the addition of an SEO Settings module to WP User Frontend, and aligns directly with the contents of the changeset without unnecessary detail or ambiguity.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7be6651 and adc1f7a.

⛔ Files ignored due to path filters (1)
  • assets/images/modules/wpuf-seo.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • includes/Free/Free_Loader.php (3 hunks)
🧰 Additional context used
🪛 GitHub Check: Run PHPCS inspection
includes/Free/Free_Loader.php

[warning] 228-228:
file_get_contents() is discouraged. Use wp_remote_get() for remote URLs instead.

🔇 Additional comments (3)
includes/Free/Free_Loader.php (3)

226-232: SEO Settings section added successfully.

The new SEO Settings section is correctly implemented with appropriate labeling and pro preview styling consistent with other pro sections.


863-881: SEO Settings configuration correctly implemented.

The SEO settings section includes a logical structure with:

  • User Directory SEO section header
  • avoid_indexing_profiles checkbox with appropriate description explaining noindex functionality
  • Consistent pro preview styling and crown icon implementation

The field configuration properly explains the SEO purpose and integrates well with the existing settings structure.


1299-1304: SEO module info correctly added to modules list.

The SEO module entry is properly structured with:

  • Descriptive name and description
  • Documentation URI pointing to the correct wedevs.com location
  • Appropriate thumbnail file reference (wpuf-seo.png)

This follows the established pattern for other pro modules.

'thumbnail' => 'wpuf-stripe.png',
],
'seo/wpuf-seo.php' => [
'name' => 'SEO Settings',
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Security risk: Use WordPress HTTP API instead of file_get_contents().

You shouldn't use file_get_contents() for remote requests. WordPress does the heavy lifting for you when determining what is compatible on your host. Instead of file_get_contents() use wp_remote_get(). The issue here is that file_get_contents will fetch remote pages but doesn't check on the integrity of the HTTPS protocol connection. This could potentially be a victim of a man-in-the-middle attack. In WordPress, it's even easier: use wp_remote_get. It works much more consistently than file_get_contents, and it'll default to verifying SSL connections.

However, since this is a local file read (crown icon SVG), the security concerns are minimal. For local file access, you should use $wp_filesystem->get_contents(), and that method simply calls the native PHP's file_get_contents(), so you may use it directly in your code - for reading local files/resources.

Based on web search results

Apply this diff to use WordPress filesystem API:

-                'title'          => __( 'SEO Settings', 'wp-user-frontend' ) . '<span class="pro-icon-title"> ' . file_get_contents( $crown_icon_path ) . '</span>',
+                'title'          => __( 'SEO Settings', 'wp-user-frontend' ) . '<span class="pro-icon-title"> ' . $this->get_crown_icon_content() . '</span>',

Then add this helper method to the class:

private function get_crown_icon_content() {
    global $wp_filesystem;
    if ( empty( $wp_filesystem ) ) {
        require_once ABSPATH . 'wp-admin/includes/file.php';
        WP_Filesystem();
    }
    $crown_icon_path = WPUF_ROOT . '/assets/images/crown.svg';
    return $wp_filesystem->exists( $crown_icon_path ) ? $wp_filesystem->get_contents( $crown_icon_path ) : '';
}
🧰 Tools
🪛 GitHub Check: Run PHPCS inspection

[warning] 228-228:
file_get_contents() is discouraged. Use wp_remote_get() for remote URLs instead.

🤖 Prompt for AI Agents
In includes/Free/Free_Loader.php around line 228, replace the direct
file_get_contents($crown_icon_path) call with a helper that uses the WordPress
Filesystem API: add a private get_crown_icon_content() method that ensures
$wp_filesystem is initialized (require_once ABSPATH .
'wp-admin/includes/file.php' and call WP_Filesystem()), checks
$wp_filesystem->exists($crown_icon_path) and returns
$wp_filesystem->get_contents($crown_icon_path) or an empty string; then update
the 'title' line to call this helper instead of file_get_contents.

@Rubaiyat-E-Mohammad Rubaiyat-E-Mohammad added QA Approved This PR is approved by the QA team and removed needs: testing labels Oct 1, 2025
Copy link
Member

@sapayth sapayth left a comment

Choose a reason for hiding this comment

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

optimize the image please. current image size is 1.12 MB

@sapayth sapayth added needs: author reply This PR needs author feedback or code changes and removed needs: dev review This PR needs review by a developer labels Oct 20, 2025
@arifulhoque7
Copy link
Contributor Author

optimize the image please. current image size is 1.12 MB

done @sapayth vai

@arifulhoque7 arifulhoque7 requested a review from sapayth October 20, 2025 04:30
@arifulhoque7 arifulhoque7 added needs: dev review This PR needs review by a developer and removed needs: author reply This PR needs author feedback or code changes labels Oct 20, 2025
@sapayth sapayth merged commit b8e2fe9 into weDevsOfficial:develop Oct 20, 2025
1 of 2 checks passed
arifulhoque7 added a commit to arifulhoque7/wp-user-frontend that referenced this pull request Oct 20, 2025
* feat: Add SEO Settings module for WP User Frontend Pro

* chore: compressed image size:

* chore: minify image file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs: dev review This PR needs review by a developer QA Approved This PR is approved by the QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants