Git Download Updater - Setup Documentation
Setting up and using the Git Download Updater is simple.
Connecting to BitBucket
To connect your Easy Digital Downloads website to your BitBucket account, you will need to add two definitions to your wp-config.php file:
define( 'EDD_GIT_BB_USER', 'username' ); define( 'EDD_GIT_BB_PASSWORD', 'password' );
Replace username and password with your actual account details.
Connecting to Github
To use GitHub, open the Downloads > Settings page, and click on the Extensions tab. Follow the instructions there to connect to GitHub.
Setting Your Download Files
Once you have connected your website to either Github or BitBucket, you can add files to your Download products.
The "Download Files" metabox on the download edit screen will now have a checkbox labelled " Fetch download from git repo." Check this box.
After a moment or two, a new set of fields will show up that will allow you to select a repository.
Search for the repository name, and then select the tag that you want to use.
Click " Fetch." When the word " Fetch" is replaced by a checkmark, your download has been successfully imported from the git repository.
You can now edit the file and/or zip name if desired, or leave them as default. Your zip file is ready to go!
Whenever you are ready to release a new version, simply select the tag you wish to use and click fetch. After fetching is complete, update your product.
Update conflict between free and paid version
There are two different ways to resolve this issue:
- Change the name / slug of the pro version. Because of a nuance with the WordPress update API, WordPress cannot actually distinguish them as separate plugins.
- Add "wp_override" to the third parameter of the EDD_SL_PLugin_Updater class when it is instantiated, like this:
// setup the updater $edd_updater = new EDD_SL_Plugin_Updater( EDD_SAMPLE_STORE_URL, __FILE__, array( 'version' => '1.0', // current version number 'license' => $license_key, // license key (used get_option above to retrieve from DB) 'item_name' => EDD_SAMPLE_ITEM_NAME, // name of this plugin 'author' => 'Pippin Williamson', // author of this plugin, 'wp_override' => true ) );
Note: this requires v1.6.4 of the plugin udpater class.