Freemius / wordpress-sdk

https://freemius.com
GNU General Public License v3.0
267 stars 77 forks source link

Replace the `WP_FS__` prefix for all defines #404

Open vovafeldman opened 4 years ago

vovafeldman commented 4 years ago

Seems like Envato's guidelines don't permit using WP_ as a prefix for defines as it is reserved for core.

yura-x commented 4 years ago

Hello, Vova! Thanks for your great project! I don't want to create a new issue because it's related to this one.

I was mention that wordpress.org review team requires to check themes with Theme Sniffer plugin: https://make.wordpress.org/themes/handbook/theme-sniffer/ https://github.com/WPTRT/theme-sniffer

After integrating your SDK inside theme this plugin is detecting a huge amount of errors and warnings. Here are some of them:

/freemius/start.php 18 | ERROR | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$this_sdk_version".

/freemius/includes/class-freemius.php 1481 | WARNING | All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$admin_param'.

6544 | ERROR | Themes should not be running regular (Cron) tasks. Found wp_clear_scheduled_hook() 13614 | ERROR | Overriding WordPress globals is prohibited. Found assignment to $pagenow

4627 | ERROR | wp_get_sites() has been deprecated since WordPress version 4.6.0. Use get_sites() instead.

/freemius/includes/debug/class-fs-debug-bar-panel.php 21 | ERROR | Classes declared by a theme/plugin should start with the theme/plugin prefix. Found: "Freemius_Debug_Bar_Panel".

/freemius/includes/l10n.php 22 | ERROR | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "_fs_text".

etc., etc., etc.

It seems that there is no chance to upload theme to wp.org with this version of SDK at the moment?

Do you have any plans to fix these issues?

Many thanks and best regards!

parasshah195 commented 4 years ago

@yura-x, upload the first version of theme without the SDK (and its integration), and then add the SDK in a subsequent update. Less code review for mods (this SDK is being used in hundreds of free and premium plugins and even in popular themes like WPOcean, so rest assured it is accepted well by the community) and your theme will be approved faster.