Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options/settings page. TypeError: Cannot read property 'status' of undefined #678

Closed
helpgood opened this issue Jan 26, 2018 · 10 comments
Closed

Comments

@helpgood
Copy link

To help track problems please follow this template. If you can provide screenshots then that will help.

Please replace this template with your own details!

Summary

It seems that there's still https:// issue on the latest version.

Actual Behavior

Something went wrong 🙁
Redirection is not working. Try clearing your browser cache and reloading this page. If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.

If that doesn't help, open your browser's error console and create a new issue with the details.

Please mention options, and explain what you were doing at the time

Steps to reproduce

Go to the plugin setting page.

Environment

Plugin: 3.0.1
WordPress: 4.9.2
PHP: 7.0.25-1+ubuntu16.04.1+deb.sury.org+1
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Buster: 3.0.1 === 3.0.1
TypeError: Cannot read property 'status' of undefined

Chrome inspector error:

Mixed Content: The page at 'https://www.example.org/wp-admin/tools.php?page=redirection.php&sub=options' was loaded over HTTPS, but requested an insecure resource 'http://www.example.org/wp-json/redirection/v1/setting/'. This request has been blocked; the content must be served over HTTPS.
tools.php?page=redirection.php&sub=options:1

Fetch API cannot load https://www.example.org/wp-json/redirection/v1/setting. Redirect failed.

@johngodley
Copy link
Owner

If you go to the WordPress menu Settings > General is the URL for your Site/WordPress URL http or https?

2018-01-26_09-30-37

@svandragt
Copy link

svandragt commented Jan 26, 2018

We have this exact error (TypeError: Cannot read property 'status' of undefined), and we use run this on multisite with a domain mapper. The 2.10.1 release worked ok. Both admin and site are HTTPS but not same domain.

Failed to load https://$livesite/wp-json/redirection/v1/group: Request header field x-wp-nonce is not allowed by Access-Control-Allow-Headers in preflight response.
tools.php?page=redirection.php:1 Failed to load https://$livesite/wp-json/redirection/v1/redirect?orderby=id: Request header field x-wp-nonce is not allowed by Access-Control-Allow-Headers in preflight response.

Perhaps it should request the admin site url?

@helpgood
Copy link
Author

helpgood commented Jan 26, 2018

@johngodley,
Both were already https.

WordPress Address (URL) |  https://www.test.org
Site Address (URL) |  https://www.test.org

@johngodley
Copy link
Owner

@svandragt I think that is a different problem, and it could be fixed in the 3.1 beta:

https://github.com/johngodley/redirection/releases/tag/3.1

@helpgood are you also using multisite by any chance? Does the request for https://www.example.org/wp-json/ show some data?

@helpgood
Copy link
Author

@johngodley,
Single site only.
I can't see the data easily, sorry.

@helpgood
Copy link
Author

@johngodley
If it helps, the previous version we use before Upgrading the plugin was Version 2.10.1, and that worked with no problem.

@johngodley
Copy link
Owner

I've released version 3.1 which may help. Let me know how it goes

@helpgood
Copy link
Author

helpgood commented Jan 29, 2018

@johngodley,

Unfortunately, it still doesn't work. Pretty much the same error.

Plugin: 3.1
WordPress: 4.9.2 (single)
PHP: 7.0.25-1+ubuntu16.04.1+deb.sury.org+1
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
REST API: https://www.example.org/wp-json/

Error: Failed to fetch

Something went wrong 🙁
Failed to fetch

Please take a look at the plugin status. It may be able to identify and "magic fix" the problem.
Redirection is unable to talk to your REST API. If you have disabled it then you will need to enable it.
Security software may be blocking Redirection. You will need to configure this to allow REST API requests.
Caching software, in particular Cloudflare, can cache the wrong thing. Try clearing all your caches.
Please temporarily disable other plugins! This fixes so many problems.


Mixed Content: The page at 'https://www.example.org/wp-admin/tools.php?page=redirection.php' was loaded over HTTPS, but requested an insecure resource 'http://www.example.org/wp-json/redirection/v1/redirect/?orderby=id&_wpnonce=decae8e1bc'. This request has been blocked; the content must be served over HTTPS.
tools.php?page=redirection.php:1

Fetch API cannot load https://www.example.org/wp-json/redirection/v1/redirect?orderby=id&_wpnonce=decae8e1bc. Redirect failed.
tools.php?page=redirection.php:1

Mixed Content: The page at 'https://www.example.org/wp-admin/tools.php?page=redirection.php' was loaded over HTTPS, but requested an insecure resource 'http://www.example.org/wp-json/redirection/v1/group/?_wpnonce=decae8e1bc'. This request has been blocked; the content must be served over HTTPS.
tools.php?page=redirection.php:1

Fetch API cannot load https://www.example.org/wp-json/redirection/v1/group?_wpnonce=decae8e1bc. Redirect failed.
tools.php:511 WOP Array(1)

@johngodley
Copy link
Owner

I think version 3.2 beta should fix the 'failed to fetch' error. This is, I think, caused by your site redirecting requests. If you try 3.2 beta you may need to visit the plugin's 'support' page and maybe press the 'magic fix' button if it suggests you do so.

https://github.com/johngodley/redirection/releases/tag/3.2-beta

The mixed content warnings I don't know about. They may be related, but if they aren't would it be possible to get a login to the site and try and debug things? If that's ok I can be contacted from https://redirection.me/contact/

@johngodley
Copy link
Owner

Closing for now, please reopen with more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants