WordPress Malaysia

So I just created a new Facebook page for Malaysian who lives & breathe WordPress. I’m not targeting for big numbers, just a platform to interact with all the nice people who shares the same interest. Hopefully it’ll just naturally grow into a community that everyone can be proud of.

Link: Facebook – WordPress Malaysia

For the next few months I’ll be answering any questions, providing professional WP tips & advice on the page. International members & participations are always welcomed. :)

P/S: I don’t do shit half hearted.

Using WP_Filesystem to generate dynamic CSS

A few months ago I wrote an article on how to generate dynamic css file which you can use for storing your css options data, among its many other practical uses. There is no shortage of real world examples where dynamic css were used with little to zero impact on security & performance it might do to your site (with correct implementation), but a few doing_it_right() policemen were not very happy with how we’re using certain functions that’s not “WP compliant” in that tutorial. Therefore here’s another instalment of that method, and a small enhancement to top it off.

Aqua Page Builder

A few months back I have been talking about building some sort of a template builder framework for WordPress themes. I don’t get around to focus too much on the project, so things has been going pretty slow with it. The last few weeks however, after much throttling of my sleeping schedules and passing a few client works; Voilà, the Aqua Page Builder.

Aqua Resizer

Not gonna write a long post here, since I already did a rather concise yet lengthy write-up about the script on WPExplorer.

What the script does basically is to resize and/or crop images from WordPress on-demand. It is easy to use, fast, secure and efficient.

One of it’s most important ingredients is the implementation of WordPress built-in functions, meaning it’s completely native. You know what that means – No more 777 folders, manual querying database for attachment id etc. Just feed in the url and you’re golden.

The script is now singing and dancing on Github so go grab it while it’s hot. If you have issues with it please, please, please post it on its Github issue page, and if the script saved your life please give me your sister’s contact no.


P/S: Thanks to AJ for testing the script and for that awesome looking feature image. I hope you live up to 90 and have many kids.

Using SMOF the smart way

I am rather ecstatic to see the number of interests people had with SMOF, and the growing number of themes already successfully porting it into their themes. It just feels great to see my work benefiting other people.

Anyway, the reason I am writing this post is to raise my concern over a few matters regarding the usage & modifications of SMOF. If you’re planning to use SMOF in your themes, and plan to continue updating it as more features & bug fixes come along in the future then you should definitely read this.

SMOF Documentation

This documentation will serve as a starting point for you to setup SMOF and will be updated from time to time as the SMOF is further developed in the future. Ultimately, I will probably just dedicate a full page documentation on this site, and include a downloadable HTML copy of it on Github. Enough talking, let’s get started.

Dynamically generate static CSS files using php

If you are a premium theme developer, there may be times when you will need to generate dynamic css/js files to be used inside your theme. An example to this is when you want the users to be able to change certain aspects of the CSS including colors, backgrounds, padding, borders etc, or add their own css classes/id’s.

There are a few popular approaches that theme developers used, including directly inserting the css code inside header.php, or call it from a style.php file. Most of these approaches have been explained by Ivan on The best way to create dynamic CSS for your WP theme.

But these approaches have problems of its own. For example, inserting css directly skips the wp_enqueue_style and still adding a few PHP calls to the header everytime the page loads; or using style.php would not only adding more PHP calls, but also require the server to load WordPress twice which is a no-no according to Otto – Don’t include wp-load, please. Worse of all, none of these methods provide an ideal environment for cache plugins like W3 Total Cache. Ultimately, nothing beats the old school way which is a static css (e.g. styles.css) which is then enqueued inside functions.php – and that’s the direction I’m going with this tutorial.