WordPress Portugal

December 1, 2010

Long time no see! I have been working really hard on the OpenTipi project and really soon it will be also available in English, can’t wait to show it’s new looks, its a baby project going into puberty! That’s more than enough to justify my absence and in fact I came here today to speak about something completely different the WordPress community in Portugal. This past weekend we had an informal meeting at this great creative place Lx Factory in Lisbon. It was the perfect environment for this kind of meeting that worked really well. we had a few presentations on different perspectives, the user a Journalist working with WordPress and 2 developers, its always great to get to know how people are using  WordPress what are they problems and how they approach them. Personally I enjoyed the chats after each presentation where we could discuss particular issues raised both by the speakers and the audience. There was also time for some networking and to get to know the new upcoming features for next WordPress release.

The highlight in my  opinion was the plot to make a WordPress hackathon in Lisbon sponsored by the Publico newspaper sometime soon. Let’s make it happen!

working at home vs co-working

September 1, 2010

being a self disciplined person I always thought it would be just perfect to work at home, I was wrong! If you are self employed you have the luxury of controlling your own time(??) and one can almost have the duty of not havng an office and just be anywhere you want and work from there so you avoid the exact same behavior as you had as an employee… that simply does not work for me. I found out that I am more lazy than I though I was, that we need to create some routines and try to avoid doing stuff that needs to be done at home… I simply can’t make the distinction between life and work if I am at home. So we decided to experiment a co-working place and it has been great ever since. The productivity increased considerably we feel more professional :) and we get to talk and discuss ideas with a lot of different people, its a completely different environment.Actually different than a office where you go as an employee. If you can, try it!

I am sure this is not a rule and for others working from home would be just perfect but probably for one week nothing more :)

WP good practices

August 19, 2010

please stop checking if a var is != null and use isset() instead!

Thanks!

Custom Data disappears on Custom Post Types

August 16, 2010

With WordPress 3.0 Custom Post Types came to life and within the project I am working on we started to use them, each post needs to have a set of custom data to associate with. Basically we were adding new posts with custom data and everything was looking fine in the front end, but after a while the custom data would disappear from the blog entry without any post update being performed on the backend… strange strange voodoo. Some checks on the logs and on the database showed no errors so something else was triggering this behavior, there was no voodoo at all this was due to the “autosave” routine performed when you have the “Edit Post” page on the dashboard open.

The problem is that the autosave option does not pass by post the Custom Fields we add to the Custom Post type so when the “save post data” is called those fields are set to blank and you loose your data. Its extremely easy to avoid this by adding an extra hidden field which will work as an id for your custom data form.


echo '<input type="hidden" name="myplugin_noncename" id="myplugin_noncename" value="' .wp_create_nonce( plugin_basename(__FILE__) ) . '" />';

This id will then be used when you save the post data to check if the request came from the “edit post” screen and with proper authorization since this could be triggered at other times.

You can use this code for that purpose:

if ( !wp_verify_nonce( $_POST['myplugin_noncename'], plugin_basename(__FILE__) )) {
return $post_id;
}

Another possible solution is to simple check if the save post data was triggered by the autosave routine and if so discard that request since it will not include your custom data.

Here is the code for that which should be also added before the save data is performed,

if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
return $post_id;

more details here!

…and that’s more than enough on this subject :)

Meeting the “Happiness Engineers”

August 16, 2010

I have been working with WordPress for a while now and I must say it amazes me all the time, maybe its a bit girly to say this but WordPress is beautifully designed and I can’t honestly say it better than that. Should have said that personally to Matt Mullenweg last friday here but what can I say the guy is a legend and you always feel that anything you say to legends will sound stupid… well maybe next time.

WordPress 3.0

June 24, 2010

WordPress 3.0 is out with a lot of exciting things to explore. Custom post types is one of them and this post by Justin Tadlock explains it verry well.

PDT & Xdebug for Mac OS

April 12, 2010

In order to take fully advantage of eclipse while developing php I just finish integrating XDebug with PDT (php development tool for eclipse). I must admit it took me a bit more than I would like to but finally I got it. I will not present here the complete process description, there is no need to reinvent the wheel, but only highligh the missing steps that made me get stuck with it for a little while.

First of all we need to install XDebug, for this you can follow this tutorial.

Give particular attention to step 1, because you need to be sure you are targeting the php instalation for your web browser and not the default one in yout system that you access via the console (they might be different).

Then in step 7 don´t forget the C compiler option CFLAGS='-arch x86_64' otherwise your Apache server will not be able to load XDebuger. This is a missing information on the XDebug install instructions since its system dependent.

After having XDebug installed please reload the phpinfo() page and double check the option set for “xdebug.remote_enable” if this is set to Off you shoudl open the php.ini file and set it to On with the following lines:

[xdebug]
xdebug.remote_enable=On

Save the file and reload the Web Server.  When you Debug as a Web Page  this option will prevent eclipse to hang waiting for Xdebug session to start.

After finishing XDebug installation please add PDT to your eclipse installation via the “install new software” option or you can download directly Eclipse with PDT incorporated.

In order to configure XDebug support in PDT follow the instructions provided with the XDebugGuide and you will be set to go!

Fly higher

April 12, 2010

After deciding that I would quit my job I waited a few more weeks before announcing it. No particular reason, I still had time and I was nervous about the reaction of my boss and co-workers, I kept telling myself that was a stupid thought I was just living my life the way I want the way it makes me happy and no one could say or convince me otherwise. If in one hand I was delaying it on the other hand I wanted to say as soon as possible, take that weight off my shoulders, so someday near the end of January I wrote my resignation letter, print it out and went to my boss office. As soon as I ask for closing the door she knew bad news were coming. We talked for a while and I have to say that she supported me right away. She made her point, “this is not good for the company but I knew you would someday try to fly higher and I am proud of you for taking that step”. It was such a good relieve… then you start telling your colleges some of them want to know what the hell will you be doing, others couldn’t care less, but that’s perfectly normal. The most important thing is that I felt I was in the right path and I felt completely free, I was the owner of my decisions and yes its difficult to stand up in front of everyone and say this is my dream and I am doing it, when you have a nice job and a good lifestyle… but its not on my genes to settle.

31/1/2010

The begining

November 22, 2009

I quit my job.


Follow

Get every new post delivered to your Inbox.