Quantcast
Viewing all articles
Browse latest Browse all 2035

MiwoVideos Lite - Share Your Videos

Emailed Author: There are issues with your plugin

## Calling files poorly

The way your plugin is referencing other files is not going to work with all setups of WordPress.

$miwi = ABSPATH.'wp-content/miwi/initialise.php'; for example

When you hardcode in paths, or assume that everyone has WordPress in the root of their domain, you cause anyone using 'Giving WordPress it's own directory' (a VERY common setup) to break. In addition, WordPress allows users to change the name of wp-content, so you would break anyone who choses to do so.

Please review http://codex.wordpress.org/Determining_Plugin_and_Content_Directories and update your plugin accordingly. And don't worry about supporting WordPress 2.x or lower. We don't encourage it nor expect you to do so, so save yourself some time and energy.

## Including a zip

$zip_file = ABSPATH.'wp-content/plugins/'.$this->context.'/miwi.zip';

There's no reason for this. You should just expand the zip in the plugin. Except that sub-zip also has issues.

## Calling wp-load directly

Including wp-config.php, wp-blog-header.php, wp-load.php, or pretty much any other WordPress core file that you have to call directly via an include is not a good idea and we cannot approve a plugin that does so unless it has a very good reason to load the file(s). It is prone to failure since not all WordPress installs have the exact same file structure.

Usually plugins will include wp-config.php or wp-load.php in order to gain access to core WordPress functions, but there are much better ways to do this.

It's best if you tie your processing functions (the ones that need but don't have access to core functions) into an action hook, such as "init" or "admin_init".

Please consult the Plugins API reference for more information: http://codex.wordpress.org/Plugin_API

If you're trying to use AJAX, please read this: http://codex.wordpress.org/AJAX_in_Plugins

For other possibilities, or to better understand why we disallow this, read this: http://ottopress.com/2010/dont-include-wp-load-please/

When you've corrected your code, reply to this email with the updated code attached, or provide a link to the new code.


Viewing all articles
Browse latest Browse all 2035

Trending Articles