• Resolved Tommy

    (@baptistej)


    Hello,

    I’m getting errors in my browser console on the plugin.php page.

    jquery.min.js?ver=3.6.0:2 jQuery.Deferred exception: w3tcData is not defined ReferenceError: w3tcData is not defined
        at cdn_cf_check (https://mysite.com/wp-content/plugins/w3-total-cache/pub/js/options.js?ver=2.2.4:332:2)
        at HTMLDocument.<anonymous> (https://mysite.com/wp-content/plugins/w3-total-cache/pub/js/options.js?ver=2.2.4:389:2)
        at e (https://mysite.com/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30038)
        at t (https://mysite.com/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30340) undefined
    jquery.min.js?ver=3.6.0:2 Uncaught ReferenceError: w3tcData is not defined
        at cdn_cf_check (options.js?ver=2.2.4:332:2)
        at HTMLDocument.<anonymous> (options.js?ver=2.2.4:389:2)
        at e (jquery.min.js?ver=3.6.0:2:30038)
        at t (jquery.min.js?ver=3.6.0:2:30340)
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @baptistej

    Thank you for reaching out.
    Can you please confirm if you enabled the CDN and if the selected CDN type is Cloudfront?
    If so, is the option “Only Purge CDN manually” enabled?

    Thanks!

    Thread Starter Tommy

    (@baptistej)

    I enabled the CDN in the past but it is currently disabled and set to StackPath by default.

    “Only Purge CDN manually” is disabled.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @baptistej

    Thank you for your feedback.
    pub/js/options.js#L332 is looking for w3tcData.cdnFlushManually. In some cases, this may cause errors that do not actually impact the performance.
    The function is meant for W3TC pages. We’ll add the condition in the next release in options.js to check if the data is loaded and not cause an error.
    You can test this by adding the following:

    if ( typeof w3tcData === 'undefined' ) {
            return;
        }

    before line 324 in /wp-content/plugins/w3-total-cache/pub/js/options.js
    var cdnEnabled = jQuery( '#cdn__enabled' ).is( ':checked' ),
    It should look like this:

    function cdn_cf_check() {
        if ( typeof w3tcData === 'undefined' ) {
            return;
        }
    	var cdnEnabled = jQuery( '#cdn__enabled' ).is( ':checked' ),
    		cdnEngine = jQuery( '#cdn__engine' ).find( ':selected' ).val(),
    		cdnFlushManually = jQuery( '[name="cdn__flush_manually"]' ).is( ':checked' );

    Please try these changes and let me know if this helps!

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Console errors’ is closed to new replies.