TGMPA / TGM-Plugin-Activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
http://tgmpluginactivation.com/
GNU General Public License v2.0
1.75k stars 431 forks source link

Can I update themes (parent and child theme) using TGMPA? #793

Open lwxbr opened 3 years ago

lwxbr commented 3 years ago

Can I update themes (parent and child theme) using TGMPA? I would like to use this feature because I have themes outside of wp.org that I want to deliver to my customers. Thank you!

PS.: I want to revive this thread that was forgotten since 2018: #729

jrfnl commented 3 years ago

The thread wasn't forgotten, the answer was already there.

No, you can not update themes with TGMPA. TGMPA only handles plugins.

For plugins you can use outside sources, though for WP - and therefore TGMPA - to know there is an update, you need to hook into WP itself and set up some way to poll for new versions. You can set that up by using a combination of the https://github.com/YahnisElsts/wp-update-server and the https://github.com/YahnisElsts/plugin-update-checker packages.

lwxbr commented 3 years ago

@jrfnl, you can update plugins outside of wp.org with TGMPA. The fact is that TGMPA could offer an all in one solution for themes and plugins. It would be possible in a near future?

jrfnl commented 3 years ago

I don't foresee that happening, though a pull request would be taken into consideration.

jrfnl commented 3 years ago

To clarify further: to update a theme from outside sources, you'd still need a mechanism like the above mentioned to hook into WP and poll for updates. That is standard WP functionality, you don't need TGMPA for that.

So the only thing which realistically could fit into TGMPA is listing an update for the parent theme (= dependency). Everything else is already standard WP functionality.

lwxbr commented 3 years ago

Ok, In my case, I have to deploy the theme parent and the child theme via git push. So the number of deploys I have to do is equal to two times the number of customers I work. With only TGMPA in my parent theme, I could upload using mytheme.zip and the rest, TGMPA would install everything and keep my plugins and themes updated. The installation and update of dependencies would be totally independent of manual uploads via .zip, and even my customer could do the update by himself.

So the only thing which realistically could fit into TGMPA is listing an update for the parent theme (= dependency). Everything else is already standard WP functionality.

That quote shows that the only dependency is the first start, the rest could be installed using TGMPA.

jrfnl commented 3 years ago

No, the rest could be installed using standard WP functionality.

TGMPA will not know there is a new zip available unless you do the above described hook-ins and polling, which is outside the scope of TGMPA. There really isn't anything here for TGMPA to do.

I understand your frustration, but when you add the server side setup and polling as per the previously mentioned packages, those updates will automatically be offered by WP. This is not something you need TGMPA for.

Please remember: TGMPA is a dependency management tool, not an update manager.

lwxbr commented 3 years ago

The wp.org repositories are okay, but I have another sources for my plugins and themes, the main issue is the dependencies outside of main repository of Wordpress, right? I understand that TGMPA uses the core functionality of WP for update plugins and themes (TGPMA is a plugin inside a theme, is it right that I named?) I studied the classes of Wordpress Updater, and Updater Skin and that classes TGMPA already make use of and make it well. The only issue is implement the installation of themes, that would be awesome, that would make the update of themes much easier and make the cycle of update complete using wp.org and external sources. My hope is that matter interest more people to keep it implementable in this repository.

jrfnl commented 3 years ago

@lwxbr Please read my previous messages again as I am under the impression that you are missing the point.

TGMPA uses the standard WP (under the hood) functionality to find out whether there are updates available.

For plugins (and themes) hosted on wp.org, any install of WordPress regularly sends an API request to the wp.org server to check if there is a new version available and if so, it will display them on the Updates page, and if the plugin is a theme/plugin dependency, TGMPA will display those updates as well.

For anything hosted externally, WP still checks for updates on wp.org, but won't find updates, so neither WP nor TGMPA will show any updates.

That's what those other packages are about. They allow you to set up a server with version based zip files of your themes/plugins and via the client-side package, you then hook into WP to tell it to also send an API request to that server to ask if there are updates available for the plugin/theme.

All of that is outside of the scope of TGMPA and not something which will ever be inside the scope of TGMPA, so pull requests to add that functionality will not be accepted.

So whether themes are listed via TGMPA or not is irrelevant. Without an API setup which registers with a WP install that there are updates available, the point is moot and you still won't archives what you want.