- This topic has 5 replies, 2 voices, and was last updated 4 years, 9 months ago by Tom.
-
AuthorPosts
-
June 20, 2019 at 2:13 pm #936331Mitch Canton
Hello,
This is likely a somewhat specific issue, but I thought I would bring it up to see if you had any ideas.
When I activate the ‘woocommerce’ module in GP+ it crashes my site. I figured out why.
To further enhance performance and limit conflicts we use a fantastic plugin “Plugin Organizer” to selectively load specific resources on specific pages and post types. For example, we don’t load woocommerce on our calendar page or single events, or our About page, etc…
However, this creates an issue as when we have GP+ woocommerce enabled, it will crash any page and post type that is not set to load woocommerce.
To resolve this, I must either load woocommerce everywhere, even where it is not needed or desired. Or disable the GP+ woocommerce module.
That all said, I guess the basis of my question is: Is there a performant way to only load the GP+ woocommerce module when the main woocommerce plugin is active on the page?
Thanks.
June 20, 2019 at 3:54 pm #936377TomLead DeveloperLead DeveloperHi there,
Our WooCommerce module only loads if WooCommerce is active. We check to see if it’s active by using the
is_plugin_active()
function provided by WordPress.It might be worth checking with the Plugin Organizer devs whether it’s possible to filter that function so WordPress itself thinks the plugin isn’t active on pages where it shouldn’t be.
June 20, 2019 at 3:58 pm #936379Mitch CantonExcellent. Sorry to assume it was your module at fault. It only started happening after I changed to the GP theme so I assumed – and you see what that got me. 🙂
Have a great day.
June 20, 2019 at 4:01 pm #936382TomLead DeveloperLead DeveloperThere might be something we can do better on our end – I’d like to hear what they say.
Thanks! You too 🙂
July 8, 2019 at 7:51 am #952109Mitch CantonJust to circle back on this, I received the following back from the Plugin Organizer dev.
If that function is filtered it can cause issues. The plugin will be deactivated on the plugins page among other things. They could do a check to see if Plugin Organizer is active and use it’s function to determine if the plugin is actually being loaded on that page. There’s a function in the MU plugin they could use. If the $PluginOrganizerMU object exists then Plugin Organizer is filtering the plugin lists. Then inside of a function they just need to add this code to get the list of active plugins.
global $PluginOrganizerMU; $pluginList = $PluginOrganizerMU->disable_plugins(get_option('active_plugins'), 0);
$pluginList will then contain the array of active plugins. You could also add code to your themes functions.php file that will filter their code to get the list of active plugins.
One of the key benefits of Plugin Organizer is the ability to selectively load plugins which prevents plugin conflicts and improves site performance. As is, to use the GP WC module, we will need to activate WC on every post, page, and CPT, even if it’s not being used there.
Not sure if this is something that can be resolved, but I wanted to make mention.
Our site performance has improved significantly since moving to GP last month (thank you!), I’d hate to lose some of those gains just to use the WC module.
Thanks in advance for any consideration.
July 8, 2019 at 3:20 pm #952457TomLead DeveloperLead DeveloperThanks for this! I’ll see what I can do 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.