@@ -47,8 +47,8 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
4747 protected $ upgrade_refresh = 'wp_update_plugins ' ;
4848 protected $ upgrade_transient = 'update_plugins ' ;
4949 protected $ check_wporg = [
50- 'status ' => false ,
51- 'update_date ' => false ,
50+ 'status ' => false ,
51+ 'last_updated ' => false ,
5252 ];
5353
5454 protected $ obj_fields = array (
@@ -253,19 +253,19 @@ protected function get_all_items() {
253253 $ wporg_info = $ this ->get_wporg_data ( $ mu_name );
254254
255255 $ items [ $ file ] = array (
256- 'name ' => $ mu_name ,
257- 'status ' => 'must-use ' ,
258- 'update ' => false ,
259- 'update_version ' => null ,
260- 'update_package ' => null ,
261- 'version ' => $ mu_version ,
262- 'update_id ' => '' ,
263- 'title ' => $ mu_title ,
264- 'description ' => $ mu_description ,
265- 'file ' => $ file ,
266- 'auto_update ' => false ,
267- 'wp_org ' => $ wporg_info ['status ' ],
268- 'wp_org_updated ' => $ wporg_info ['last_updated ' ],
256+ 'name ' => $ mu_name ,
257+ 'status ' => 'must-use ' ,
258+ 'update ' => false ,
259+ 'update_version ' => null ,
260+ 'update_package ' => null ,
261+ 'version ' => $ mu_version ,
262+ 'update_id ' => '' ,
263+ 'title ' => $ mu_title ,
264+ 'description ' => $ mu_description ,
265+ 'file ' => $ file ,
266+ 'auto_update ' => false ,
267+ 'wporg_status ' => $ wporg_info ['status ' ],
268+ 'wporg_last_updated ' => $ wporg_info ['last_updated ' ],
269269 );
270270 }
271271
@@ -719,20 +719,20 @@ protected function get_item_list() {
719719
720720 $ duplicate_names [ $ name ][] = $ file ;
721721 $ items [ $ file ] = [
722- 'name ' => $ name ,
723- 'status ' => $ this ->get_status ( $ file ),
724- 'update ' => (bool ) $ update_info ,
725- 'update_version ' => isset ( $ update_info ) && isset ( $ update_info ['new_version ' ] ) ? $ update_info ['new_version ' ] : null ,
726- 'update_package ' => isset ( $ update_info ) && isset ( $ update_info ['package ' ] ) ? $ update_info ['package ' ] : null ,
727- 'version ' => $ details ['Version ' ],
728- 'update_id ' => $ file ,
729- 'title ' => $ details ['Name ' ],
730- 'description ' => wordwrap ( $ details ['Description ' ] ),
731- 'file ' => $ file ,
732- 'auto_update ' => in_array ( $ file , $ auto_updates , true ),
733- 'author ' => $ details ['Author ' ],
734- 'wp_org ' => $ wporg_info ['status ' ],
735- 'wp_org_updated ' => $ wporg_info ['last_updated ' ],
722+ 'name ' => $ name ,
723+ 'status ' => $ this ->get_status ( $ file ),
724+ 'update ' => (bool ) $ update_info ,
725+ 'update_version ' => isset ( $ update_info ) && isset ( $ update_info ['new_version ' ] ) ? $ update_info ['new_version ' ] : null ,
726+ 'update_package ' => isset ( $ update_info ) && isset ( $ update_info ['package ' ] ) ? $ update_info ['package ' ] : null ,
727+ 'version ' => $ details ['Version ' ],
728+ 'update_id ' => $ file ,
729+ 'title ' => $ details ['Name ' ],
730+ 'description ' => wordwrap ( $ details ['Description ' ] ),
731+ 'file ' => $ file ,
732+ 'auto_update ' => in_array ( $ file , $ auto_updates , true ),
733+ 'author ' => $ details ['Author ' ],
734+ 'wporg_status ' => $ wporg_info ['status ' ],
735+ 'wporg_last_updated ' => $ wporg_info ['last_updated ' ],
736736 ];
737737
738738 if ( null === $ update_info ) {
@@ -770,7 +770,7 @@ protected function get_wporg_data( $plugin_name ) {
770770 'status ' => 'no_wp_org ' ,
771771 'last_updated ' => '- ' ,
772772 ];
773- if ( ! $ this ->check_wporg ['status ' ] && ! $ this ->check_wporg ['update_date ' ] ) {
773+ if ( ! $ this ->check_wporg ['status ' ] && ! $ this ->check_wporg ['last_updated ' ] ) {
774774 return $ data ;
775775 }
776776
@@ -779,7 +779,7 @@ protected function get_wporg_data( $plugin_name ) {
779779 $ response_code = wp_remote_retrieve_response_code ( $ request );
780780 if ( 200 === $ response_code ) {
781781 $ data ['status ' ] = 'active ' ;
782- if ( ! $ this ->check_wporg ['update_date ' ] ) {
782+ if ( ! $ this ->check_wporg ['last_updated ' ] ) {
783783 return $ data ; // The plugin is active on .org, but we don't need the date.
784784 }
785785 }
@@ -1252,8 +1252,8 @@ public function delete( $args, $assoc_args = array() ) {
12521252 * * file
12531253 * * auto_update
12541254 * * author
1255- * * wp_org
1256- * * wp_org_updated
1255+ * * wporg_status
1256+ * * wporg_last_updated
12571257 *
12581258 * ## EXAMPLES
12591259 *
@@ -1281,16 +1281,16 @@ public function delete( $args, $assoc_args = array() ) {
12811281 public function list_ ( $ _ , $ assoc_args ) {
12821282 $ fields = Utils \get_flag_value ( $ assoc_args , 'fields ' );
12831283 if ( ! empty ( $ fields ) ) {
1284- $ fields = explode ( ', ' , $ fields );
1285- $ this ->check_wporg ['status ' ] = in_array ( 'wp_org ' , $ fields , true );
1286- $ this ->check_wporg ['update_date ' ] = in_array ( 'wp_org_updated ' , $ fields , true );
1284+ $ fields = explode ( ', ' , $ fields );
1285+ $ this ->check_wporg ['status ' ] = in_array ( 'wporg_status ' , $ fields , true );
1286+ $ this ->check_wporg ['last_updated ' ] = in_array ( 'wporg_last_updated ' , $ fields , true );
12871287 }
12881288
12891289 $ field = Utils \get_flag_value ( $ assoc_args , 'field ' );
1290- if ( 'wp_org ' === $ field ) {
1290+ if ( 'wporg_status ' === $ field ) {
12911291 $ this ->check_wporg ['status ' ] = true ;
1292- } elseif ( 'wp_org_updated ' === $ field ) {
1293- $ this ->check_wporg ['update_date ' ] = true ;
1292+ } elseif ( 'wporg_last_updated ' === $ field ) {
1293+ $ this ->check_wporg ['last_updated ' ] = true ;
12941294 }
12951295
12961296 parent ::_list ( $ _ , $ assoc_args );
0 commit comments