Support » Theme: Hueman » Hueman depends on jQuery Migrate. Can it be fixed?

  • In order to optimise and speed up my website, I temporarily stopped the jQuery Migrate javascript library (jquery-migrate.min.js) from loading by adding a few lines of code in the theme’s functions.php file.

    My site seemingly worked fine afterwards, but I did get an error in the web console. Maybe this is something the theme author, Nicolas @nikeo, can have a look at.

    The Console in Safari’s Web Inspector reported:

    NOK => browserDetect::addBrowserClassToBody => TypeError: undefined is not an object (evaluating ‘a.browser.chrome’)

    The error was located in scripts.min.js:1516:96 in /hueman/assets/front/js/. I don’t know what the numbers (1516:96) after the file name mean (maybe line number?).

    The Web Console in Firefox had a similar message:

    NOK => browserDetect::addBrowserClassToBody => TypeError: $.browser is undefined

    The error was located in scripts.min.js:23:2201.

    I’m not an expert at all, but the errors seem to indicate that the code in the scripts.min.js file in the Hueman theme is not 100% compatible with the latest version of JQuery and thus requires that jQuery Migrate is also loaded. Ideally, jQuery Migrate should not be necessary.

    I did a bit of googling and found some info about the “$.browser function” being deprecated since 2012/2013. Maybe this is related to the error message…?

    (FYI: I’m running the latest version of WP and Hueman, with only one plugin: WP Super Cache. However, I performed the test with the cache plugin deactivated, i.e zero plugins.)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author presscustomizr

    (@nikeo)

    Thanks for reporting this. I agree.
    I’m exploring it.

    Theme Author presscustomizr

    (@nikeo)

    Thanks for reporting this. I’ve replied to your topic in Hueman support forum.

    Theme Author presscustomizr

    (@nikeo)

    Thanks for reporting this. I’ve replied to your topic in Hueman support forum.

    Thread Starter yallaman

    (@yallaman)

    Thank you very much, @nikeo, for taking a look at this.

    PS: I also noticed that the FlexSlider javascript, i.e. jquery.flexslider.min.js, is always loaded despite the fact that my website never use it (and never has).

    In the changelog for Hueman v3.0+ in 2016 I found the following info:

    Improved: performance, don’t load js/css files that are not needed in a given context, like flexslider and jqueryplayer

    I’m wondering why jquery.flexslider.min.js is always loaded even when FlexSlider is not used? According to the changelog, it shouldn’t.

    Both GTmetrix and PageSpeed Insights report that various JavaScript files are render-blocking resources. Defer parsing of JavaScript is recommended for both jquery.flexslider.min.js and the aforementioned jquery-migrate.min.js, plus a few more.

    If would be great if users of the Hueman theme could avoid loading of jquery-migrate.min.js and – if FlexSlider functionality is not needed – jquery.flexslider.min.js.

    Theme Author presscustomizr

    (@nikeo)

    You’re right, after exploring the problem I realized that flexslider.js can be loaded on blog page even when featured posts are disabled. Because the condition to enqueue this script is based on the Featured post count option, and not on the fact that featured post are enabled or not.
    A fix is on the way, thanks.

    Thread Starter yallaman

    (@yallaman)

    Any update on whether the error related to jQuery Migrate javascript and the “browserDetect” function (see my first message) can be resolved?

    It would be good if Hueman was not dependent on jQuery Migrate, although I guess loading jquery-migrate.min.js does not negatively impact website performance and speed too much…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hueman depends on jQuery Migrate. Can it be fixed?’ is closed to new replies.