The plugin does not have a valid header.
-
When installing the plugin, then pressing “Activate” I received the following error message page:
“The plugin does not have a valid header.”
-
That means some files are missing or are corrupted. Uninstall it and re-install it, preferably from the WordPress plugins page (“Plugins > Add New”, then enter “ninjafirewall” in the “Search plugins” input field and install it from the list).
I have the same The plugin does not have a valid header. error whether I add via “Search plugins” or download from your site and upload.
This is being installed on a shared site beneath another install. Versions prior to 4.0 installed fine on sites beneath the parent.
After the “The plugin does not have a valid header.”, If I click on the activate button from the plugin page, the activation states it was successful and says it is running in Full WAF mode, but the .htaccess and php.ini is never modified.
I had no issues with the older version, the auto_prepend line was added to php.ini and the suPHP_ConfigPath was added to .htaccess just fine.
Even changing the parent install to debug mode did not stop the install error. Could I download an older version and upgrade to 4.0? That worked on the other three child installs.
I think I know why: there are 2 ninjafirewall.php scripts: one in the plugin root folder:
wp-content/plugins/ninjafirewall/ninjafirewall.php
This is main file of the plugin.And one in the plugin
lib/sub-folder:
wp-content/plugins/ninjafirewall/lib/ninjafirewall.php
This is a loader.For whatever reason, your blog could be fetching the one in the
lib/folder instead of the one in the root folder.
Can you try to edit thelib/ninjafirewall.phpand remove the 3rd line:Plugin Name: NinjaFirewall (WP Edition)Then, try again to activate it.
Removing the line: Plugin Name: NinjaFirewall (WP Edition)
from the lib/ninjafirewall.php did allow activation, however the overview page says:
Firewall Enabled
Mode NinjaFirewall is running in Full WAF mode.
Edition WP Edition ~ Need more security? Get Premium!
Version 4.0 ~ Security rules: 2019-07-01.2
PHP SAPI CGI-FCGI ~ 7.2.19and neither the php.ini or .htaccess in the root of the child site was modified
This is being installed on a shared site beneath another install.
I think this is your issue: the site inherit the firewall from its parent folder. Always disable the firewall in the parent folder when installing it in a sub-folder. Then you can go ahead with the installation and re-enable it in the parent folder afterwards.
I installed NF on 3 other child sites using v3.x without error, I’ll try your suggestion and report back
I simply deactivated the plugin on the parent and upon activating on the child, I still received the “The plugin does not have a valid header.” error.
I guess I could manually edit the .htaccess and php.ini, but I’d imagine you want to fix the issue.
I will update a new file in a few minutes, you could test it.
Let’s try:
1. Download this file (make sure you are running NF 4.0): https://plugins.trac.ww.wp.xz.cn/export/HEAD/ninjafirewall/trunk/lib/utils.php
2. Over FTP, upload it into your/ninjafirewall/lib/folder and overwrite the current one.
3. Rename the/ninjafirewall/lib/ninjafirewall.phpto/ninjafirewall/lib/loader.php.Try again to enable it.
It looks like your WP install is confused about thislib/ninjafirewall.phpfile.OK, more info….
I disabled NF on the parent
renamed the php.ini in the root of the parent
commented out the below section of the .htaccess in the root of the parent:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/*****/public_html
</IfModule>and still receive the “The plugin does not have a valid header.” error upon activating.
As an FYI, on the other three child sites, I was able to install v3.x without disabling the parent and was successful at them upgrading to 4.0
Just saw your above post and will report back…
That gave me the following error:
Plugin could not be activated because it triggered a fatal error.
Error, cannot write /home/*****/public_html/mysite.tld/wp-content/mu-plugins/0-ninjafirewall.php. Check your server permissions and try again.
That’s my mistake, an error in the uploaded file 🙁
Try to download the new one: https://plugins.trac.ww.wp.xz.cn/export/HEAD/ninjafirewall/trunk/lib/utils.php/home/*****/public_html/mysite.tld/wp-content/mu-plugins/0-ninjafirewall.php exists with permissions set to 644
Plugin activated with that one, overview is saying:
Mode NinjaFirewall is running in Full WAF mode.yet, the php.ini nor the .htaccess has been modified on the child site.
The topic ‘The plugin does not have a valid header.’ is closed to new replies.