Skip to content

Activate "required plugins" before the tested plugin - #10

Merged
meszarosrob merged 8 commits into
mainfrom
feature/activate-plugin-dependencies
Jul 27, 2026
Merged

Activate "required plugins" before the tested plugin#10
meszarosrob merged 8 commits into
mainfrom
feature/activate-plugin-dependencies

Conversation

@meszarosrob

@meszarosrob meszarosrob commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Addresses the issue reported at #9 where custom code was needed to activate the dependencies in cases where a plugin defined "Requires Plugins".

This PR takes advantage of WP-CLI, which could return the "Requires Plugins" information, as that was the simplest option to retrieve. Alternatives included parsing the header ourselves or including the necessary WP classes and functions to extract the information.

For this reason, the WpCli class's run method signature was changed to return the output of WP-CLI. This is not a breaking change.

@meszarosrob
meszarosrob marked this pull request as ready for review July 21, 2026 08:25
@meszarosrob
meszarosrob requested a review from a team July 21, 2026 08:26
@meszarosrob meszarosrob linked an issue Jul 21, 2026 that may be closed by this pull request
1 task

public function execute(): void
{
$testedPluginName = Path::getFilenameWithoutExtension($this->packageRootPath->path());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note:

This is now done in multiple files https://github.com/search?q=repo%3Ainpsyde%2Fwp-phpunit-integration%20getFilenameWithoutExtension&type=code.

In a future PR, I would like to move this "filename without extension" functionality to some central place, perhaps a service class, rather than doing it in the tasks themselves.

@amiut amiut left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it on https://github.com/inpsyde/fairyloot-multi-warehouse/pull/66 and it works like a charm 💪, thanks a lot for taking care of it. LGTM.
I left a very minor comment but please feel free to ignore.

Comment thread src/Task/ActivateTestedPluginDependencies.php Outdated
@meszarosrob
meszarosrob merged commit 270e3fb into main Jul 27, 2026
13 checks passed
@meszarosrob
meszarosrob deleted the feature/activate-plugin-dependencies branch August 4, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Allow the activation of dependencies before package

2 participants