Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

#6976 closed enhancement (fixed)

bp_core_print_generation_time() should echo only in WP_DEBUG mode

Reported by: slaFFik Owned by: boonebgorges
Priority: normal Milestone: 2.6
Component: Core Version: 1.0
Severity: normal Keywords: has-patch
Cc:

Description

Currently bp_core_print_generation_time() prints info like this:

<!-- Generated in 0,608 seconds. (103 q) -->

on every page load.

I believe, that's quite sensitive information, and should NOT be printed in normal mode.

WP_DEBUG is more appropriate situation.

Also, I think we need to increase the $priority to something like 9999 or bigger, as wp_footer is rather popular action.

Attachments (1)

6976.patch (756 bytes ) - added by slaFFik 10 years ago.

Download all attachments as: .zip

Change History (12)

#1 @DJPaul
10 years ago

Nah, let's just kill it. It's so old it was probably used as a way of measuring performance during initial development.

#2 @slaFFik
10 years ago

There IS a difference in data, when we have 9999 priority (both in queries and seconds). Between 10 and 9999 - 8 queries, 10 and 99999 - 10 queries.

And I do want to preserve it :) So can I submit a patch that will preserve it and display in DEBUG mode only?

Last edited 10 years ago by slaFFik (previous) (diff)

#3 @slaFFik
10 years ago

  • Version1.0
Version 0, edited 10 years ago by slaFFik (next)

@slaFFik
10 years ago

#4 @slaFFik
10 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review2.6

#5 @slaFFik
10 years ago

  • Owner set to slaFFik
  • Status newassigned

This ticket was mentioned in Slack in #buddypress by boone. View the logs.


10 years ago

This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.


10 years ago

#8 @DJPaul
10 years ago

Let's decide in dev chat whether to keep this with slaFFik's patch or just remove it entirely (my preference).

#9 @boonebgorges
10 years ago

  • Owner changed from slaFFik to boonebgorges
  • Status assignedaccepted

Let's decide in dev chat whether to keep this with slaFFik's patch or just remove it entirely (my preference).

Let's just decide now. Out it goes :)

@slaFFik - I can see why it'd be useful to have data during WP_DEBUG, but a BP core function doesn't seem like the appropriate place. A proper debugging tool should be used. May I suggest https://wordpress.org/plugins/query-monitor/ ?

#10 @slaFFik
10 years ago

And Debug Bar displays that info too (with SAVEQUERIES defined). This small comment with sec and q was used by me for 7 years, it's like an old good friend :)

But I totally understand Paul's and your idea. So just remove it completely. Perhaps this will save some CPU for servers out there :)

#11 @boonebgorges
10 years ago

  • Resolutionfixed
  • Status acceptedclosed

In 10723:

Deprecate bp_core_print_generation_time().

Props slaFFik.
Fixes #6976.

Note: See TracTickets for help on using tickets.