<?php

class WKFE_PRO_Filter_Pro{
    private static $instance = null;

    public static function init(){
        if(null === self::$instance ){
            self::$instance = new self;
        }
        return self::$instance;
    }

    public function __construct(){
        add_filter('wkpro_enabled', array($this, 'check_pro'));
        add_filter('wkpro_check_plugin', array($this, 'check_plugin'));
        $this->wkp_woocommerce_filter();
    }

    public function check_pro($status){
        return true;
    }

    public function check_plugin($plugin_main_file){
        $installed_plugins = get_plugins();
        $site_has_this_plugin = isset($installed_plugins[$plugin_main_file]);
        if($site_has_this_plugin){
            return true;
        }else{
            return false;
        }
    }
    
    public function wkp_woocommerce_filter(){
        add_action( 'wkp_woo_product_price', 'woocommerce_template_single_price', 10 );
        add_action( 'wkp_woo_product_rating', 'woocommerce_template_single_rating', 10 );
        add_action( 'wkp_woo_product_sale_flash', 'woocommerce_show_product_loop_sale_flash', 10 );
    }
}

?>