Open dd32 opened 1 week ago
Note: This can be worked around with a step after the installPlugin
step that involves renaming the folder, although that's not ideal longer term, and would also require then re-implementing any activation logic. It's harder when there's multiple plugins installed as well, as we're not able to know for sure which folder it was installed into at the blueprint stage.
Currently
installAsset
guesses the path to install an asset into based on two things:folder-name.zip
=>plugins/folder-name
)my-plugin
at the root level =>plugins/my-plugin
)This is not ideal in some scenario's, especially as some software and plugins expect the plugin to be installed into a very specific path.
For example, Plugin Check expects that the folder that the plugin is installed in is the ultimate slug on WordPress.org. This is usually incorrect, but is sometimes correct.
This becomes a problem when we're loading user-supplied ZIPs into playground, as we can't force the ultimate install path, and it may end up being something like
2024_09_25-uploaded-my-plugin
orMy-Plugin-For-Review
rather than the expectedhello-world-example
.Ideally,
InstallAssetOptions
would expose aslug
/installFolder
optional property that can be set viaInstallPluginOptions
, which forcesinstallAsset
.assetFolderName
rather than the heuristic guess that's presently in place.An example step after this would be, to install the
hello-dolly
plugin into a arbitraryhello-world-example
path:Another option would be that it's a property of the
FileReference
, but that might overload theFileReference
structure to be too asset-central.