[wp-hackers] wp_list_authors and DB queries
Alexander Concha
alex at buayacorp.com
Thu Nov 22 01:14:34 GMT 2007
Bob escribió:
> I wrote my own version of the widget/plugin. I hardcoded an array with the
> author IDs to display, then called get_userdata() and get_usernumposts() in
> a foreach loop. That cut the number of queries to 44, still 21 higher than
> normal, and the time to 0.020 seconds more than normal.
>
> That's an improvement over the generic plugin, but I was hoping for better.
> I'd appreciate it if anyone has any more suggestions.
Look at the changes I made [1], it only uses one query (two if
"show_fullname" is enabled) to do the same thing, but probably the
plugin will fail (if database schema changes) in future versions of WP.
[1] http://wordpress.pastebin.com/m6d2e537
Regards
--
Alexander Concha
http://www.buayacorp.com/
More information about the wp-hackers
mailing list