WPIntell

Source evidence

Edge-case bug with require/include and WP-CLI

Modal Window – create popup modal window · support · 2023-11-02T21:05:00+00:00

mixedsentiment
mediumseverity
0.84relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

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

4 / 23 rows with source links

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

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

19 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
cjhaas resolved
In the Wow_Plugin class, in the _includes method, there’s three includes: if ( ! class_exists( 'Wow_Company' ) ) { include_once 'includes/class-wow-company.php'; } include_once 'admin/class-admin.php'; include_once 'public/class-public.php'; Unless the include uses path semantics such as ./ , .// or / (depending on OS), PHP actually searches the local directory last , which is probably not what you mean. We’ve run into an issue with your plugin because our theme happens to have a file at exactly admin/class-admin.php , same as you, and when we run any WP CLI commands while we are cd’d into our theme, your plugin is including our file. As noted, this is an edge case but is pretty easy to fix by just adding __DIR__ , same as you are already doing at the bottom of the file. We made a very minimal theme to repro this which is available here: https://github.com/vendi-advertising/vendi-minimum-theme Take a brand new WordPress site Install and activate the modal-window plugin Install and activate the theme (don’t bother browsing to it in a browser) cd into the vendi-minimum-theme directory Try running a WP CLI command such as wp cache flush , and you should see a die message along with a stack trace showing who is requesting for it to be included. Hello. Thanks for your feedback. I fixed this issue and updated the plugin to version 5.3.8 Thanks again Thanks for your very quick response and resolution!

Comments

2 shown
DmtLo 2023-11-03T05:32:00+00:00

Hello. Thanks for your feedback. I fixed this issue and updated the plugin to version 5.3.8 Thanks again

cjhaas 2023-11-03T13:14:00+00:00

Thanks for your very quick response and resolution!