Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust plugin directory name for "wrongly" packaged zips. #327

Merged
merged 5 commits into from
Apr 24, 2015

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Apr 24, 2015

This allows for instance for GitHub pre-packaged zips to be correctly installed and recognized.

Previously if you'd use the GitHub packaged zips - for instance: either master: https://github.com/lmartins/webipack-posts-widget/archive/master.zip or release based: https://github.com/lmartins/webipack-posts-widget/archive/v1.1.zip, you'd end up with an installed plugin, but with the plugin directory having a non-standard name webipack-posts-widget-master, cq webipack-posts-widget-1.1 which would cause TGMPA not to recognize it as installed.

Fixes #280, Fixes #283

This allows for instance for GitHub pre-packaged zips to be correctly installed and recognized.

Previously if you'd use the GitHub packaged zips - for instance: either master: https://github.com/lmartins/webipack-posts-widget/archive/master.zip or release based: https://github.com/lmartins/webipack-posts-widget/archive/v1.1.zip, you'd end up with an installed plugin, but with the plugin directory having a non-standard name `webipack-posts-widget-master`, cq `webipack-posts-widget-1.1` which would cause TGMPA not to recognize it as installed.

Fixes #280, Fixes #283

// Check for single file plugins
$source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
if ( 1 === count( $source_files ) && false === $wp_filesystem->is_dir( $source ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

Does there need to be a global $wp_filesystem, or is it already effectively done so by the $GLOBALS['wp_filesystem] on the previous line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and no. Good catch - I copied that line from the WP_Upgrader class and obviously missed that. Fixed.

jrfnl added 2 commits April 24, 2015 13:53
…ion into feature/fix-280-283-github-installs
Fixed
- one missed global reference
- use of of `(un)trailingslashit()`
- escape the two new strings and minor translation efficiency
@jrfnl
Copy link
Contributor Author

jrfnl commented Apr 24, 2015

Updated

GaryJones added a commit that referenced this pull request Apr 24, 2015
…-installs

Adjust plugin directory name for "wrongly" packaged zips.
@GaryJones GaryJones merged commit 13a1c22 into develop Apr 24, 2015
@GaryJones
Copy link
Member

Because the second part is the same in both messages, so makes for easier and more consistent translations.

Logical 👍

Once we split the files up, I'd like to look into having something along the lines of a TGMPA_Strings class which holds all of the strings, and could be accessed either statically or via dependency injection etc.

Merged.

@GaryJones GaryJones deleted the feature/fix-280-283-github-installs branch April 24, 2015 13:03
@jrfnl
Copy link
Contributor Author

jrfnl commented Apr 24, 2015

Once we split the files up, I'd like to look into having something along the lines of a TGMPA_Strings class which holds all of the strings, and could be accessed either statically or via dependency injection etc.

We'll need to think about this carefully. Once we make the strings more context-agnostic, there should be little need for clients to overrule our strings.
Also it would be nightmarish to deal with plugin A overruling the strings, then theme B overruling the strings and us getting bug reports about error messages we don't recognize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Name of plugin from GitHub Failing to rename temporary folders
2 participants