Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Add 'CF7 tested up to' readme header support #414

Open
maxguru opened this issue May 3, 2021 · 8 comments
Open

Proposal: Add 'CF7 tested up to' readme header support #414

maxguru opened this issue May 3, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@maxguru
Copy link

maxguru commented May 3, 2021

This isn't really a bug but a feature request.

WooCommerce supports the 'WC tested up to' readme header for plugins that integrate with the plugin. I propose a similar 'CF7 tested up to' readme header support (for plugins that integrate with Contact Form 7). Additionally, users that attempt to upgrade Contact Form 7 can be warned about possible issues due to lack of support in other plugins, similarly to how it is done with WooCommerce.

Any thoughts?

@maxguru
Copy link
Author

maxguru commented May 3, 2021

The header 'CF7 requires at least' would also be helpful.

@takayukister
Copy link
Collaborator

Sounds interesting. I think the header naming needs more polishing, though.

@takayukister takayukister added the enhancement New feature or request label May 5, 2021
@maxguru
Copy link
Author

maxguru commented May 5, 2021

To be honest, I think WordPress itself needs to have this feature.

@takayukister
Copy link
Collaborator

Yeah, I think so, too.

There is no way for a plugin to know whether its add-on plugins are used.

@maxguru
Copy link
Author

maxguru commented May 6, 2021

If they are active then they might be used. My thinking was, it would have been nice for WordPress core to have functionality for resolving plugin dependencies. Something similar to composer. Maybe they can switch to that someday. Meanwhile, it would be nice to have some solution that would alert the user about a possible problem prior to updates.

@pwkip
Copy link
Contributor

pwkip commented May 15, 2021

Just one possible approach. What do you think about adding a global variable $wpcf7_third_party_extensions?

This could hold an array of arrays/objects that look something like this:

[
  'contact-form-cfdb7' => [
    'tested_up_to' => '5.4',
    'requires_at_least' => '3.0'
  ],
  'wpcf7-recaptcha' => [
    'tested_up_to' => '5.4.1',
    'requires_at_least' => '5.0'
  ],
]

Then, if you make it filterable,

$wpcf7_third_party_extensions = apply_filters( 'wpcf7_third_party_extensions', [] );

third party plugins would be able to declare WPCF7 support like this:

add_filter('wpcf7_third_party_extensions', function($wpcf7_third_party_extensions) {
    $wpcf7_third_party_extensions['cf7-conditional-fields'] = [
        'tested_up_to' => '5.4.1',
        'requires_at_least' => '5.4'
    ];

    return $wpcf7_third_party_extensions;
});

You could then show upgrade notices based on the information present in this variable. Additionally, there could be a dismissible admin notice if you detect conflicting plugins.

Some potential problems:

  • It will only work for plugins that are activated.
  • It will only work for plugins that have explicitly declared support in this way. (But that's the same for WooCommerce)

@Zodiac1978
Copy link

To be honest, I think WordPress itself needs to have this feature.

There was a time this was an active idea ... resulting in this plugins:
https://de.wordpress.org/plugins/plugin-dependencies/
https://de.wordpress.org/plugins/known-plugin-dependencies/

Starting point was: https://core.trac.wordpress.org/ticket/22316

Additional ideas:
https://core.trac.wordpress.org/ticket/40460
https://core.trac.wordpress.org/ticket/43882

@Zodiac1978
Copy link

The latest solution is this feature plugin: https://wordpress.org/plugins/wp-plugin-dependencies/
(From: https://make.wordpress.org/core/features/)

Although, it only prevents activating the plugin if the dependencies are not met, and it prevents deactivating or deleted if the plugin is required by another plugin.

This line ("Requires Plugins") need to be added in the add-on plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants