Support » Plugin: Widget Logic » Massively long TTFB

  • Website:

    I ran the site through WebPagetest and am also seeing a long TTFB being reported:
    Time to First Byte (TTFB) represents the time it takes for the first pieces of data to be delivered to the browser. TTFB is not related to images or other large files. During this time, the webserver is processing .php and JavaScript data. As such, I ran a few requests from my end and compiled a trace for one such home page request to try and identify what is needing to be processed. Here’s one example indicating that the processing time (from a server standpoint) was just under 4.5 seconds:
    That overview indicates that the bulk of the duration was comprised of the widget_logic_filter_sidebars_widgets component. I ran a search for that item in your install’s file system and found it referenced within the directory of your “widget-logic” plugin:
    112: add_filter( ‘sidebars_widgets’, ‘widget_logic_filter_sidebars_widgets’, 10);
    414:function widget_logic_filter_sidebars_widgets( $sidebars_widgets )

    Digging a bit deeper into that request, I’ve included a more detailed trace below. The output is similar to what you’d see when using tools like GTMetrix or Pingdom:
    Both the header and footer stand out so I’ve provided insight on each one individually starting with the header:
    The add_widgets_to_menu and subsequent widget_logic_filter_sidebars_widgets items accounted for a large percentage here. The latter was outlined above but the former was found within the “megamind” plugin:
    66: add_filter( ‘wp_nav_menu_objects’, array( $this, ‘add_widgets_to_menu’ ), 10, 2 );
    489: public function add_widgets_to_menu( $items, $args ) {

    The footer again showed the need to load several widget_logic_filter_sidebars_widgets items but one area that I wanted to point out involved popmake_render_popups -> popmake_get_template_part which was referenced in yet another plugin, “popup-maker:”
    87:function popmake_render_popups() {
    104:add_action( ‘wp_footer’, ‘popmake_render_popups’, 1 );

    33:function popmake_get_template_part( $slug, $name = null, $load = true ) {
    45: $templates = apply_filters( ‘popmake_get_template_part’, $templates, $slug, $name );

    98: popmake_get_template_part( ‘popup’ );

    317: popmake_get_template_part( ‘popup’ );

    Drilling into the segments for those items, we see that this plugin also involved calls to widget_logic_filter_sidebars_widgets in addition to the calls inherent to “popup-maker” itself:

    Those plugins are up-to-date which is great, but given the amount of time spent processing the various .php files within those plugins, we certainly need your help with further review and optimization assistance.

  • The topic ‘Massively long TTFB’ is closed to new replies.