array( 'name' => __( 'Rebuild reports data', 'woocommerce-admin' ), 'button' => __( 'Rebuild reports', 'woocommerce-admin' ), 'desc' => __( 'This tool will rebuild all of the information used by the reports.', 'woocommerce-admin' ), ), ) ); } /** * Actually executes a tool. * * @param string $tool Tool. * @return array */ public function execute_tool( $tool ) { $ran = true; $message = ''; switch ( $tool ) { case 'rebuild_stats': WC_Admin_Api_Init::regenerate_report_data(); $message = __( 'Rebuilding reports data in the background . . .', 'woocommerce-admin' ); break; default: return parent::execute_tool( $tool ); } return array( 'success' => $ran, 'message' => $message, ); } }