| @@ -76,9 +76,9 @@ | ||
| 76 | 76 | * |
| 77 | 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 | */ |
| @@ -755,12 +755,12 @@ | ||
| 755 | 755 | self::$counter = 1; |
| 756 | 756 | |
| 757 | 757 | if ( $this->delete_stats_transients() ) { |
| 758 | 758 | // Report .eading. |
| 759 | - WP_CLI::success( 'Give cache deleted.' ); | |
| 759 | + WP_CLI::success( 'GiveWP cache deleted.' ); | |
| 760 | 760 | } else { |
| 761 | 761 | // Report .eading. |
| 762 | - 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.' ); | |
| 763 | 763 | } |
| 764 | 764 | break; |
| 765 | 765 | } |
| 766 | 766 | |
| @@ -778,12 +778,12 @@ | ||
| 778 | 778 | global $wpdb; |
| 779 | 779 | |
| 780 | 780 | $stat_option_names = $wpdb->get_results( |
| 781 | 781 | $wpdb->prepare( |
| 782 | - "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')", | |
| 783 | 783 | array( |
| 784 | - '_transient_give_stats_', | |
| 785 | - 'give_cache', | |
| 784 | + '%_transient_give_stats_%', | |
| 785 | + '%give_cache%', | |
| 786 | 786 | ) |
| 787 | 787 | ), |
| 788 | 788 | ARRAY_A |
| 789 | 789 | ); |
| @@ -1021,9 +1021,9 @@ | ||
| 1021 | 1021 | public function test_mode( $args, $assoc ) { |
| 1022 | 1022 | |
| 1023 | 1023 | // Return if associative arguments are not specified. |
| 1024 | 1024 | if ( empty( $assoc ) ) { |
| 1025 | - WP_CLI::error( "--enable or --disable flag is missing." ); | |
| 1025 | + WP_CLI::error( '--enable or --disable flag is missing.' ); | |
| 1026 | 1026 | return; |
| 1027 | 1027 | } |
| 1028 | 1028 | |
| 1029 | 1029 | $enabled_gateways = give_get_option( 'gateways' ); |
| @@ -1028,9 +1028,8 @@ | ||
| 1028 | 1028 | |
| 1029 | 1029 | $enabled_gateways = give_get_option( 'gateways' ); |
| 1030 | 1030 | $default_gateway = give_get_option( 'default_gateway' ); |
| 1031 | 1031 | |
| 1032 | - | |
| 1033 | 1032 | // Enable Test Mode. |
| 1034 | 1033 | if ( true === WP_CLI\Utils\get_flag_value( $assoc, 'enable' ) ) { |
| 1035 | 1034 | |
| 1036 | 1035 | // Set `Test Mode` to `enabled`. |
| @@ -1035,21 +1034,18 @@ | ||
| 1035 | 1034 | |
| 1036 | 1035 | // Set `Test Mode` to `enabled`. |
| 1037 | 1036 | give_update_option( 'test_mode', 'enabled' ); |
| 1038 | 1037 | |
| 1039 | - | |
| 1040 | 1038 | // Enable `Test Donation` gateway. |
| 1041 | - $enabled_gateways['manual'] = "1"; | |
| 1039 | + $enabled_gateways['manual'] = '1'; | |
| 1042 | 1040 | give_update_option( 'gateways', $enabled_gateways ); |
| 1043 | 1041 | |
| 1044 | - | |
| 1045 | 1042 | // Set `Test Donation` as default gateway. |
| 1046 | 1043 | add_option( 'give_test_mode_default_gateway', $default_gateway ); |
| 1047 | 1044 | give_update_option( 'default_gateway', 'manual' ); |
| 1048 | 1045 | |
| 1049 | - | |
| 1050 | 1046 | // Show success message on completion. |
| 1051 | - WP_CLI::success( 'Give Test mode enabled' ); | |
| 1047 | + WP_CLI::success( 'GiveWP Test mode enabled' ); | |
| 1052 | 1048 | } |
| 1053 | 1049 | |
| 1054 | 1050 | // Disable Test Mode. |
| 1055 | 1051 | if ( true === WP_CLI\Utils\get_flag_value( $assoc, 'disable' ) ) { |
| @@ -1056,22 +1052,19 @@ | ||
| 1056 | 1052 | |
| 1057 | 1053 | // Set `Test Mode` to `disabled`. |
| 1058 | 1054 | give_update_option( 'test_mode', 'disabled' ); |
| 1059 | 1055 | |
| 1060 | - | |
| 1061 | 1056 | // Disable `Test Donation` gateway. |
| 1062 | 1057 | unset( $enabled_gateways['manual'] ); |
| 1063 | 1058 | give_update_option( 'gateways', $enabled_gateways ); |
| 1064 | 1059 | |
| 1065 | - | |
| 1066 | 1060 | // Backup `Default Gateway` setting for restore on test mode disable. |
| 1067 | 1061 | $default_gateway_backup = get_option( 'give_test_mode_default_gateway' ); |
| 1068 | 1062 | give_update_option( 'default_gateway', $default_gateway_backup ); |
| 1069 | 1063 | delete_option( 'give_test_mode_default_gateway' ); |
| 1070 | 1064 | |
| 1071 | - | |
| 1072 | 1065 | // Show success message on completion. |
| 1073 | - WP_CLI::success( 'Give Test mode disabled' ); | |
| 1066 | + WP_CLI::success( 'GiveWP Test mode disabled' ); | |
| 1074 | 1067 | } |
| 1075 | 1068 | } |
| 1076 | 1069 | |
| 1077 | 1070 | |
| @@ -1119,17 +1112,17 @@ | ||
| 1119 | 1112 | * |
| 1120 | 1113 | * ## OPTIONS |
| 1121 | 1114 | * |
| 1122 | 1115 | * [--name=<name>] |
| 1123 | - * : Update a single addon. | |
| 1116 | + * : Update a single add-on. | |
| 1124 | 1117 | * |
| 1125 | 1118 | * [--exclude=<names>] |
| 1126 | - * : Names of addons that should be excluded from updating. | |
| 1119 | + * : Names of add-ons that should be excluded from updating. | |
| 1127 | 1120 | * |
| 1128 | 1121 | * ## EXAMPLES |
| 1129 | - * wp give addon-update | |
| 1130 | - * wp give addon-update --name="Give-Stripe" | |
| 1131 | - * 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" | |
| 1132 | 1125 | * |
| 1133 | 1126 | * @param array $pos Array of positional arguments. |
| 1134 | 1127 | * @param array $assoc Array of associative arguments. |
| 1135 | 1128 | * |
| @@ -1134,9 +1127,9 @@ | ||
| 1134 | 1127 | * @param array $assoc Array of associative arguments. |
| 1135 | 1128 | * |
| 1136 | 1129 | * @since 2.1.3 |
| 1137 | 1130 | * |
| 1138 | - * @subcommand addon-update | |
| 1131 | + * @subcommand add-on-update | |
| 1139 | 1132 | */ |
| 1140 | 1133 | public function addon_update( $pos, $assoc ) { |
| 1141 | 1134 | |
| 1142 | 1135 | /** |
| @@ -1150,9 +1143,9 @@ | ||
| 1150 | 1143 | /** |
| 1151 | 1144 | * Update a single Give addon. |
| 1152 | 1145 | */ |
| 1153 | 1146 | if ( false !== ( $addon_name = WP_CLI\Utils\get_flag_value( $assoc, 'name', false ) ) ) { |
| 1154 | - $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 ); | |
| 1155 | 1148 | |
| 1156 | 1149 | /** |
| 1157 | 1150 | * Display error if the plugin (addon) name entered does |
| 1158 | 1151 | * not exist. |
| @@ -1157,9 +1150,9 @@ | ||
| 1157 | 1150 | * Display error if the plugin (addon) name entered does |
| 1158 | 1151 | * not exist. |
| 1159 | 1152 | */ |
| 1160 | 1153 | if ( empty( $give_addon_path ) ) { |
| 1161 | - 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 ) ); | |
| 1162 | 1155 | } |
| 1163 | 1156 | |
| 1164 | 1157 | /** |
| 1165 | 1158 | * If the directory does not contain a Git |
| @@ -1184,13 +1177,13 @@ | ||
| 1184 | 1177 | * Show success/error messages depending on whether the |
| 1185 | 1178 | * current branch of the addon was updated or not. |
| 1186 | 1179 | */ |
| 1187 | 1180 | if ( 0 === $return_var ) { |
| 1188 | - 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 ) ); | |
| 1189 | 1182 | |
| 1190 | 1183 | return; |
| 1191 | 1184 | } elseif ( 1 === $return_var ) { |
| 1192 | - 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 ) ); | |
| 1193 | 1186 | } |
| 1194 | 1187 | } |
| 1195 | 1188 | |
| 1196 | 1189 | /** |
| @@ -1205,9 +1198,9 @@ | ||
| 1205 | 1198 | /** |
| 1206 | 1199 | * Get directory paths of all the addons including |
| 1207 | 1200 | * Give Core. |
| 1208 | 1201 | */ |
| 1209 | - $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 ); | |
| 1210 | 1203 | |
| 1211 | 1204 | foreach ( $give_addon_directories as $repo ) { |
| 1212 | 1205 | |
| 1213 | 1206 | /** |
| @@ -1222,9 +1215,9 @@ | ||
| 1222 | 1215 | */ |
| 1223 | 1216 | if ( ! $this->is_git_repo( $repo ) ) { |
| 1224 | 1217 | WP_CLI::line( |
| 1225 | 1218 | sprintf( |
| 1226 | - __( "%s: '%s' does not contain git repo.", 'give' ), | |
| 1219 | + __( "%1\$s: '%2\$s' does not contain git repo.", 'give' ), | |
| 1227 | 1220 | WP_CLI::colorize( '%RError%n' ), |
| 1228 | 1221 | $plugin_name |
| 1229 | 1222 | ) |
| 1230 | 1223 | ); |
| @@ -1256,12 +1249,12 @@ | ||
| 1256 | 1249 | passthru( "cd $repo && git pull origin $branch_name", $return_var ); |
| 1257 | 1250 | } |
| 1258 | 1251 | |
| 1259 | 1252 | $items[] = array( |
| 1260 | - 'Give Addon' => $plugin_name, | |
| 1261 | - 'Branch' => $branch_name, | |
| 1262 | - 'Remote' => 'origin', | |
| 1263 | - 'Status' => ( 0 === $return_var ) | |
| 1253 | + 'GiveWP Addon' => $plugin_name, | |
| 1254 | + 'Branch' => $branch_name, | |
| 1255 | + 'Remote' => 'origin', | |
| 1256 | + 'Status' => ( 0 === $return_var ) | |
| 1264 | 1257 | ? __( 'Success', 'give' ) |
| 1265 | 1258 | : __( 'Failed', 'give' ), |
| 1266 | 1259 | ); |
| 1267 | 1260 | |
| @@ -1277,9 +1270,9 @@ | ||
| 1277 | 1270 | WP_CLI\Utils\format_items( |
| 1278 | 1271 | 'table', |
| 1279 | 1272 | $items, |
| 1280 | 1273 | array( |
| 1281 | - 'Give Addon', | |
| 1274 | + 'GiveWP Addon', | |
| 1282 | 1275 | 'Branch', |
| 1283 | 1276 | 'Remote', |
| 1284 | 1277 | 'Status', |
| 1285 | 1278 | ) |