trulycool
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact Form 7] Please help with REST API not work@nataliehoang91 glad you’ve got form submit working; still a no go for me 🙁
The only way I have found to get all the needed form data is:
– embed the shortcode in a Post or Page
– view the page (i.e. the WordPress version, not frontend rendered)
– right click on first form field and ‘inspect element’
– look for the <form> tag just above the first form field, and just below it there is a hidden <div> with all the CF7 ‘special fields’<div style="display: none;"> <input type="hidden" name="_wpcf7" value="2039"> <input type="hidden" name="_wpcf7_version" value="5.8.5"> <input type="hidden" name="_wpcf7_locale" value="en_US"> <input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f2039-p3653-o1"> <input type="hidden" name="_wpcf7_container_post" value="3653"> <input type="hidden" name="_wpcf7_posted_data_hash" value=""> </div>The first hidden <input) is _wpcf7, and that is the Form ID. The rest of the input are named in a self explanatory way.
All the best 🙏
Forum: Plugins
In reply to: [Contact Form 7] Please help with REST API not workAm running a headless WordPress site, and have the same REST API submit problems listed above; have been unable to successfully send forms in the last month or so.
Last good version of CF7 for REST API form submittal: 5.8.5
Have followed the advice in this thread and spent many hours back and forth between the WordPress side & the form data on the front end to try to match the payload which works on the WordPress side.
This is the form submit from Vite dev server, which appears to match the payload from the WordPress embedded form page:
Payload: FormData { [Symbol(state)]: [ { name: 'your-email', value: '[email protected]' }, { name: 'newsletter', value: 'SUBSCRIBE' }, { name: '_wpcf7', value: '2039' }, { name: '_wpcf7_version', value: '5.9.2' }, { name: '_wpcf7_container_post', value: '3653' }, { name: '_wpcf7_posted_data_hash', value: '' }, { name: '_wpcf7_locale', value: 'en_US' }, { name: '_wpcf7_unit_tag', value: 'wpcf7-f2039-p3653-o1' } ] } MLX Form Success: { id: '1qyk770', valid: true, posted: true, errors: {}, data: { email: '[email protected]', newsletter: 'on', _wpcf7_unit_tag: undefined, _wpcf7: undefined, _wpcf7_version: undefined, _wpcf7_locale: undefined, _wpcf7_container_post: undefined, response: 200 }, constraints: { email: { required: true }, newsletter: { required: true }, _wpcf7_unit_tag: { required: true }, _wpcf7: { required: true }, _wpcf7_version: { required: true }, _wpcf7_locale: { required: true }, _wpcf7_container_post: { required: true } } }The same payload to the same endpoint in Postman gives a unit tag error, although that is the unit tag from the WordPress version of the form page which works:
{"code":"wpcf7_unit_tag_not_found","message":"There is no valid unit tag.","data":{"status":400}}It appears that in order to protect against SPAM, it is no longer possible to submit from React/Vue/SvelteKit frontend?
Any insight anyone has would be greatly appreciated. Would prefer not to stick at the older version, but it does still work.
All the best,
Morgan
🙏- This reply was modified 2 years, 2 months ago by trulycool. Reason: form submitted before done writing
Forum: Plugins
In reply to: [Memcached Object Cache] Plugin works, but completely breaks WP CLIUPDATE: this turns out to be related to the managed VPS where my site runs. And it is now fixed 🙂
The php.ini they gave me access to (as I don’t have sudo) was in ~/public_html/fcgi-bin, and I blithely assumed that would include PHP CLI…
So tho I had enabled the PECL memcache extension for the regular web PHP, it was not available via PHP CLI, which is essentially a different beast, and what wp-cli uses.
Finally figured it out while reporting the error to the wp-cli repo, and looking for solutions to offer there…contacted my VPS support, and had them add it to the actual system php.ini, and now wp-cli works as expected w/ Memcached Object Cache enabled 🙂
Thanks for the excellent plugin; much appreciated!
All the best,
Morgan
🙏