PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
← All changes | includes/class-give-cli-commands.php +34 -38 2.3.04.16.9 View file →
@@ -73,12 +73,12 @@
73 73 * @param array $assoc_args List of command data.
74 74 *
75 75 * @return void
76 76 *
77 - * @subcommand logo
77 + * @subcommand ascii
78 78 */
79 79 public function ascii( $args, $assoc_args ) {
80 - WP_CLI::log( file_get_contents( GIVE_PLUGIN_DIR . 'assets/dist/images/give-ascii-logo.txt' ) );
80 + WP_CLI::log( file_get_contents( GIVE_PLUGIN_DIR . 'build/assets/dist/images/give-ascii-logo.txt' ) );
81 81 }
82 82
83 83
84 84 /**
@@ -106,9 +106,9 @@
106 106
107 107 /**
108 108 * Plugin Information
109 109 */
110 - WP_CLI::log( $this->color_message( __( 'Give Version: ', 'give' ) ) . GIVE_VERSION );
110 + WP_CLI::log( $this->color_message( __( 'GiveWP Version: ', 'give' ) ) . GIVE_VERSION );
111 111
112 112 /**
113 113 * General Information.
114 114 */
@@ -235,9 +235,9 @@
235 235 foreach ( $data as $subheading => $subdata ) {
236 236
237 237 switch ( $subheading ) {
238 238 case 'earnings':
239 - WP_CLI::log( $this->color_message( $subheading . ': ', give_currency_filter( $subdata ) ) );
239 + WP_CLI::log( $this->color_message( $subheading . ': ', give_currency_filter( $subdata, array( 'decode_currency' => true ) ) ) );
240 240 break;
241 241 default:
242 242 WP_CLI::log( $this->color_message( $subheading . ': ', $subdata ) );
243 243 }
@@ -491,9 +491,9 @@
491 491 }
492 492
493 493 switch ( $heading ) {
494 494 case 'total_spent':
495 - $table_row[] = give_currency_filter( $data );
495 + $table_row[] = give_currency_filter( $data, array( 'decode_currency' => true ) );
496 496 break;
497 497
498 498 default:
499 499 $table_row[] = $data;
@@ -500,8 +500,11 @@
500 500 }
501 501 }
502 502 break;
503 503
504 + case 'address':
505 + break;
506 +
504 507 case 'info':
505 508 default:
506 509 foreach ( $donor as $heading => $data ) {
507 510
@@ -752,12 +755,12 @@
752 755 self::$counter = 1;
753 756
754 757 if ( $this->delete_stats_transients() ) {
755 758 // Report .eading.
756 - WP_CLI::success( 'Give cache deleted.' );
759 + WP_CLI::success( 'GiveWP cache deleted.' );
757 760 } else {
758 761 // Report .eading.
759 - WP_CLI::warning( 'We did not find any Give plugin cache to delete :)' );
762 + WP_CLI::warning( 'We did not find any GiveWP plugin cache to delete.' );
760 763 }
761 764 break;
762 765 }
763 766
@@ -775,12 +778,12 @@
775 778 global $wpdb;
776 779
777 780 $stat_option_names = $wpdb->get_results(
778 781 $wpdb->prepare(
779 - "SELECT option_name FROM {$wpdb->options} where (option_name LIKE '%%%s%%' OR option_name LIKE '%%%s%%')",
782 + "SELECT option_name FROM {$wpdb->options} where (option_name LIKE '%s' OR option_name LIKE '%s')",
780 783 array(
781 - '_transient_give_stats_',
782 - 'give_cache',
784 + '%_transient_give_stats_%',
785 + '%give_cache%',
783 786 )
784 787 ),
785 788 ARRAY_A
786 789 );
@@ -1018,9 +1021,9 @@
1018 1021 public function test_mode( $args, $assoc ) {
1019 1022
1020 1023 // Return if associative arguments are not specified.
1021 1024 if ( empty( $assoc ) ) {
1022 - WP_CLI::error( "--enable or --disable flag is missing." );
1025 + WP_CLI::error( '--enable or --disable flag is missing.' );
1023 1026 return;
1024 1027 }
1025 1028
1026 1029 $enabled_gateways = give_get_option( 'gateways' );
@@ -1025,9 +1028,8 @@
1025 1028
1026 1029 $enabled_gateways = give_get_option( 'gateways' );
1027 1030 $default_gateway = give_get_option( 'default_gateway' );
1028 1031
1029 -
1030 1032 // Enable Test Mode.
1031 1033 if ( true === WP_CLI\Utils\get_flag_value( $assoc, 'enable' ) ) {
1032 1034
1033 1035 // Set `Test Mode` to `enabled`.
@@ -1032,21 +1034,18 @@
1032 1034
1033 1035 // Set `Test Mode` to `enabled`.
1034 1036 give_update_option( 'test_mode', 'enabled' );
1035 1037
1036 -
1037 1038 // Enable `Test Donation` gateway.
1038 - $enabled_gateways['manual'] = "1";
1039 + $enabled_gateways['manual'] = '1';
1039 1040 give_update_option( 'gateways', $enabled_gateways );
1040 1041
1041 -
1042 1042 // Set `Test Donation` as default gateway.
1043 1043 add_option( 'give_test_mode_default_gateway', $default_gateway );
1044 1044 give_update_option( 'default_gateway', 'manual' );
1045 1045
1046 -
1047 1046 // Show success message on completion.
1048 - WP_CLI::success( 'Give Test mode enabled' );
1047 + WP_CLI::success( 'GiveWP Test mode enabled' );
1049 1048 }
1050 1049
1051 1050 // Disable Test Mode.
1052 1051 if ( true === WP_CLI\Utils\get_flag_value( $assoc, 'disable' ) ) {
@@ -1053,22 +1052,19 @@
1053 1052
1054 1053 // Set `Test Mode` to `disabled`.
1055 1054 give_update_option( 'test_mode', 'disabled' );
1056 1055
1057 -
1058 1056 // Disable `Test Donation` gateway.
1059 1057 unset( $enabled_gateways['manual'] );
1060 1058 give_update_option( 'gateways', $enabled_gateways );
1061 1059
1062 -
1063 1060 // Backup `Default Gateway` setting for restore on test mode disable.
1064 1061 $default_gateway_backup = get_option( 'give_test_mode_default_gateway' );
1065 1062 give_update_option( 'default_gateway', $default_gateway_backup );
1066 1063 delete_option( 'give_test_mode_default_gateway' );
1067 1064
1068 -
1069 1065 // Show success message on completion.
1070 - WP_CLI::success( 'Give Test mode disabled' );
1066 + WP_CLI::success( 'GiveWP Test mode disabled' );
1071 1067 }
1072 1068 }
1073 1069
1074 1070
@@ -1116,17 +1112,17 @@
1116 1112 *
1117 1113 * ## OPTIONS
1118 1114 *
1119 1115 * [--name=<name>]
1120 - * : Update a single addon.
1116 + * : Update a single add-on.
1121 1117 *
1122 1118 * [--exclude=<names>]
1123 - * : Names of addons that should be excluded from updating.
1119 + * : Names of add-ons that should be excluded from updating.
1124 1120 *
1125 1121 * ## EXAMPLES
1126 - * wp give addon-update
1127 - * wp give addon-update --name="Give-Stripe"
1128 - * wp give addon-update --exclude="Give-Stripe, Give-Recurring-Donations"
1122 + * wp give add-on-update
1123 + * wp give add-on-update --name="Give-Stripe"
1124 + * wp give add-on-update --exclude="Give-Stripe, Give-Recurring-Donations"
1129 1125 *
1130 1126 * @param array $pos Array of positional arguments.
1131 1127 * @param array $assoc Array of associative arguments.
1132 1128 *
@@ -1131,9 +1127,9 @@
1131 1127 * @param array $assoc Array of associative arguments.
1132 1128 *
1133 1129 * @since 2.1.3
1134 1130 *
1135 - * @subcommand addon-update
1131 + * @subcommand add-on-update
1136 1132 */
1137 1133 public function addon_update( $pos, $assoc ) {
1138 1134
1139 1135 /**
@@ -1147,9 +1143,9 @@
1147 1143 /**
1148 1144 * Update a single Give addon.
1149 1145 */
1150 1146 if ( false !== ( $addon_name = WP_CLI\Utils\get_flag_value( $assoc, 'name', false ) ) ) {
1151 - $give_addon_path = glob( WP_CONTENT_DIR . "/plugins/$addon_name/" , GLOB_ONLYDIR );
1147 + $give_addon_path = glob( WP_CONTENT_DIR . "/plugins/$addon_name/", GLOB_ONLYDIR );
1152 1148
1153 1149 /**
1154 1150 * Display error if the plugin (addon) name entered does
1155 1151 * not exist.
@@ -1154,9 +1150,9 @@
1154 1150 * Display error if the plugin (addon) name entered does
1155 1151 * not exist.
1156 1152 */
1157 1153 if ( empty( $give_addon_path ) ) {
1158 - WP_CLI::error( sprintf( __( "The Give addon '%s' does not exist.", 'give' ), $addon_name ) );
1154 + WP_CLI::error( sprintf( __( "The GiveWP add-on '%s' does not exist.", 'give' ), $addon_name ) );
1159 1155 }
1160 1156
1161 1157 /**
1162 1158 * If the directory does not contain a Git
@@ -1181,13 +1177,13 @@
1181 1177 * Show success/error messages depending on whether the
1182 1178 * current branch of the addon was updated or not.
1183 1179 */
1184 1180 if ( 0 === $return_var ) {
1185 - WP_CLI::success( sprintf( __( "The Give addon '%s' is up-to-date with origin." ), $addon_name ) );
1181 + WP_CLI::success( sprintf( __( "The GiveWP add-on '%s' is up-to-date with origin.", 'give' ), $addon_name ) );
1186 1182
1187 1183 return;
1188 1184 } elseif ( 1 === $return_var ) {
1189 - WP_CLI::error( sprintf( __( "The Give addon '%s' was not updated." ), $addon_name ) );
1185 + WP_CLI::error( sprintf( __( "The GiveWP add-on '%s' was not updated.", 'give' ), $addon_name ) );
1190 1186 }
1191 1187 }
1192 1188
1193 1189 /**
@@ -1202,9 +1198,9 @@
1202 1198 /**
1203 1199 * Get directory paths of all the addons including
1204 1200 * Give Core.
1205 1201 */
1206 - $give_addon_directories = glob( WP_CONTENT_DIR . '/plugins/[gG]ive*/' , GLOB_ONLYDIR );
1202 + $give_addon_directories = glob( WP_CONTENT_DIR . '/plugins/[gG]ive*/', GLOB_ONLYDIR );
1207 1203
1208 1204 foreach ( $give_addon_directories as $repo ) {
1209 1205
1210 1206 /**
@@ -1219,9 +1215,9 @@
1219 1215 */
1220 1216 if ( ! $this->is_git_repo( $repo ) ) {
1221 1217 WP_CLI::line(
1222 1218 sprintf(
1223 - __( "%s: '%s' does not contain git repo.", 'give' ),
1219 + __( "%1\$s: '%2\$s' does not contain git repo.", 'give' ),
1224 1220 WP_CLI::colorize( '%RError%n' ),
1225 1221 $plugin_name
1226 1222 )
1227 1223 );
@@ -1253,12 +1249,12 @@
1253 1249 passthru( "cd $repo && git pull origin $branch_name", $return_var );
1254 1250 }
1255 1251
1256 1252 $items[] = array(
1257 - 'Give Addon' => $plugin_name,
1258 - 'Branch' => $branch_name,
1259 - 'Remote' => 'origin',
1260 - 'Status' => ( 0 === $return_var )
1253 + 'GiveWP Addon' => $plugin_name,
1254 + 'Branch' => $branch_name,
1255 + 'Remote' => 'origin',
1256 + 'Status' => ( 0 === $return_var )
1261 1257 ? __( 'Success', 'give' )
1262 1258 : __( 'Failed', 'give' ),
1263 1259 );
1264 1260
@@ -1274,9 +1270,9 @@
1274 1270 WP_CLI\Utils\format_items(
1275 1271 'table',
1276 1272 $items,
1277 1273 array(
1278 - 'Give Addon',
1274 + 'GiveWP Addon',
1279 1275 'Branch',
1280 1276 'Remote',
1281 1277 'Status',
1282 1278 )