Showing with 35 additions and 16 deletions.
  1. +5 −0 CHANGELOG.md
  2. +18 −12 classes/admin.class.php
  3. +1 −1 package.json
  4. +9 −1 readme.txt
  5. +2 −2 woocommerce-product-addon.php
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### [Version 32.0.11](https://github.com/Codeinwp/woocommerce-product-addon/compare/v32.0.10...v32.0.11) (2024-02-29)

### Bug Fixes
- Fixed error with the latest version related to current_user_can check

##### [Version 32.0.10](https://github.com/Codeinwp/woocommerce-product-addon/compare/v32.0.9...v32.0.10) (2024-02-28)

### Bug Fixes
Expand Down
30 changes: 18 additions & 12 deletions classes/admin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* working behind the seen
*/

/*
**========== Direct access not allowed ===========
/*
**========== Direct access not allowed ============
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'Not Allowed' );
Expand Down Expand Up @@ -52,7 +52,7 @@ function __construct() {
array(
$this,
'add_menu_pages',
)
)
);

add_action( 'init', array( 'NM_PersonalizedProduct', 'set_ppom_menu_permission' ) );
Expand All @@ -62,7 +62,7 @@ function __construct() {
add_action( 'wp_ajax_ppom_attach_ppoms', array( $this, 'ppom_attach_ppoms' ) );

// Adding setting tab in WooCommerce
if ( ! ppom_settings_migrated() && current_user_can( 'manage_options' ) ) {
if ( ! ppom_settings_migrated() ) {
add_filter( 'woocommerce_settings_tabs_array', __CLASS__ . '::add_settings_tab', 50 );
// Display settings
add_action( 'woocommerce_settings_tabs_ppom_settings', array( $this, 'settings_tab' ) );
Expand All @@ -83,7 +83,7 @@ function __construct() {
'ppom_multi_select_role_setting',
),
2,
10
10
);

}
Expand Down Expand Up @@ -114,7 +114,7 @@ function add_menu_pages() {
$page ['callback'],
),
$this->plugin_meta ['logo'],
$this->plugin_meta ['menu_position']
$this->plugin_meta ['menu_position']
);
} else {

Expand All @@ -127,7 +127,7 @@ function add_menu_pages() {
array(
$this,
$page ['callback'],
)
)
);
}

Expand All @@ -142,9 +142,9 @@ function add_menu_pages() {
array(
$this,
$page ['callback'],
)
)
);
}
}
}
}

Expand Down Expand Up @@ -312,20 +312,26 @@ function validate_plugin() {

public static function add_settings_tab( $settings_tabs ) {

$settings_tabs['ppom_settings'] = __( 'PPOM Settings', 'woocommerce-product-addon' );
if ( current_user_can( 'manage_options' ) ) {
$settings_tabs['ppom_settings'] = __('PPOM Settings', 'woocommerce-product-addon');
}

return $settings_tabs;
}

function settings_tab() {

woocommerce_admin_fields( ppom_array_settings() );
if ( current_user_can( 'manage_options' ) ) {
woocommerce_admin_fields(ppom_array_settings());
}

}

function save_settings() {

woocommerce_update_options( ppom_array_settings() );
if ( current_user_can( 'manage_options' ) ) {
woocommerce_update_options(ppom_array_settings());
}
}

function ppom_setting_wpml( $value, $option, $raw_value ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "woocommerce-product-addon",
"version": "32.0.10",
"version": "32.0.11",
"description": "PPOM for WooCommerce",
"main": "index.js",
"repository": "https://github.com/Codeinwp/woocommerce-product-addon",
Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: themeisle
Tags: woocommerce product addons, woocommerce product options, woocommerce product fields, woocommerce product, woocommerce product addon
Requires at least: 3.5
Tested up to: 6.4
Stable tag: 32.0.10
Stable tag: 32.0.11
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Requires PHP: 7.2
Expand Down Expand Up @@ -122,6 +122,14 @@ If you feels that PPOM Free or PPOM PRO versions are not enough for your needs,

== Changelog ==

##### [Version 32.0.11](https://github.com/Codeinwp/woocommerce-product-addon/compare/v32.0.10...v32.0.11) (2024-02-29)

### Bug Fixes
- Fixed error with the latest version related to current_user_can check




##### [Version 32.0.10](https://github.com/Codeinwp/woocommerce-product-addon/compare/v32.0.9...v32.0.10) (2024-02-28)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions woocommerce-product-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: PPOM for WooCommerce
* Plugin URI: https://themeisle.com/plugins/ppom-pro/
* Description: PPOM (Personalized Product Meta Manager) plugin allow WooCommerce Store Admin to create unlimited input fields and files to attach with Product Pages.
* Version: 32.0.10
* Version: 32.0.11
* Author: Themeisle
* Text Domain: woocommerce-product-addon
* Domain Path: /languages
Expand All @@ -26,7 +26,7 @@
define( 'PPOM_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
define( 'PPOM_WP_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __DIR__ ) ) );
define( 'PPOM_BASENAME', basename( PPOM_WP_PLUGIN_DIR ) );
define( 'PPOM_VERSION', '32.0.10' );
define( 'PPOM_VERSION', '32.0.11' );
define( 'PPOM_DB_VERSION', '30.1.0' );
define( 'PPOM_PRODUCT_META_KEY', '_product_meta_id' );
define( 'PPOM_TABLE_META', 'nm_personalized' );
Expand Down