URGENT: breaking change in plugin dependency update

[ad_1]

hello @vnoben, sorry for the miss.
I don’t have the pro version of the polylang plugin.

Fixed – can you confirm that everything is OK now (3.4.4)?

Thread Starter
vnoben

(@vnoben)

Hi @marcinkazmierski the fix looks good but sadly does not work, which makes sense if you think about it. The filter you added is inside the plugin code. When the plugin is inactive (auto-inactivated due to the dependency requirement), no code in the plugin runs, hence it cannot change the slug and make it available. I think that’s what happening now.

I see 2 fixes for this:
– Remove the “Requires plugins” header altogether so that existing sites stop breaking and auto-deactivating your plugin.
– Add a big warning in your plugin documentation, with that filter snippet of code that people who use polylang-pro should add that snippet to their theme functions file. But, note that many people will not be developers and will not know where to place it, or use a bought theme that does not allow changes. So this is not a fix I’d advice.

I fear your best option is to remove the header again.

Sidenote: I’m not sure if you can influence this, but packagist only shows the latest version of your plugin (currently still 3.4.3) If it had older versions too, developers like us who use composer could easily revert back to an earlier version while waiting for an update. But this is not possible at the moment.
(https://wpackagist.org/search?q=theme-translation-for-polylang)

Thread Starter
vnoben

(@vnoben)

Note: IF the plugin is active, and the filter is added in an update, then the filter will work and will allow the polylang-pro plugin it seems. In my case where it was already auto-deactivated due to the bad version, and hence it was already to late to work and fix the issue.

  • This reply was modified 46 minutes ago by vnoben.

Thread Starter
vnoben

(@vnoben)

Note: When a user disables your plugin (for testing or whatever reason), even after updating to 3.4.4, they will never be able to re-activate it again as the filter is now in the deactivated plugin code and will not run and not allow polylang-pro.

So again, I think your best option is to remove the header again.

OK, I disabled “Requires Plugins” in 3.4.5 version of plugin.

Thanks for help 🙂

Thread Starter
vnoben

(@vnoben)

No problem, it’s not yet available on https://projectdmc.org/plugins/theme-translation-for-polylang/ but I assume that’s just a matter of time? Same for packagist? Have you considered my suggestion about packagist, allowing multiple version so people can revert to an older version if needed? thanks

packagist – I’ll do it soon 🙂

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer