WPIntell

Source evidence

Undefined Constants & PHP 8

Giveaways and Contests by RafflePress – Get More Website Traffic, Email Subscribers, and Social Followers · support · 2022-06-30T20:28:00+00:00

neutralsentiment
highseverity
0.52relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

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

3 / 28 rows with source links

10.7% 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
ejw773 resolved
I have not had a problem with your plugin yet, but I’ve been tracking down PHP 8 upgrade troubles with some other plugins due to “undefined constants” causing fatal errors. Example: $_SERVER[REQUEST_URI] throws a fatal error, as PHP 7 would implicitly convert REQUEST_URI to a constant, but PHP 8 won’t. I noticed your rafflepress-giveaway.php file has an occurrence, and I’ve seen $_SERVER[HTTP_HOST] in other files as well. Are you planning on changing these to $_SERVER[‘REQUEST_URI’] and $_SERVER[‘HTTP_HOST’] at some point? Thanks! Hello @ejw773 The error might be from another plugin. We have checked rafflepress in a site with PHP 8 and it does not have such an error. The error you mentioned would be related to a syntax error where the other plugin authors have $_SERVER[REQUEST_URI] instead of $_SERVER[‘REQUEST_URI’] (with REQUEST_URI in single quotes). Without the single quotes, the web server sees a constant (which would be undefined) instead of an expected variable array RafflePress we’re using the correct syntax for calling the $_SERVER[‘REQUEST_URI’] web server array variable. It might be from another plugin. Thanks,

Comments

1 shown
franz1989 2022-07-01T18:24:00+00:00

Hello @ejw773 The error might be from another plugin. We have checked rafflepress in a site with PHP 8 and it does not have such an error. The error you mentioned would be related to a syntax error where the other plugin authors have $_SERVER[REQUEST_URI] instead of $_SERVER[‘REQUEST_URI’] (with REQUEST_URI in single quotes). Without the single quotes, the web server sees a constant (which would be undefined) instead of an expected variable array RafflePress we’re using the correct syntax for calling the $_SERVER[‘REQUEST_URI’] web server array variable. It might be from another plugin. Thanks,