autoptimize captcha plugin conflict
-
autoptimize captcha plugin conflict,,, when the above page is loaded the captcha box is not available but when auto is disabled then the captch box appears also sometimes the site name(font type paparika) in header wont load but loads normal font
-
This topic was modified 4 years, 7 months ago by
anand99.
The page I need help with: [log in to see the link]
-
This topic was modified 4 years, 7 months ago by
-
Well, I guess you know the drill by now; First and foremost try to identify what is breaking things by just disabling CSS or JS or HTML or Image optimization (incl. lazyload).
Once you know that, dive in and try identify what code/ files (CSS or JS) are responsible for the broken feature and try excluding that.
If the problem is with JS, chances are you’ll find useful information on your browser’s developer console.
There’s more info in the troubleshooting tips and info on exclusions in the AO FAQ.
hope this helps,
frankthe issue is not there when also aggregate inline is disabled,,after disabling it the browser console message is
A cookie associated with a cross-site resource at https://www.google.com/ was set without the
SameSiteattribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with
SameSite=Noneand
Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
autoptimize_aec3283004ab7103c1064cb35a52987d.js:2 JQMIGRATE: Migrate is installed, version 1.4.1
DevTools failed to load SourceMap: Could not load content for /wp-content/cache/autoptimize/css/slick-theme.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE’and after enabling it the message is
reCAPTCHA couldn't find user-provided function: anr_onloadCallback autoptimize_e8a656ebc632e200d2c3872012b2231a.js:4 JQMIGRATE: Migrate is installed, version 1.4.1 DevTools failed to load SourceMap: Could not load content for /wp-content/cache/autoptimize/css/slick-theme.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
iam not able to go further on excluding this plugin scripts or entire plugin
till date i didnt face this issue but suddenly without any plugin update or theme update but i have added few codes in function.php for phone nofunction wooc_extra_register_fields() {?> <p class="form-row form-row-wide"> <label for="reg_billing_phone"><?php _e( 'Phone', 'woocommerce' ); ?></label> <input type="text" class="input-text" name="billing_phone" id="reg_billing_phone" value="<?php esc_attr_e( $_POST['billing_phone'] ); ?>" /> </p> <div class="clear"></div> <?php } add_action( 'woocommerce_register_form_start', 'wooc_extra_register_fields' ); function wooc_validate_extra_register_fields( $username, $email, $validation_errors ) { if ( isset( $_POST['billing_phone'] ) && empty( $_POST['billing_phone'] ) ) { $validation_errors->add( 'billing_phone_error', __( '<strong>Error</strong>: Phone is required!.', 'woocommerce' ) ); } if ( isset( $_POST['billing_phone'] ) ) { $hasPhoneNumber= get_users('meta_value='.$_POST['billing_phone']); if ( !empty($hasPhoneNumber)) { $validation_errors->add( 'billing_phone_error', __( '<strong>Error</strong>: Mobile number is already used!.', 'woocommerce' ) ); } } } add_action( 'woocommerce_register_post', 'wooc_validate_extra_register_fields', 10, 3 ); function wooc_save_extra_register_fields( $customer_id ) { if ( isset( $_POST['billing_phone'] ) ) { // Phone input filed which is used in WooCommerce update_user_meta( $customer_id, 'billing_phone', sanitize_text_field( $_POST['billing_phone'] ) ); } } add_action( 'woocommerce_created_customer', 'wooc_save_extra_register_fields' );
-
This reply was modified 4 years, 7 months ago by
anand99.
OK, if the issue isn’t there when “also aggregate inline JS” is disabled, then check the HTML source for inline JS that refers to recaptcha and exclude that by choosing a keyword from that inline JS and adding that to the JS exclusion field.
hope this helps,
frankhow to find HTML source for inline JS that refers to recaptcha ,please send a snapshot
-
This reply was modified 4 years, 7 months ago by
anand99.
the best i could do was to add recaptcha__en.js in the Exclude scripts from Autoptimize: js
from
</style> <link rel="stylesheet" type="text/css" href="https://www.gstatic.com/recaptcha/releases/aUMtGvKgJZfNs4PdY842Qp03/styles__ltr.css"> <script nonce="VAwdnS2P2FQ6RynrWOs59w" type="text/javascript">window['__recaptcha_api'] = 'https://www.google.com:443/recaptcha/';</script> <script type="text/javascript" src="https://www.gstatic.com/recaptcha/releases/aUMtGvKgJZfNs4PdY842Qp03/recaptcha__en.js" nonce="VAwdnS2P2FQ6RynrWOs59w">
it doesn’t work
No, inline script is what is in a
<script
tag that has nosrc
, so maybe try__recaptcha_api
instead?now it seems to be working, but i need to know why suddenly this happened ,i have been using captcha plugin along with auto for a year
with every theme and plugin update things can change anand99 and that means things can break as well, with or without Autoptimize. ideally you test your site after each update to ensure all is well.
have a nice Sunday ??
frankrecently i have updated few plugins along with theme and the issue is partially solved,
before updation without using __recaptcha_api captcha box wont appear but after various plugins and theme updation the captcha box will not appear the first time the page is loaded but appears after one refreshnow even with __recaptcha_api in the exclusion list the captcha box is not been shown but on disabling Also aggregate inline JS the captcha box shows
-
This reply was modified 4 years, 6 months ago by
anand99.
in that case you’ll have to go through the same process to find what inline recaptcha JS needs to be excluded anand99 or (a lot easier) simply disable “also aggregate inline JS” off course ??
now with js,__recaptcha_api in the js exclusion list the captcha issue is solved but header disappears
can you copy/paste your full JS exclusion field anand99 ?
wp-includes/js/dist/, wp-includes/js/tinymce/, js/jquery/jquery
here
__recaptcha_api has been removed temporarily-
This reply was modified 4 years, 6 months ago by
anand99.
-
This reply was modified 4 years, 7 months ago by
- The topic ‘autoptimize captcha plugin conflict’ is closed to new replies.