Oct 16 2012

Tweet My Post is Back, Working

Category: Programming,Tweet My Post,WordPressksg91 @ 12:48 pm

Sorry for the inconvenience, guys. Tweet My Post was not working for last 4-5 days and I only got to know about that 2 days back.

Being quite busy in office projects, I didn’t have enough time to look after my plugin. But I have already released the hotfix which has solved the issue. Tweet My Post is working again.  Go and update the plugin from your admin panel or download it from http://wordpress.org/extend/plugins/tweet-my-post/ asap.

My plugin uses https://github.com/jmathai/twitter-async library for Twitter API. It uses version 1, which is deprecated. However version 1 should work till March 2013 but it was returning “Page Not Found” error for last 5 days. I don’t have clue what has gone wrong with Twitter API or this plugin and I don’t have enough time to look into that either.

I fixed the issue by changing the version to 1.1 by updating line number 25 in EpiTwitter.php to

[php] protected $apiVersion = ‘1.1’;[/php]

You can also use library’s function to update version to 1.1 by using

[php]$EpiTwitter->useApiVersion(‘1.1’);[/php]

before sending any request.

I’ve sent the pull request already to Github. Author of library will unit test the changes and merge it asap. You can use updated version by downloading it from https://github.com/ksg91/twitter-async until it is merged.

Tags: , , , , , , , ,


May 29 2012

Tweet My Post v1.2 Update

Category: WordPressksg91 @ 2:11 pm

I have just released small update for Tweet My Post WordPress plugin. This update allows you to enable debug log. Response from the twitter will be logged, so that you can find out any issue, if any.

More updates will be coming in few days. This updates will bring custom tweet format, user authentication, etc. Stay Tuned.

Visit http://wordpress.org/extend/plugins/tweet-my-post/ to check out the plugin. Suggestions are most welcome. 🙂

What is Tweet My Post?

It is a WordPress plugin allows wordpress users to set their twitter handle and whenever a new post is published, tweet will be sent with post’s title, link and it’s author’s twitter handle. A sample tweet would be “POST_TITLE – POST_LINK by @AUTHOR” . If Author has not set any handle, only POST_TITLE & POST_LINK are tweeted.

Don’t forget to rate the plugin. 🙂

Tags: , , , , ,


Feb 25 2012

How to Track Your WordPress Plugin’s users?

Category: PHP,Programming,WordPressksg91 @ 7:59 pm

Let me clear this straight, this post isn’t about to create WordPress plugin, but how to track your plugin users (blogs).

I have recently published my first plugin on WordPress’ repository at http://wordpress.org/extend/plugins/tweet-my-post/ and I felt really happy to see the downloads. However, what I was missing was, who are using my plugin. I am not sure if tracking the plugin users prohibited or not by WordPress but I am just tracking the url of blogs, that uses my plugin.

Let’s get back to the point – how to track our plugin’s users. This is a simple thing, but main thing is, this should strike your mind. I am posting this for those who haven’t thought (or not able make this happen). Useful also if you’re planning to make one too.

Plugin has a plugin_activation and plugin_deactivation hook, that means, you can register your functions that are executed every time, your plugin is activated and deactivated.

You need to add following code in your plugin file:
As I mentioned earlier, I have added log_operation($op) in the functions that are called while activation and deactivation. $op is operation, either activate or deactivate. Use  appropriate operation in functions. Then whenever plugin is activated or deactivated, log_operation will be called. That function will create a cURL session and post the data of blog url and activation status to the page on our server. Now, what you need to do is to put following code in a page, let’s call it service.php, which is hosted at your server. What it will do is, add the status in our database. You need to put link to this page in above code as a value of $url variable.  
The code is relatively simple to understand so I’m not explaining it at all. Just replace the database name and user details with yours. You will now need the database. Use following table:

Well, you are not ready to see, who are using your plugin. You can look into your database table and enjoy! 😀

If you’re lazy to open PhpMyAdmin and browse the database, simply make a file which fetches the data and display it. 😉

I have not added this in my initial release of plugin, so I can only track the users who are using it after Tweet My Post 1.0. Actually, I should be able to track old users too, because WordPress first deactivate plugin, update it and the reactivate it, so I should have the data of old users who have update the plugin but WordPress doesn’t execute activation and deactivation hook while updating plugin. I’m not sure if this is a bug or intentional, but I can’t know my old users unless they deactivate and reactivate the plugin.

Anyways, if you have any problem or query, please let me know in comments below or ping me  @ksg91 on Twitter. 🙂

Tags: , , , ,