Oracast Blog

Archive for the ‘Coding Tips’ Category

Why coding standards are important

Monday, May 17th, 2010

A perfect axiom of coding standards is summed up by “don’t judge a book by its cover.” Sure the website may look great on the outside to the average visitor, but under the hood can tell a very different story. The underlying code, when following “best practice” coding standards, is quite easy to work with especially when a customer would like to expand the features of their website. Unfortunately, in our experience, many web designers don’t follow any coding standards and it is a nightmare to maintain, which ends up costing the customer more time and money.

As a business owner or manager who is looking for a website, make sure to ask the company if they follow any specific coding standards such as W3C. Making sure that your website follows best practice coding standards will help make your website more accessible to many different web browsers and devices, but more importantly, it will help insure that your future maintenance costs are minimal. In addition, if you ever fire your existing web provider and hire someone new to take over, the new company has to understand and work with the code, so if it’s terrible code it will take them longer to update your site and cost you more money, however, if your website is written with coding standards that are easy to read and understand, the new company will be off to the races in no time.

Here at Oracast we employ best practice coding standards to ensure that your website will look great and function properly in all major web browsers, and help minimize your maintenance cost by providing quicker and easier maintenance implementations. Don’t hesitate to contact us for a free consultation.

Wordpress multiple quotes issue

Friday, July 24th, 2009

We have seen a few instances where double quotes or apostrophes have shown up in blog posts and sometimes in the actual Wordpress code. If you are using the built-in Wordpress editor, whether you are coding or simply posting a blog, singe quotes get repeated when you save your work. For example: it’s = it’’s, or in the code we have seen: $_SERVER['''something'''].

This obviously causes some problems, but have no fear, the solution is quite simple. The multiple quotes issue is caused by magic_quotes, and can be found in the php.ini file, or if you are in a shared environment, the .htaccess file. These variables need to be turned off.

php.ini settings should look like:


; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ‘ with ” instead of \’).
magic_quotes_sybase = Off

Or if you are using an .htaccess file, your settings should look something like this:


# BEGIN WordPress

RewriteEngine On
php_value magic_quotes_gpc 0
php_flag magic_quotes_runtime 0

# END WordPress

That is it! The problem isn’t a bug in Wordpress but rather a result of having magic_quotes turned on.

Home | About Us | Our Services | Our Work | Support Centre | Contact Us | Blog | Web Mail | Site Map
Copyright © Oracast Inc. All Rights Reserved. | Terms of Use | Privacy