Connect with us

Common submission rejection reasons in WordPress plugin review on CodeCanyon (and their fixes)

coding

Common submission rejection reasons in WordPress plugin review on CodeCanyon (and their fixes)

In this post I will detail a list of common code issues that can cause your newly submitted plugins to CodeCanyon to be rejected during the initial review. There are based on my experience, all were found in plugin reviews for the plugins I submitted. Please note that I have submitted only WordPress plugins so far, so, these will be rejection reasons for WordPress plugins only.

Here is the list of submission rejection reasons, that I got so far for my plugins:

Bad code:

update_option('xxxxsettings_changedx', 1);

Good code:

update_option('coderevolution_settings_changed', 1);

Bad code:

if( $ignore_sticky_posts )
$args['ignore_sticky_posts'] = true;
/*if( !empty( $meta_key ) )
$args['meta_key'] = $meta_key;
if( !empty( $meta_value ) )
$args['meta_value'] = $meta_value;*/

Good code:

if( $ignore_sticky_posts )
$args['ignore_sticky_posts'] = true;

Bad code:

<script>
jQuery(document).ready(function(){update_option(1);...\\this code is included directly into a PHP file}
</script>

Good code:

 wp_enqueue_script('my-custom-footer-script', plugins_url('scripts/footer.js', __FILE__), array('jquery'), false, true); \\this script contains the above js code

Bad code:

jQuery('span.wpmovieomatic-delete').html('X').css({'color':'red','cursor':'pointer'}).click(function(){
var confirm_delete = confirm('Delete This Rule?');
if (confirm_delete) {
jQuery(this).parent().parent().remove();
jQuery('#myForm').submit();
}
});

Good code:

jQuery('span.wpmovieomatic-delete').on('click', function(){
var confirm_delete = confirm('Delete This Rule?');
if (confirm_delete) {
jQuery(this).parent().parent().remove();
jQuery('#myForm').submit();
}
});;

Bad code:

<tr><td><div>Hello</div></td></tr>

Good code:

<tr>
<td>
<div>
Hello
</div>
</td>
</tr>

Bad code:

echo '>' . $user->display_name . '</option>';

Good code:

echo '>' . esc_html($user->display_name) . '</option>';

Bad code:

<b>Generated Post Title:</b>

Good code:

<b><?php echo esc_html__("Generated Post Title:", 'your-plugin-textdomain');?></b>

Bad code:

@ini_set('safe_mode', 'Off');

Good code:

ini_set('safe_mode', 'Off');

  • Instead of using file_get_contents, fopen, fread, fwrite, fputs, chmod and such, could you please use the WordPress equivalents. You can access these through the WP Filesystem API.

Bad code:

$image_data = file_get_contents($image_url);

Good code:

global $wp_filesystem;
if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){
include_once(ABSPATH . 'wp-admin/includes/file.php');
$creds = request_filesystem_credentials( site_url() );
wp_filesystem($creds);
}
$image_data = $wp_filesystem->get_contents($image_url);

  • All JavaScript should be written with “use strict” mode on. For example, you can do this with jQuery as follows: (function($) { “use strict”; // Author code here })(jQuery); https://envato.d.pr/zGx3xH

Bad code (this is the content of a  single js file):

var ajaxurl = mycustomsettings.ajaxurl;

Good code (this is the content of a  single js file):

"use strict";
var ajaxurl = mycustomsettings.ajaxurl;update_option('coderevolution_settings_changed', 1);

Bad code:

wp_enqueue_style('movieomatic_thumbnail_css', $src, __FILE__);

Good code:

wp_enqueue_style('movieomatic-thumbnail-css', $src, __FILE__);

Bad code:

$settings_link = '<a href="https://codecanyon.net/downloads" target="_blank" title="Rate">';

Good code:

$settings_link = '<a href="//codecanyon.net/downloads" target="_blank" title="Rate">';

Bad code:

esc_html__('Activate Plugin License', 'textdomain');

Good code:

esc_html__('Activate Plugin License', 'movieomatic-themoviedb-post-generator');

 

And that’s it!

Please keep in mind that these are only a list of issues that were found during review for my plugins from CodeCanyon, you might find also other rejections reasons for your specific code. Please check and follow this full list of WordPress plugin coding requirements from CodeCanyon.

I detailed these issues also in this YouTube video from my channel.

I hope this post helps in the approval process for your CodeCanyon new submissions. 🙂

 

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in coding

About Me:

Szabi Kisded

Hey there, I'm Szabi. At 30 years old, I quit my IT job and started my own business and became a full time WordPress plugin developer, blogger and stay-at-home dad. Here I'm documenting my journey earning an online (semi)passive income. Read more

Sign up for my newsletter and get the YouTube Caption Scraper WordPress plugin for free
(worth 29$)!

All My Plugins In A Bundle:

My AutoBlogging Plugins:

My Online Courses:

A Theme I Recommend:

Featured Posts:

To Top