diff --git a/examples/api-test.txt b/examples/api-test.txt
index 680db184..f77150fc 100644
--- a/examples/api-test.txt
+++ b/examples/api-test.txt
@@ -1,7 +1,7 @@
add_notice( __( 'You do not have permission to perform this action.', 'wc-serial-numbers' ), 'error' );
wp_safe_redirect( wp_get_referer() );
exit;
@@ -95,8 +95,8 @@ public static function handle_edit_key() {
public static function search_product() {
check_ajax_referer( 'wc_serial_numbers_search_nonce', 'nonce' );
- // Must have manage options user capability role to access this endpoint.
- if ( ! current_user_can( 'manage_options' ) ) {
+ // Must have manage woocommerce user capability role to access this endpoint.
+ if ( ! current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore WordPress.WP.Capabilities.Unknown
wp_send_json_error( array( 'message' => esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) );
wp_die();
}
@@ -158,8 +158,8 @@ public static function search_product() {
public static function search_orders() {
check_ajax_referer( 'wc_serial_numbers_search_nonce', 'nonce' );
- // Must have manage options user capability role to access this endpoint.
- if ( ! current_user_can( 'manage_options' ) ) {
+ // Must have manage woocommerce user capability role to access this endpoint.
+ if ( ! current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore WordPress.WP.Capabilities.Unknown
wp_send_json_error( array( 'message' => esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) );
wp_die();
}
@@ -233,8 +233,8 @@ public static function search_orders() {
public static function search_customers() {
check_ajax_referer( 'wc_serial_numbers_search_nonce', 'nonce' );
- // Must have manage options user capability role to access this endpoint.
- if ( ! current_user_can( 'manage_options' ) ) {
+ // Must have manage woocommerce user capability role to access this endpoint.
+ if ( ! current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore WordPress.WP.Capabilities.Unknown
wp_send_json_error( array( 'message' => esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) );
wp_die();
}
diff --git a/languages/wc-serial-numbers.pot b/languages/wc-serial-numbers.pot
index d3d6e6eb..808dcc23 100644
--- a/languages/wc-serial-numbers.pot
+++ b/languages/wc-serial-numbers.pot
@@ -2,9 +2,9 @@
# This file is distributed under the GPL v2 or later.
msgid ""
msgstr ""
-"Project-Id-Version: WC Serial Numbers 2.0.3\n"
+"Project-Id-Version: WC Serial Numbers 2.0.4\n"
"Report-Msgid-Bugs-To: https://pluginever.com/support\n"
-"POT-Creation-Date: 2024-09-12 10:07:53+00:00\n"
+"POT-Creation-Date: 2024-09-17 09:13:02+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
diff --git a/package-lock.json b/package-lock.json
index 1152c8a4..5c0896fd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "wc-serial-numbers",
- "version": "2.0.3",
+ "version": "2.0.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "wc-serial-numbers",
- "version": "2.0.3",
+ "version": "2.0.4",
"license": "GPL v2 or later",
"devDependencies": {
"@lodder/time-grunt": "^4.0.0",
diff --git a/package.json b/package.json
index ab9b35ad..5e0cab86 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "wc-serial-numbers",
"title": "WC Serial Numbers",
- "version": "2.0.3",
+ "version": "2.0.4",
"description": "Sell and manage license keys/ serial numbers/ secret keys easily within your WooCommerce store.",
"homepage": "https://pluginever.com/plugins/woocommerce-serial-numbers-pro/",
"license": "GPL v2 or later",
diff --git a/readme.txt b/readme.txt
index cc9f712c..17cdc2db 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Tags: license, license manager, serial number, serial key, woocommerce
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 7.4
-Stable tag: 2.0.3
+Stable tag: 2.0.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
diff --git a/src/Admin/ListTables/ActivationsTable.php b/src/Admin/ListTables/ActivationsTable.php
index 450277cf..eeb078f4 100644
--- a/src/Admin/ListTables/ActivationsTable.php
+++ b/src/Admin/ListTables/ActivationsTable.php
@@ -123,7 +123,7 @@ protected function extra_tablenav( $which ) {
* @since 1.4.6
*/
public function process_bulk_actions( $doaction ) {
- if ( $doaction && check_ajax_referer( 'bulk-activations' ) && current_user_can( 'manage_options' ) ) {
+ if ( $doaction && check_ajax_referer( 'bulk-activations' ) && current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore WordPress.WP.Capabilities.Unknown
if ( isset( $_REQUEST['id'] ) ) {
$ids = wp_parse_id_list( wp_unslash( $_REQUEST['id'] ) );
} elseif ( isset( $_REQUEST['ids'] ) ) {
diff --git a/src/Admin/ListTables/KeysTable.php b/src/Admin/ListTables/KeysTable.php
index f66d48e3..ccadb2e2 100644
--- a/src/Admin/ListTables/KeysTable.php
+++ b/src/Admin/ListTables/KeysTable.php
@@ -292,7 +292,7 @@ protected function extra_tablenav( $which ) {
* @since 1.4.6
*/
public function process_bulk_actions( $doaction ) {
- if ( $doaction && check_ajax_referer( 'bulk-' . $this->_args['plural'] ) && current_user_can( 'manage_options' ) ) {
+ if ( $doaction && check_ajax_referer( 'bulk-' . $this->_args['plural'] ) && current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore WordPress.WP.Capabilities.Unknown
if ( wp_unslash( isset( $_REQUEST['id'] ) ) ) {
$ids = wp_parse_id_list( wp_unslash( $_REQUEST['id'] ) );
} elseif ( isset( $_REQUEST['ids'] ) ) {
diff --git a/src/Admin/Menus.php b/src/Admin/Menus.php
index 81fd5d8d..f9d3455c 100644
--- a/src/Admin/Menus.php
+++ b/src/Admin/Menus.php
@@ -87,7 +87,7 @@ public function main_menu() {
add_menu_page(
__( 'Serial Numbers', 'wc-serial-numbers' ),
__( 'Serial Numbers', 'wc-serial-numbers' ),
- 'manage_options',
+ 'manage_woocommerce', // phpcs:ignore WordPress.WP.Capabilities.Unknown
'wc-serial-numbers',
null,
'dashicons-lock',
@@ -98,7 +98,7 @@ public function main_menu() {
'wc-serial-numbers',
__( 'Serial Keys', 'wc-serial-numbers' ),
__( 'Serial Keys', 'wc-serial-numbers' ),
- 'manage_options',
+ 'manage_woocommerce', // phpcs:ignore WordPress.WP.Capabilities.Unknown
'wc-serial-numbers',
array( $this, 'output_main_page' )
);
@@ -118,7 +118,7 @@ public function activations_menu() {
'wc-serial-numbers',
__( 'Activations', 'wc-serial-numbers' ),
__( 'Activations', 'wc-serial-numbers' ),
- 'manage_options',
+ 'manage_woocommerce', // phpcs:ignore WordPress.WP.Capabilities.Unknown
'wc-serial-numbers-activations',
array( $this, 'output_activations_page' )
);
@@ -135,7 +135,7 @@ public function tools_menu() {
'wc-serial-numbers',
__( 'Tools', 'wc-serial-numbers' ),
__( 'Tools', 'wc-serial-numbers' ),
- 'manage_options',
+ 'manage_woocommerce', // phpcs:ignore WordPress.WP.Capabilities.Unknown
'wc-serial-numbers-tools',
array( $this, 'output_tools_page' )
);
@@ -152,7 +152,7 @@ public function reports_menu() {
'wc-serial-numbers',
__( 'Reports', 'wc-serial-numbers' ),
__( 'Reports', 'wc-serial-numbers' ),
- 'manage_options',
+ 'manage_woocommerce', // phpcs:ignore WordPress.WP.Capabilities.Unknown
'wc-serial-numbers-reports',
array( $this, 'output_reports_page' )
);
@@ -169,7 +169,7 @@ public function settings_menu() {
'wc-serial-numbers',
__( 'Settings', 'wc-serial-numbers' ),
__( 'Settings', 'wc-serial-numbers' ),
- 'manage_options',
+ 'manage_woocommerce', // phpcs:ignore WordPress.WP.Capabilities.Unknown
'wc-serial-numbers-settings',
array( Settings::class, 'output' )
);
@@ -187,7 +187,7 @@ public function promo_menu() {
'wc-serial-numbers',
'',
' ' . __( 'Upgrade to Pro', 'wc-serial-numbers' ) . '',
- 'manage_options',
+ 'manage_woocommerce', // phpcs:ignore WordPress.WP.Capabilities.Unknown
'go_wcsn_pro',
array( $this, 'go_pro_redirect' )
);
diff --git a/src/Admin/Notices.php b/src/Admin/Notices.php
index 62a10e5f..a93b4f40 100644
--- a/src/Admin/Notices.php
+++ b/src/Admin/Notices.php
@@ -113,8 +113,8 @@ public function output_notices() {
public function dismiss_notice() {
check_ajax_referer( 'wc_serial_numbers_dismiss_notice', 'nonce' );
- // Must have manage options user capability role to access this endpoint.
- if ( ! current_user_can( 'manage_options' ) ) {
+ // Must have manage woocommerce user capability role to access this endpoint.
+ if ( ! current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore WordPress.WP.Capabilities.Unknown
wp_die();
}
diff --git a/src/Admin/views/html-edit-key.php b/src/Admin/views/html-edit-key.php
index e018c16a..47da7852 100644
--- a/src/Admin/views/html-edit-key.php
+++ b/src/Admin/views/html-edit-key.php
@@ -103,7 +103,7 @@
-