• Resolved vnoben

    (@vnoben)


    Hello,

    There is a breaking change in your last update regarding topic: https://wordpress.org/support/topic/wp-6-6-and-requires-plugin-header/

    The header is added but it does not consider the use of polylang-pro !!!
    When updating your plugin WordPress will auto disable this plugin for all websites that use polylang-pro plugin and will not allow users to activate it as the dependency is not met.

    This could break all sites that use your plugin in combination with polylang-pro, without the users even noticing. Please fix this asap, before to many users are affected.

    WordPress has provided a filter specifically for this “premium” plugin feature.
    It is at the the bottom of the instruction page that was also shared in the previous support item, under title “New filter” https://make.wordpress.org/core/2024/03/05/introducing-plugin-dependencies-in-wordpress-6-5/ (I tried to add screenshots but those fail to upload)

    • This topic was modified 1 month ago by vnoben.
    • This topic was modified 1 month ago by vnoben.
Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    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 1 month 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.

    Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    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://wordpress.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

    Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    packagist – I’ll do it soon 🙂

    hupe13

    (@hupe13)

    Oh I’m sorry, I didn’t know about PRO version. I’m using the header in my plugin, but there is not a PRO version.

    There is a hook for this https://developer.wordpress.org/reference/hooks/wp_plugin_dependencies_slug/


    I tried to write a function for it, but I’m not satisfied with it yet. But I’m also interested in a solution, so I’ll keep testing.

    Thread Starter vnoben

    (@vnoben)

    @hupe13 The hook was tested but ineffective, as you can read above.
    When placing the filter hook in the plugin code it “works” as long as the plugin is active. As in “it stops wp from de-activating it automatically”. But if a user disables the plugin manually for testing, they will never be able to activate it again without going into the code and changing the “Plugins requires” header manually. Which cannot be expected from most non-developer users. Because code in inactive plugins does not run, so the slug cannot be changed from within the plugin. Maybe polylang itself could include the hook to go from -pro to the default, to make all plugins that depend on it work as long as it is active. But that would break plugins that have already set a dependency on the -pro version, so that wouldn’t be a good solution eighter and will therefor not be implemented by polylang.

    And for developers like ourselves you could suggest putting in it the theme’s functions.php but… Many many sites use bought themes that do not support child themes or custom php functions, and non-developer website owners would not be able to do it and add it, let alone “unbreak” their site if an update has already done it. So for now I would say removing the header was the correct way to go.

    • This reply was modified 1 month ago by vnoben.
    • This reply was modified 1 month ago by vnoben.
    hupe13

    (@hupe13)

    Then it might be necessary to report this to the WordPress Core developers?

    Thread Starter vnoben

    (@vnoben)

    @hupe13 I’ve thought about that too but… To busy today to make a ticket 😅
    Most ideal solution would be if they would allow for an “or” option in the header, for example with a |.
    Like:

    * Requires Plugins: polylang|polylang-pro,some-other-plugin

    I’ll drop this support link in the core slack channel, but I fear they will not appreciate that without ticket 😅
    EDIT: slack conversation: https://wordpress.slack.com/archives/C06U06K50Q5/p1723036896974069

    • This reply was modified 1 month ago by vnoben.
    hupe13

    (@hupe13)

    Thank you. I don’t use Polylang, but I support TTfP in my other plugin.

    Thread Starter vnoben

    (@vnoben)

    @hupe13 @marcinkazmierski
    I’ve had a discussion about this in the “Make WordPress” slack channel.
    You can read up on the conversation here: https://wordpress.slack.com/archives/CULBN711P/p1723040226494739 (+ comments after)

    In short: it is up to polylang-pro (read: not you) to implement that filter, and as long as it does not has it implemented no plugin that depends on it (read: you) should add the header as it will break the plugin on deactivation. So you did correct in removing the header again. Discussion rises to make that more clear in the filter documentation as it is not clear now.

    • This reply was modified 1 month ago by vnoben.
    • This reply was modified 1 month ago by vnoben.
    hupe13

    (@hupe13)

    Thank you very much and sorry again for the trouble. The header is basically a good thing.

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.