Request to Update include_once Paths Using DIR for Reliability
-
Hi,
I’d like to suggest a small change for the
WC_AC_Hookclass. In theadd_integration()method, the file"settings.php"is loaded usinginclude_once()and in theorder_status_change()method, the file"sync-contact.php"is loaded usinginclude_once():44: include_once '/settings.php';109: include_once '/sync-contact.php';Using
__DIR__ensures that the path to ‘settings.php’ is always resolved relative to this file’s directory, regardless of the current working directory at runtime. This ensures reliable loading. Using a relative path like'/settings.php'could attempt to include from the wrong location, which happened in my case, the plugin tried to loadwp-admin/network/settings.phpand resulted in unexpected errors in my case.44: include_once __DIR__ . '/settings.php';
109: include_once __DIR__ . '/sync-contact.php';Can this be changed in a future update?
Thanks!
You must be logged in to reply to this topic.