SLTy Plugins

WordPress Plugins that are both practical and Spirit-Led.

 

WP Tuner 0.9.6 Comment Thread

This release: is tested on latest WP version, and generalizes support for almost any kind of unusual query.

Please post your comments and questions below. I reserve the right to snip inappropriate commentary, flame wars and so forth.

If you are reporting a problem:

  • Please set Debug Level to 1 and copy the wpTuner Diagnostics report here
  • If a specific plugin or widget is misbehaving, please note which one (if you know)

22 Responses to “WP Tuner 0.9.6 Comment Thread”

  1. ovidiu:

    hey, can you make a changelog accessible please? maybe on the plugin’s page at wordpress.org?

  2. Pete:

    Re: ovidiu (#1),
    I’ll see what’s possible. It’s all automated by WordPress… I just check changes in to their system and it automagically publishes updated releases.

  3. Leon:

    Hi, when I add the action the_content to the wptuner.php file, the content of posts and pages isn’t shown anymore (only the title and comment links are shown, the “format_text entry-content” div is empty). I added this line to wptuner.php:
    add_action(’the_content’, ‘wpTuneFilterTime’ );

    Am I doing something wrong?

  4. Pete:

    Re: Leon (#3),
    That’s a tricky one, Leon. the_content() assumes the filter will process data passed into it, and return a new version of the data. Since my filter knows nothing about the_content, it returns nothing — and that’s what you get on the page. :(

    Let me look around a bit and see if there is a general purpose way for me to set up the filter action so it automagically works with the_content and any other filters that make assumptions about what the filter does.

  5. Leon:

    Re: Pete (#4), cool, thanks! I look forward to a the next version of WP Tuner :)

  6. Redemptor:

    Please help, Pete!

    WP Tuner
    This plugin is only visible to site admins. (Update settings here; Visit MrPete at ICTA for bouquets/brickbats/help. Love it? Fill the Tip Jar.)
    Analysed in 0.005 seconds.
    wpTuner Diagnostics
    Debug level: 1
    User level: 10
    WP version: 2.8.4
    PHP version: 5.2.1
    MySQL version: 4.1.16-nt
    WP theme: Eos
    WP Tuner is not correctly configured. Please go to the Settings page using the link above, and set it up correctly. Render Time: 0.136 sec (23.2% for queries). DB queries: 20, none defective, none > 0.500 sec. Memory: 11.9MB
    Performance Analysis
    Queries triggered by plugins calling Core functions are charged to: The Plugin
    Yellow-highlighted rows indicate slow elements (more than 0.500 seconds)
    Page Generation Performance (Order: Chronological)
    (Tech note: If output buffering (OB) is not enabled at init, WP Tuner enables it so output size can be tracked.)
    Index Marker %Time %DB Time %DB Count Time DB Time DB Count Memory Output
    (msec) (msec) (kb) lev(bytes)
    0 Start 9 1 10 12.2 0.4 2 ?
    1 plugins_loaded 23 1 10 31.6 0.4 2 11,094.4 0()
    2 widgets_init 1 0 0 1.7 0.0 0 12,043.0 0()
    3 init 1 0 0 1.5 0.0 0 12,099.9 0()
    4 posts_selection 13 68 20 18.2 21.4 4 12,043.2 1(0)
    5 wp_head 11 27 20 14.4 8.4 4 12,102.0 1(1512)
    6 loop_start 16 0 0 21.9 0.0 0 12,086.4 1(2820)
    7 get_sidebar 8 0 5 10.8 0.1 1 12,093.3 1(8706)
    8 posts_selection 2 1 10 3.2 0.3 2 12,222.4 2(0)
    9 loop_start 14 -98 25 19.5 -30.9 5 12,189.3 2(143)
    10 get_footer 1 0 0 0.7 0.0 0 12,146.3 1(12985)
    11 Stop 12,158.3 1(13261)
    Total 100 0 100 135.6 0.0 20

    Plugin / Theme SQL Query Performance (Order: DB Time)
    Code Name %DB Time %DB Count DB Time DB Count
    Category (msec)
    -Core- wp-blog-header.php 37 20 11.8 4
    theme eos.1.2.7 32 10 10.0 2
    -Core- widgets 29 40 9.0 8
    -Core- wp-settings.php 1 10 0.4 2
    -Core- (Other) 0 5 0.1 1
    plugin rus-to-lat 0 5 0.1 1
    Total 90 100 31.4 18

    SQL Table Performance (Order: DB Time)
    (Tech note: The first table in a query is recorded here; complex queries may reference many tables.)
    Table %DB Time %DB Count DB Time DB Count
    (msec)
    pw_terms 57 15 17.9 3
    pw_posts 24 40 7.6 8
    pw_postmeta 16 5 5.2 1
    pw_options 1 10 0.2 2
    pw_users 1 5 0.2 1
    (N/A - Non-Table Query) 1 10 0.2 2
    pw_usermeta 0 5 0.1 1
    Total 90 100 31.4 18

    SQL Query Analysis
    20 Valid queries. None slow, none invalid. Display of normal queries is disabled.

  7. ovidiu:

    hey Pete: found a problem in conjunction with the mailpress plugin:

    `2009-09-17 08:52:40 000000 — PHP [E_NOTICE] 8 : Undefined index: class in /var/www/clients/client4/web18/web/wp-content/plugins/wptuner/wptunerdb232.php at line 86
    2009-09-17 08:52:40 000000 — PHP [E_NOTICE] 8 : Undefined index: class in /var/www/clients/client4/web18/web/wp-content/plugins/wptuner/wptunerdb232.php at line 91
    `

    http://mailpress.org - care to have a look? the above error is in the log files of mailpress…

  8. Pete:

    Re: Redemptor (#6),
    As the message says, please go to the WP Tuner admin page, and read the more detailed error message there. It should give a hint about the problem.

    Usually, it is an issue with permission for writing the configuration files…either permission on the file, or on the folder.

  9. Pete:

    Re: ovidiu (#7),
    Thanks!

    Mailpress must be turning on a more detailed level of logging. I’ll clean this up; must have missed it earlier.

    The good news: E_NOTICE messages don’t cause the program to run incorrectly. :)

  10. Daniel:

    Hi,
    WP Tuner causes conflict with DB Cache Reloaded plugin. It loads the wp-includes/wp-db.php file directly, whereas it should first try to include wp-includes/db.php file. Please use require_wp_db() function instead to include correct file (it is defined in wp-includes/functions.php file), or copy its body to your plugin.

  11. Daniel:

    One correction - plugin should try to include wp-content/db.php file first, not wp-includes/db.php.

  12. Tim Nicholson:

    Re: Pete (#4)
    Pete, thanks for writing this plugin! Although your tip on removing unused plugins was what saved me seconds off my page load times!

    the_content() only accepts and returns one parameter, which is $content. So you could just return $content at the end of your function. I believe most WP filters only accept one parameter, that parameter is just sometimes an array (like $post or $comment). Either way, you should be able to just pass it back at the end of your function.

    The format of the function is: add_action( $tag, $function_to_add, $priority, $accepted_args );

    So we can also specify that your function should be called before or after all other functions that get called to act on that $content by including a low $priority (10 is default, so anything lower than that would likely be first) or a high $priority (say, 90).

    Now on to my question about improving performance… do you have any general guidelines as to what takes so much time in the “start” section? I’ve added your function in wp-settings.php to generate separate load times for each plugin. I ended up removing one plugin as a result, but I still get long load times on the mess of stuff between the beginning of wp-settings and when the first plugin is loaded. I’m guessing there probably isn’t much that can be done to speed up that core WP startup time without hacking wp-settings to try to remove stuff that I don’t think I need to use from core WP as of right now.

    However, I know you’ve done a ton of research into this and would love to hear your opinion.

    I also found another thread about performance in the WP forums and it mostly talks about slow page loads (especially slow WP admin pages) due to hangs on various things like curl, fopen, etc. http://wordpress.org/support/topic/224410. There is a hack to shut off some of that stuff, but don’t we need it!? For pingbacks, RSS, remote posting (XML-RPC), etc!?

  13. Tim Nicholson:

    Re: Tim Nicholson (#12)
    Pate, do you have idea WHY removing unused plugins might help performance? I looked at the wp-settings.php file it reads the list of active plugins from the database. It doesn’t just loop through all the files in the plugin directory. So it really makes no sense, but it seems to work.

  14. ZDN:

    looks like WPT expects wp-config.php to be where WP sticks it by default. maybe WPT could/should use the same method as WP for locating the config (which can be up a directory (or 2?)). ex: if WP is installed in root, then /home/user/www/wp-config.php is default, but i keep mine in home/user/wp-config.php for xtra security and would rather not have to move it to run WPT.
    flowers and beer and peace

  15. Pete:

    Re: Tim Nicholson (#13),
    The list of active plugins IS read from the DB, but there are some loops that look at all plugins. I’ve not taken time to analyze it completely. (If you are interested and have time, the easy way in Windows is: install System Internals’ FileMon, then run Wordpress on your local computer. You’ll soon see the issue.)

    The main reasons for slow startup seem to be:
    - too many plugins
    - badly written plugins
    - inefficient/wasteful DB access
    - cross-site access

    That last one IS needed sometimes, but certainly ought to be cached. I recently saw a system that did 20 accesses to eBay on every page load. At busy times of day it took 3 minutes to load the page! Pretty sick.

  16. Pete:

    Re: Daniel (#11),
    Thanks, Daniel. I’ll look into that before the next release.

    That’s some of the trickiest code in the system. wpTuner has to preempt the loading of database code, in order to properly instrument DB access. To be compatible with another DB plugin, I’m going to have to test that pretty carefully!

  17. Pete:

    Re: ZDN (#14),
    Sorry about that. Support for up-level wp-content is (relatively) recent. I’ll see what I can do to fix that in the next release. AND, I’ll try to move the wpTuner startup code earlier in the load cycle. Might as well have it in index.php for that matter :)

  18. Pete:

    Folks, I want you to know I have not forgotten wpTuner.

    Unfortunately, I’ve got to spend most of my time on other things right now (financial and other priorities), but I’ll get back to this.

  19. Daniel:

    Re: Pete (#16),
    I have just released DB Cache Reloaded 2.0 - it introduces Wrapper Mode. In this mode my plugin can work with WP Tuner at the same time. There is one problem only - WP Tuner incorrectly shows who executes query. I have posted a small fix for this on WP Forum.

  20. Vladimir:

    Hi Pete

    I just tested your plugin on one of my site and it work great but some results are bit puzzling. Analysis states that slowest is start and almost 80% of loading time. Is it then a hosting problem? Another one is get_footer (around 10% of loading time). Any thought on that?
    Thnx

  21. jeremyclarke:

    Hey Pete,

    I love WP-Tuner, I mention it all the time when I to WordCamp talks, it blows everyone’s minds.

    I know the CSS isn’t that important because its only admins that see it, but I think WPTuner could be styled in a way that made it feel cleaner and be easier to read through. I worked out a style that is similar to yours but with tweaked contrast and spacing for the tables. I hope you consider integrating it into WPTuner, I think a lot of people would appreciate it.

    Here’s how it looks in the admin:
    http://simianuprising.com/wp-content/uploads/2009/12/wptuner-cssmod-admin.png

    Here’s how it looks with kubrick:
    http://simianuprising.com/wp-content/uploads/2009/12/wptuner-cssmod-kubrick.png

    I made a svn .diff of the changes to the css in wptunershow.php, you can find it here:
    http://pastie.org/748351

    And here is a paste of the entire wptunershow.php file with my css modifications:
    http://pastie.org/748355

    Thanks for your work on the plugin!

  22. Katie Daniel:

    k..i agree with you…but can you give us more details about this subject?…thanks :)

Leave a Reply

Quicktags:

Pages

Blogs

Quick Tip Jar

Currency:

Amount:

Categories

Tags