Archive for: WordPress Hack

Force WordPress to Check for Plugin Update

Over the weekend I was jumping back into some old code that I wanted to turn into a simple plugin. (That plugin that lets you insert any widget anywhere in your site with a shortcode is now available.) But during the course of my packaging this up, I also wanted to add in the ability to use auto-updating. So that anyone who downloaded my plugins would automatically get any feature enhancements and bug fixes without having to redownload the plugin.

So I found some code api here at CodeCanyon, (WordPress Update Plugin), that will gave me the necessary tools to turn a simple plugin into an auto-updating plugin. But now I ran into a problem. If I wanted to test to make sure the code was working so that the plugin would update, I needed to force WordPress to check and see if there was an update available. So, here’s a little WordPress hack to make this happen.

You just need to run a simple MySQL query (if you don’t like working on the command line you can also use PHPMyAdmin to run this query).

update wp_options set option_value='' where option_name='_site_transient_update_plugins';

Now you can head back to your Admin Plugin area and if there are updates available, you will see them immediately. Hope this little code hack helps you.

Adding a Google Plus Button to WordPress

Google+ is a not only a great social network, but its a great way to advance your social sharing objectives for your website. When someone shares your site or your post using the “+1″ button, it not only shares the link, but it will continue to “share” the link on Google search results. Many times this alone will assist in the decision making process of whether someone clicks on a search result or not.

And while there are plugins that you can use that will auto-insert the Google Plus icon on your site… why waste the overhead of a plugin if you can accomplish the same thing with a single line of code. That’s right, I’m going to show you how to easily add the Google Plus icon/button to your site/post.

Read More→