• Resolved Ludovic S. Clain

    (@ludovicsclain)


    Hi there,
    I just drop to PHP 8.0 & WP 5.9 and I’m in front of this error on my logs:

    Uncaught TypeError: number_format(): Argument #1 ($num) must be of type float, string given in ~/wp-content/plugins/simple-blog-stats/simple-blog-stats.php:814
    Stack trace:
    #0 ~/wp-content/plugins/simple-blog-stats/simple-blog-stats.php(814): number_format()
    #1 ~/wp-content/plugins/simple-blog-stats/simple-blog-stats.php(1028): sbs_word_count_all()
    #2 ~/wp-includes/shortcodes.php(356): sbs_blog_stats()
    #3 [internal function]: do_shortcode_tag()
    #4 ~/wp-includes/shortcodes.php(228): preg_replace_callback()
    #5 ~/wp-content/plugins/simple-blog-stats/simple-blog-stats.php(1054): do_shortcode()
    #6 ~/wp-admin/includes/template.php(1395): sbs_dashboard_widget_stats()
    #7 ~/wp-admin/includes/dashboard.php(268): do_meta_boxes()
    #8 ~/wp-admin/index.php(203): wp_dashboard()
    #9 {main}
      thrown

    Thank you for your help!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Thanks! Can you let me know the steps how to repeat the error on default WP? That way I can investigate and try to resolve asap.

    Thread Starter Ludovic S. Clain

    (@ludovicsclain)

    In my administration dashboard home, I just found it strange that my usual empty “Add boxes from the Screen Options menu” boxes were no longer there, and when I wanted to click on the “Screen options” tab nothing happened, I then received the email “Your site is experiencing a technical problem”…

    Plugin Author Jeff Starr

    (@specialk)

    So just to be clear, the steps are:

    1) Activate SBS
    2) Visit Dashboard
    3) Click on “Screen Options”

    Does that sound correct?

    Again, I need actual steps to repeat the issue, else there’s nothing I can do.

    Thread Starter Ludovic S. Clain

    (@ludovicsclain)

    Yes, these are the steps, just that SBS was already activated for me.

    Plugin Author Jeff Starr

    (@specialk)

    Okay thanks. So I tried it on default WP setup and there is no error or issue. Everything working normally.

    Are you using any other plugins? If so, there’s probably some conflict. A quick way to check is to temporarily disable all other plugins and try again.

    Thread Starter Ludovic S. Clain

    (@ludovicsclain)

    Since the bug, I had deactivated the plugin.
    I have just reactivated it and on the first loading of the dashboard, the SBS widget displayed the statistics, then when loading the page again, I again had a PHP fatal error:

    [26-Jan-2022 09:49:35 UTC] PHP Fatal error:  Uncaught TypeError: number_format(): Argument #1 ($num) must be of type float, string given in ~/wp-content/plugins/simple-blog-stats/simple-blog-stats.php:814
    Stack trace:
    #0 ~/wp-content/plugins/simple-blog-stats/simple-blog-stats.php(814): number_format()
    #1 ~/wp-content/plugins/simple-blog-stats/simple-blog-stats.php(1028): sbs_word_count_all()
    #2 ~/wp-includes/shortcodes.php(356): sbs_blog_stats()
    #3 [internal function]: do_shortcode_tag()
    #4 ~/wp-includes/shortcodes.php(228): preg_replace_callback()
    #5 ~/wp-content/plugins/simple-blog-stats/simple-blog-stats.php(1054): do_shortcode()
    #6 ~/wp-admin/includes/template.php(1395): sbs_dashboard_widget_stats()
    #7 ~/wp-admin/includes/dashboard.php(265): do_meta_boxes()
    #8 ~/wp-admin/index.php(203): wp_dashboard()
    #9 {main}
    Plugin Author Jeff Starr

    (@specialk)

    That error does not happen on default WP install. Did you try deactivating all other plugins and try again?

    Thread Starter Ludovic S. Clain

    (@ludovicsclain)

    update: just tried, all plugins deactivated, SBS actived, and error still here

    Plugin Author Jeff Starr

    (@specialk)

    Okay so the only thing left is your theme. To test, deactivate all plugins except for SBS (like before) and then also switch your theme to one of the WP default themes. Then try the dashboard thing again.

    • This reply was modified 2 years, 9 months ago by Jeff Starr.
    Thread Starter Ludovic S. Clain

    (@ludovicsclain)

    Thank you,
    I created a WP sandbox on tastewp.com to try and reproduce the error but couldn’t.
    Here is what I tried on my site:

    All plugins disabled except SBS
    Default theme enabled
    Result: SBS works well

    Astra child theme enabled (my default theme)
    All plugins are still disabled
    Result: SBS works well

    So in my opinion it may end up being a real plugin conflict, but I’m on a production site and can test more.

    What I notice is that the errors appear randomly for various shortcodes but with the same error number_format(): Argument #1 ($num) must be of type float

    I will therefore stop using the plugin, if indeed it is specifically related to my association of plugins.

    All the best!

    Plugin Author Jeff Starr

    (@specialk)

    Great thanks for the feedback. If you (or anyone) can provide steps to repeat any issue on default WordPress, I will be able to investigate and resolve asap. Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Uncaught TypeError: number_format(): Argument #1 ($num) must be of type float’ is closed to new replies.