Optimizing WordPress’s styles and scripts

Query Monitor will show you what is loaded or you can print them directly. function print_wp_scripts_queue(){ $scripts = wp_scripts(); echo “<pre><h1>scripts</h1>”; print_r ( $scripts->queue ); echo “<h1>todo</h1>”; print_r ( $scripts->to_do ); echo “<h1>done</h1>”; print_r ( $scripts->done ); echo “<h1>registered</h1>”; print_r ( $scripts->registered ); echo “</pre>”; wp_die(); } add_action( ‘wp_head’, ‘print_wp_scripts_queue’, PHP_INT_MAX ); wp_deregister_script removes a … Read more

Should I remove transients from the wp_options table?

This is not an amount that is likely to cause performance issues. However if you are concerned about leftover transients it is worth looking into if any code you are using is consistently “leaking” them (creating transients that are never removed). See Are transients garbage collected? for relevant discussion and some code snippets.

Can’t move jQuery to footer

Not the best way but removing the default WordPress actions that allow any scripts in the document’s head can help: function md_footer_enqueue_scripts() { remove_action(‘wp_head’, ‘wp_print_scripts’); remove_action(‘wp_head’, ‘wp_print_head_scripts’, 9); remove_action(‘wp_head’, ‘wp_enqueue_scripts’, 1); } add_action(‘wp_enqueue_scripts’, ‘md_footer_enqueue_scripts’);`

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)