[wp-hackers] Seeing the Actual SQL statements WP is running when compiling the posts...

IC IC icwordpress at gmail.com
Tue Dec 6 03:38:38 UTC 2011


Frank, I got your plug in. For a moment, I thought I would  need a
German interpreter but that feeling faded away fast. Your plug in
works right out of the box. Very educational..

What's the call from list all about?

    Time: 0.00058102607727051
    Query: SELECT * FROM wp_users WHERE user_login = 'admin'
    Call from: require, require_once, require_once, require_once,
WP->init, wp_get_current_user, get_currentuserinfo,
wp_validate_auth_cookie, get_userdatabylogin, get_user_by



On Sat, Dec 3, 2011 at 12:00 AM, Frank Bueltge <frank at bueltge.de> wrote:
> You can use the plugin Debug Queries, list all queries with full sql
> statement on all pages.
>
> Sorry für die kurze Mail, vom Mobile gesendet.
> Am 03.12.2011 07:41 schrieb "IC IC" <icwordpress at gmail.com>:
>
>> Is it theoretically possible to write a parser to run over all the
>> core files and parse each and every function that belongs to the core?
>>
>> before parser
>>
>> function get_queried_object_id() {
>>        global $wp_query;
>>        return $wp_query->get_queried_object_id();
>> }
>>
>>
>> after parser
>>
>> function get_queried_object_id() {
>>
>>      $list_of_functions_that_have_run_so_far =
>> $list_of_functions_that_have_run_so_far .   "get_queried_object_id()";
>>      or even better
>>      $list_of_functions_that_have_run_so_far =
>> $list_of_functions_that_have_run_so_far .   "> wp-includes > query.php
>> > get_queried_object_id()";
>>
>>
>>        global $wp_query;
>>        return $wp_query->get_queried_object_id();
>> }
>>
>>
>> would that work? or would there be some functions that would halt the
>> execution because of this change therefore,  this is a mute exercise?
>>
>>
>>
>>
>>
>> On Fri, Dec 2, 2011 at 10:07 PM, Dion Hulse (dd32) <wordpress at dd32.id.au>
>> wrote:
>> > On 3 December 2011 17:03, IC IC <icwordpress at gmail.com> wrote:
>> >> That's very cool. Thank you..
>> >>
>> >> Along the same learning lines, how about printing the list of every
>> >> single WP function that have run before it makes it to the template?
>> >> And perhaps display that list in the post itself?
>> >>
>> >> Did somebody programmatically do that already?
>> >>
>> >> Obviously, this would be on a test site where it is OK and quite
>> >> interesting to see all the actual run time list..
>> >>
>> >> BTW, is there a way in PHP to tell the functions to output their name
>> >> programmatically?
>> >>
>> >> something like
>> >>
>> >> function xyx ()
>> >> {
>> >>  echo this.function.name;
>> >> }
>> >>
>> >
>> > There's a few php "dynamic" constants which refer directly to the
>> > point in execution:
>> > __FUNCTION__, __CLASS__, __FILE__, __LINE__
>> >
>> > I don't believe it's possible to get all the functions that have been
>> > executed in PHP, however, you can easily output the name of each
>> > hook(action, filter) as it's fired in WordPress with this code
>> > snippet:
>> >
>> > add_action( 'all', function() { var_dump( current_filter() ); });
>> >
>> > That'll execute on every WordPress hook, allowing you to see where
>> > each hook is fired.. Can be very useful to work it out.
>> > _______________________________________________
>> > wp-hackers mailing list
>> > wp-hackers at lists.automattic.com
>> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list