WordPress 4.3 new formatting shortcuts

Hi guys,

I am pretty excited to see WordPress 4.3’s new formatting shortcuts. It makes blogging life lot easier with newly added formatting shortcuts. Here I am going to list those shortcuts for you.

  • Use ## to make a text h2, ### to make a text h3 and all the way to h6.  (By the way no h1 is available, so you can’t just use one #, perhaps another approach ?)
  • Use * (asterisk) or – (dash) to create an unordered list. Make sure you give a space after the asterisk / dash. However I found it little bit difficult to create an unordered list with dash, so I always use asterisk.
  • Use 1. or 1) to make an ordered list. Make sure there’s no space between the 1 and dot but a space after the dot. However I found it little bit difficult to create an ordered list with 1) over 1(dot). So I always use 1(dot).
  • Use > to make a quoted text. Once again make sure you give a space after the greater than sign.

These are the shortcuts what I have found so far, but there will be more in future. Text formatting shortcuts is not the only new feature in WordPress 4.3. Watch this video below to see new features in WordPress 4.3. Continue reading


Symfony 2, five quick tips

Hi all, today I am going to share with you five quick, but important tips in Symfony 2 programming.

  1. Use bundles where appropriate, such as to wrap set of reusable functionalities (business logic), reusable services and reusable views. But, don’t over use bundles as this will include unnecessary headache on performance and maintenance in long run.
  2. If you use a functionality in more than five different places, make it as a services function (Service container) . Also you might need to inject varies different services to the services class (Injecting services). In that case make sure you inject starting from the most specific to most generic service. If possible try not to inject big entities such as Container, unless you left out with no other option.
  3. Make the view less brainy. What I mean by that is, let the view (such as twig) to do less work than the Controller. In some rare cases this can be hardly achievable but in most cases you could easily make the view less brainy by doing most of the logical operations inside the Controller, Repository, Services etc. Let the view to render without it doing complex logical operations.
  4. Use Doctrine Queries Language (DQL) to query data instead of Repository class (such as $em->getRepository()) to get the maximum efficiency of your project. If you are querying from one table, using either option won’t make a big difference. But if you are querying varies tables through joins, definitely use DQL.
  5. In terms of security, try not to send parameters in the URL as it is, if possible (including non sensitive parameters). What I mean by that is, if you use URL patterns like this ‘route_to_page/{id1}/{id2}’, encrypt those ‘id1’ and ‘id2’ through a custom encrypt function created by you. Then decrypt (using a custom decrypt function created by you) those ‘id1’ and ‘id2’ in the Controller to continue with your logic.
    (Ideally through an injected services class which contains your security functionalities – How to create and inject services ? )
    See below,

Continue reading