• Hi,
    I recently noticed several warnings of this type in the error logs:

    PHP Warning: Array to string conversion in [...]/wp-admin/includes/class-wp-debug-data.php on line 1543.

    The problem occurs when visiting the site health info screen if Solid Security is active; deactivating the plugin makes the warnings disappear.

    The Query Monitor plugin provided me with the following additional information about the error:

    wp-admin/includes/class-wp-debug-data.php:1543
    sprintf()
    wp-admin/includes/class-wp-debug-data.php:1543
    WP_Debug_Data::format()
    wp-admin/site-health-info.php:56
    WP_Site_Health->show_site_health_tab()
    wp-includes/class-wp-hook.php:324
    do_action(‘site_health_tab_content’)
    wp-admin/site-health.php:220

    I thought it might be related to the custom Site Health Tab of Solid Security, but I haven’t delved into it.

    I first noticed the issue on a client’s site, but I was able to reproduce it on a fresh install with the default theme (Twenty Twenty-Four) and no plugins, except for Query Monitor and Solid Security.

    LiteSpeed server, php 8.2.
    WordPress 6.5.3
    Solid Security Basic?9.3.2

    Thank you for any help you can provide ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @cp_so,

    It’s a(n easily reproducible) bug in the add_site_health_info() method which is located in the better-wp-security/core/modules/core/class-itsec-core-admin.php file. The plugin method is returning an array() value instead of a string value for debug data (key settings).

    Note the PHP warning(s) are visible in the (debug) output generated by the Copy site info to clipboard button.

    +++ To prevent any confusion, I’m not SolidWP +++

    • This reply was modified 6 months, 1 week ago by nlpro.
    • This reply was modified 6 months, 1 week ago by nlpro.
    Thread Starter Str3lla

    (@cp_so)

    Thanks @nlpro!
    Do you know if there are any plans for a fix from Solid Security?

    Thank you again, and have a great day.

    Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @cp_so, great to see you!

    I am seeing this on a fresh install as well and have escalated it to our dev team for checking. I don’t have an ETA for the fix, but we’ll surely address this since this is reproducible on our end.

    @nlpro, thank you for your input on the issue. It’s greatly appreciated!

    Hi @cp_so,

    Temporary workaround:

    add_filter( 'debug_information', 'reset_site_health_info' );
    
    function reset_site_health_info( $info ) {
    
    	$info['solid-security']['fields']['settings']['debug'] = $info['solid-security']['fields']['settings']['value'] . ' (Debug value reset to default to prevent PHP warnings due to a bug in the Solid Security Basic 9.3.2 release).';
    
    	return $info;
    }
    • This reply was modified 6 months, 1 week ago by nlpro.
    Thread Starter Str3lla

    (@cp_so)

    Hi @shanedelierrr, happy to hear that. Thank you for the prompt support.

    Thanks again, @nlpro: your kindness is invaluable.
    I will take a look at your workaround right away!

    PS: Most supportive support forum ever.

    Hi @cp_so,

    If my earlier code snippet is not taking care of all the PHP warnings try the one below (thoroughly tested):

    add_filter( 'debug_information', 'reset_site_health_info', 11 );
    
    function reset_site_health_info( $info ) {
    
    	$msg = ' (Debug value reset to default to prevent PHP warnings due to a bug in the Solid Security Basic 9.3.2 release).';
    
    	$info['solid-security']['fields']['settings']['debug'] = $info['solid-security']['fields']['settings']['value'] . $msg;
    
    	$info['solid-security']['fields']['user_groups']['debug'] = $info['solid-security']['fields']['user_groups']['value'] . $msg;
    
    	return $info;
    }

    Hi @cp_so,

    According to the 9.3.4 Changelog:

    Bug Fix: PHP warning on Site Health page.

    Please update the SolSec plugin to the 9.3.4 release (remove the temporary workaround filter I recommended) and then confirm the issue has been fixed in your env. If so, please mark this topic as ‘Resolved’.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.