<?php 

    namespace WKPtraits\Traits;

    trait WKP_Helper{
        private $all_plugins_array;
        private $active_plugins;
        private $admin_url;
        private $woocommerce = 'woocommerce/woocommerce.php';
        private $widgetkit = 'widgetkit-for-elementor/widgetkit-for-elementor.php';
        private $elementor = 'elementor/elementor.php';
        private $elementor_pro = 'elementor-pro/elementor-pro.php';
        private $widgetkit_pro = 'widgetkit-pro/widgetkit-pro.php';
        private $learnpress = 'learnpress/learnpress.php';
        private $learndash = 'learndash/learndash.php';
        private $sensei = 'sensei/sensei.php';
        private $lifter = 'lifterlms/lifterlms.php';

        public function helper_initiate(){
            $this->all_plugins_array = get_plugins();
            $this->active_plugins = get_option( 'active_plugins' );
            $this->admin_url = get_admin_url();
        }

        public function woocommerce_installed(){

            $this->helper_initiate();
            
            $is_installed = array_key_exists( $this->woocommerce, $this->all_plugins_array );

            if( $is_installed ){
                return true;
            }else{
                return false;
            }

        }

        public function woocommerce_active(){

            $this->helper_initiate();
            
            $is_active = array_key_exists( $this->woocommerce, $this->all_plugins_array );

            if( $is_active ){
                return true;
            }else{
                return false;
            }

        }
        
    }


?>