Title: Need help for WordPress coding standards
Last modified: May 11, 2024

---

# Need help for WordPress coding standards

 *  [boradashvin](https://wordpress.org/support/users/boradashvin/)
 * (@boradashvin)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/need-help-for-wordpress-coding-standards/)
 * My plugin faced rejection due to specific reasons, and I’m seeking guidance on
   resolving these issues. According to WordPress standards, the use of multiple
   prefixes is discouraged. However, my plugin requires the inclusion of both WooCommerce
   and Elementor templates.
 * For instance:
    1. The WooCommerce cart template is incorporated into my plugin. It contains the“
       woocommerce_” prefix, which cannot be altered as it is a standard WooCommerce
       template. An example action hook is:
 *  `do_action( 'woocommerce_before_cart_contents' );`
    2. In the canvas widget template, we’ve utilized an Elementor hook, enabling the
       application of filters. Here’s an example of an Elementor hook in use:
 *  `do_action('elementor/page_templates/canvas/before_content');`
 * I appreciate any guidance on how to address these issues effectively.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/need-help-for-wordpress-coding-standards/#post-17747935)
 * I don’t see the connection right now, and I’m not aware of the rule you mentioned(
   despite very good experiences with WCS in the meantime).
 * Can you please name the specific error message you received?
   And what did you
   test with? With WCS from the composer package, with the plugin checker plugin
   or is it the feedback from the plugin team about your plugin?
 *  Thread Starter [boradashvin](https://wordpress.org/support/users/boradashvin/)
 * (@boradashvin)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/need-help-for-wordpress-coding-standards/#post-17747965)
 * We are Using WCS but no error found in this.
   We got feedback from the WordPress
   plugin teamWe got message from wordpress team**## Generic function/class/define/
   namespace/option names** Remember: Good prefix names are unique and distinct 
   to your plugin. This will help you and the next person in debugging, as well 
   as prevent conflicts.
 * Analysis result:
   # This plugin is using the prefix “woocommerce” for 43 element(
   s).
 * **## Undocumented use of a 3rd Party or external service**
   We require plugins
   that reach out to other services to disclose this, in clear and plain language,
   so users are aware of where data is being sent. This allows them to ensure that
   any legal issues with data transmissions are covered. This is true even if you
   are the 3rd party service.inc/classes/functions.php:1036 $sharing_url = ‘[https://api.whatsapp.com/send?text=*](https://api.whatsapp.com/send?text=*)‘.
   wp_strip_all_tags($args[‘text’]) .’%0a’. $args[‘url’];
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/need-help-for-wordpress-coding-standards/#post-17747985)
 * I would recommend you to send a corresponding answer to the 1st point that your
   plugin uses WooCommerce hooks because you extend their functions. I don’t think
   this is something you can solve technically but should clarify with the plugin
   team.
 * And on the 2nd point, I think you should point out the use of this external service
   to your plugin user in your readme.txt and, if necessary, in other places where
   it makes sense.
 *  Thread Starter [boradashvin](https://wordpress.org/support/users/boradashvin/)
 * (@boradashvin)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/need-help-for-wordpress-coding-standards/#post-17748005)
 * Ok, Thank you!
   Also, one thing we are not able to find prefixes below points 
   using WCS. Is it possible to use the custom rule to find prefixes?**## Generic
   function/class/define/namespace/option names**
 * All plugins must have unique function names, namespaces, defines, class and option
   names. This prevents your plugin from conflicting with other plugins or themes.
   We need you to update your plugin to use more unique and distinct names.
 * A good way to do this is with a prefix. For example, if your plugin is called“
   Easy Custom Post Types” then you could use names like these:
    - function ecpt_save_post()
    - class ECPT_Admin{}
    - namespace ECPT;
    - update_option( ‘ecpt_settings’, $settings );
    - define( ‘ECPT_LICENSE’, true );
    - global $ecpt_options;
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/need-help-for-wordpress-coding-standards/#post-17748016)
 * I’m not aware of any sniff, and I’d say it would be very difficult to do in terms
   of content. You have to make sure that all your functions are unique and cannot
   be used by other plugins, themes, WordPress itself or even PHP. I usually add
   the plugin slug as a prefix, sometimes completely, sometimes shortened, depending
   on the situation.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Need help for WordPress coding standards’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 5 replies
 * 2 participants
 * Last reply from: [threadi](https://wordpress.org/support/users/threadi/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/need-help-for-wordpress-coding-standards/#post-17748016)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
