0

Why my wordpress plugin is not working after I uploaded it to wordpress plugin repository. Is there any requirement of what tool I should use to write it or may be something else?

Here is my plugin repository http://plugins.svn.wordpress.org/ind-css3-pricing-table/

5
  • which error message you getting when trying to activate plugin Sep 19, 2013 at 10:39
  • Your plugin installs and activates fine, however there are runtime errors trying to use it. What exactly do you consider cause by plugin directory?
    – Rarst
    Sep 19, 2013 at 12:33
  • I tested the plugin that I took directly from my computer, and its jquery is working fine, but after I place it to the plugin folder that is the svn gateway and then uploaded it and installed it from the repository, the plugin's jquery won't work at all. It should hide the "Remove Column" button when there are only one column and it should also connecting some input fields with wp-colorpicker.
    – Ari
    Sep 19, 2013 at 13:55
  • And what is different about the install from the repo than on your local machine? Did a js file maybe not get included? Sep 19, 2013 at 15:13
  • All included, but the wp enqueue scripts doesn't seem to work.
    – Ari
    Sep 19, 2013 at 15:46

2 Answers 2

3

You have to develop with WP_DEBUG enabled. And use Firebug or Chrome Console to check for Network/JavaScript errors.

enter image description here

WP is trying to locate the folder /wp-content/plugins/ind_css3_pricing_table and the correct is /wp-content/plugins/ind-css3-pricing-table

1
  • Owwwh.. my dumb.. I didn't pay attention to how wordpress repository write plugin's main folder. I should use " -" instead of " _" . Thank you!
    – Ari
    Sep 20, 2013 at 2:49
4

You can't assume that your plugin will be in either the ind-css3-pricing-table or ind_css3_pricing_table folders all the time. This should not be hardcoded in your plugin. Instead, you can determine the path or URL to your plugin folder using the __FILE__ magic constant in your main PHP file.

$plugin_path = plugin_dir_path(__FILE__);
$plugin_url = plugins_url('', __FILE__);
1
  • Woops, I forgot to show an example...
    – brasofilo
    Sep 20, 2013 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.