Forum Replies Created

Viewing 7 replies - 16 through 22 (of 22 total)
  • I followed @pzxyz’s suggestion on testing the custom code for functions.php. Turns out, it was these 2 code snippets that were meant to optimize my results on web tools that were the culprit:

    /***** Start: Defer parsing of javascript *****/
    function defer_parsing_of_js ( $url ) {
      if ( FALSE === strpos( $url, '.js' ) ) return $url;
      if ( strpos( $url, 'jquery.js' ) ) return $url;
      return "$url' defer='defer";
    }
    add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
    /***** End: Defer parsing of javascript *****/
    
    /***** Start: Remove query string from static resources *****/
    function _remove_script_version( $src ){
      $parts = explode( '?', $src );
      return $parts[0];
    }
    add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
    add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
    /***** End: Remove query string from static resources *****/

    I commented them out and got no errors anymore. Even got the blank page on editor issue resolved as well.

    *Additional note: I was using the autoptimizer plugin and I had to disable minification on javascript and css files. This solved issues on console errors on post pages.

    • This reply was modified 6 years, 2 months ago by midnitedev.

    Yes, I do, lots of it actually. I’ll try minimizing it to see if that’s the cause of the issues.

    Thread Starter midnitedev

    (@midnitedev)

    Thank you. I already posted in that forum, I thought I could get more help by posting on this site as well to see if any other users had similar issues.

    Found the issue. It was caused by child theme incompatibility for my website. I was using a custom Divi child theme and somehow all these issues popped up.

    Tested reinstalling wordpress and deactivated plugins but still having a blank page on page edits.

    Having these errors on wordpress admin dashboard as well, might be related:

    Uncaught SyntaxError: missing ) after argument list
    19:19:51.725 backbone.min.js:1 Uncaught TypeError: Cannot read property 'extend' of undefined
        at backbone.min.js:1
        at backbone.min.js:1
        at backbone.min.js:1
    19:19:51.725 wp-backbone.min.js:1 Uncaught ReferenceError: Backbone is not defined
        at wp-backbone.min.js:1
        at wp-backbone.min.js:1
    19:19:51.726 media-models.min.js:1 Uncaught TypeError: Cannot read property 'extend' of undefined
        at Object.20 (media-models.min.js:1)
        at b (media-models.min.js:1)
        at media-models.min.js:1
        at media-models.min.js:1
    19:19:51.726 wp-plupload.min.js:1 Uncaught TypeError: Cannot read property 'Attachments' of undefined
        at wp-plupload.min.js:1
        at wp-plupload.min.js:1
    19:19:51.736 media-views.min.js:1 Uncaught TypeError: Cannot set property 'l10n' of undefined
        at Object.<anonymous> (media-views.min.js:1)
        at b (media-views.min.js:1)
        at media-views.min.js:1
        at media-views.min.js:1
    19:19:51.736 media-editor.min.js:1 Uncaught TypeError: Cannot read property 'settings' of undefined
        at media-editor.min.js:1
        at media-editor.min.js:1
    19:19:51.737 media-audiovideo.min.js:1 Uncaught TypeError: Cannot read property 'settings' of undefined
        at Object.<anonymous> (media-audiovideo.min.js:1)
        at b (media-audiovideo.min.js:1)
        at media-audiovideo.min.js:1
        at media-audiovideo.min.js:1
    19:19:51.737 mce-view.min.js:1 Uncaught ReferenceError: Backbone is not defined
        at mce-view.min.js:1
        at mce-view.min.js:1
    19:19:51.742 wp-api.min.js:1 Uncaught TypeError: Cannot read property 'isFunction' of undefined
        at wp-api.min.js:1
        at wp-api.min.js:1
    19:19:52.606 jquery.flot.resize.min.js:1 Uncaught TypeError: Cannot set property 'w' of undefined
        at n (jquery.flot.resize.min.js:1)
        at dispatch (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,underscore,wp-util,wp-a11y,updates,jquery-ui-core,jquery-ui-widget,moxiejs,plupload&ver=5.0.1:3)
        at r.handle (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,underscore,wp-util,wp-a11y,updates,jquery-ui-core,jquery-ui-widget,moxiejs,plupload&ver=5.0.1:3)

    I’ve had this one too and I thought it was the jetpack module at first, so I tried disabling it as well as Autoptimizer plugin, but issue is still there. I think minifying them with Autoptimizer might have been the cause but I’m not too sure. Someone needs to verify.

    Thread Starter midnitedev

    (@midnitedev)

    @heator Thank you very much, it works now. Lol, i don’t know how I missed this on the docs, I guess I was in such a rush I probably referenced the wrong one a couple times. Good stuff! ??

Viewing 7 replies - 16 through 22 (of 22 total)