The Error:
rest api endpoint: https://game411.site/wp-json/wp/v2/types/post?context=edit
rest api response: (http_request_failed) stream_socket_client(): ssl operation failed with code 1. openssl error messages: error:0a000410:ssl routines::sslv3 alert handshake failure stream_socket_client(): failed to enable crypto stream_socket_client(): unable to connect to ssl://game411.site:443 (unknown error)
]]>I have a Contact Form 7 filter function to modify the form. Based on the user inputs I am differentiating as eligible and non-eligible. Then I want to redirect it to respective thank you pages. There are two thank you pages. One for eligiable and other one for not eligible. So, at the end I used this code to call to a function to do this.
add_filter('wpcf7_before_send_mail', 'validate_and_redirect');
function validate_and_redirect($contact_form) {
// my form codes
cf7_eligibility_thank_you_redirect($eligibility);
}
function cf7_eligibility_thank_you_redirect($eligibility) {
?>
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
// Check the eligibility value
if ('<?php echo $eligibility; ?>' === 'Eligible') {
location = 'https://mywebsite.com/thank-you-eligible/';
} else {
location = 'https://mywebsite.com/thank-you-not-eligible/';
}
}, false );
</script>
<?php
}
When I run the code, I am getting this error. Form is submitting and receiving. But this redirection is not working. And spinning all along. Once I remove the function call from the filter function all works well.
{code: 'invalid_json', message: 'The response is not a valid JSON response.'}
Can you let me know how can I achieve this and do the redirection?
Note: Tested with disabling all plugins except CF7 and switching the theme to a default theme. Getting the same error.
]]>Is there any fix I can apply?
]]>‘Publishing failed. The response is not a valid JSON response.’
When I click back to the posts menu, it shows the page I just edited as ‘Auto Draft’.
This problem goes away when I change the permalink structure from ‘post name’ to ‘plain’.
However, I want to keep my permalink structure as a post name because it is better for the SEO.
This error first came after I installed some new plugins. I tried deactivating them 1 by 1, still, the problem persists.
I ran the ‘Plugin Detective – Troubleshooting’ plugin. It couldn’t find any errors either. The front end of the site works completely fine.
I noticed today that Google Stats has error notices associated to it in our site Admin.
I believe this is a recent issue – though I am not clear if the GA4 in Tag Manager completed. I think it states “empty” when checking things out via the Google Account Admin.
I ran through the “Health Check & Troubleshooting” process without any success.
Is there any support available for this situation?
Sincerely,
Greg
I hope I can get some help. I have been trying solutions I see online relating to this problem but no solution to this problem for me so far.
Originally everything works well as it should be but I don’t know why I started to get the error message each time I try to publish or update a post or page “Publishing failed. The response is not a valid JSON response.”
In addition to this, when use the option for “post name” in permanlink, the page returns “The requested URL was not found on this server.Apache Server at Port 443”
When I used the “plain”, the page displays content but this is not good for SEO. I tried using the “post name” again after clearing .htaccess according to some of the information I found but still no resolution.
I also get a message from the site health that
I also got this from error message from the SEO plugin I am using”
AIOSEO relies on the WordPress Rest API and your site might have it disabled” The information in the link provided for me information did not give exact solution. How do I enable “Rest API”, if this might be the problem.
I do not understand exactly what I am supposed to do to enable REST API from the information I got researching, I am not a developer. It seems the REST API information given is for those developing plugins that need REST API not exactly for end users like me in this situation.
from the site health check, I also get report “The REST API encountered an unexpected result” and there is no indication on how to fix this.
I have diabled plugins one after the other but no resolution.
I use theme “Mesmerize”, I swapped for twenty-twenty-two and twenty-twenty-three but the problem remains.
Webiste is hosted on google cloud Compute Engine
I will appreciate any directions towards fixing.
Thank you.
]]>I have been use site kit since it release without much changes in my plugin or anything in the site. And today I received error data in all aspects either analytics, search console, adsense, well basically in all column with message: Error: Invalid JSON response.
I have tried the idea of temporary shut off the security plugin and it didn’t work. Can anyone help me with this issue?
]]>I try to check in WooCommerce -> Status -> Logs but I get absolutely no info from that (this is what I mean), so not sure what to even look for
Everything works fine but that option, customers can ask questions in that inquiry tab from single product page, but vendors when checking the inquiry board in when they get said error
Any help or guidance would be helpful
Thanks
Do you plan an update in the near future?
]]>I have updated the contact form-7 to the latest version 5.4.
When I try to submit the form the new ajax loader keeps on rotating.
While inspecting the element in chrome, it shows the following error :
Code: “invalid_json
Message : “The response is not valid json response”
in the /inclues/js/index.js
My PHP version is 7.4.15
I switched back to contact form 7 version 5.3.2 and it working
Kindly resolve it
Thank you