get_handle(); return "https://github.com/{$handle}/archive/refs/heads/{$branch}.zip"; } /** * Validate repository url * * @return WP_Error|boolean */ protected function validate_repo_url() { parent::validate_repo_url(); // check if string has exact format in a URL like this: https://github.com/company/wordpress-theme . if ( ! preg_match( '/^https:\/\/github.com\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+$/', $this->get_repo_url() ) ) { return new \WP_Error( 'invalid', __( 'Repository url must be a valid GitHub repository url', 'deployer-for-git' ) ); } } }