Hey there,
It’s kind of a weird thing because the login customizer doesn’t affect your front-page at all. It only appears when you try to customize your login page.
And apart from all of that, it doesn’t add anything which WordPress already doesn’t have. The plugin is built entirely using Customizer API provided by WordPress, which every theme uses and there’s nothing custom in it so I really don’t have any idea what we can do to prevent it.
Here’s something you can try and see if it works. Make sure that you’re using FTP:
Visit /wp-content/plugins/login-customizer/login-customizer.php, and look for the following line of code:
include( LOGINCUST_FREE_PATH . 'customizer.php' );
And replace it with:
if ( is_customize_preview() || is_login_page() ) {
include( LOGINCUST_FREE_PATH . 'customizer.php' );
}
And run the test after that and see if it improves the loading time. Don’t forget to let me know the results.
Thank you. 🙂
Regards,
Hardeep
Hi Hardeep,
I copied and pasted the code as instructed and got this reply when I tried to run the scan:
Fatal error: Call to undefined function is_login_page() in /home/content/p3pnexwpnas08_data02/34/2479434/html/wp-content/plugins/login-customizer/login-customizer.php on line 41
Sorry I forgot something. You also need to include there:
function is_login_page() {
return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'));
}
Add add it before the above code. 🙂
Hello Hardeep,
The changes were accepted and I ran the scan. It still produces a run time of 0.3632 seconds (unchanged).
Eric
Hi Eric,
That’s really weird because now the plugin isn’t loading 90% of its code unless it’s the login page. :/
Hello Hardeep,
I’ve re-run the P3 scan. Custom Login Page Customizer now takes 0.1449 seconds. That’s less than half the previous number, although it’s still pretty slow for such a basic plugin. It’s also still No. 2 on time consumption on our site, out of 34 active plugins.
Since most of the code isn’t loading unless the login page is open, could it be something about the P2 Plugin Profiler?
Thanks for the help.
Hi,
I’m not sure about how P2 Plugin Profiler works and heard its name for the first time on this thread so don’t know about that. But maybe it could be a factor, like how it measures it.
Maybe you can try something else to see if they also report this plugin being the second lowest. 🙂
Regards,
Hardeep