I was facing a similar issue when trying to use Client-CLI with OAuth 1.0a plugin, however I found a solution here on the official repository.
In the file lib/class-wp-json-authentication-oauth1.php
on line 524
, change the following code:
$base_request_uri = rawurlencode( get_home_url( null, parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), 'http' ) );
to:
$home_url_path = parse_url(get_home_url (null,'','http'), PHP_URL_PATH );
$request_uri_path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
if (substr($request_uri_path, 0, strlen($home_url_path)) == $home_url_path) {
$request_uri_path = substr($request_uri_path, strlen($home_url_path));
}
$base_request_uri = rawurlencode( get_home_url( null, $request_uri_path, 'http' ) );
This should solve the problem you are facing.
Related Posts:
- How do I access the body of a WP API request in a custom route?
- wp rest api v2 return json_no_route
- WP-REST API not returning all its endpoints, 404 on documented endpoints
- WP REST API V2 – Modifying responses
- How to upload image to wordpress from external page
- WP API to fetch all records for /posts, /media, /categories
- WP Rest API get page from path
- backbone fetch() not working
- WP-API user email change confirmation
- No featured media in API request
- Syntax for REST API to have bold formatted and multiple lines in product description [closed]
- WP Rest get all by post within that category, by category name not by cat ID
- Add Data to Response of WP-JSON Root
- OAuth1 empty “authentication” in /wp-json
- WP – API – OAuth 1.0a Server, How to implement with AngularJS?
- Are there events pub/sub for external application to subscribe to file/pdf uploads by wordpress admin
- WP API and Proxy
- Get single item from cURL plugin API call inside bash [closed]
- why woocommerce api only do not upload images from local computer? [closed]
- ng-repeat is not returning a list of posts
- What request is WordPress sending on theme update?
- Is WP API going to be around in the long term?
- How to Create a Post from localfiles?
- Get a complete list of all categories using node-wpapi
- upload image to wp-api
- WP-API call function
- wordpress api make 2 custom post type with single request
- Update Custom Post Type Metadata Wp Rest API
- WP-API Content showing null
- How to retreive/set wordpress page html?
- How can I use React packages with the clasic editor?
- Hiding WordPress REST API v2 endpoints from public viewing
- Get WP Navigation Menu from REST API V2
- Get post count in wp rest API v2 and get all categories
- Query WP REST API v2 by multiple meta keys
- Show popular post in another php website via WP REST JSON API
- Uploading media with the REST API
- WP-API v2 Custom Endpoint Response Formatting
- How do I cache (core) API requests?
- Implementing Isomorphic JavaScript (React JS) in WordPress?
- WP REST API only returning partial list of users
- Is there a way to get protected meta fields through any of the available built-in WordPress APIs? (xmlrpc, wp-json)
- WP API returning SQL results as strings, rather than numbers
- Are there server performance benefits to fetching only specific fields when querying the REST API?
- WordPress Rest API
- Retrieving pages with multiple tags using REST API
- Insert variations via woocommerce api [closed]
- Fetching private posts or custom post types via WP-API with basic authentication
- Custom endpoint and X-WP-TotalPages (headers)
- WP Rest API v2 filter and display latest post with specific tag
- WordPress Rest API: How do we validate with our custom API key?
- How to update/insert custom field(post meta) data with wordpress REST API?
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- How to save new transients if query changes?
- How to loop through JSON data in wordpress WP REST API
- WP API V2 returning Invalid User ID
- Unset data in custom post type WordPress API (wp-json)
- Can I list all installed plugins/versions and wp version from API
- How do I retrieve a list of popular plugins using the WordPress.org Plugin API?
- WP API : date_query parameter
- How to filter or search the posts using postmeta tables custom meta fields with wordpress REST API
- WP-API: how do I allow authenticated clients only?
- Hiding API routes list
- WordPress wp-json API – Custom Post Type returns 403
- Get the Category Name instead of ID from WP-API
- Get more than 10 posts in a specific category with the wordpress api
- WP API to fetch all the media/posts records if count is more than 100
- Add Products to Woocommerce through WP API
- WP REST API – Retrieve content from page
- Updata Metadata WP Rest API
- Authentication for a mobile app connected via wp-rest api?
- Add media with WP-Rest-API v2 II
- wordpress custom endpoint multiple params
- Can we access the REST request parameters from within the permission_callback to enforce a 401 by returning false?
- Create post with REST API in php with file_get_contents
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- Keep getting 401 error from WordPress on AWS Lightsail
- WP-API and Basic Auth returning 403 on POST but not GET
- WordPress API returns empty page when page is less than X-WP-TotalPages
- Extending wp JavaScript base class to make a post request to a custom REST endpoint
- WP Rest API max limit include parameter?
- How to filter users on custom meta fields in WP JSON v2?
- Passing Meta array in wp-rest api
- How to make a WP REST API query with meta_query in WP4.7?
- How to retrieve custom meta term of category taxonomy from WP Rest API?
- Gutenberg Custom Block Getting All Posts
- Inserting custom post meta value using WP-REST API
- node-wpapi: how to handle authentication?
- Get all tags not just first 10 with wp api 2.0
- Mass importing json data into custom fields (postmeta)
- Backbone.js and WP API
- React post to WordPress custom post type
- Post body not working with wp_remote_post()
- PHP Fatal error: Cannot use object of type WP_REST_Response as array in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
- How to add WP API and JS featured image attachment
- WP REST API V2 – Add user data to response
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Hook before posting via JSON REST API
- Display post title from WordPress excluding a string via API
- WP_REMOTE_POST Requests are being blocked by API provider [closed]