Plugin Support
wfphil
(@wfphil)
Hi @iwdatanu
Something on your site is preventing Wordfence’s script_loader_tag filter from taking effect, or is rewriting/removing the attribute.
On a staging site with the same fault, please try switching to the default theme Twenty Twenty-Five and disable all other plugins, MU plugins, and Drop-In plugins. If the fault is fixed then you will need to enable your normal theme and all three types of plugins one-by-one to find the cause of the fault.
Thread Starter
Atanu
(@iwdatanu)
Hi,
I’ve activated a default theme “Twenty Twenty-Five”. Deactivated all other plugins. But I’m still gettings same error and can not setup Wordfence fully.
The console error is – “Uncaught SyntaxError: import declarations may only appear at top level of a module wordfence.1778685035.js:1:1“
FYI, I’ve modified “wp-content” directory name to “frontend”, “plugins” to “modules”.
define('WP_CONTENT_FOLDERNAME', $env['WP_CONTENT_FOLDERNAME']);
define('WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME);
define('WP_CONTENT_URL', 'https://' . $_SERVER['HTTP_HOST'] . '/' . WP_CONTENT_FOLDERNAME);
define('WP_PLUGIN_DIR', WP_CONTENT_DIR . "/". $env['WP_PLUGIN_FOLDERNAME'] );
define('WP_PLUGIN_URL', WP_CONTENT_URL . "/" .$env['WP_PLUGIN_FOLDERNAME'] );
I’m not sure but can you please suggest if that could be the reason. Please suggest for a solution.
Thread Starter
Atanu
(@iwdatanu)
Hi,
I’ve tested with changing “modules” directory name back to “plugins”. It works perfectly. So it means there are something wrong in the plugin’s latest version. Because I did not face such issue before. Please check and fix the issue asap. Otherwise we can’t able to use the plugin.
There are so many websites for which we have changed the default directory name for long time. All are having same problem right now. It is really difficult for us to change back to original directory name right now. So please fix this issue as a high priority and asap.
-
This reply was modified 3 days, 22 hours ago by
Atanu.
-
This reply was modified 3 days, 22 hours ago by
Atanu.
Plugin Support
wfphil
(@wfphil)
Hi @iwdatanu
Thank you for the update that the fault is fixed by renaming the directory for WordPress plugins back to its correct name.
Technically, it’s a bug, but we should not have to expect the plugins directory to be renamed as modules so please do not use that name for the directory for WordPress plugins.
Thread Starter
Atanu
(@iwdatanu)
WordPress alllow to do change the plugin directory name as “define( ‘WP_PLUGIN_DIR’ )”. Then why should we not use that. And we are using this for a long time now in several websites. Never get that issue… It must be something inside Wordfence plugin’s latest version that need to be fix.
You guys also need to consider all WP golbal variables in your code base. Please fix that issue asap.