#1469 Install wordpress theme from versioned zip archive
Closed: Fixed a month ago by arrfab. Opened a month ago by areguera.

Currently, ansible-role-wp copies theme files directly to server nodes. The files copied take css, images and js assets remotely from www.c.o. This model restricts blog.c.o redesign to www.c.o redesign. www.c.o css, images and js assets are already functional for blog.c.o to use however they are not ready to be published in www.c.o, yet.

I would like to discuss the idea of having a wordpress-theme-centos repository to produce a versioned theme artifact in zip format, and update ansible-role-wp to install the specified archived version produced by wordpress-theme-centos in the theme directory of server nodes. Whenever a new version need to be install, the archive version number is updated in ansible-role-wp, and the wordpress user interface used to switch from one version to another. In this model, wordpress themes are accumulated in the theme directory so it might be possible to use them as backup as well.

There is a PR already available in ansible-role-wp, describing these changes along with some screenshots related to blog.c.o theme redesign.


Metadata Update from @arrfab:
- Issue assigned to arrfab

a month ago

Metadata Update from @arrfab:
- Issue tagged with: centos-common-infra, feature-request, high-gain, medium-trouble

a month ago

Ansible applied it and it was manually set to new theme on staging instance : https://blog.stg.centos.org/

Is that looking as you wanted ?
One thing though, it seems that it's unarchiving with name+version :

drwxr-xr-x. 4 root   root   4096 Aug  6 12:54 wordpress-theme-centos-1.0.16

So if I understand correctly, that would mean that a new version bump would just unarchive to a new directory ? wondering about how wordpress metadata parser for themes would find same name for theme but through different directories. I see that it detects the theme version too but it's not displayed in the theme selector easily (just a thought)

Metadata Update from @arrfab:
- Issue priority set to: Waiting on Reporter (was: Needs Review)

a month ago

The menu on the right doesn't look exactly as expected. Some styles seems to be missing there. Here is an example of how it looks on my local workstation (Wordpress 6.5.5):

Screenshot_from_2024-08-07_09-18-46.png

Other than that it looks good to me.

So if I understand correctly, that would mean that a new version bump would just unarchive to a new directory ? wondering about how wordpress metadata parser for themes would find same name for theme but through different directories. I see that it detects the theme version too but it's not displayed in the theme selector easily (just a thought)

Yes. Theme metadata is defined in the style.css file inside the theme directory. It shouldn't produce any conflict to have the same value in the Theme Name field as long as the directory that holds the theme is unique. Here is Wordpress 6.5.5 theme manager presenting two example versions (1.0.17 and 1.0.18) with the same name under different directories:

Screenshot_2024-08-07_at_09-40-12_Themes_Blog_WordPress.png

and in themes filesystem:

egrep -i '(name|version)' wordpress-theme-centos-1.0.1*/style.css
wordpress-theme-centos-1.0.17/style.css:Theme Name:        wordpress-theme-centos
wordpress-theme-centos-1.0.17/style.css:Version:           v1.0.17
wordpress-theme-centos-1.0.18/style.css:Theme Name:        wordpress-theme-centos
wordpress-theme-centos-1.0.18/style.css:Version:           v1.0.18

I am not sure if ansible.builtin.unarchive allows us to remove old files from a directory structure based on the new archive content. Also, wondering about the possibilities of testing new theme versions using wordpress theme preview feature if we apply changes directly to the same directory.

it's running wordpress 6.6.1.
Let me know when you want to test another release somehow and then we you want me to update real https://blog.centos.org with that theme

As work was done for .stg. , can we just close this request ?

Yes. Let's close it. We tested the approach successfully and can open a new one for updates. Thanks @arrfab !

Metadata Update from @arrfab:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

a month ago

Log in to comment on this ticket.

Metadata