Plugin Dependencies
[resolved] Unreliable plugin naming/identifying scheme (3 posts)

  1. binki
    Posted 4 years ago #

    I can't figure out what the standards or requirements are for plugin naming in wordpress. It appears, from the examples I read, that this plugin relies on site administrators following strict file-naming conventions when installing plugins. For example, if a plugin were to declare a dependency on contact-form-7/wp-contact-form-7.php and the admin decides to check it out into wp-content/plugins/contact-form instead of wp-content/plugins/contact-form-7 , the first plugin is unable to be enabled. I even tried just listing `wp-contact-form-7.php' as a dependency.

    There should be a more reliable way of identifying plugins. I think that even extracting Name: Contact Form 7' from wp-contact-form-7.php would be much more reliable than depending on the filename. Unlike in drupal, as another user mentioned earlier, plugins in wordpress don't even have a standard location for acomputer-friendly' name. The wordpress.org URI for wp-contact-form-7 is http://wordpress.org/extend/plugins/contact-form-7 -- thus contact-form-7' would seem to be the longer-standing reliable handle for that plugin. Yet thecontact-form-7' is not present in _any_ of the metadatada fields -- not even in its readme.txt.

    Perhaps we can come to a compromise that might work, though. Even though plugins are resilient to the point of them being placed in different folders... and often to having the plugin entry point .php file (wp-contact-form-7.php in this case) be renamed, there is no reason I can think of for the administrator to rename a plugin's .php file -- unless if he's developing a different plugin, of course. So ignoring the directories in a plugin's per-installation identifier yields a slightly stabler identifier -- the basename of the plugin.

    Could plugin-dependencies be modified to accept Depends: wp-contact-form-7.php' and recognize a match even when the per-installation identifier for Contact Form 7 iscontact-form-7/wp-contact-form-7.php'? May the documentation be updated to encourage plugin authors to use the `Provides:' directive unconditionally in every plugin since the identifier a plugin author places in that directive will enable plugins to depend on it without worrying about this folder names problem?


  2. scribu
    Plugin Author

    Posted 4 years ago #

    Dropping the folder name from the dependency identifier is not a good idea. For example, what happens if you have two different plugins that look like this:


    Also, the 'Nmae' header can be changed by a plugin author quite easily, but that's pretty rare.

    I suppose the name could be used, transforming it internally to contact-form-7 (like a post slug):


  3. scribu
    Plugin Author

    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Plugin Dependencies
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic