codesnippetspro/code-snippets

Possible REST issue when WordPress URL and Site URL are different

Closed this issue · 1 comments

Current behavior

Due to the plugin automatic update today, the version changed from 3.5.0 to 3.6.1, but immediately after that, when I saved the snippet, the message “Could not create snippet. Request failed with status code 404” appeared. I can no longer save.

The JSON response message is code “rest_no_route”.

When using 3.5.0, it is normally 200 OK.

Edit: In looking at the console, it looks like the 404 is happening when trying to access https://*my website*.com/wp-json/code-snippets/v1/snippets

WordPress URL : https://xxxxxx.com/zzzzzzzz

Site URL : https://xxxxxx.com/

WordPress URL and Site URL are different.

Expected behavior

Saving should work as expected.

Steps to reproduce

I checked the following in my environment, and it is version 3.6.2.
The situation did not change.

  1. After exporting and backing up the snippet, delete the snippet, import it again, and save it on the editing screen.
    → 404 error will occur.
  2. Uninstall and reinstall the plugin, import the snippet and save it on the editing screen
    → 404 error will occur.

If you change the version back to 3.5.0, you can save without any problems.

WordPress version

unknown

Code Snippets version

3.6.1

Code Snippets license

Core (free)

Anything else?

Transposed from here: Could not create snippet. Request failed with status code 404

Also see: Could not create snippet. Request failed with status code 500

I have checked with v3.6.8 on free and pro and this is no longer occuring, i believe this is resolved