define_constants(); $this->includes(); $this->init_hooks(); } private function define_constants() { $this->define( 'TR_PMD_DIR', plugin_dir_path( __FILE__ ) ); $this->define( 'TR_PMD_URL', plugin_dir_url( __FILE__ ) ) ; $this->define( 'TR_PMD_NS', __NAMESPACE__ ); $this->define( 'TR_PMD_API_KEY', 'tpmd-api-key' ); $this->define( 'TR_PMD_API_CUR', 'tpmd-api-cur' ); $this->define( 'TR_PMD_API_ATTR', 'tpmd-api-attr' ); $this->define( 'TR_PMD_API_CLIENT', 'WP_1.0' ); $this->define( 'TR_PMD_API_URL', 'https://business.trustedpmdealers.com/api/v1/' ); } private function includes() { require_once TR_PMD_DIR . 'includes/config/class-auto-loader.php'; } private function init_hooks() { $tr_pmd_manager = new Main_Manager(); $tr_pmd_manager->run(); } private function define( $name, $value ) { if ( ! defined( $name ) ) { define( $name, $value ); } } } function trpmd_log($message){ $date = date('Y-m-d H:i:s'); if ( is_array( $message ) || is_object( $message ) ) { $message = print_r($message, true); } error_log('[ ' . $date . " ] $message\r\n", 3, TR_PMD_DIR . '/error.log' ); } if ( ! function_exists('write_log')) { function write_log ( $log ) { if ( is_array( $log ) || is_object( $log ) ) { error_log( print_r( $log, true ) ); } else { error_log( $log ); } } } add_action( 'admin_init', 'TrustedPMDealers\init' ); add_action( 'admin_menu', 'TrustedPMDealers\init' ); function init() { TrustedPMDealers::get_instance(); }