Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
769 views
in Plugins by
Every plugin folder have metadata.json file.

Is it mandatory to keep metadata.json file in plugin folder?

1 Answer

+3 votes
by

It is not mandatory, but you will lose lot's of basic stuff such as: plugin name, ability to (really) disable the plugin, Q2A and PHP version checks, plugin version update checks, among others.

You could move that to the qa-plugin.php file but that behavior is deprecated and you won't be able to disable the plugin anyway, if you do so.

Considering it is just a single and considerable small file, it makes no sense at all to take any action on that.

by
+2
The "Enabled" checkbox is disabled.  So all plugins without a metadata.json file are always enabled. That's why I said in my answer "ability to (really) disable the plugin"
by
ok.. But there is one plugin which have metadata file but still checkbox is disabled. What could be the reason here...

{
  "name": "Q2A Social Sharing",
  "uri": "https://github.com/amiyasahu/q2a-social-share/",
  "description": "Adds Clickable Social Sharing Buttons Below Questions",
  "version": "1.7.0",
  "date": "2016-02-07",
  "author": "Amiya Sahu",
  "author_uri": "http://www.amiyasahu.com/",
  "license": "GPLv3",
  "update_uri": "https://raw.githubusercontent.com/amiyasahu/q2a-social-share/master/qa-plugin.php",
  "min_q2a": "1.5",
  "min_php": "5.1.6"
}
by
+1
The metadata provides a way to disable the plugin in Q2A. However, the metadata.json file needs to be properly configured for that to happen.

Make sure it ends this way:

    "min_php": "5.1.6",
    "load_order": "after_db_init"
}
by
That's just great ! You are a Q2a champion ! Thanks !!
...