$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Homepage loads many unnecessary jquery-ui files|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Homepage loads many unnecessary jquery-ui files

matteradmin11PV0评论

In order to speed up loadtime I try to avoid unnecessary loads. In the Google report (and in my html) I see that many unwanted files are loaded, as jquery-migrate.min.js?ver=1.4.1, core-min, mouse-min, button-min, widget-min and more. I am certain I do not need or use them but they cause (among more) a terrible loadtime. I am using theme Twenty Seventeen.

What should I do to avoid loading these jquery-min files?

The site: www.vakantiehuisverhuur.eu.

Regards Rudolph Smits, NL

In order to speed up loadtime I try to avoid unnecessary loads. In the Google report (and in my html) I see that many unwanted files are loaded, as jquery-migrate.min.js?ver=1.4.1, core-min, mouse-min, button-min, widget-min and more. I am certain I do not need or use them but they cause (among more) a terrible loadtime. I am using theme Twenty Seventeen.

What should I do to avoid loading these jquery-min files?

The site: www.vakantiehuisverhuur.eu.

Regards Rudolph Smits, NL

Share Improve this question asked Feb 21, 2019 at 8:57 Rudolph SmitsRudolph Smits 1 1
  • You can try to find a responsible plugin by disabling them one by one like mentioned here. – moped Commented Feb 21, 2019 at 11:44
Add a comment  | 

3 Answers 3

Reset to default 0

I can not explain this but this seems to be solved.

Using Autoptimize already but now aggregating javascript in stead of minify did the job. I could not do this before because it made Contact Form 7 fail to redirect to a "thank you" page after sending a form. With the help of the author that has been solved so that I can "aggregate" now.

I saw people from all over the world visiting my site. Thank you for your intention to help. Moped, especially to you!

Regards Rudolph Smits, Netherlands

add the following codes to the functions.php file:

// Remove Query Strings

function _remove_script_version( $src ){

    $parts = explode( '?ver', $src );
    return $parts[0];
}

add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

// Remove jquery migrate
function dequeue_jquery_migrate( $scripts ) {
  if ( ! is_admin() && ! empty( $scripts->registered['jquery'] ) ) {
    $scripts->registered['jquery']->deps = array_diff(
        $scripts->registered['jquery']->deps,
        [ 'jquery-migrate' ]
    );
  }
}
add_action( 'wp_default_scripts', 'dequeue_jquery_migrate' );

Trying to find out what "migrate" does I found this wordpress plugin: https://nl.wordpress/plugins/remove-jquery-migrate/

I think it does the same as the code of Maynor Peralta above but his code will do it more efficiently. I will try do apply that next week.

Yesterday I got a ban from Google Recaptcha v3 due to - I think - to many same test actions. I will have to wait till this is over. ;-(

Regards Rudolph Smits

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far