Skip to content

Commit 6d34ae5

Browse files
committed
Use the Plugin Name in header info for package name - plugin filename is not reliable
1 parent 7fb307d commit 6d34ae5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Plugin.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
* - be able to tell the installer to ignore a specific type by setting it to false in the path mapping
2626
* - why does wordpress keep downloading every time?
2727
* - add retries for the package listing! and increase timeout limit
28+
* - should be some way to force non-composer-wp packages to be mu-plugins
29+
* - troubleshoot why '~' doesn't work for wp-zip repos
30+
* - allow you to list all of the packages from a specific repo
2831
*/
2932

3033
namespace BalBuf\ComposerWP;

src/Repository/ZipRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ protected function scanDir() {
157157
// use the basename of the file where the plugin headers were as the name
158158
// this is a wordpress convention, but may not always be accurate
159159
// @todo: what do we do about that?
160-
$name = Util::callFilter( $this->repoConfig['name-filter'], basename( $fileName, '.php' ), $url, $fileName, $headers );
160+
$name = Util::slugify( $headers['plugin name'] );
161+
$name = Util::callFilter( $this->repoConfig['name-filter'], $name, $url, $fileName, $headers );
161162
if ( !empty( $headers['plugin uri'] ) ) {
162163
$package['homepage'] = $headers['plugin uri'];
163164
}

0 commit comments

Comments
 (0)