Posts Tagged plugins

Passing Variables To JavaScript In WordPress

Passing Variables To JavaScript In WordPress

We have touched on several complex subjects when it comes to writing plugins for WordPress that make use of JavaScript.  In these articles we discuss built-in scripts, custom static scripts, and dynamic scripts.   Dynamic scripts are the scripts that need access to information from the WordPress application environment in order to function properly, such as passing in a setting stored in the WordPress database or a variable that is calculated within PHP.    There is a simple trick for getting variables into your JavaScript that is quite a bit more elegant than our dynamic scripting approach using the output buffering PHP trick we outlined earlier. In later versions of WordPress (2.2+ if I recall) there is a function that was originally intended for language translation.  It is meant to localize your scripts.   You can leverage this feature to load up a variable array in JavaScript which provides an effective ...

WordPress – plugin does not have a valid header

WordPress – plugin does not have a valid header

We've run into this one a couple of times when publishing our WordPress plugins. If you look closely at the URL when that error message appears you will often find that you have a duplicate "main" file that launches the plugin. All plugins should have a single php file that "runs the show" and it should be named the same thing as the plugin subdirectory. If you have a plugin named "Store Locator Plus" and it resided in the plugin directory store-locator-plus, then the main file in that directory should be called store-locator-plus.php. If that file is missing WordPress will try to guess, and often guesses wrong, what the starting file is. That is one source of the invalid header issue. Another source that we recently ran into was the fact that we had multiple copies of store-locator-plus.php ...

WordPress Plugins – Is Charging A Fee GPL Compliant?

WordPress Plugins – Is Charging A Fee GPL Compliant?

According to WordPress, asking for a fee in order to make a plugin easier to use is not GPL compliant. At least that is what we are being told with regard to our plugins and being de-listed from the official WordPress Plugins Directory. We can still sell our plugins directly via other venues and they will be fully functional within WordPress. However not being listed in the directory has two significant impacts on our business: 1) The WordPress Plugin Directory sends us 90+% of our sales leads. Without those leads we sell 90% less product. The volume of sales, not the price, is what makes it viable for us to continue to provide updates and support. 2) Without a listing in the WordPress Plugin Directory, existing users will not be automatically notified of updates. ...

4 Comments   |   Posted in blog,Web Apps,Wordpress May 13, 2011