Thursday, November 20, 2014

Few good Tricks To Improve Your WordPress Theme

Improve your WordPress Themes

In WordPress, the “Themes” play a vital part in making one’s site look unique and impressive. To that fact, there are thousands of themes available for the users to choose from and download, these are either offered for free or for a premium. However, did you know all these themes can be further tweaked in order to get better optimization, features or customization?

Well, let’s have a look at few simple yet effective tweaks that can be done to your WordPress themes, to offer better and safer experience to your website visitors.

Theme Images

Images are the primary part of most themes; they are on the logos, the backgrounds, icons and so on. However, WordPress theme developers sometimes fail to realize that their high resolution/high quality images are actually doing more bad to the theme users than good.

How? A high resolution image may make the theme look very pretty and luring, but, what they are also doing is, drastically increasing the load time of these images. When we factor that there are multiple images within a webpage; we can assume how greatly they would affect the total load time or bandwidth consumption - resulting in a very slow website altogether, which we don’t want.

Hence, by optimizing these images we can ensure for a better web experience for our website users. To do that we need to use photo editing tools (for example “Photoshop”), and reduce the image’s resolution through quality settings. Lowering the resolution up to the point just before where the image starts to have a hit on its color or quality would be your sweet spot. Also, some tools offer you options to reduce image file size without making much change to the image’s quality.

This should effectively speedup the theme.

PHP Flush

Like the above step, the purpose of this function is to make your WordPress blog load faster too. A PHP flush should be added immediately after the header, this forces the server to send the header content before rest of the website.

<?php flush(); ?>

What this does is give the browser enough time to load stylesheets in the header reference when it’s waiting for other contents of the webpages to load.

Favicon

Favicon makes your website look professional. But, what is a favicon? It is the icon that you see on the browser’s address bars. Some themes do not come with it by default, in-order to add one you can do the following.

<link rel="icon" href="favicon.ico" type="image/x-icon" />

The “href” refers to the favicon file. Adding this code within the header.php found inside the theme’s directory should get your icon up on the bar.

Theme Security

Hackers and other such malicious users can take advantage of various weaknesses within a specific version of the WordPress to attack your website. What makes it ironic is that, your WordPress version is displayed right on the header.

So, what do you do? There’re few steps you can take to get your website protected – that is by removing the displayed version number altogether. The generator code is placed within the <head> tags of the theme.

Step 1

  • Check if the following line is present in the header.php <meta name="generator" content="WordPress <?php bloginfo(’version’); ?>" />
  • If yes, then remove it, as it prints the version number as the <meta> tag.

Step 2

  • Now, under functions.php (you can create one if it does not exist, using “source code editor”) past the following: <?php remove_action('wp_head', 'wp_generator'); ?>
  • This ensures that the version number won’t be available through wp_head()

Login Errors

Hiding your login errors is another way of protecting your themes too. The reason being that when a person types in a wrong password or a wrong username this error code reveals the exact type of error to the users.

That is; when one type’s in a wrong username the message states its so, giving the potential hacker a confirmed feedback. And when the password alone is wrong, it states that too, ensuring to them that a username is valid, which only requires from them to hack for the password.

So, to remove this - add the following line under functions.php.

add_filter('login_errors', create_function('$a', "return null;"));

Making these minor changes to your wordpress theme, will ensure that it better optimized for safer and faster browsing experience.

Tuesday, November 4, 2014

Why to choose ruby on rails to develop a website?

Ruby on Rails

Ruby on Rails is a hot open source web app framework that’s written using the Ruby language - a general purpose programming language that was developed to keep the object-oriented part of coding intact. Through recent years the number of dedicated followers of Ruby on Rails has increased by large. It’s being enthusiastically used by web app developers who appreciate the clean and elegant coding structure when programming.

This framework allows for us to run web applications and provides us with a platform to build new web pages on. With that you can gather information from the server, query the database or manage templates under a secure interface using the ruby on rails CMS (Content Management System).

Also, the Rails framework gives a simplified and easier approach towards developing a website or an app, by coming up with abstracts for common and repetitive tasks. This enables Ruby on Rails developers to deliver speedier projects, thus making it a serious contender to the position held by PHP. Rightly so you can find numerous arguments over which one is better for the development of their next website. Now, let’s have a look at what makes Ruby on Rails the right choice.


Facts of Ruby on Rails

Here are few statements that you hear often when the conversation is about RoR.

  1. The Framework of RoR is mature” - this is true as the Ruby is built on a much advanced foundation, thus granting us a much easier approach towards developing a high-end product faster and more efficiently. Also, being built on top of solid foundation allows for it to offer a stable maintenance solution. In comparison a PHP website is very weak to tweaks and changes, as the coding most often do not follow a fixed structuring making it very hard for future modifications or additions.

    Ruby offers lots of open source contents that are extremely helpful in cutting down on initial development costs, which proves to be game-changer in multiple occasions, for many developers.

  2. “It’s difficult to write bad codes in RoR” this may seem fictional, however that’s very close to reality. Again taking PHP as an example - one of the major advantages of PHP was that it was very easy to pick up and start working with, this enabled lot of developers to flush in with many PHP products under least amount of time. But, trouble brew when bugs where discovered or when contents where needed to be amended, that’s when the easy its structuring proved to also be its major down point.

    Now with Ruby on Rails, the rules are strict and structure and flow of coding is mature. This allows for easy changes and bug fixing, which means lower maintenance cost. RoR can be said as – “hard work to begin, but easy work to sustain”. This brings to the next fact.

  3. “RoR has a very steep learning curve” Yes, that’s true too, like mentioned above this fact about Ruby on Rails, actually proves to be its advantage. You don’t have to worry as-much about the quality of projects coming out of a RoR developer, as with other easy to learn development tools. One cannot get away with bad coding here, thus, this toughness filters all the posers from the skilled developers.

Note: Use of agile development is recommended by the Ruby community, for apps with ever-changing requirements.

Features of Ruby on Rails


Here’s a list of features that make RoR a very potent tool for programmers.

  • The open source nature of ruby on rails provides the programmers with a vast library of codes, which allows for fasters and more efficient programming.
  • The programming structure of RoR is consistent throughout, that allow rails developers to move between different projects.
  • The framework of Rails makes it easy for a Ruby developer to make changes to the application as and when needed, without much trouble.
  • Ruby programming uses a very readable coding style, such that they themselves serve as documents for other developers or future references.
  • Rails being open source requires no licensing, thus leaving you to focus your cost on rails hosting services and kind.

However, there are certain down sides to Ruby on Rails as well, which includes that fact that not all website hosts support Rails at the moment. This is because Rails is resource intensive when in comparison to the other popular programming tool - the PHP. Then, unlike Java or PHP, Rails is not as popular either, it is gaining in popularity but, has a long way to go. Finally Rails isn’t as fast as related programming tools – Java or C.

Conclusion

Despite these minor setbacks Ruby on Rails has in offer a very elegant and powerful development tool that is apt for today’s modern website and mobile application needs; hence, as a reputed developer we provide you with just that.