michelve / software-license-manager

🔐Wordpress Software License Management. Supports WooCommerce, and WP eStore.
https://epikly.com
GNU General Public License v3.0
77 stars 29 forks source link

Getting Fatal error when install without WooCpmmerce #9

Closed yduke closed 4 years ago

yduke commented 4 years ago

Describe the bug Trying to install the release 5.1.4 in WordPress, getting fatal error and can not continue.

Fatal error: Uncaught Error: Class 'WC_Product' not found in D:\xampp\htdocs\dk\wp-content\plugins\software-license-manager\woocommerce\includes\slm-meta-boxes.php:234 Stack trace: #0 D:\xampp\htdocs\dk\wp-includes\class-wp-hook.php(286): slm_register_product_type('') #1 D:\xampp\htdocs\dk\wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 D:\xampp\htdocs\dk\wp-includes\plugin.php(465): WP_Hook->do_action(Array) #3 D:\xampp\htdocs\dk\wp-settings.php(525): do_action('init') #4 D:\xampp\htdocs\dk\wp-config.php(90): require_once('D:\xampp\htdocs...') #5 D:\xampp\htdocs\dk\wp-load.php(37): require_once('D:\xampp\htdocs...') #6 D:\xampp\htdocs\dk\wp-admin\admin.php(34): require_once('D:\xampp\htdocs...') #7 {main} thrown in D:\xampp\htdocs\dk\wp-content\plugins\software-license-manager\woocommerce\includes\slm-meta-boxes.php on line 234

I think this is a dependency problem which called a WooCpmmerce Class but can not find it. I delete the plugin file installed WooCpmmerce later, reinstall software-license-manager plugin and error was gone.

Maybe some "if():"conditional check will solve this?

To Reproduce Steps to reproduce the behavior:

  1. A wordpress without WooCpmmerce installed.
  2. Upload the release software-license-manager-5.1.4 plugin
  3. Activate it.
  4. Go to admin.php?page=slm_overview see error

Expected behavior Use this plugin with/without WooCpmmerce

System

The error message was on a windows xampp but I tested 2 times with linux server and xampp, both turned out the same.

Thank you For develop this good work.

cheers

michelve commented 4 years ago

@yduke - thanks for reporting this, i will take a look at the above.

michelve commented 4 years ago

@yduke - issue has been solved