WPIntell

Source evidence

PHP warning in debug logs

Siteimprove · support · 2023-07-27T19:36:00+00:00

complaintsentiment
mediumseverity
0.8relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 31 rows with source links

19.4% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

25 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Room 34 Creative Services, LLC unresolved
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, 10 months ago by Room 34 Creative Services, LLC . 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. +1 for this fix, debug logs are filled with this warning after PHP 8 upgrade and it makes other issues harder to debug PHP Warning: Undefined array key "si_preview" in /data/wordpress/htdocs/wp-content/plugins/siteimprove/includes/class-siteimprove.php on line 148

Comments

2 shown
jefflogan303 2023-08-01T12:24:00+00:00

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 2023-09-06T07:05:00+00:00

+1 for this fix, debug logs are filled with this warning after PHP 8 upgrade and it makes other issues harder to debug PHP Warning: Undefined array key "si_preview" in /data/wordpress/htdocs/wp-content/plugins/siteimprove/includes/class-siteimprove.php on line 148