Category Archives: PHP

CakePHP headaches at a glance

@jose_zap has replied to me regarding a tweet of mine comparing CodeIgniter and CakePHP and the different aspects of both technologies.

Since Twitter itself is way restricted into the 140 chars (which I like most usually - less offtopic and media) I will better blog this off here as a couple of things I don't like in Cake.

First of all, I've been doing Cake for a year and a half and have several projects up and running with different web services, sync mechanisms and so on. It's usually one of my preferred platforms (right after WP and Croogo which is actually Cake based) but it doesn't mean that I adore all of the features in it.

Auto recursive models 

By default linking the models in Cake sets a recursive level of 1 - so you get a direct access to level 1 of all corelated models. it is usually nice as you don't have to join or bind models every few requests. The bad part however is that every serious project (and even non-serious ones with more than 10 tables!) gets bloated with so much insignificant data not being used anywhere in the site. When we have a product which has categories and part of an order, which has a user and so on there are lots of queries back there and tons of useless data which leads to reduced performance and page load time. 

Yet again - very useful, especially for non-technicians who have hard time joining and so, but I get different requests from oDesk or local clients with old Cake sites that need optimization and fine tuning cause the site used to work at the beginning but the previous developer uses the standard recursive=1 settings and therefore the more the database records, the more hardcore the end results.


ACL is... well, it sucks big time in my opinion. It has a wrong concepts at the beginning, it is also hard to implement (lots of years technical background and lots of hours, if not days, trying to setup something that needs to be in the core). @jose_zap - I like Croogo's way of setting the jquery matrix of roles and controller actions and predefining the actions for each role. The UI plugin for the standard ACL is too complex in a usability manner and doesn't do the work.

Another thing is the role based auth. Cake does a pretty good job restricting different roles, but the autogeneration of MVC implies that no user-based authentication would be done or so. Another few projects of mine used to fix actions accessible via URL (no controller backend checks) and protecting every single add/edit and listing as index/view from unauthorized data listing. Or in other words - user number 2 is usually able to change the URL and see the listings of user number 3 or click the edit/5 link and edit the records of another user. It is not hard to implement it manually, but it takes time and having the logic predefined and working and generating tens of MVCs from tables opens lots of vulnerabilities out there.


What I don't like here is basically using one table for all translations by default. Once I tried setting different tables for i18n for the different DB tables but it was kinda tough for me to set up the models. Also the multilingual content with the localized data (so to speak i18n with the l10n together) had to be implemented by some third party tutorials with lots of app_controller magic in between.


I had been able to fix all of the concerns above back then. It just happened for them not to be straight forward or workarounds are painful which leads to discomfort while coding or revamping an application.

These are my top concerns for Cake so far. Pretty sure I've had many more back there, but now as I do explore a framework, I usually look for several things first:

  • multilingual support
  • user management
  • security
  • design adaptiveness and plugins capabilities

I think I have some hard time with AJAX as well, but can't recall the specific projects with it. Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati

DX Image Box – Lighbox Croogo plugin

Today I released on github DX Image Box. It's a Fancybox wrapper that hooks in the Croogo plugin system so a developer could easily integrate lightbox integration with two lines of code. 

Last time I was doing Croogo work was in December, but recently I had to do some development on small Croogo-based projects and due to the chance that some of the features are going to be reused later, decided to do some plugin work. This is the first plugin released and I will consider contributing another one or two small thanks to Fahad's work on Croogo. Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati

Twitter using Drupal

Following Dries and Rob Douglas on Twitter I mentioned in the latest updates that Twitter started using Drupal for community site for the dev team. Dries has described in his blog that Twitter migrated to Drupal using one of their community platforms that I really enjoy. While WP has BuddyPress (and that could be ran separately as well) Drupal has few configurations for social platforms and seems like Twitter is using one of them.

There we are - . I would really like to see a feedback from the Twitter dev team for the usability of the platform. It's a well known fact that Drupal is a great platform for developers but has an non-intuitive interface for end clients which is one of the reasons WordPress is so popular right now. Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati

ddsmoothmenu arrow dynamic paths

Working with ddsmoothmenu Smooth Navigation Menu by Dynamic Drive for a WordPress project I encountered a stupid lack of setting to provide image paths dynamically. This is a jQuery-based dropdown menu which seems and works fine but requires a static path to the images. Only two images though, for the arrows down and right, but it would be a serious issue when releasing a website or migrating to a new server.

So I decided to add a new setting configurable through the JavaScript call in your call-menu file where you could use php/java/python/whateva to retrieve the correct path dynamically and just pass it. I'm using v.1.5 and I did 2 corrections:

  1. in the ddsmoothmenu.js file replaced all smoothmenu.arrowimages strings with setting.arrowimages (just changing 'smoothmenu' to 'setting' in these three lines). There are 5 strings to be replaced at lines 75 to 77. What I do is add a new setting for them in the next section.
  2. Adding the paths to the images as a setting. So at the end my call includes the dynamic path to be used in the menus. Since I'm using WordPress, here there is my code for calling the menu:
  2. ddsmoothmenu.init({
  3. mainmenuid: "header_top_menu",
  4. orientation: 'h',
  5. classname: 'ddsmoothmenu',
  6. arrowimages: {down:['downarrowclass', '<?php bloginfo("template_url"); ?>/img/down.gif', 23], right:['rightarrowclass', '<?php bloginfo("template_url"); ?>/img/right.gif']},
  7. contentsource: "markup"
  8. });
  9. Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati

Subscribe to comments has to be integrated

WordPress is still number 1 platform for blogging. Top used blogging functionality is blog posting and commenting to blog threads. 

However, people that comment on a blog post normally have no way to get feedback eventually if anyone comments back in the same post. The post author (and administrator) receives notification for the comment but the comment author, on the other hand, has no natural way to be pinged back for a reply. This is a serious leak in the WP standard functionality. It is at least unethical not to inform someone for the reply (which might occur in a day, month, year even more).

WordPress comes with a standard feed for latest posts and feed for recent comments as well. However subscribing for all comments in a blog or finding a specific thread to subscribe for is not usable and not practical as well. The solution is the Subscribe To Comments plugin that adds a checkbox to the comment form which allows one to subscribe for further comments in the same thread. This is completely optional and up to ones preferences, but instead of breaking the whole conversation because of the 'echoing' this provides the instrumentation for a real communication. uses Subscribe To Comments for 2 years or something, it's integrated in their web service. So why is it not included in the platform yet? Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati

Interview with ThemeForest author Slobodan Kustrimovic – wpcanyon


wpcanyonHello everyone, today we will discuss the hot topics on the Internet and specifically the WordPress platform and some premium hints from the ThemeForest market presented by one of the authors there - Slobodan Kustrimovic (a.k.a. wpcanyon). He is an expert in the WP world and has published few themes on ThemeForest and currently working on a new framework in his passion to constantly improve the quality and usability of his products. 


M: Hi Slobodan and thanks for your time. How are the things going on your side?


S: Hi Mario.

Can't complain, everything is great at the moment. Currently working a new framework that'll give the user even more flexibility and also be a great base on which we'll develop themes faster.


M: Great - can't wait to see your first demo. Where are you from?


S: I'm from a little country in Europe called Serbia, right next to your country. :)


M: What do you do for a living and in your spare time? 


S: I make premium WordPress themes which are sold on ThemeForest and in my spare time pretty much what a typical 22 years old guy does, watching movies, hanging out with friends, getting drunk occassionaly... :)


M: Sounds like fun then - glad that you are able to manage your spare time and still produce such a high quality of templates. I have been exploring the TF market for months and I have noticed your products there and the activity online. How many themes have you released on ThemeForest?

S: We have published 4 themes by now (Lifeline, Brainstorm, Eptonic, Nuance), the latest one was published few days ago. I also developed one theme as a freelancer some time ago that was for ThemeForest.


M: Do you work alone or in partnership with other authors?


S: It's a partnership, Justin is the designer and I am the developer. But there's more to it then just designing and developing, there's testing, making the demo, handling support, writing documentation...

I admire those who do everything alone, it's simply way too much to handle for one person.


M: Indeed. How long does it take for a theme to get "up and running"?


S: About 25 days from the start of designing to submitting the theme to ThemeForest. But we plan to cut that time to about 15 days so we can release 2 themes per month.


M: Pretty ambitious. Which is the most time consuming element in the whole cycle - planning, design, development, testing, release, support, upgrade?

S: Well I can't say for sure about designing since Justin is the designer, but i think development and designing take about the same time and they take the most of the time from the whole process.

Support is also time consuming.


M: Name the most frequently asked questions from your clients via the TF support? What do clients need more or don't understand by default?



1. "The theme doesn't work, it says the stylesheet is missing"

This one is by far the most frequent question all the authors get. The reason is that people are used to just install the theme with the zip they download, but on Themeforest that zip contains more then just the theme so WordPress gets confused. So what the customers needs to do iz unzip it and inside of it they'll find the actual theme zip.

2. "The theme breaks a plugin"

But in 99% of the cases the theme doesn't brake the plugin, it's the plugin that brakes the theme.


M: Where do you go for marketing - are there any specific channels where you popularize your theme or warm up the buyers?


S: The best thing about Themeforest is that you don't need any special marketing, it has a huge traffic and it's very popular. But we do use our twitter account to promote our items a bit. We do plan to start a little website to share design freebies, write tutorials and publish free themes so that'll be a nice way of promoting our themes.


M: What is your weekly load in a time manner for ThemeForest - i.e. how many hours a week do you dedicate on this?


S: Can't say for sure, sometimes i work more sometimes less, depends on the mood i'm in at the time. That's the best thing about premium WordPress themes, you work how much you want. If i have to give a number then i guess it's about 50 hours a week.


M: What was the toughest thing at the beginning? Have you changed the way you work for TF based on the leaks from your first theme?


S: The toughest thing was falling asleep the night we submitted the first theme. :)

I was simply way too excited and a bit terrified so i simply couldn't. I kept hitting F5 to refresh the page every 20 seconds to see if there are any news. And when it was approved and published, well let's just say F5 on the keyboard doesn't work as good as the other keys since then.

I didn't really change the way i work but the way the themes work has certainly changed a lot thanks to tons of suggestions from the customers.


M: I know that feeling of excitement - hopefully you will continue to develop yourself and your themes and have larger challenges to check out!

Where do you see yourself in 1 year?

S: I'm pretty much sure i'll still be making WordPress themes with Justin, no need to change something that works well. And i hope we'll be in the first 20 top selling authors by then.


M: Do you foresee any major change in the way developers and designers create WordPress themes and the ThemeForest market? Probably new fancy changes in WP 3.3/3.4 or another popular product to be themed such as Tumblr? We see the OpenCart category drastically growing up right now.

S: The way developers and designers create WordPress themes for ThemeForest is certainly going to be changing quite a lot in terms of flexibility and usability, not because of WordPress versions but because the auhors try to make every theme better then the one before.

WordPress has alredy evolved into a wonderful CMS and i don't think any major changes will be made. I would like if they improved the current features instead of adding new ones, the shortcodes system definetely needs to be rewritten.

About OpenCart it seems to be getting quite popular, sales are nice, but i don't know much about it.


M: Could you spoil a part of your new framework for the readers - some useful feature or anything for the developers to build against?


S: Well as you know we have that nice content composer, it'll be rewritten so it's more flexible and one awesome addittion will be "live content composer" which will allow the user to also make changes right there on the post/page instead of doing it in the admin.

Content composer Nuance

M: Name your favorite ThemeForest authors and top themes (except yours, of course :) )




1. Orman Clark

2. Kriesi

3. DMThemes



1. Gridlocked

2. Periodical

3. inFocus (you got to admire the sales, 6K+)


M: Are there any regular resources that you follow (online media, blogs, tutorials)?


S: Tons of them :) Here are a few of them: ...


M: OK, that was great - thank you for your time!


S: Thank you for having me :) Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati

Two students presented CodeIgniter research projects

Beyond the training and consulting business I am also part-time teacher for the Technology School Electronic Systems - Sofia and I do teach web technologies and WordPress. As the representer of the Web 2.0 world I took part in mentoring 2 teams for their diploma research assignments based on CodeIgniter.

One of the projects was a music web portal for artists, media, albums and more. Encyclopedia format for music addicts that could easily transform in a front-end manner using the same database structure. It was meant to start as a hard rock and metal project and later easily skinned and themed into other music categories as well. I really do hope to see it ready, as I already saw most pages and the database structure which extended the modeling structure that exists by default in CodeIgniter.

The other project is a social network for places. A mix of the foursquare listing of categories and places and the Golden Pages catalogue, but with better interaction for users, taking advantage of the localization browser services and latest HTML 5 fine tunes. It has a pretty neat design and more than 30 DB tables at the moment and is going to be ready soon. Users in the site could interact to each other and follow the new places being added with their comments. The basic idea is filling in a database of places with location (easy to find in a Google Map) with comments, ratings and more that is built on the CodeIgniter framework. This is a great profiler that helps the PR managers of a company or a restaurant to improve the quality and social skills and keeps the good rating online.

I'm glad to see the enthusiasm of the development process and the improving code quality and feature set. Both teams work hard and would probably take part in competitions with their projects. Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati

WordPress Powerful Forms Plugin – Gravity Forms

WordPress is the most popular leader in the open source web industry and started as a blog platform it developed itself as a grown up and a mature CMS system. Currently more than 4M WP-based websites are out there (I definitely believe they are at least twice as much - the Counter states there are 12M downloads in WordPress 3.1 only, and there are 20M websites on . Nice, huh?

WordPress supports most of the popular modules like posts, pages, users, links and categories, media (for uploads), lots of settings etc. There are some other powerful free mods for caching or SEO as well as 15K public plugins in the repository. However there are few weak points for WordPress sites that take time to create - such as creating forms

Gravity Forms Contact Form Plugin for WordPress

Forms in a website could vary - Contact Form, Registration Form, Enquiries. The basic idea of a form is - fill in content, send to the administrator (or persist in a database). No such default behavior in WordPress and basic plugin functionality is available only.

Gravity Forms is the leader of the "forming industry" out there. When you need a professional help to build your request on the form, Gravity Forms is the answer. I had to do a kick start with the plugin to define a real estates website with step by step confirmation process based on a form. The form itself had 2 branches - so I had to use some conditional logic and define many subforms that were going to persist the data from every step and each step to be defined based on the choice of the previous step. It sounds a bit blurry and yes, it actually is. A true story looking like a real world solution.

What actually made Gravity Forms the answer was the fact that it had in built step-by-step wizard with conditions, with ability to add different field types such as inputs, dropdowns, HTML blocks, file uploaders, email fields (with validations) and more. By default Recaptcha is available and you could integrate only in a step Really Simple Captcha with the Gravity Forms plugin. 

Every field could be validated or not, and the code is CSS-ized big time - with classes and IDs of every single field and block. Honestly there are some things that are not possible in GF - the layout rearrangement currently seems like hell. All fields are bound to a <UL> list as <li> elements. If you need to style the confirmation button - that's OK, you can change it's text or apply an image, but if you want it to be aligned right next to the last element, you definitely need to do some absolute CSS positioning or JavaScript alignment on-the-fly. Pretty bad if your designer hates you. ;)

You can use widget or shortcode to activate Gravity Forms - hiding the description, the title and the steps counter is an option to be done. What helps me big time in GF were the HTML blocks - could be defined everywhere and there you can actually do your magic when the lack of layout manager ties your hands. 

Records from the forms are mailed to you and persisted in the database. The data could be exported and imported in some sample CSV format as well. There is a complete documentation available for the subscribers including 1-year support too - and I really enjoy the support on Twitter which used to be amazing. 

As a supporter of the plugin I joined the affiliate program and started spreading that piece of software. I do enjoy open source big time, but here you pay about monthly updates and 1 year support of the highest quality which shines compared to most of the free plugins on the market. I consider buying the developer license of Gravity Forms for my next forms-based website. Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati

Welcome on board, WordPress

After few months of hardcore research, development and exploration I'm officially adding WordPress as a preferred and well known platform in my CV. Besides the few blogs of mine and couple of small projects based on WordPress we are almost at the end of releasing a new WP-based product with all the fancy things in the platform - custom posts, widgets, shortcodes, theming and so on. It has be a great adventure for me to enter the world of WP and it definitely worths the effort - I'm already migrating some of my other project to WordPress for a reason.

So basically we stay open for any proposals and questions on WordPress theme/plugin development, modifications of the platform, hooking there and using some other on-top frameworks and extensive plugins from the open (and not only) WP libraries. Hopefully we would commit something to the open source community in two months to help the overall development process. Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati