Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

Speed up your website – Part 5: Images

Thursday, July 19th, 2018 by Servage
This is the fifth part of a simplified explanation of the "Yahoo best practices for speeding up your web site". Read the fourth part here. The fourth part is about image related optimization. Minimize image file size Avoid using GIF files. If you have GIFs, try to convert them to PNG, in order to evaluate if you might save some size. PNG files are more efficient in terms of quality and size. Most browser-issues with PNG are resolved, so there are not many things in favor of the GIF anymore. If you must use it, make sure to include the amount of colors in the color palette, which are necessary. ...

Speed up your website – Part 4: JavaScript

Saturday, July 14th, 2018 by Servage
This is the fourth part of a simplified explanation of the "Yahoo best practices for speeding up your web site". Read the third part here. The third part is about CSS related optimization. Preferably place scripts at the bottom Scripts block parallel downloads of multiple items in the browser. Therefore you might want to place the scripts at the bottom of the page, if possible. It is a problem if your scripts alter the content of your document on the initial load, since you might want those scripts at the top. Make JavaScript (and CSS) external Including JavaScript and CSS in the HTML document reduces the amount of requests, but also ...

Speed up your website – Part 3: CSS

Monday, July 9th, 2018 by Servage
This is the third part of a simplified explanation of the "Yahoo best practices for speeding up your web site". Read the second part here. The third part is about CSS related optimization. Include stylesheets in the head section Use the <link> tags in the <head> section of your HTML code to include CSS files. This enables your website to load progressively, instead of waiting for style information in the middle, or at the bottom of your page. It means that content can be rendered when it is ready, because the style information has already been loaded in the beginning. This makes the page appear to load faster. Do not ...

Speed up your website – Part 2: Server

Thursday, July 5th, 2018 by Servage
This is the second part of a simplified explanation of the "Yahoo best practices for speeding up your web site". Read the first part here. The second part is about server related optimization. I am aware that some settings are not available to all developers, depending on their development and deployment infrastructure. Use Content Delivery Networks Where possible you should take advantage of servers closer to your users than your own. TO get started quickly with some major improvements, try to load JavaScript sources like Google APIs, jQuery or similar code you might use in your project, directly from their servers, or suggested CDN. Add expires header to utilize ...

Speed up your website – Part 1: Content

Sunday, July 1st, 2018 by Servage
There are many ways to improve website performance. The "Yahoo best practices for speeding up your web site" is a very comprehensive guide to optimizing many factors of your website. However, the article is very long, and sometimes quite hard to understand, because the technical level of the article is high. Therefore I have collected the main tips of the optimization guide, and will present them in a series of more comprehensible articles. Make fewer requests Each page often contains multiple resources, which each generate a request. For example a basic HTML page with a CSS stylesheet and 5 images, generates a total of 7 request (one for the HTML, ...

Send PHP errors per mail

Monday, June 25th, 2018 by Servage
Error-handling in PHP can be complex, and getting a good way of having clear and good error reporting and maintaining security, by not displaying to much to the public, can be difficult. Maybe sending errors to developers per email could be a good tool for you. Check out the following example code: // Our custom error handler function nettuts_error_handler($number, $message, $file, $line, $vars) { $email = " <p>An error ($number) occurred on line <strong>$line</strong> and in the <strong>file: $file.</strong> <p> $message </p>"; $email .= "<pre>" . print_r($vars, 1) . "</pre>"; $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Email the error to someone... error_log($email, 1, 'you@youremail.com', $headers); // Make sure that you decide how to respond to errors (on the user's side) // Either ...

Create your own WordPress plugin

Monday, June 18th, 2018 by Servage
You probably know Wordpress as a very popular blog or content management system. It has tons of features, and can even be extended with plugins - adding custom functionality. There are very many plugins available already, by individual developers and other web services, to integrate with and extend Wordpress. You can find a directory of most existing plugins here: Wordpress Plugin Directory Creating your own plugin Sometimes it's hard to find a plugin that exactly fits your needs. Maybe because you want to integrate with a very specific service, or because existing plugins just don't cut it the way you want. In that case custom plugin development is a really good ...

Collection of CSS techniques

Monday, June 11th, 2018 by Servage
I've stumbled over a great list of cool CSS techniques I think could be useful some web developers: "CSS3 is taking web development and web design to a higher level. In this article, I have compiled examples of amazing CSS3 techniques that will probably become very popular when CSS3 will be fully supported by most browsers." Color animate any shape with CSS3 and a PNG Let’s start this compilation with an interesting effect created using only CSS3: A png image with a changing background. The background is using CSS3 transitions. Not the kind of effect you’ll put on your website, but definitely an interesting demo of what CSS3 can do. View source: http://jsfiddle.net/chriscoyier/vhKhT/ Create adaptable layout using ...

Remember to use secure passwords

Monday, June 4th, 2018 by Servage
It seems that the increasing amount of accounts, logins, services, increases the amount of passwords to keep in mind dramatically. All too often you see people using too simple, or same passwords, for many important services. Therefore I would like to remind about the importance of secure passwords, like in a previous article here on the Servage Magazine. It's important to keep focus on this issue, so users are always reminded to increase their personal level of security. It’s easy for service providers to ask their users to use secure passwords. After all it is the user who is supposed to remember it. Obviously it is better for everyone if secure ...

Create nicer looking forms with CSS

Monday, May 28th, 2018 by Servage
Forms are one of the commonly used elements in HTML. It's a basic functionality for most websites to capture specific information via user input through HTML forms. So why do so many forms look really boring? Why are businesses still missing out on new customers because of unappealing order forms? It's amazing what you can accomplish with form design. It looks good, gives a serious impression, and attracts users. Examples The images illustrating this article are two examples of beautiful order forms I've found online. They are integrated with the rest of the website design, they have a simple layout, there isn't too much data to be added. Users are unlikely ...

Recent articles

Blueprint CSS Framework makes CSS styling easy

The last post about nicer forms introduced some simple CSS tricks to get nice looking forms. It also mentioned the Blueprint CSS framework, which is pretty nice. Blueprint is basically just a set of stylesheets (.css files) that you can include in your website to get certain default design and layout functionality. Why is this great? You often want to do similar things with your web projects in terms of ...

Code tips for .htaccess files

The .htaccess files are often underrated and forgotten, but they do have great powers to manipulate your web server. It's possible to set and change various server settings, for example the Apache configuration. Thereby you can have individual configurations based on files in folders, rather than configuration files that require server restarts to take effect. You can also change settings for plugins, like PHP settings. I've stumbled over a few great .htaccess snippets here, which I found quite useful and wanted to share.

Lightweight CMS for your websites

PulseCMS is a lightweight content management system for small websites that just need basic features - which are most of the sites out there! Core features PulseCMS is easy to install. It only requires a PHP webhost like Servage. No database is required because the CMS works with files alone. This improves performance. Rebranding and localization are possible, so you can even let your customers work directly on their own websites. ...

PHP-like in_array function in JavaScript

Recently I once more found myself in a situation where I really felt that I am a PHP-developer, more that a JavaScript-developer. Do you also find your self writing stuff like in_array() in JavaScript code? It happens often to me, that I take for granted in other languages, what I know and love in PHP. It also often takes quite a while to find a good alternative for missing functions ...

HTML parser in PHP

Are you ever struggling with HTML content in PHP? Do you need to parse a HTML source? Going through a HTML document in order to extract data might seem like a complicated, or even wrong, way of approaching a problem. Surely there must be another way... Well, sometimes other ways aren't available, sometimes the quick and dirty HTML extraction is simply the easiest way to get things done. Therefore you ...