The WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. development team builds WordPress! Follow this site for general updates, status reports, and the occasional code debate. There’s lots of ways to contribute:
Found a bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority.?Create a ticket in the bug tracker.
This feature allows pluginPluginA plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party authors to identify which other plugins must be installed so that their plugin functions as expected. This is done by adding a “Requires Plugins” headerHeaderThe header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. to the docblockdocblock(phpdoc, xref, inline docs) of the main plugin file which contains a comma-separated list of slugs for the required plugins.
The feature is not intended to work with Must-Use plugins, nor does it impact them.
Delete the Hello Dolly plugin, a single file plugin cannot be a dependency
Copy the three test plugin files from /plugins/wp-plugin-dependencies/test-plugins to the /plugins directory.
Navigate to Plugins > Installed Plugins.
Test Instructions / Key Features
Confirm that a new adminadmin(and super admin) notice is displayed if there are additional plugins that must be installed if dependencies are missing.
Confirm that individual plugins with dependency relationships on Plugins > Installed Plugins display Requires or Required by: under the version information.
Add (install/activate) needed dependencies.
Confirm that admin notice goes away once all the dependencies have been installed. Dependencies don’t need to be activated for the admin notice to be satisfied and go away.
After installing all dependencies, confirm that the new admin notice disappears.
Confirm that the Deactivate link and checkbox are not available for plugins that are dependencies with active dependent plugins.
Once all dependent plugins are deactivated, confirm that plugin dependencies can then be deactivated and deleted.
Confirm that the Add Plugins > Dependencies page lists correct plugins, including non-WordPress.orgWordPress.orgThe community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ plugins that are and aren’t supported.
Other Things to Test
In a test plugin, try to add a dependency using a plugin’s full name (not slug).
No dependency should be noted
Add a dependency for a non-wordpress.org plugin slug that is installed/active.
Hook the Plugins APIAPIAn API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. to register a non-wordpress.org plugin.
This is done with the GitGitGit is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. Most modern plugin and theme development is being done with this version control system. https://git-scm.com/. Updater plugin
Test adding “Requires Plugins” to the DocBlock of a plugin in mu-plugins.
Nothing should happen as mu-plugins are not supported for this feature.
In the main plugin file’s docblock:
A Requires Plugins header has been introduced.
List the slugs of the dependencies in a comma separated string. For example:
Each plugin that is a dependency, and is also dependent on other plugins, has both lines above.
If all the dependencies of a plugin have not been installed and activated then the dependent plugin will not be able to be activated.
On the Plugins > Add New > Dependencies tab:
The above Requires and Required by data will display in the plugin card.
This tab shows a card for each plugin that is required for other plugins to work.
Familiar Install Now, Activate and Active buttons are provided so that site owners can manage these plugins.
If a dependency is not available on wordpress.org and does not integrate with the Plugin Dependencies feature, it will not be possible to install or activate via this tab. The plugin will display in a generic card.
It is possible to integrate a dependency that is not available on wordpress.org with the Plugin Dependencies feature. This requires hooking into the plugins_api_requestfilterFilterFilters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. and returning a valid plugins_api() response. This type of code was added to the feature pluginFeature PluginA plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. as a composer dependency with afragen/add-plugin-dependency-api, and a filter to the endpoint returning valid plugins_api() response for the Git Updater plugin.
Instructions for Reporting Issues
Please leave feedback in the comments below this post.