• 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]

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    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,
    frank

    Thread Starter anand99

    (@anand99)

    the issue is not there when also aggregate inline is disabled,,after disabling it the browser console message isA cookie associated with a cross-site resource at https://www.google.com/ was set without theSameSiteattribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set withSameSite=NoneandSecure`. 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 no

    
        function 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.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    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,
    frank

    Thread Starter anand99

    (@anand99)

    how 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.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Thread Starter anand99

    (@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

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    No, inline script is what is in a <script tag that has no src, so maybe try __recaptcha_api instead?

    Thread Starter anand99

    (@anand99)

    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

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    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 ??
    frank

    Thread Starter anand99

    (@anand99)

    recently 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 refresh

    Thread Starter anand99

    (@anand99)

    now 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.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    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 ??

    Thread Starter anand99

    (@anand99)

    now with js,__recaptcha_api in the js exclusion list the captcha issue is solved but header disappears

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    can you copy/paste your full JS exclusion field anand99 ?

    Thread Starter anand99

    (@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.
Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘autoptimize captcha plugin conflict’ is closed to new replies.