我试图优化我的网站我的wordpress网页,当我检查我的可湿性粉剂页面大小,从总数900KB - 400KB是zxcvbn.min.js我了解到,这个脚本是用来确保密码是强大的,但我不需要它。
我试过这个页面上的推荐,但对我不起作用-- disable zxcvbn.min.js in wordpress and woocommerce
发布于 2019-05-16 22:36:02
这将删除它。问题是它还会导致404错误和1秒的页面速度延迟(第一个字节的时间)……
function my_add_frontend_scripts() {
// Deregister script about password strenght meter ~ 800kb
wp_dequeue_script('wc-password-strength-meter');
wp_deregister_script('wc-password-strength-meter');
wp_register_script('custom-script', get_stylesheet_directory_uri().'/custom-script.js', array('jquery'), 1, false );
wp_enqueue_script('custom-script');
}add_action('wp_enqueue_scripts','my_add_frontend_scripts');
我仍在寻找解决方案。我不敢相信Wordpress/WooCommerce没有在管理仪表板中提出一个内置设置来关闭这个PW强度计。不真实
https://stackoverflow.com/questions/55793291
复制相似问题