Download the PHP package wecodemore/wp-downloader without Composer

On this page you can find all versions of the php package wecodemore/wp-downloader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-downloader

wp-downloader

A Composer plugin that provides a zero effort way to solve a very specific issue for a very specific edge case: install WordPress plugins and themes, with Composer, inside WordPress /wp-content folder.


Why?

By using Composer to manage both WordPress core and plugins/themes and at same time to tell Composer to put plugins and themes inside WordPress default /wp-content folder is just not possible without issues.

Because, in short, every time WordPress is installed or updated, the whole WordPress folder (so including /wp-content dir) is deleted and so plugins and themes packages inside it are lost.

I have explored different ways to solve this issue, but it seems that the most simple way is just to avoid to treat WordPress as a regular Composer package, because - guess what - it is not a regular Composer package.

Thanks to many people effort, nowadays we have ways to use Composer to manage entire WordPress websites that works in the large majority of the cases.

This plugin comes for that specific case that does not belong to that "large majority". But:


How it works?

WordPress will be downloaded from zip releases available at wordpress.org and unzipped in a folder of choice.

When Composer is ran to update WordPress, old installation files are deleted, but /wp-content dir and wp-config.php (if found in WP root folder) are not touched.

If Composer is setup to place plugins and themes inside /wp-content, they will be updated when needed, by Composer.


Usage

In the root composer.json require wecodemore/wp-downloader.

That's it.

There are few optional configurations, explained below.


Configuration

The plugin supports a wp-downloader object in composer.json (to be placed inside extra object in root package) that allows to configure:

An example:

None of the settings above are mandatory, in fact the wp-downloader object could not be there at all.

All settings have defaults and both target dir and WordPress version may be set in a different way.

Configure WordPress installation path

As you can see above, the target path can be set via the extra.wp-downloader.target-dir setting.

However, the plugin also supports the path to be set in extra.wordpress-install-dir (used, for example, also by johnpbloch/wordpress-core-installer).

So if that settings is used, the path in there will be used, unless it is overridden by putting a different path in extra.wp-downloader.target-dir.

Configure WordPress version

In the example above, the WordPress version to download is set using extra.wp-downloader.version config.

You can put there anything that Composer understands.

Well, not really anything because this package only work with stable versions.

Additionally, it is possible to use the keyword latest that, as you can guess, will download the latest version of WordPress.

There's also another way to setup the WordPress version to download.

If the root composer.json requires any package of the type wordpress-core, the version used in that requirement will be "discovered" and used by this plugin.

For example, if a composer.json contains:

wp-downloader will read the version of johnpbloch/wordpress and will download a version compatible with the requirements of that package (in example above the version 4.6 or higher).

This works only if a WordPress core package is required in the root composer.json: core packages required as secondary dependencies will not be read, and if no version is provided (neither by package nor via wp-downloader object) the latest WordPress version will be downloaded.

Also note that using example above the WP installation folder will be public/wp, being it read from the wordpress-install-dir setting.

Please note: using a composer.json like the one right above will not install WordPress from the required package (johnpbloch/wordpress).

In fact, wp-downloader prevents packages of type wordpress-core to be installed by Composer, or the unique reason to exists of this plugin would be defeated.

No-content setting

By default wp-downloader downloads the "no-content" version of WordPress archives.

This is usually fine when using Composer to manage the entire website, as the themes and plugins are pulled with Composer.

However, if someone wants to use a default theme, it needs to be pulled separately using Composer, or maybe, wp-downloader can be instructed to download a full WordPress archive of by setting extra.wp-downloader.no-content setting to false.


Gotchas

Even if wp-downloader could be used when WP plugins and themes are placed outside of WordPress folder, there's actually no benefit on using it in those cases.

Usage of this plugin is suggested only when plugins and themes really need to be inside WordPress folder.

Main plugin gotchas are:


FAQ

How do I tell Composer to place my plugin / themes inside WordPress /wp-content folder?

I required this plugin, now the website show just WSOD!

Do you wish to support [insert crazy edge case here]?

Do you wish to implement [feature here]?

I found a bug, can you fix it?

I used a fixed required version for WP and it does not work. Why?

The package [package here] I am using requires WordPress package, but the plugin does not auto-discover which WP version to download, and always download latest version.

Does this work with WP Starter?


License

MIT.


All versions of wp-downloader with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
composer-plugin-api Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wecodemore/wp-downloader contains the following files

Loading the files please wait ....