Deploy failing at TASK [deploy : Get WP theme template root]

I ran into a problem with deploys.

I provisioned a droplet and then ran an initial deploy which worked fine.

Subsequent deploys failed at:

TASK [deploy : Get WP theme template root]

The error is:

PHP Fatal error:  Uncaught Error: Class 'Kirki' not found in /srv/www/test.com/releases/20170719083002/web/app/themes/sage/lib/kirki.php:3

I got around it by removing:

--skip-plugins

From:

command: wp option get template_root --skip-plugins

in finalize-after.yml

Hmm we added --skip-plugins recently to avoid plugins that break this command. I wonder what exactly is happening here though.

After only a cursory look, perhaps this raises the question: Should Trellis deploys accommodate themes that are dependent on plugins? Or should Trellis require themes to have fallbacks for situations when plugins are disabled?

Again I didn’t look closely, but maybe this comment suggests that the Kirki plugin has a wrapper class for Kirki:

In case the plugin is not installed, this acts as a fallback ensuring that all CSS & fonts still work.

That is an interesting question.

From a purist perspective, it is obviously bad for a theme to be dependent on plugins.

From a more practical perspective, the reality is that many of us are using plugins for fundamental stuff like theme options and custom fields.

I’d be interested to hear other views on this.

I guess maybe Trellis should just stay out of it. :slight_smile:

I’ve proposed that the task in question just --skip-themes (in addition to --skip-plugins).

Thanks for reporting the issue @treb0r – this improves Trellis deploys.

1 Like