Behold! Technical Support for WordPress

February 5th, 2010

I got a response from the WordPress Plugin Directory today. Positive! They approved the new plugin’s home so I officialy let the plugin go public this morning. Of course I set up a page on my blog with the complete description, screenshots, feedback section (feature requests are welcome). Check it out – Technical Support for WordPress!

YouTube Preview Image

Thank you for your support and voting at WordPress.org ;)

Permalink, comment (0) or share:
  • Twitter
  • Digg
  • Facebook
  • del.icio.us
  • FriendFeed
  • Technorati
  • Google Bookmarks
  • LinkedIn
  • Ping.fm
  • Identi.ca
  • StumbleUpon
  • Print
  • email

Plugin Development: Technical Support for WordPress

February 4th, 2010

So, you’re a freelancer and you make WordPress powered websites for your clients, cool. Now how many times have you experienced them calling, emailing, texting, tweeting you asking for a core upgrade, plugin upgrade, theme fix or whatever? Well I’ve been experiencing that quite a lot, and that’s a reason to charge an extra monthly fee for support. And with this plugin …

Provide Support to Your WordPress Clients

Provide Support to Your WordPress Clients

Yeah, with this plugin you’ll get rid of the annoying phonecalls and tweets. Technical Support for WordPress (formely called Bug Reporting for WordPress) adds a dashboard widget to the WordPress admin panel, where your clients could file a support ticket in only a few clicks! Pick a topic, write a title, describe the issue, send. Voila! You will receive the filed report by e-mail, well formatted and with all the necessary details. You can then take action, and finally reply to the e-mail when everything’s done.

This is one side of it. The second side is that the plugin is totally customizable, the subject and message format are powered by short tags, the topic list is customizable, and of course the company (provider) name and email address. This means that you can include a certain tag, keyword or whatever to the subject line, say “#CompanyName” then filter that in Gmail or whatever, and make different clients go to different folders. There, no more junk in your Inbox!

Okay there’s a second side, this means that there should be a third. What about branding? The plugin permits you to have a provider name, provider URL and a provider logo! Which will be displayed in your clients’ dashboards and will link directly to your website. That way, your clients will keep you in mind, 24/7! Ok, kidding, but it’s really good for branding..

Now, I know you already want this and can’t wait to download it, but hey, the request hasn’t been approved by the WordPress.org Plugin Directory yet, so as soon as it does, we’ll go live. Meanwhile take a look at these screenshots:

Looking forward to your comments, feature requests, etc ;)

Permalink, comment (8) or share:
  • Twitter
  • Digg
  • Facebook
  • del.icio.us
  • FriendFeed
  • Technorati
  • Google Bookmarks
  • LinkedIn
  • Ping.fm
  • Identi.ca
  • StumbleUpon
  • Print
  • email

WordPress: Extending the Contact Form 7 Plugin

February 1st, 2010

There are tonnes of good plugins for displaying contact forms on your WordPress blog, even a simple comment form without displaying the comments would do just fine, but let’s speak about one called Contact Form 7 written by Takayuki Miyoshi. I don’t think there’s a reason behind the number 7, perhaps it meant the year 2007, when Takayuki published the first version of his plugin.

Adding the Source URL Module to Contact Form 7

Adding the Source URL Module to Contact Form 7

First of all I’d like to note that he plugin is very well written, it’s very, and I mean VERY flexible, and only due to its flexibility we’re allowed to extend its functionaltiy. Of course Takayuki’s probably missed some filters and hooks that other plugin and theme developers would love to see, but the modules directory is good enough, despiting the fact that it’ll probably be erased and rewritten after an ongoing plugin update.

Now, suppose you have designed a placed a contact form in your sidebar as a widget, using the Contact Form 7 shortcode. It’s got all the necessary fields, AJAX powered form, Akismet spam check & so on. But we’re missing something. Contact Form 7 is located in your sidebar, which means that you’re displaying it on most (if not all) of your posts and pages. Now when somebody writes a message via your contact form, you’re left guessing which page the visitor was viewing while typing.

This may be crucial in e-commerce situations, say you’re selling books from your blog, and a visitor contacts you to ask “who’s the publisher of this book?” or “how many pages does this book have?”. So you received an e-mail and you have no idea which book is being mentioned. You’re lucky if you only work with one publisher, or all your books are 100 pages long ;)

Anyways, let’s create a new file in the modules folder of the plugin, and call it sourceurl.php:

1
2
3
4
5
6
7
8
9
10
11
12
wpcf7_add_shortcode('sourceurl', 'wpcf7_sourceurl_shortcode_handler', true);
 
function wpcf7_sourceurl_shortcode_handler($tag) {
	if (!is_array($tag)) return '';
 
	$name = $tag['name'];
	if (empty($name)) return '';
 
	$html = '<input type="hidden" name="' . $name . '" 
		value="http://' . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"] . '" />';
	return $html;
}

This is very easy to understand once you’ve read (and understood) what’s written in the other modules. Try to take a look at text.php for a while, it includes the code for both text and e-mail fields. I copied some of the code for the text fields, simplified it a little and removed the validation process (why validate our own URL?), and voila, 12 lines of code ;)

Save the file and go to your Contact Form 7 settings in your WordPress admin panel. Select the contact form you’d like to add source URL to and in the part where it says “Form” add the new short code (sourceurl) and give it a name (thesource):

1
[sourceurl thesource]

Now you can use “thesource” in your Mail part of the contact form settings, say:

1
Source URL: <a href="[thesource]">[thesource]</a><br />

Then look for the new Source URL in your e-mail ;) So if you’ve used more than one contact form on several different pages, just to distinguish them in your emails, you can merge them into one now. You can use a similar way to add other interesting data to your e-mails such as, say the user’s IP address for instance, browser capabilities, etc.

Permalink, comment (2) or share:
  • Twitter
  • Digg
  • Facebook
  • del.icio.us
  • FriendFeed
  • Technorati
  • Google Bookmarks
  • LinkedIn
  • Ping.fm
  • Identi.ca
  • StumbleUpon
  • Print
  • email

From MySQL GUI Tools to MySQL Workbench

January 27th, 2010

I bet that some of you still work with phpMyAdmin and there are plenty of good reasons for that. Perhaps the main reason would be its mobility. Being run by a web server, phpMyAdmin is accessible from anywhere, without installing any extra software, even on the mobiles phones. And the second reason is of course security – most web hosting providers restrict external access to MySQL servers. But there’s absolutely no reason to get used to phpMyAdmin, as there’s software far better than that.

Drop that phpMyAdmin Stuff, it's for Kids! ;)

Drop that phpMyAdmin Stuff, it's for Kids! ;)

Most of you probably used the MySQL GUI Tools bundle, which is very similar to what phpMyAdmin is – database tweaking, user management, structure design, query builder, etc. Browsing up to the usual MySQL GUI Tools place a few days ago, I encountered the following message:

Users of the MySQL GUI Tools Bundle should plan to upgrade to MySQL Workbench. MySQL Workbench provides DBAs and developers an integrated tools environment for:

  • Database Design & Modeling
  • SQL Development (replacing MySQL Query Browser)
  • Database Administration (replacing MySQL Administrator)

So we’re now forced to upgrade to MySQL Workbench. Honestly, for a moment there I though that it’s just a naming issue, and that MySQL GUI Tools has gone so far, that the guys from Sun Microsystems decided to ship the bundle as a single product – MySQL Workbench, but I was wrong. Browsing the MySQL Workbench website I noticed the archive, which dates back to Novermber 8th, 2007! So it seems that they’ve just merged the two pieces.

MySQL Workbench is far more professional then the GUI Tools, but may be complicated at first sight. And the most funny thing about it is that the MySQL GUI Tools leads to a page to download the 5.1 community version of MySQL Workbench, which unfortunatelly does not have all the promised features (SQL development, data modelling, server administration), and there’s no home screen at all, which is shown on each and every screenshot related to the move!

I thought something was wrong, so I went back to the Workbench homepage, browsed the blogs, forums and downloads. It turned out that 5.2 is the one we were supposed to move to, but it’s still in beta, thus hidden in the downloads. After installing MySQL Workbench 5.2 I finally managed to get to the promising home screen, a little bit fancier than 5.1, and very similar to what we used to see in MySQL GUI Tools, plus the improvements.

Here are a few screenshots:

So I hope to see the 5.2 release very very soon, and, oh come on, drop the phpMyAdmin stuff, that’s for kids ;)

Permalink, comment (9) or share:
  • Twitter
  • Digg
  • Facebook
  • del.icio.us
  • FriendFeed
  • Technorati
  • Google Bookmarks
  • LinkedIn
  • Ping.fm
  • Identi.ca
  • StumbleUpon
  • Print
  • email

Twitter Robot in PHP: Twibots Draft

January 25th, 2010

As I promised quite some time ago, I’m putting out a draft of the Twitter Robot I wrote. Make sure you read Create Your Own Automated Twitter Robot in PHP before going on. The current functionality is as follows:

  • Tweets around the clock
  • Tweets from RSS feeds, supporting prefix and postfix text (for adding hashtags)
  • Retweet via the Twitter Search API and build conversation lists
  • Shoot random sentences at users who mention you, thank them for retweets
  • Control your robot via your own Twitter account by sending him direct messages
  • All this is Twitter OAuth powered, no password required
  • Such robots are called Twibots

Create Your Own Twitter Robot in PHP

Create Your Own Twitter Robot in PHP

Now, before downloading the code, I have to warn you that it’s completely unorganized. The code is horrible, comments are awkward, the database being used is SQLite (just for the fun of it) and it’s very very glitchy. Be prepared for Twitter suspending your account for ’strange activity’ and use this at your own risk, don’t run here blaming me for that ;) I also suggest you’d contact Twitter to get your IP addresses and Twitter account white-listed before you start, especially if you plan to tweet very often (which I wouldn’t recommend). Use this at your own risk, and please keep my copyrights and preferably the OAuth application IDs.

Download: here (version 0.1)

Operation Instructions.. To say the truth it’s pretty tough, no web interface, not buttons, no config files. There are a bunch of files there, some of them useless. There’s the Snoopy class for reading and parsing RSS, there’s the Twitter OAuth class, and two core php files – cron.php and oauth.php. Open up cron.php, there are some comments and examples there. Make sure you get your own bit.ly API key and secret. Also make sure you get a connection with the twibots.sqlite database which has a couple of empty tables. Those will be used for tokens and dump data for unrepeated tweets.

Once you’re done configuring, use the command-line php in order to make it work. It goes something like this:

# php cron.php oauth register
# Please browse to https://twitter.com/…
# php cron.php oauth validate 123465
# Authentication successful, greetings @ev ;)

# php cron.php random
# tweeting a random RSS feed …

# php cron.php reply
# sending replies…

# php cron.php dm
# reading direct messages

# php cron.php retweet
# retweeting…

You’ll have to put that in your crontab file and launch by schedule. Don’t run them too often though, as Twitter doesn’t like flooding, especially from newly created accounts. Any questions or suggestions are welcome in the comments below, but please, don’t tell me the code is horrible, I know it is, and I wouldn’t have posted it if you didn’t ask ;) Cheers!

Permalink, comment (4) or share:
  • Twitter
  • Digg
  • Facebook
  • del.icio.us
  • FriendFeed
  • Technorati
  • Google Bookmarks
  • LinkedIn
  • Ping.fm
  • Identi.ca
  • StumbleUpon
  • Print
  • email