Skip to content

Commit ae6424c

Browse files
committed
add version info
1 parent 7ca140b commit ae6424c

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

includes/API.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use WP_REST_Response;
1818
use WP_REST_Server;
1919

20+
2021
/**
2122
*
2223
*/
@@ -50,7 +51,7 @@ public function __construct() {
5051
add_filter( 'determine_current_user', array( $this, 'determine_current_user' ), 20 );
5152
add_filter( 'rest_authentication_errors', array( $this, 'rest_authentication_errors' ), 50, 1 );
5253

53-
// Adds uuid for the WordPress install
54+
// Adds info about the WordPress install
5455
add_filter( 'rest_index', array( $this, 'rest_index' ), 10, 1 );
5556

5657
// These filters allow changes to the WC REST API response
@@ -219,9 +220,11 @@ public function get_auth_header() {
219220
}
220221

221222
/**
222-
* Add uuid to the WP REST API index.
223+
* Adds info to the WP REST API index response.
224+
* - UUID
225+
* - Version Info
223226
*
224-
* @param WP_REST_Response $response Response data
227+
* @param WP_REST_Response $response Response data.
225228
*
226229
* @return WP_REST_Response
227230
*/
@@ -232,6 +235,9 @@ public function rest_index( WP_REST_Response $response ): WP_REST_Response {
232235
update_option( 'woocommerce_pos_uuid', $uuid );
233236
}
234237
$response->data['uuid'] = $uuid;
238+
$response->data['wp_version'] = get_bloginfo( 'version' );
239+
$response->data['wc_version'] = WC()->version;
240+
$response->data['wcpos_version'] = VERSION;
235241

236242
return $response;
237243
}

includes/Templates/Frontend.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ function ( $store ) {
120120
'home' => home_url(),
121121
'gmt_offset' => get_option( 'gmt_offset' ),
122122
'timezone_string' => get_option( 'timezone_string' ),
123+
'wp_version' => get_bloginfo( 'version' ),
124+
'wc_version' => WC()->version,
125+
'wcpos_version' => VERSION,
123126
'wp_api_url' => get_rest_url(),
124127
'wc_api_url' => get_rest_url( null, 'wc/v3' ),
125128
'wc_api_auth_url' => get_rest_url( null, 'wcpos/v1/jwt' ),

woocommerce-pos.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
// minimum requirements.
3737
const WC_MIN_VERSION = '5.3';
3838
const PHP_MIN_VERSION = '7.4';
39-
const MIN_PRO_VERSION = '1.4.0';
39+
const MIN_PRO_VERSION = '1.5.0';
4040

4141
// load .env flags (for development).
4242
function load_env( $file ) {

0 commit comments

Comments
 (0)