Support » Plugin: Black Bar » Long sql code rows break the visual table

  • Resolved Rookie

    (@alriksson)


    SQL code row styling issue.

    Sometimes some extremely long queries from wp-options table break the visual readable table. We need something like:

    #glbb-debug-bar code, #glbb-debug-bar pre {
        white-space: pre-wrap;
    }
    #glbb-debug-bar td, #glbb-debug-bar tr {
        flex-direction: column;
    }

    Without this I have to scroll for a long time horizontally to find all other SQL queries. It’s just optimal which can be fixed with some CSS when there are edge cases of very long queries.

    • This topic was modified 10 months, 3 weeks ago by Rookie.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    Please post a screenshot

    Thread Starter Rookie

    (@alriksson)

    @geminilabs https://snipboard.io/ucxbyw.jpg

    • This reply was modified 10 months, 3 weeks ago by Rookie.
    Plugin Author Gemini Labs

    (@geminilabs)

    Using white-space: pre; instead of white-space: pre-wrap; was intentional I as personally prefer to see the SQL queries without a word-wrap. Instead, I opted to break the SQL query strings into new lines by SQL statement.

    This edge case is an extreme one, and only occurs when performing an UPDATE query of a long serialised string value to the database. 99% of the time you will not be doing this kind of SQL query on page load.

    The SQL tab is meant to help you evaluate SQL query performance. If you are using it to inspect serialised values that you are saving to the database, a better way to do this is to use apply_filters('console', $updateValue)

    Thread Starter Rookie

    (@alriksson)

    That’s great and I could vote for!

    This edge case is an extreme one, and only occurs when performing an UPDATE query of a long serialised string value to the database. 99% of the time you will not be doing this kind of SQL query on page load.

    So you would say I have an issue I need to look into?

    The SQL tab is meant to help you evaluate SQL query performance. If you are using it to inspect serialised values that you are saving to the database

    Yes but hard to see everything at a glance without all scrolling just a minor styling update as I had this never ending horizontal scrolling bar, and it was just annoying.

    a better way to do this is to use apply_filters(‘console’, $updateValue)

    What will this do?

    Plugin Author Gemini Labs

    (@geminilabs)

    Is this SQL query being run on each page load?

    UPDATE wp_options SET option_value = '...' WHERE options_name = 'fs_accounts

    If so, why?
    If not, when?

    And why does the value being saved need to be evaluated?

    If the value needs evaluating, a better way to do this is with apply_filters('console', $value) which will unserialise the value being updated and print it to the console tab.

    Thread Starter Rookie

    (@alriksson)

    Seems to be used by “Freemius” Freemius, have two plugins using it as their SDK.

    One will move to EDD soon so will apply this https://github.com/Freemius/freemius-fixer once it’s done.

    If the value needs evaluating, a better way to do this is with apply_filters(‘console’, $value) which will unserialise the value being updated and print it to the console tab.

    Can you show me an example? Is it supposed to work as the profiler?

    Why can’t the profiler show time + amount of SQL queries you profile. As the general sql profile is showing everything. Would be useful. And also to see which queries are cached and not to better improve the calls. How do you check if a query is cached by wordpress or not?

    Plugin Author Gemini Labs

    (@geminilabs)

    Can you show me an example? Is it supposed to work as the profiler?

    This is explained in the FAQ

    Why can’t the profiler show time + amount of SQL queries you profile. As the general sql profile is showing everything. Would be useful. And also to see which queries are cached and not to better improve the calls. How do you check if a query is cached by wordpress or not?

    That is outside of the scope of this plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Long sql code rows break the visual table’ is closed to new replies.