Title: PHP warning in debug logs
Last modified: July 27, 2023

---

# PHP warning in debug logs

 *  [Room 34 Creative Services, LLC](https://wordpress.org/support/users/room34/)
 * (@room34)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warning-in-debug-logs/)
 * I’m debugging a site I’m working on, and the debug log is filling with this error
   message:
 * > PHP Warning: Undefined array key “si_preview” in /html/wp-content/plugins/siteimprove/
   > includes/class-siteimprove.php on line 148
 * Looking at that line of code, there’s something nonsensical about the conditional:
 * `if ( isset( $_GET['si_preview'] ) || '1' === $_GET['si_preview'] ) {`
 * It doesn’t make sense to have an “or” `||` here; the second condition cannot 
   possibly evaluate to true unless the first condition does. Using `||` eliminates
   the purpose of the first condition, which is to avoid having the second condition
   trigger the PHP warning.
 * I am assuming this should be an “and” `&&` instead.
    -  This topic was modified 2 years, 8 months ago by [Room 34 Creative Services, LLC](https://wordpress.org/support/users/room34/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [jefflogan303](https://wordpress.org/support/users/jefflogan303/)
 * (@jefflogan303)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warning-in-debug-logs/#post-16938458)
 * After upgrading to php8 I also receive the above warning. I would agree the logic
   is incorrect and should be changed from `||` to `&&`. Please can a new version
   of the plugin be created containing this bugfix.
 *  [veerap](https://wordpress.org/support/users/veerap/)
 * (@veerap)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-warning-in-debug-logs/#post-17029249)
 * +1 for this fix, debug logs are filled with this warning after PHP 8 upgrade 
   and it makes other issues harder to debug
 *     ```wp-block-code
       PHP Warning:  Undefined array key "si_preview" in /data/wordpress/htdocs/wp-content/plugins/siteimprove/includes/class-siteimprove.php on line 148
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP warning in debug logs’ is closed to new replies.

 * ![](https://ps.w.org/siteimprove/assets/icon-256x256.png?rev=3351890)
 * [Siteimprove](https://wordpress.org/plugins/siteimprove/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/siteimprove/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/siteimprove/)
 * [Active Topics](https://wordpress.org/support/plugin/siteimprove/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/siteimprove/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/siteimprove/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [veerap](https://wordpress.org/support/users/veerap/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/php-warning-in-debug-logs/#post-17029249)
 * Status: not resolved