JustinBBC
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: disable wp-json outputFor anyone else wanting to block this data leak, I found two methods:
add_filter( ‘rest_authentication_errors’,
function () { return new WP_Error( ‘rest_disabled’, ‘disabled’ ); }
);or
add_filter( ‘rest_jsonp_enabled’, ‘_return_false’ );Forum: Everything else WordPress
In reply to: disable wp-json outputMod: Please fix the forum code then. It tries to accept the image and even assigns a UUID to it. Thanks for the info.
Forum: Everything else WordPress
In reply to: disable wp-json outputThank you, @threadi . Would you happen to know where the $access variable is defined? It doesn’t even seem to be used in the function. Do you know how this function is triggered? Doh, I guess it is self-triggered by the add_filter function.
<WP mod – where is the image I pasted into this? I see the ‘file name is’ string below but the img doesn’t show.>
Thank you. So is it correct to say that the permalink is the only way to access a page and there is no other URL to get to any particular page?
Forum: Everything else WordPress
In reply to: how to modify server headersFor the record, I fixed this by adding headers to Apache .htaccess file. For example:
Header always set X-Frame-Options "SAMEORIGIN"
Forum: Everything else WordPress
In reply to: how to modify server headersThank you.
Forum: Everything else WordPress
In reply to: how to modify server headersStrict-Transport-Security, Content-Security-Policy, X-Frame-Options X-Content-Type-Options, Referrer-Policy, Permissions-Policy
Forum: Plugins
In reply to: [Contact Form 7] GA events not workingYou paste in the code (like the first one) into your webpage just like you did your code, then use the contact form and see if you get a pop-up.
But, you can do it now w/o changing your page. Open the webpage, press F12 to open the dev tools, select the “Conosle” tab.
on the input line, paste this code and press Enter:document.addEventListener( 'wpcf7mailsent', function( event ) { console.log("mailsent event fired"); }, false );
Now (without closing the console pane/dev tools), fill out the form and send it. Did you get a message in the console that says “mailsent event fired” ?
After looking at that page, I’m thinking you don’t even have a Contact Form 7 form. Are you sure you have the Contact From 7 plugin installed and configured? Are you sure the shortcode is on this contact page? Are you using your theme’s built-in contact form?
Forum: Plugins
In reply to: [Contact Form 7] How to intercept form submissionAlso, to be sure, are you saying the PHP action hook and JS wpcf7submit event can be used in conjunction with each other, or are you suggesting to use only the PHP action hook?
I’m not sure right now how’d I’d mix the two.
Forum: Plugins
In reply to: [Contact Form 7] How to intercept form submissionThank you. Action hooks are new to me. Does your plugin already have some part of the hook framework in place? Do you have any documentation for the hooks in CF7?
Forum: Plugins
In reply to: [Contact Form 7] Email sent through form has “fields” not info HELPHave you read the docs?
https://contactform7.com/docs/Here is the fields page:
https://contactform7.com/text-fields/Forum: Plugins
In reply to: [Contact Form 7] Email sent through form has “fields” not info HELPIt looks to me like there is a disconnect between the form and mail data.
Your mail has tags (I think they are called) like “your-name” but your form has something like “cf7s-name”. Make them the same.
Also, you might want to try putting an asterisk (*) after each field in the form. I’m no expert on this plugin, but mine has it.As an example for you, here is my form:
<div id="contactForm"> <div id="name"><p> [text* your-name id:name placeholder "Your Name"]</p> </div> <div id="email"><p> [email* your-email id:email placeholder "Your E-mail Address"]</p> </div> <div id="message"><p> [textarea* your-message x15 id:message placeholder "Message"]</p> </div> <div id="send"><p>[submit "Send"]</p> </div> </div>
My mail message body:
From: [your-name] <[your-email]> Message: [your-message]
See how the two have corresponding tags?
Forum: Plugins
In reply to: [Contact Form 7] Email sent through form has “fields” not info HELPThat looks proper. So that makes me wonder if your Form tab info is correct. Or else you have a typo somewhere on either tab. Double-check syntax and look for any stray (unintentional) characters. Post all of your text if you question anything.
Don’t need to remove anything if your form uses those properties.
Forum: Plugins
In reply to: [Contact Form 7] Email sent through form has “fields” not info HELPSounds like it might be a syntax issue in your form. What text do you have in the Mail tab – Message body?
Forum: Plugins
In reply to: [Contact Form 7] GA events not workingThis may sound elementary, but are you sure this code is loaded and executed?
Have you tried a simple test, like:<script> document.addEventListener( 'wpcf7mailsent', function( event ) { alert("sent event"); }, false ); </script>
or
<script> document.addEventListener( 'wpcf7mailsent', function( event ) { console.log("mailsent event fired"); }, false ); </script>
If that doesn’t prove out then it sounds like the new header may not be loading – clear cache.
You can also load the page, open the console, paste in your code, then submit the form. If that works then you know your code is good and it is just not loading or parsing for some reason.