I'm trying to check if WooCommerce plugin is active then add some options to the option panel. but this code doesn't work right.
can anyone tell me what is wrong?
if( class_exists( 'WooCommerce' )) {//add options}
Try the following instead:
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
// Yes, WooCommerce is enabled
} else {
// WooCommerce is NOT enabled!
}