WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Tuner] Finding what's slow (1 post)

  1. MrPeteH
    Member
    Posted 6 years ago #

    Mental Magma asked:

    Can you give me any tips or point me to any documentation that would help me understand the results? I've got three slow processes, here are the milliseconds:
    0 Start 1,186.6
    2 widgets_init 625.8
    3 init 1,832.6

    First thought: you have some slow-loading code. Probably plugins, widgets, and who-knows-what-else.

    Suggestion: if you have some plugins in your wp-content/plugins folder that are not being used, move them to a spare folder (I moved mine to wp-content/ex-plugins). On my system, that literally DOUBLED the speed! I was amazed. That's one of the first things I learned from doing the process I outline below.

    Suggestion #2: do you see a lot of database queries and/or time being charged to certain plugins? That would indicate a poorly coded plugin.

    How to dig deeper?

    WordPress currently provides limited ability for me to automagically dig much deeper than what I've already done with WP Tuner. However, if you don't mind getting your hands a bit dirty in the code, you can learn a LOT through inserting a line of code here and there.

    This is exactly what one of the FAQ "Other Notes" is about. (Ignore the funny characters at the beginning of some lines in the code example -- they are just blank spaces. I don't know why they show up that way here.)

    You can place the following line of code almost anywhere in WordPress, to get more detail on how it spends its time. The quoted string ("Load Plugins" in my example) is what will show up in the timing table:
    if (function_exists(wpTuneMarkTime)) wpTuneMarkTime('Load Plugins');

    The example I gave in the FAQ is found in wp-settings.php in your installed system. As you can see, there are two of these wpTuneMarkTime lines. What this does is mark the beginning of when your plugins are loaded, and adds another line for each plugin.

    I'm guessing a good chunk of your startup time is used in loading plugins... perhaps one or more of them are very slow.

    One hint about performance improvement: don't try to accomplish too many things at once. If you find something worth changing, then make that change and see if other aspects have improved at the same time.

    If you have a super-slow plugin, then disabling that plugin will likely improve your whole website's performance... the plugin might also have slow widgets and so forth.

    That's enough for one comment here. Sounds like I need to start blogging about Tuning WordPress Performance with WP Tuner!

Topic Closed

This topic has been closed to new replies.

About this Topic