Author: Saim Khalid

  • Features of Ruby

    Ruby language has many features. Some of them are explained below:

    Features of Ruby
    • Object-oriented
    • Flexibility
    • Expressive feature
    • Mixins
    • Visual appearance
    • Dynamic typing and Duck typing
    • Exception handling
    • Garbage collector
    • Portable
    • Keywords
    • Statement delimiters
    • Variable constants
    • Naming conventions
    • Keyword arguments
    • Method names
    • Singleton methods
    • Missing method
    • Case Sensitive

    Object Oriented

    Ruby is purely object oriented programming language. Each and every value is an object. Every object has a class and every class has a super class. Every code has their properties and actions. Ruby is influenced with Smalltalk language. Rules applying to objects applies to the entire Ruby.


    Flexibility

    Ruby is a flexible language as you can easily remove, redefine or add existing parts to it. It allows its users to freely alter its parts as they wish.


    Mixins

    Ruby has a feature of single inheritance only. Ruby has classes as well as modules. A module has methods but no instances. Instead, a module can be mixed into a class, which adds the method of that module to the class. It is similar to inheritance but much more flexible.


    Visual appearance

    Ruby generally prefers English keyword and some punctuation is used to decorate Ruby. It doesn’t need variable declaration.


    Dynamic typing and Duck typing

    Ruby is a dynamic programming language. Ruby programs are not compiled. All class, module and method definition are built by the code when it run.

    Ruby variables are loosely typed language, which means any variable can hold any type of object. When a method is called on an object, Ruby only looks up at the name irrespective of the type of object. This is duck typing. It allows you to make classes that pretend to be other classes.


    Variable constants

    In Ruby, constants are not really constant. If an already initialized constant will be modified in a script, it will simply trigger a warning but will not halt your program.


    Naming conventions

    Ruby defines some naming conventions for its variable, method, constant and class.

    • Constant: Starts with a capital letter.
    • Global variable: Starts with a dollar sign ($).
    • Instance variable: Starts with a (@) sign.
    • Class variable: Starts with a (@@) sign.
    • Method name: Allowed to start with a capital letter.

    Keyword arguments

    Like Python, Ruby methods can also be defined using keyword arguments.


    Method names

    Methods are allowed to end with question mark (?) or exclamation mark (!). By convention, methods that answer questions end with question mark and methods that indicates that method can change the state of the object end with exclamation mark.


    Singleton methods

    Ruby singleton methods are per-object methods. They are only available on the object you defined it on.


    Missing method

    If a method is lost, Ruby calls the method_missing method with name of the lost method.


    Statement delimiters

    Multiple statements in a single line must contain semi colon in between but not at the end of a line.


    Keywords

    In Ruby there are approximately 42 keywords which can’t be used for other purposes. They are called reserved words.


    Case Sensitive

    Ruby is a case-sensitive language. Lowercase letters and uppercase letters are different.

  • What is Ruby

    Ruby is a dynamic, open source, object oriented and reflective programming language. Ruby is considered similar to Perl and Smalltalk programming languages. It runs on all types of platforms like Windows, Mac OS and all versions of UNIX.

    It is fully object oriented programming language. Everything is an object in Ruby. Each and every code has their properties and actions. Here properties refer to variables and actions refer to methods.

    Ruby is considered to follow the principle of POLA (principle of least astonishment). It means that the language behaves in such a way to minimize the confusion for experienced users.


    History of Ruby

    Ruby is designed and developed by Yukihiro “Martz” Matsumoto in mid 1990s in Japan.


    Idea of Ruby

    Perl is a scripting language but comes under the category of Toy language. Python is not fully object oriented language. Ruby developer Yukihiro “Martz” Matsumoto wanted a programming language which is completely object oriented and should be easy to use as a scripting language. He searched for this type of language, but couldn’t find one. Hence, he developed one.


    The name “Ruby”

    The name “Ruby” originated during a chat session between Matsumoto and Keiju Ishitsuka. Two names were selected, “Coral” and “Ruby”. Matsumoto chose the later one as it was the birthstone of one of his colleagues.


    Ruby Early Years

    The first public release of Ruby 0.95 was announced on Japanese newspaper on December 21, 1995. Within next two days, three more versions were released.

    Ruby was localized to Japan. To expand it, the Ruby-Talk, first English language Ruby mailing list was created.

    In 2001, first Ruby book “Programming Ruby” was published. After its publishment, learners of Ruby throughout the world increased.

    In 2005, they released their first Ruby framework “Ruby on Rails”. The framework release was a big success and the Ruby community increased incredibly.

    Ruby 1.8.7 was released in May 2008. At this point, Ruby was at its peak so much that even Mac OS X began their shipping with built-in Ruby.


    Ruby in Present

    The current Ruby version 2.4.0 was released on Christmas in 2016. It has several new features like improvement to hash table, instance variable access, Array#max and Array#min.


    Future of Ruby

    Ruby is a great object oriented scripting programming language. Looking at its past we can say that it has a bright future if its community members continue expanding it beyond the thinking.


    Ruby Versions

    There are many Ruby versions that have been released till date. Current stable Ruby version is 2.4

    • Version 1.8 (4th Aug, 2003)
    • Version 1.9 (25th Dec, 2007)
    • Version 2.0 (24th Feb, 2013)
    • Version 2.1 (25th Dec, 2013)
    • Version 2.2 (25th Dec, 2014)
    • Version 2.3 (25th Dec, 2015)
    • Version 2.4 (25th Dec, 2016)
    • Version 3.0 (Future Release)
  • Ruby Tutorial

    Ruby tutorial provides basic and advanced concepts of Ruby. Our Ruby programming tutorial is designed for beginners and professionals both.

    Ruby is an open-source and fully object-oriented programming language.

    Our Ruby tutorial includes all topics of Ruby such as installation, example, operators, control statements, loops, comments, arrays, strings, hashes, regular expressions, file handling, exception handling, OOPs, Ranges, Iterators. etc

  • Free vs Paid WordPress Theme

    As you already know there are two types of WordPress themes, one is paid (premium) and other one is free. Both are from WordPress community but they possess some differences in their functionality. For some users free themes may be suitable and for some users premium themes may be suitable. It all depends upon their need. A huge number of WordPress themes are available as free but still people go for premium themes. There are multiple reasons why one should go for paid one.

    Let’s have a look on some of the functions of free as well as premium themes. It will help you in choosing a theme for you.


    Cost

    Free themes of course as name suggests are absolutely free. You can use them any time without any money.

    For premium you have to pay. Its range starts from $1000 which varies depending upon the designing of theme. It is good when you are earning enough from your site but if you are using your site just as a hobby then it may cost you a lot.


    Quality

    If you want your site at a good rank then you need to improve its quality.

    Free theme will not make your site unique. Same theme will be used by other sites because it is free for everyone.

    To make your site unique go for the premium one. There are some other qualities which need to be fulfilled. Like your site has to be responsive and should support different browsers. Free theme is not guaranteed to provide these qualities.


    Support

    In free themes if you need any type of help, you have to search for help and ask on forums. If someone will be willing then you may get your answer but it will take some time.

    Premium themes designer offer some support system. You will get timely support from reliable developers. Your problem will be solved very quickly.


    Update

    WordPress is constantly updated in every few months, so your themes and plugins need to be compatible with the updated version.

    Free themes may not be updated regularly. If you are using a free theme and an updated version comes, then you have two options. Either don’t update your site or install a new them. Both the options are not right.

    Premium theme developers update it on a regular basis to make it compatible with the new WordPress version. So if you are using a premium theme, then it is the responsibility of company to update it. You don’t have to worry about it.


    SEO

    SEO plays an important role in the ranking of your website. It is important for your site to have an SEO options and clean code.

    In free themes there are many structural bugs and they don’t provide inbuilt SEO options.

    Premium themes provide better coding which helps to load your site faster.


    Features

    Theme developers have to offer latest features for their customers according to the trend.

    Free themes provide limited features. Their developers do not update their theme. They are more compatible to the plugins than premium themes.

    Premium theme developers provide latest features and much more functionality than free themes. They provide an easy user interface that allows users to make any type of changes in the design of their site.


    Encrypted Links

    In free themes there are some unwanted links in the footer area. These links are irrelevant from the content of your website. It seriously affects the SEO of your site.

    Free themes developers add some links at the footer of their themes which is very annoying.


    Security

    Security should be of a high level in order to prevent your site. wordPress provides a better security by updating it every few months. An out dated theme may cause a lot of security issues.

    Free themes generally have high security threat.

    On the other hand, premium themes give high security standards to their customers.

  • How to Install WordPress Themes

    For theme installation, first you need to select a theme either free or a premium one. There are a lot of sites from where you can download a theme. Theme will be downloaded in zip format. The next process is installation process. Installation has some steps to be followed.

    There are two methods from which you can install a theme:

    • Installing WordPress using admin theme search
    • Installing WordPress using upload method

    Installing WordPress using admin theme search

    To install free themes from WordPress.org directory, login into your account and click Appearance > Themes.

    Wordpress How to install wordpress themes1

    Look at the above snapshot, click on Themes option. Following page will appear in front of you.

    Wordpress How to install wordpress themes2

    Click on Add New button to Add New themes.

    Wordpress How to install wordpress themes3

    Look at the above snapshot, here you’ll see an option for Feature Filter.

    Wordpress How to install wordpress themes4

    Look at the above snapshot, here you can filter your search for themes by applying your choice for Layout, Features and Subject.

    Wordpress How to install wordpress themes5

    Look at the above snapshot, we have selected 4 filter criteria, now click on button Apply Filters 4 to apply the filters.

    Wordpress How to install wordpress themes6

    Look at the above snapshot, select a theme and take your mouse above it. Click on Install button.

    Wordpress How to install wordpress themes7

    Look at the above snapshot, our theme is installed. To activate it click on Activate button. And you have successfully activated your WordPress theme.


    Installing WordPress using upload method

    The above method was only to install free themes that are available in WordPress directory only. But if you want to install premium themes, then you have to choose this option which includes following steps. This method can be used to install premium as well as free themes.


    Downloading theme

    WordPress site itself has a large collection of themes. All the themes on the WordPress site is fully examined and tested. If you are not satisfied with these themes you can go to other sites to download a theme. Make sure you select trusted site to download a theme as anyone can create a theme for WordPress.

    Themes are downloaded in the zip format.

    Go to wordpress.org site.

    Wordpress How to install wordpress themes8

    Look at the above snapshot, this is the site. Here click on Themes. You will be directed to the following page.

    Wordpress How to install wordpress themes9

    Look at the above snapshot, on this page you’ll have a lot of options to select themes.

    Select a theme and then click on Download button.

    Theme will be downloaded in zip format in your system.


    AD

    Installing theme

    To install the downloaded theme, you have to login to your WordPress and click on Appearance > Themes.

    Now click on Add New button, following screen will appear in front of you.

    Wordpress How to install wordpress themes10

    Look at the above snapshot, click on Upload Theme button.

    Wordpress How to install wordpress themes11

    Look at the above snapshot, choose the file that you installed and click Install Now.

    Wordpress How to install wordpress themes12

    Look at the above snapshot, once your theme is installed, you will get a successfully installed message. Now click on Activate button, and your theme will be successfully installed.

    Now you can customize it according to your choice.

  • WordPress Themes

    With the help of WordPress theme, you can design the layout and appearance of your website in the front-end.

    When WordPress is installed, it has a pre-installed theme which is very simple and unattractive. But no one wants a website to be that much simple. To make it more attractive one can install and apply different themes from WordPress.

    Themes provide a style (including font styling), colors, page layouts, widget positions, etc. You can change the theme of your site without changing the content of the site. Themes provide a unique look to your site.

    Types of WordPress theme

    There are thousands of themes available on the WordPress. Some are free and some are paid. You can choose a theme according to your choice.

    Free

    WordPress provides many good looking themes absolutely free in the WordPress theme directory. If you are using your site for a small audience or yourself, go for free one. Because there are some chances that same theme is being used by another site.

    Premium

    Premium themes may cost you starting from $1,000. Prize varies depending upon the design and requirement of your site.

    One advantage in premium themes is that they provide a reliable code base and offer support. It gives you a more enhanced security.

    How to make a WordPress theme

    Building a WordPress theme is somewhat technical work. To build a theme you should have a little knowledge about the following development languages.

    • HTML
    • CSS
    • JavaScript
    • PHP
    • Database

    You should know how to use a web server.

    Selecting WordPress Theme

    WordPress theme should be selected very wisely, so that it perfectly fits on your site. You can select any one either paid or free. It should be complemented to your site.

    Themes affect a website in a lot of way. Heavy themes which look great may slow down your website and Google will degrade its ranking. If a theme is not coded properly, it becomes difficult to add any plugin or change that theme.

    Theme selection is very important as everything for your website depends upon theme.

    Given below are some of the points which may help the users to select a theme for their website.

    Look for Simplicity

    Your website should look good, but for that you shouldn’t compromise with your site’s functionality. Theme styling should not be complicated. Complexity will make things difficult for your users. All you need is a good theme, so don’t go for an attractive one compromising your users.

    Responsive

    Your theme should be compatible with all type of screen sizes. A large number of traffic generates from devices other than laptops and PCs. Google also gives better ranking to the responsive sites. Lot of themes is by default responsive but still there are some themes which are not responsive. So look for a theme which is responsive to make your website accessible by all device users.

    Browser Support

    Make sure the theme you select is supported by all the browsers. Before selecting it, test it on different browsers for mobiles as well as laptops like Chrome, Internet Explorer, and Firefox.

    Plugin Support

    Plugins are very important for a WordPress site. They enhance the functionality of your site. Make sure that your selected theme must support all the popular plugins.

    Multilingual Support

    Your theme should support multilingual to support different languages for users.

    Help Option

    Only some developers provide support option with free themes, not all. So, if you messed up with your site then you may have to solve it on your own. So rather than facing all these problems, you should better choose a theme which has a good documentation and support help option.

    SEO Friendliness

    To increase your site performance on search engines, choose a theme which is SEO friendly. Many theme developers will let you know whether their theme is SEO friendly or not.

    Ratings and Reviews

    Before downloading a theme, have a look on its rating and reviews. A theme has both good and bad reviews, but if there are more negative reviews then read it carefully and consider it once again.

  • WordPress Users

    User Role

    User role determines the access permission to the users of a WordPress site.

    There are five user roles:

    • Administrator – An administrator has full rights over a site. They can do anything from adding a post to deleting the other user’s post. They have the authority to design a website by installing plugin and adding themes. They can even change the existing user?s password, delete them or add them.
    • Editor – They deal with content section of a site. They have the right to add, delete, edit, or publish even others posts. They can also add, delete, or edit comments.
    • Author – They only deal with their own posts in all manners like creating, deleting, editing, publishing or uploading images and videos. They can delete their post, even if that is published. They can’t create a new category, they have to choose from the existing one. Although they can add tags to their post.
    • Contributor – A contributor doesn’t have right to publish their post or page. They have to send their post to the administrator to review. And once it is reviewed, it can’t be further edited by the contributor.
    • Subscriber – Users which are subscribed to your site can log in and update their profile. They have the authority to change their passwords when they want. They can only read posts and leave comments on your posts.
    • Follower – They don’t have any right. They can only read and comment on your post. They are only signed up in your site to receive notifications every time when you update a post.
    • Viewer – They can only read and comment on a post.

    How to Add Users

    When a user is registered into your site, you’ll get a notification. So you can edit a user’s role according to your choice.

    Click on Users > Add New

    Wordpress Users1

    Look at the above snapshot, fill all the details and click on Add New User button.

    Wordpress Users2
    Wordpress Users3

    Look at the above snapshot, a message is generated at the top stating, new user created.


    How to Edit Users

    To edit users, go to Users > All Users

    Wordpress Users4

    Look at the above snapshot, this is the list of users.

    Click on a user’s Edit button.

    Wordpress Users5

    Look at the above snapshot, here you can edit and modify the details.


    How to Delete Users

    Click on Users > All Users, users list will appear.

    Wordpress Users6

    Look at the above snapshot, select Delete option.

    Wordpress Users7

    Look at the above snapshot, click Confirm Deletion to delete this user.

    There is one more method to delete a user. Click on Users > All Users

    Wordpress Users8

    Look at the above snapshot, select a user by clicking on checkbox, from drop-down select Delete and then click on Apply button.


  • WordPress Appearance

    Appearance is to manage your theme. From here you can install, delete, update and activate themes. Its menus allow you to change your site’s appearance and behavior.

    Depending upon the theme, some of the appearance menu may not appear to you because some of the options under appearance are theme based.


    How to Manage Theme

    For theme management, go to Themes

    All the installed themes will be displayed. Hover a theme and click it for theme description.

    Wordpress Appearence1

    Look at the above snapshot, these are the themes installed in our site. After clicking on a theme, theme description page will appear in front of you.

    Wordpress Appearence2

    Look at the above snapshot, it displays theme description like version, tags and information. If you want to implement this theme then click on Activate button, and to see the preview of theme click on Live Preview button.

    We have activated a theme and got a message as shown in below snapshot.

    Wordpress Appearence3

    How to Customize Theme

    Theme customizer allows you to design your site with your theme. It gives a new look to your site.

    Go to Appearance > Customize

    Wordpress Appearence4

    Look at the above snapshot, on the left side it is customizing section and on the right side it is the theme we have selected. Any changes made on the left side will be displayed on the right side of the screen.

    At the left side of the screen, following options are present,

    • Active Theme –It shows which theme is currently activated on your site. On our site, Twenty Fourteen theme is activated.
    • Site Identity – It specifies basic site information.
    • Colors – This option allows you to change the color of your site by changing site color and background color.
    • Header Image – It will select an image for the header of your site.
    • Background Image – Select an image for your background from here.
    • Menus – Select the menu type to appear on your site.
    • Widgets – Themes have sidebars either on left or right. You can add, remove, move up or down widgets into sidebars according to your choice.Wordpress Appearence14Look at the above snapshot, you can move the widgets according to your need in all the three sidebars.Wordpress Appearence15Look at the above snapshot, we have added Recent posts widget in the Footer widget area. Just choose a widget from the given options and it will be on your sidebar menu.
    • Static Front Page – Home page will be either static or display latest posts.

    How to Manage Widget

    Widgets are like blocks having specific codes for different functions. In any sidebar you can add and remove widget as per need through drag and drop.

    Wordpress Appearence17

    Look at the above snapshot, following options are available,

    Available widgets, these are available to you to add to the sidebar.

    Inactive sidebar (not used), these are not used.

    Inactive widgets, these are the removed widgets from sidebar.

  • WordPress Links

    We can add/edit/delete links on WordPress posts, pages, text widgets and navigation menus. Let’s see the 3 ways to add a link in WordPress..

    • Add a link in WordPress posts and pagesAdd a link in WordPress text widgetsAdd a link in WordPress navigation menusHow to Delete WordPress Links

  • WordPress Categories vs Tags

    Earlier only categories were available in WordPress to divide the posts. But to describe a post more specifically more categories were used. This made the category list very long. To avoid this, we have tags.

    Categories are broad-ranging. It helps your users to identify what your blog is about. For a post, there may be sub-categories which make a hierarchy of category. It is possible for a post to have more than one category but it is best for a post to have a single category. A post must have at least one category.

    Tags are like categories but they are used to describe a post more specifically. In some posts you may not need to use a tag. Tags are not needed in every post.

    Multiple categories may confuse the readers. If you want to provide additional grouping in a post use tags. Tag should be relevant to the topic covered in the post. For example, if you Google for “ladies watch”. Here watch is category and ladies is tag.


    SEO effect from Category and Tag

    Wise use of tag and category can increase traffic to your site via search engines. If both are used together, they will increase your site’s usability.

    Having internal links will let your sites content to be discovered by the search engine. Tags and categories will clue the search engines about your website topic and your site will be ranked for those targeted keywords.


    Optimal number of Categories and Tags

    There is no defined limit to use category for a post. However, for simplicity sub-categories are used when more categories are needed for a single post.

    For tags also there is specific limit. You can add 100 tags in a post. Tags are used to help in searching of a post. So it is necessary to use relevant keywords related to your post.


    Assigning one Post under multiple Categories

    Some people used to say that using multiple categories for a single post can result SEO in a negative way or you can be penalized for duplicate content. But it is not entirely true.

    Basic use of category is to sort the content on your site for your users so that they could find it easily. It is better to use sub-categories or tags than multiple categories.

    Overall there is no SEO advantage in multiple categories. Only consider about your targeted audience and not the search engine. If your decision will be according to your viewers, it will increase your visitors and your site?s SEO will automatically increase.