Quantcast
Channel: admin — WordPress Plugins
Viewing all articles
Browse latest Browse all 2035

Fit My Sidebar

$
0
0

Emailed Author: ## Calling file locations poorly

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

$output .= "

  • Custom Stock Ticker
  • ";

    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.

    In the case of this example, read http://codex.wordpress.org/Function_Reference/admin_url :) That's the function you need.

    ## Hardcoded plugin folder name

    Your plugin won't work via our repository because you hardcoded in the plugin's folder. You've defined your plugin name like this:

    include WP_CONTENT_DIR . '/plugins/fit-my-sidebar/relevad_plugin_utils.php';

    Problem is? That won't be the folder name. The plugin folder name is derived from the name you used to submit your plugin. So if you submitted it as 'Joe's Cool Nameapp' then the folder will be joes-cool-nameapp and not cool-nameapp.

    Please read http://codex.wordpress.org/Function_Reference/plugins_url - you'll notice how we have a __FILE__ parameter used in most examples. If you change your plugin to use that, it will work no matter what the folder name is.

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


    Viewing all articles
    Browse latest Browse all 2035

    Trending Articles