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

Themes/Plugin Conflict #735

Closed raphcadiz closed 6 years ago

raphcadiz commented 6 years ago

I'm using TGMPA on my plugin to support installation of add-ons. Everything was working fine until on of the site's theme it was installed is also using TGMPA.

The registered menu is not correct anymore and it follows the one on theme registered on the theme instead of the one below.

'parent_slug'  => 'edit.php?post_type=g2pdf_merge',
'capability'   => 'manage_options',

The other required theme's plugin is now showing on my add-ons list

install gravity2pdf add-ons

Any workaround for this?

GaryJones commented 6 years ago

You've wrongly assumed that your plugin is the only one that's using TGMPA. If your plugin is doing something that makes it display in a different position (apparently in your System Check) tab, then this isn't default behaviour.

raphcadiz commented 6 years ago

@GaryJones exactly my point. I didn't realize that a theme may also be using TGMPA. Now what I am asking is there a way that I can create another menu item base on the declaration of my plugin and display the plugins that I added on items. So basically just another instance of TGMPA

jrfnl commented 6 years ago

The whole point of TGMPA is to have one page from which to install all dependencies from both plugins as well as the theme, so having another instance of TGMPA would go against the principle for which it was build.

GaryJones commented 6 years ago

You could try putting your TGMPA into its own namespace, renaming the class, any globals etc.

Oxibug commented 4 years ago

TGMPA with unique namespace to be included into plugins TGMPA uses Namespace

And TGMPA with unique classes working with themes TGMPA in Classes

Both working together simultaneously in the same site whereas both are prefixed and you will see notifications separately and each one can be dismissed separately.

It helped me a lot, Hope it help you.