Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Frank Goossens

    (@futtta)

    well, first of all (but you probably know this); AO doesn’t cache pages, only the optimized JS /CSS. additionally there isn’t a lot of CSS/ JS to optimize on (a default) wp-login.php.

    now to answer your question: autoptimize hooks into the template_redirect action by default, which does not get fired when in wp-login.php. you could switch to hooking into init instead by setting the AUTOPTIMIZE_INIT_EARLIER constant to true which will allow AO to optimize wp-login.php as well. do test thoroughly though, as this can have other impacts.

    hope this helps,
    frank

    Thread Starter esemlabel

    (@esemlabel)

    Much obliged!
    You can close topic.

    Thread Starter esemlabel

    (@esemlabel)

    Some low prpiority additional notes about.
    It would be great not just set AUTOPTIMIZE_INIT_EARLIER for earlier optimizing, but have possibility to choose the needed hook, for example, ‘login_init’; Or have possibility to limit earlier optimizing for certain pages, as wp-login.php or others.

    • This reply was modified 7 years, 4 months ago by esemlabel.
    Plugin Author Frank Goossens

    (@futtta)

    OK, committed something along those lines on the github-repo; https://github.com/futtta/autoptimize/commit/ed2a1f4ee1610e602d4e73fccf2de7cebaeaeeee which allows something like

    
    define('AUTOPTIMIZE_HOOK_INTO','after_setup_theme');

    to be added to your wp-config.php (where you can obviously wrap this in a conditional, checking e.g. against the value of $_SERVER[‘REQUEST_URI’]).

    you can download the GitHub version of AO (with some other improvements) from https://github.com/futtta/autoptimize/archive/master.zip (overwrite your /wp-content/plugins/autoptimize with the contents of autoptimize_master in the zipfile).

    have fun! 🙂
    frank

    Thread Starter esemlabel

    (@esemlabel)

    nice work!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Autoptimize wp-login.php’ is closed to new replies.