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: , , , ,


Feb 23 2012

Tweet My Post 1.0 Available

Category: PHP,Programmingksg91 @ 11:11 pm

I have just released an update for Tweet My Post plugin for wordpress. If you are already using it, update it from Plugin menu. You can try plugin by searching for “Tweet My Post” in plugin directory or visit http://wordpress.org/extend/plugins/tweet-my-post/

New version doesn’t have changes to end user but I have updated code internally and added tracking system for me, so that I can analyze plugin usage.

Let me know if you face some problem or issue with this new update. Suggestions are most welcomed.

It’s really nice to see around 400 downloads in just 2 days. Thanks for the support guys. 🙂

 

Tags: , , , ,


Feb 19 2012

Tweet My Post – A WordPress Plugin

Category: PHP,Programmingksg91 @ 10:16 am

I also run a blog at http://NokiaTips.in and we have many authors there. I always wanted a plugin which auto-tweet our new post to our Twitter account @NokiaTips. There are several WordPress plugin available but I wanted more out of that. I wanted that, that tweet should also contain the twitter handle of Author, so that readers can know that post is authored by whom. I searched WordPress’ Plugin directory but couldn’t find one. So, I thought, better to create one, myself.

I have almost finished the plugin. Find its Git repo at Github – https://github.com/ksg91/Tweet-My-Post

I may have some bug. It’s beta release for now tagged 0.9.

If you have any suggestion, please let me know. You can also contribute to Plugin by forking the repo.

Feel free to try the plugin, after all, it’s free. 😉

Tags: , , , ,


Jan 13 2012

Autolink-Twitter : A WordPress Plugin to Autolink the mentions and hashtags

Category: PHPksg91 @ 3:27 pm

WordPress’ official plugin contains some nice plugins that automatically replace mentions and hashtags with links to the profile and search page. But they also brings other several features. I just wanted a simple plugin which does only this thing. I also wanted to learn making plugins for wordpress. So I thought to make one.

So here is a plugin I named Autolink-Twitter. It links mentions to twitter profile page and hashtags to search stream.

Download Plugin: Autolink-Twitter

How to Install?

Put autolink-twitter.php file under your plugin directory and activate plugin from your admin menu.
I haven’t uploaded the plugin yet to wordpress.org library because I think very few people would be interested there.
You may keep up with this plugin on my Git repository on github at https://github.com/ksg91/Autolink-Twitter


Tags: , , ,