• Resolved saltykey

    (@saltykey)


    I’m seeing the following warnings displaying when I turn on wp_debug:

    Warning: foreach() argument must be of type array|object, null given in?/public_html/wp-content/plugins/ithemes-security-pro/core/lib/class-itsec-lib-fingerprinting.php?on line?44

    The warnings only appear when I’m editing a post, page, etc. Obviously not an urgent issue, but wanted to report.

    I’m using the latest version of the WordPress (6.4.3.), I’m using Gutenberg, I have the latest version of Solid Security Pro (8.3.1), and I’m on PHP 8.1.27.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @saltykey, we’re here to help!

    I’ve seen few reports of this error, but I haven’t been able to replicate it in any of my test sites yet. A possible cause of this warning could be due to a corruption during the update process or something caused the property that the?foreach?loop is trying to iterate to not be initialized correctly.

    I do have a workaround which is manually re-installing the Solid Security Pro plugin files. This way we can ensure the plugin files aren’t corrupted. Here are the steps on how to do this:

    1. Back up your site as preventive measure.
    2. Download the latest plugin ZIP from your?SolidWP Member Panel.
    3. Deactivate the currently installed Solid Security Pro plugin using FTP/Host CPanel by renaming the plugin folder.
    4. Reload your WP Admin Dashboard, go to the Plugins page, and make sure the plugin is showing as deactivated.
    5. Install the downloaded plugin ZIP from the SolidWP Member Panel.
    6. WP will detect that the folder already exists and click “Replace current with uploaded” (see sample here)
    7. Once the upload finishes, activate the plugin, and reload the site to check if the warning still shows.

    If the issue persists, please reach out to us on the SolidWP support channel so we can assist you.

    I hope this helps!

    Hi there,

    I am having the same issue on most of my clients sites. Is the only solution this manual re?nstall? I have quite alot of sites, so just want to make sure before I go this route ??

    Hi @laurajacob1986,

    Try it first on one site just to see whether a manual reinstall of the plugin (or if not already, simply updating to the latest 8.3.2 release) helps resolve this issue or not. If not we’ll have to think about going a different route to solve this issue.

    One other thing, is the Trusted Devices feature enabled ?

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

    I noticed today that whenever I log into the admin dashboard with two-step login (authentication), the following error appears in the host errors twice:

     PHP Warning:  Invalid argument supplied for foreach() in public_html/wp-content/plugins/ithemes-security-pro/core/lib/class-itsec-lib-fingerprinting.php on line 44

    Hi @sangshenas,

    PHP < 8 returns a bit of a different warning message. A PHP Stack Trace would be helpful. Also do you have the?Trusted Devices?feature enabled ?

    Thread Starter saltykey

    (@saltykey)

    Hi @shanedelierrr,

    I tried the steps you provided. The error persists, but when I disabled the ithemes-security-pro folder via FTP, I never got the “Replace current with uploaded” option. Instead, it just disabled the plugin when I renamed it (just added an underscore (_) in front of it) and then added Solid Security again. (See screenshot.)

    Still getting this error, but only on pages using the Gutenberg editor (and only when wp_debug is enabled): Warning: foreach() argument must be of type array|object, null given in?/public_html/wp-content/plugins/ithemes-security-pro/core/lib/class-itsec-lib-fingerprinting.php?on line?44

    hi @nlpro ,
    no that is not enabled .

    Hi @sangshenas,

    Does the PHP warning persist after enabling the Trusted Devices feature ? Please also share the exact Solid Security and PHP version you are using.

    • This reply was modified 9 months, 2 weeks ago by nlpro.
    Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @saltykey, thanks for trying the steps! We have an open internal ticket to track this error. Could you contact us in our priority support channel from your my.solidwp.com account so we can add your ticket and update you on its progress?

    Hi @laurajacob1986 and @sangshenas, if the error persists after trying out the manual re-install steps, please open a support ticket via our priority support channel so we can also update you there.

    Thank you!

    @shanedelierrr,

    … or something caused the property that the foreach loop is trying to iterate to not be initialized correctly.

    That may very well be the case. I’m putting my money on line #14 (Pro 8.3.2) in the core/lib/class-itsec-lib-fingerprinting.php file:

    private static $sources; //null

    … which may need to be initialized like so:

    private static $sources = array(); //Empty array

    The above is based on some fundamental/isolated PHP code tests. I have yet to reproduce the PHP warning in WordPress/SolSec Pro. It probably only happens under certain very specific conditions. Typical edge case.

    • This reply was modified 9 months, 2 weeks ago by nlpro.
    Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @nlpro, thanks for sharing your thoughts! I’ve added this to the internal ticket so our dev team will know. Please feel free to ping us anytime you need clarification.

    Plugin Support chandelierrr

    (@shanedelierrr)

    Hi All,

    I’m circling back here to let you know that a fix for this has been released on Solid Security Pro v8.4.0. Kindly update to the latest version and let us know if you’re still seeing the error.

    Cheers!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Warnings while editing posts/pages’ is closed to new replies.