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

Flag if Advanced Custom Fields plugin version is 4.* #702

Open
rebeccahum opened this issue Nov 15, 2021 · 2 comments
Open

Flag if Advanced Custom Fields plugin version is 4.* #702

rebeccahum opened this issue Nov 15, 2021 · 2 comments

Comments

@rebeccahum
Copy link
Contributor

rebeccahum commented Nov 15, 2021

Describe the solution you'd like

On https://docs.wpvip.com/technical-references/plugins/acf-5-and-vip-go/, we prohibit using any ACF version 4:

Please note that while ACF version 5 can be used on most VIP Go sites (at customer discretion), ACF 4 should not be used.

What code should be reported as a violation?

/*
Plugin Name: Advanced Custom Fields
Plugin URI: http://www.advancedcustomfields.com/
Description: Customise WordPress with powerful, professional and intuitive fields
Version: 4.4.4
Author: Elliot Condon
Author URI: https://www.advancedcustomfields.com
Text Domain: acf
Domain Path: /lang
*/

/*
Plugin Name: Advanced Custom Fields PRO
Plugin URI: http://www.advancedcustomfields.com/
Description: Customise WordPress with powerful, professional and intuitive fields
Version: 4.4.4
Author: Elliot Condon
Author URI: https://www.advancedcustomfields.com
Text Domain: acf
Domain Path: /lang
*/

What code should not be reported as a violation?

/*
Plugin Name: Advanced Custom Fields
Plugin URI: https://www.advancedcustomfields.com
Description: Customize WordPress with powerful, professional and intuitive fields.
Version: 5.9.5
Author: Elliot Condon
Author URI: https://www.advancedcustomfields.com
Text Domain: acf
Domain Path: /lang
*/
/*
Plugin Name: Advanced Custom Fields PRO
Plugin URI: https://www.advancedcustomfields.com
Description: Customize WordPress with powerful, professional and intuitive fields.
Version: 5.9.5
Author: Elliot Condon
Author URI: https://www.advancedcustomfields.com
Text Domain: acf
Domain Path: /lang
*/

@jrfnl
Copy link
Collaborator

jrfnl commented Nov 15, 2021

Note: a sniff which looks for this will need to look for both docblocks as well as comments, just in case someone would have changed the format used by ACF itself.

The sniff should probably also use a form of caching for performance, i.e. if the plugin header for ACF has already been seen and verified, bow out for the rest of files. Or do you think it at all likely that a site would ever have more than one ACF installed (ACF + Pro, but possibly with different versions) ?

@rebeccahum
Copy link
Contributor Author

rebeccahum commented Nov 15, 2021

Or do you think it at all likely that a site would ever have more than one ACF installed (ACF + Pro, but possibly with different versions) ?

Definitely. Some do keep multiple versions and only activate one.

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

No branches or pull requests

2 participants