• Resolved alexg9

    (@alexg9)


    Setup:

    1. Environment: – WordPress 6.7.0 (latest version) – PHP 8.x (exact version can be provided if needed) – Apache/Nginx on Virtualmin (using Cloudflare as CDN – development mode)

    2. REST API Usage: I am trying to consume the REST API using the following endpoint: https://www.sitename.com/wp-json/wp/v2/users/me Using Application Passwords generated from the user profile.

    3. REST API Usage: I am trying to consume the REST API using the following endpoint: https://www.sitename.com/wp-json/wp/v2/users/me Using Application Passwords generated from the user profile.

    Issue:

    When **UsersWP** is **activated**, the request to the REST API with the Authorization: Basic ... header **fails** and returns one of the following errors: – **500 Internal Server Error** – **401 Unauthorized** (depending on configuration) However, when **UsersWP** is **deactivated**, the **REST API** works as expected and returns the user information.

    What I Have Tried:

    1. I checked the **debug.log** and found the following: PHP Fatal error: Uncaught Error: Call to a member function get_page_permastruct() on null in /wp-includes/link-template.php:435 This seems to be related to **UsersWP**’s handling of permalinks.

    2. Paused Cloudflare to ensure it’s not interfering.

    3. When UsersWP is deactivated, the request succeeds and the API returns the expected JSON.

    4. REST API is enabled (works correctly without UsersWP).

    Possible Conflict:

    It appears that UsersWP is interfering with: – Authentication via Authorization: Basic ... – Permalink structure or loading of REST API endpoints.

    Request for Help:

    1. Is UsersWP compatible with Application Passwords and Basic Auth in the WordPress REST API?

    2. Is there a specific setting in UsersWP to allow REST API requests with Application Passwords?

    3. How can the Fatal Error related to get_page_permastruct() be resolved?

    4. Can you suggest any hooks or filters to allow the REST API requests without conflicts?

    Thank you in advance for any help or guidance you can provide to resolve this issue.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.