使用Composer安装高级Wordpress主题 [英] Install premium Wordpress theme with Composer

查看:164
本文介绍了使用Composer安装高级Wordpress主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在主题森林上购买了一个高级主题: Avada 。我想使用 Composer 安装此主题,因为它是依赖项(我正在使用基岩作为基础)。因此,我遇到了本文,他们建议制作一个自定义程序包带有下载链接(例如,其中有一些自己的Wordpress插件WP Migrate DB Pro):

I've bought a "premium" theme on Themeforest: Avada. I'd like to install this theme with Composer because it's a dependency (I'm using Bedrock as base). So I came across this article where they suggest to make a custom package with the download link (example with some of there own Wordpress plugins WP Migrate DB Pro):

"require": {
    "deliciousbrains/wp-migrate-db-pro": "*"
},
"repositories": [
    {
        "type": "package",
        "package": {
            "name": "deliciousbrains/wp-migrate-db-pro",
            "type": "wordpress-plugin",
            "version": "1.5",
            "dist": {
                "type": "zip",
                "url": "https://deliciousbrains.com/dl/wp-migrate-db-pro-latest.zip?licence_key=<LICENSE_KEY>&site_url=composer-test.dev"
            },
            "require": {
                "composer/installers": "v1.0.7"
            }
        }
    }
]

非常好,但是我必须自己维护版本号(我无法下载旧版本),而且我不太喜欢URL中的许可证密钥。但是好吧,我已经尝试过了,但是我需要登录Themeforest才能登录,否则需要下载链接(例如 http://themeforest.net/user/username/download_purchase/some-random-id?accessor = wordpress_theme )无效。我可以尝试跟踪下载链接,但是Envato 建议反对下载管理器,所以我认为这是不允许的或不可行的方法。我过去曾与Envato联系,因为他们建议在该教程站点 Tutsplus 上使用Composer,但他们不支持此功能有市场网站。永远不会得到答复。

Very nice, but then I've to maintain the version numbers by myself (I can't download an old version) and I don't like license keys in urls that much. But alright, I've tried but I need to be logged in on Themeforest else the download link (something like http://themeforest.net/user/username/download_purchase/some-random-id?accessor=wordpress_theme) won't work. I can try to trace the download link but Envato recommends against download manager, so I don't think this is allowed or the way to go. I've contacted Envato in the past because they recommend using Composer on there tutorial site Tutsplus but they don't support this on there marketplace sites. Never got a reply.

另一种方法是为Avada创建我自己的GIT存储库。没问题,所以我创建了它,并用我自己的 composer.json 文件添加了所有文件:

Another method is to create my own GIT repository for Avada. No problem, so I've created it, added all the files with my own composer.json file:

{
    "name": "username/wordpress-avada-theme",
    "type": "wordpress-theme"
}

很简单,在版本中添加了GIT标签,可以安装它。非常好!但是...我必须自己维护这一点,如果Avada发布了新版本,则必须从Avada存储库中删除所有文件,添加具有新版本号标签的新文件,然后可以使用以下命令安装新版本:

Pretty simple, added a GIT tag with the version and it can be installed. Very nice! But... I've to maintain this by myself, if Avada releases a new version I've to remove all files from my Avada repo, add the new files with a new version number tag and then I can install the new version with Composer.

另一个问题:插件,Avada附带了一些需要安装的插件:

Another problem: plugins, Avada comes with some plugins which needs to be installed:


  • 融合核心

  • Layerslider

  • Revolution Slider

因此,我需要3个以上的存储库,并且如果要发布新版本,则必须对其进行维护。因此,我已经联系了主题创建者主题融合。我不认为他们不能使用版本控制,的确是这样,他们使用GIT,但是由于Envato的条件,他们不允许我访问。

So I need 3 more repositories and I've to maintain them all if a new version comes out. So I've contacted Theme Fusion, the creators of the theme. I don't think they doesn't work with version control and it's true, they use GIT but they are not allowed to give me access because of the conditions of Envato.

我还有什么其他选择?我现在只使用Composer for Wordpress本身和所有免费插件,但我也想将其用于我的高级功能。 Composer应该使事情变得容易些,但是当我需要维护这些存储库时,情况并非如此。因此,现在我已经将Avada及其插件放入了项目仓库中,但感觉并不好。

What other options do I have? I'm now just using Composer for Wordpress itself and all free plugins but I'd like to use it for my "premium" stuff too. Composer should make things easier, but when I've to maintain those repo's it's not. So for now I've putted Avada and it's plugins in the project repo but it doesn't feel good.

编辑:同时,我在Envato API中发现了一些有趣的东西,可以使之成为可能,请参阅wpackagist存储库上的问题是Wordpress插件和主题目录的Composer镜像。

Meanwhile I've found some interesting stuff in the Envato API which could make this possible, see my issue on the wpackagist repository which is a Composer mirror of the Wordpress plugin and theme directory.

推荐答案

SatisPress 。此工具可让您


将已安装的WordPress插件和主题公开为Composer软件包。

expose installed WordPress plugins and themes as Composer packages.

设置和使用非常简单:


  1. 设置WordPress实例(例如 packages.example.com

  2. 安装并激活SatisPress

  3. 安装并激活高级/付费软件包(插件/主题)

  4. 提供许可证凭据以启用自动更新

  5. 添加访问令牌

  6. 添加存储库并 composer.json / auth.json (或Private Packagist镜像)的凭据

  7. 需要这样的高级软件包: $作曲家需要satispress / my-private-plugin

  1. Setup WordPress instance (e.g. packages.example.com)
  2. Install and activate SatisPress
  3. Install and active premium/paid packages (plugins/themes)
  4. Provide license credentials to enable automatic updates
  5. Add access token
  6. Add repository and credentials to your composer.json/auth.json (or Private Packagist mirror)
  7. Require premium package like this: $ composer require satispress/my-private-plugin

有关更多详细信息,请参阅文档: https:/ /github.com/cedaro/satispress/blob/develop/docs/index .md

Refer to the documentation for more details: https://github.com/cedaro/satispress/blob/develop/docs/index.md

注意:我与SatisPress或Private Packagist无关。

Note: I'm not affiliated with SatisPress or Private Packagist.

这篇关于使用Composer安装高级Wordpress主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆