PHP 8.1 deprecates FILTER_SANITIZE_STRING
. Suggested replacement is to use FILTER_SANITIZE_FULL_SPECIAL_CHARS
Following up on this previous thread: https://www.ads-software.com/support/topic/error-500-if-_embed1-parameter-is-provided/
I too just saw the same 500 Error. Here is my stack trace:
PHP Fatal error: Uncaught Error: Call to undefined method WP_Error::get_matched_route() in /wordpress-versions/6.1.3/wp-includes/rest-api.php:805
Stack trace:
#0 /wordpress-versions/6.1.3/wp-includes/class-wp-hook.php(308): rest_send_allow_header(Object(WP_Error), Object(WP_REST_Server), Object(WP_REST_Request))
#1 /wordpress-versions/6.1.3/wp-includes/plugin.php(205): WP_Hook->apply_filters(Object(WP_Error), Array)
#2 /wordpress-versions/6.1.3/wp-includes/rest-api/class-wp-rest-server.php(731): apply_filters('rest_post_dispa...', Object(WP_Error), Object(WP_REST_Server), Object(WP_REST_Request))
#3 /wordpress-versions/6.1.3/wp-includes/rest-api/class-wp-rest-server.php(581): WP_REST_Server->embed_links(Array, true)
#4 /wordpress-versions/6.1.3/wp-includes/rest-api/class-wp-rest-server.php(503): WP_REST_Server->response_to_data(Object(WP_REST_Response), true)
#5 /wordpress-versions/6.1.3/wp-includes/rest-api.php(410): WP_REST_Server->serve_request('/wp/v2/posts')
#6 /wordpress-versions/6.1.3/wp-includes/class-wp-hook.php(308): rest_api_loaded(Object(WP))
#7 /wordpress-versions/6.1.3/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#8 /wordpress-versions/6.1.3/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#9 /wordpress-versions/6.1.3/wp-includes/class-wp.php(399): do_action_ref_array('parse_request', Array)
#10 /wordpress-versions/6.1.3/wp-includes/class-wp.php(780): WP->parse_request('')
#11 /wordpress-versions/6.1.3/wp-includes/functions.php(1332): WP->main('')
#12 /wordpress-versions/6.1.3/wp-blog-header.php(16): wp()
#13 /wordpress-versions/6.1.3/index.php(17): require('/wordpress-vers...')
#14 {main}
thrown in /wordpress-versions/6.1.3/wp-includes/rest-api.php on line 805
I will try to replicate this locally, to see if I can come up with a fix. Looks like at some point the replacement of WP_REST_Response with WP_Error is causing the error.
]]>In our site I’ve checked that _embed=1
parameter is added to the REST API URL, a fatal error is generated:
PHP Fatal error: Uncaught Error: Call to undefined method WP_Error::get_matched_route() in /var/www/html_dev5/wp-includes/rest-api.php:765
Stack trace:
#0 /var/www/html_dev5/wp-includes/class-wp-hook.php(303): rest_send_allow_header(Object(WP_Error), Object(WP_REST_Server), Object(WP_REST_Request))
#1 /var/www/html_dev5/wp-includes/plugin.php(189): WP_Hook->apply_filters(Object(WP_Error), Array)
#2 /var/www/html_dev5/wp-includes/rest-api/class-wp-rest-server.php(701): apply_filters('rest_post_dispa...', Object(WP_Error), Object(WP_REST_Server), Object(WP_REST_Request))
#3 /var/www/html_dev5/wp-includes/rest-api/class-wp-rest-server.php(551): WP_REST_Server->embed_links(Array, true)
#4 /var/www/html_dev5/wp-includes/rest-api/class-wp-rest-server.php(474): WP_REST_Server->response_to_data(Object(WP_REST_Response), true)
#5 /var/www/html_dev5/wp-includes/rest-api.php(370): WP_REST_Server->serve_request('/wp/v2/posts')
#6 /var/www/html_dev5/wp-includes/class-wp-hook.php(303): rest_api_loaded(Object(WP))
#7 /var/www/html_dev5/wp-i in /var/www/html_dev5/wp-includes/rest-api.php on line 765
For example, the URL that generates the error is:
/wp-json/wp/v2/posts?_embed=1&post_type=post:page&per_page=6&search=blog
If I deactivate the REST API Toolbox plugin, that call returns the corresponding posts without any problem.
Also, the call:
/wp-json/wp/v2/posts?post_type=post:page&per_page=6&search=blog
works correctly without deactivating the plugin.
Hi there, I am trying to accomplish this.
Restrict API and ajax requests if made by non logged in users.
The issue I am facing is that some plugins not working perfectly such forms as they need to access API/Ajax. Is there a way to restrict access while if the request was made by any wordpress plugin it bypass the check.
Thanks
]]>hi, how do you configure the plugin to allow redirection plugin access to wp-json? thanks!
]]>Hey there –
Noticing an odd kind of issue here that seems to be caused by the Toolbox.
Basically if we run any WP CLI command, we get an error. It seems to be some sort of conflict with Woocommerce but disabling Toolbox results in a clean command execution.
I’ve pasted a stack trace below but unfortunately not really sure how to better troubleshoot or diagnose so hoping it’s something simple.
Thanks for any assistance here.
TL
————-
EXAMPLE CLI COMMAND THAT CHOKES
# wp option get siteurl
EXAMPLE CLI COMMAND THAT WORKS
# wp option get siteurl --skip-plugins=rest-api-toolbox
STACK TRACE
# wp option get siteurl
Fatal error: Uncaught Error: Call to undefined method WP_Error::get_data() in /home/nginx/domains/OUR_DOMAIN.com/public/wp-content/plugins/woocommerce/includes/cli/class-wc-cli-runner.php:64
Stack trace:
#0 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php(304): WC_CLI_Runner::after_wp_load()
#1 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1263): WP_CLI::do_hook('after_wp_load')
#2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1158): WP_CLI\Runner->load_wordpress()
#3 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
#4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(74): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
#6 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('phar:///usr/loc...')
#7 /usr/local/bin/wp(4): include('phar:///usr/loc...')
#8 {main}
throw in /home/nginx/domains/OUR_DOMAIN.com/public/wp-content/plugins/woocommerce/includes/cli/class-wc-cli-runner.php on line 64
]]>
please update the plugin,
if I used this plugin now to last WordPress version
did there is any problem?
Hi,
i have a real estate wordpress website. And i would like to export properties to another platform by JSON.
The other platform send me a link with the specifications https://feeds.idealista.com/v6/specs/properties.html, i would like to know if your plugin can help me exporting properties with those specifications.
Thanks for your help.
Nuno Vieira
Hello, has this plugin been tested and is it supported on multisite?
Thanks!
patrick
I idea of this plugin is excellent. I activated it and then required authentication for the users endpoint and it made my site extremely slow.
Any ideas if this can be fixed. For security reasons I do not want to allow people to view the users endpoint unless they are authenticated.
]]>Hi there,
First of all tank you for your nice work!
Is it just me or there is now a notice & a warning generated by the plugin:
Notice: Undefined variable: endpoints in ...../plugins/rest-api-toolbox/includes/settings/class-rest-api-toolbox-settings-custom-post-types.php on line 47
Warning: Invalid argument supplied for foreach() in ...../plugins/rest-api-toolbox/includes/settings/class-rest-api-toolbox-settings-custom-post-types.php on line 47
Thanks for your answer!
]]>Hello, I’d like to know if this plugin works with jwt token authentification: https://br.www.ads-software.com/plugins/jwt-authentication-for-wp-rest-api/
]]>