Skip to content

Commit a3145be

Browse files
authored
Updates the terminology to match upcoming WCAM v3.5.0 (#9)
1 parent 96a2029 commit a3145be

File tree

4 files changed

+59
-51
lines changed

4 files changed

+59
-51
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.* export-ignore
22
/.* export-ignore
3-
/examples export-ignore
43
/node_modules export-ignore
54
/resources export-ignore
65
/tests export-ignore

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*** WooCommerce API Manager PHP Library for Plugins and Themes Changelog ***
22

3+
2025.05.22 - version 2.11.0
4+
* New: Update the terminology in labels and text matching the latest API Manager version
5+
36
2025.03.17 - version 2.10.0
47
* Tweak: Reduce the number of calls to the API server when loading activation settings pages
58
* Tweak: Allow passing the parent product ID to the client constructor (breaking change)

examples/wc-api-manager-example.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22
/**
3-
* Plugin Name: WooCommerce API Manager PHP Library for Plugins and Themes Example
3+
* Plugin Name: Kestrel API Manager for WooCommerce PHP Library for Plugins and Themes Example
44
* Plugin URI: https://kestrelwp.com/product/woocommerce-api-manager-php-library-for-plugins-and-themes/
55
* Description: Drop the wc-am-client.php library into a plugin or theme, and use the example code below this comment block following carefully the instructions and the documentation.
6-
* Version: 2.10.0
6+
* Version: 2.11.0
77
* Author: Kestrel
88
* Author URI: https://kestrelwp.com
99
*
1010
* Copyright: (c) 2023-2025 Kestrel [[email protected]]
1111
*
12-
* @package WooCommerce API Manager Library for plugin or theme
12+
* @package API Manager for WooCommerce PHP Library for Plugins and Themes Example
1313
* @author Kestrel
1414
* @category Plugin/Theme/library
1515
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
@@ -25,7 +25,7 @@
2525
*/
2626

2727
// Load the WC_AM_Client client class if it exists.
28-
if ( ! class_exists( 'WC_AM_Client_2_10_0' ) ) {
28+
if ( ! class_exists( 'WC_AM_Client_2_11_0' ) ) {
2929
/**
3030
* This library does not use Composer autoloading to support a wider range of implementations.
3131
*
@@ -37,7 +37,7 @@
3737
}
3838

3939
// Instantiate the WC_AM_Client class object if the WC_AM_Client class is loaded.
40-
if ( class_exists( 'WC_AM_Client_2_10_0' ) ) {
40+
if ( class_exists( 'WC_AM_Client_2_11_0' ) ) {
4141
/**
4242
* This file is only an example that includes a plugin header, and this code is used to instantiate the client object.
4343
*
@@ -69,7 +69,7 @@
6969
*
7070
* @NOTE Replace the dummy values with your own.
7171
*/
72-
$wcam_lib = new WC_AM_Client_2_10_0( __FILE__, 123, null, '1.0', 'theme', 'https://example.org/example-theme', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain' );
72+
$wcam_lib = new WC_AM_Client_2_11_0( __FILE__, 123, null, '1.0', 'theme', 'https://example.org/example-theme', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain' );
7373

7474
/**
7575
* Plugin example (default menu).
@@ -80,13 +80,13 @@
8080
*/
8181

8282
// If the Product ID is not set the customer will see a form field when activating the API Key that requires the Product ID along with a form field for the API Key.
83-
$wcam_lib = new WC_AM_Client_2_10_0( __FILE__, '', null, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain' );
83+
$wcam_lib = new WC_AM_Client_2_11_0( __FILE__, '', null, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain' );
8484

8585
// Setting the Product ID below will eliminate the required form field for the customer to enter the Product ID, so the customer will only be required to enter the API Key.
86-
$wcam_lib = new WC_AM_Client_2_10_0( __FILE__, 456, null, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain' );
86+
$wcam_lib = new WC_AM_Client_2_11_0( __FILE__, 456, null, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain' );
8787

8888
// If you offer the product as a variable product where the customer can switch to another product with a different Product ID, then do not set the Product ID here, but you may pass a product parent ID instead (generally not recommended unless you are using subscription switches and not setting a product ID or letting the customer enter it).
89-
$wcam_lib = new WC_AM_Client_2_10_0( __FILE__, null, 789, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain' );
89+
$wcam_lib = new WC_AM_Client_2_11_0( __FILE__, null, 789, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain' );
9090

9191
/**
9292
* Custom top level or top level submenu.
@@ -99,7 +99,7 @@
9999
* @see add_options_page( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null );
100100
* @see add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '', $position = null );
101101
*
102-
* Then pass the custom menu settings as an array to the WC_AM_Client_2_10_0 class as shown in the example below.
102+
* Then pass the custom menu settings as an array to the WC_AM_Client_2_11_0 class as shown in the example below.
103103
*/
104104

105105
$wcam_lib_custom_menu = array(
@@ -109,13 +109,13 @@
109109
'menu_title' => __( 'Example API Key', 'example-textdomain' ),
110110
);
111111

112-
$wcam_lib = new WC_AM_Client_2_10_0( __FILE__, 123, null, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain', $wcam_lib_custom_menu );
112+
$wcam_lib = new WC_AM_Client_2_11_0( __FILE__, 123, null, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain', $wcam_lib_custom_menu );
113113

114114
/**
115115
* Suppress the inactive notice.
116116
*
117-
* When your plugin or theme is activated, the WC_AM_Client_2_10_0 class will display a notice in the admin area if the plugin or theme has not been activated.
117+
* When your plugin or theme is activated, the WC_AM_Client_2_11_0 class will display a notice in the admin area if the plugin or theme has not been activated.
118118
* You can disable this by setting the last argument passed to the client constructor to false.
119119
*/
120-
$wcam_lib = new WC_AM_Client_2_10_0( __FILE__, 123, null, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain', null, false );
120+
$wcam_lib = new WC_AM_Client_2_11_0( __FILE__, 123, null, '1.2.3', 'plugin', 'https://example.org/example-plugin', __( 'Example WordPress Plugin', 'example-textdomain' ), 'example-textdomain', null, false );
121121
}

0 commit comments

Comments
 (0)