The upcoming release of Give 1.7 is going to include support for WP-CLI. This tool is perfect for developers who prefer working from the command line. Now you can view donation data, donor data, and more without leaving your keyboard.
The WordPress Command Line Interface (WP-CLI) is a set of tools that allow you to manage your WordPress site from the command line. This means you can accomplish many admin-related tasks of your WordPress install without ever taking your fingers off the keyboard.
The base WP-CLI commands allow you to perform common tasks, such as installing and updating plugins, backing up your database, or regenerating your thumbnails. WP-CLI is also extensible and allows plugins to register their own commands, and this is what Give 1.7 is introducing to the free Give plugin.
What will you be able to do with Give CLI?
The addition of command line support for Give allows you to retrieve details about your installation, your forms, your donors, and their donations. Here are some of the most useful commands you’ll find in version 1.7.
Give Plugin Details
wp give details command gives you a quick overview of your Give plugin settings.
wp give forms command returns a list the donation forms that you have posted to your site.
--id parameter to the forms command will return additional details about the specified form.
wp give donors command allows you to list your donors, or create a new donor record from the command line.
Adding a new donor is as simple as executing a command like:
wp give donors --create=1 --firstname.lastname@example.org
wp give donations command will retrieve the details of the most recent donations made on your site. You can limit the number of donations returned by adding the
--number parameter to the command.
wp give report command retrieves a quick summary of the total earnings and number of donations made. By default, it will show you these two numbers for all donations made on your site for all time. You can limit the results of this report by a specified date range, or by the ID of a specific donation form.
Clearing the Cache
You can delete all transients related to Give by typing:
wp give cache --action=delete
Getting Started with WP-CLI
Want to get ready to use the Give CLI features? First check out the official WP-CLI site for instructions for how to get the WP-CLI library installed on your server.
If you’re familiar with Github you can review all the Give CLI commands here. Once Give 1.7 is released (and you’ve upgraded your version), the “give” commands will be available to you.