path = plugin_dir_path( __FILE__ ); $this->url = plugin_dir_url( __FILE__ ); require_once dirname(__FILE__)."/vendor/autoload.php"; $this->database = new Database(); $this->query_manipulation = new QueryManipulation( $this ); $this->assets = new Assets($this); $this->rest = new REST($this); $this->meta_box = new MetaBox( $this ); $this->gutenberg = new Gutenberg($this); $this->user = new User( $this ); $this->render = new Render( $this ); $this->migrate = new Migrate( $this ); $this->update = new Update( $this ); /** * on activate or deactivate plugin */ register_activation_hook(__FILE__, array($this, "activation")); } /** * get the additions authors user ids * * @param null|int $post_id * * @return array */ public function get_ids( $post_id = null ) { return $this->database->get_author_ids($post_id); } /** * Add an unguessable string to end * * @return string */ public function generateUnguessableString() { return bin2hex( openssl_random_pseudo_bytes( 20 ) ); } /** * generate a strong password * @return string */ public function generatePassword() { return wp_generate_password( 20, true ); } /** * on plugin activation */ function activation(){ $this->database->install(); } } /** * init plugin and make it accessible */ Plugin::get_instance(); require_once dirname( __FILE__ ) . "/public-functions.php"; require_once dirname( __FILE__ ) . "/deprecated.php";