Quantcast
Channel: Topic Tag: error 500 | WordPress.org
Viewing all articles
Browse latest Browse all 1704

megamurmulis on "[Plugin: Contact Form 7] Error 500 ajax wpcf7"

$
0
0

Not true how? You can easily verify this yourself..

When using newer CF7 (like 4.3.x) on older WP (like v3.9.9) - you will get message: Contact Form 7 4.3.1 requires WordPress 4.2 or higher. Please update WordPress first.

Note:
- create, edit, display form on frontend = all working ok;
- but when form is submitted - AJAX POST request will fail.

What happens next depends on your server config:
You either get a non-descriptic Error 500 or if you have Debug/Error logging enabled - you can see actual error instead of Error 500:

Fatal error:  Call to undefined function wp_json_encode() in wp-content/plugins
/contact-form-7/includes/controller.php on line 97
..

Solution:
If updating to WP 4.1+ is not possible then:
a) use older CF7 version;
b) or you can just add missing functions using a fix plugin:

You will need to copy 3 functions from: wordpress-4.1.8.zip/wordpress/wp-includes/functions.php

wp_json_encode
_wp_json_sanity_check
_wp_json_convert_string

Sample plugin:
http://pastebin.com/urhmsP9k


Viewing all articles
Browse latest Browse all 1704

Trending Articles