related links

   Bluekora

   Linkedin

   Facebook

   Chris Shiflett Blog

   CSS-Tricks

Coffee!!
Drag Me!

Welcome!

I’m a 23 year old lad from Portugal, Vila Nova de Gaia.
I’m a Software Engineer working, at the moment, at bluekora.
I can be found on LinkedIn at my profile.

June 29 2010

WP-RESTful WordPress Plugin

Tagged Under : , , , , , ,

Hello!

I’m 99% sure that you already heard about APIs or REST APIs, it’s what Twitter, flickr and a lot more companies use to share they’re resources with a consumer.
A consumer can be anything from a website (for example, showing your Twitter updates on your blog or personal website) to a desktop / mobile application (iPhone, Android, Windows Mobile, …).
This is possible because all information sent to and from the API is encoded in either two common, inter-platform language, XML and JSON.
The difference between a regular API and a REST API is on the way they work. A REST API requires two entities to work, a client and a server.

Download WP-RESTful (Version 0.1)

Download WP-RESTful Users Plugin (Version 0.1)

Download WP-RESTful Categories Plugin (Version 0.1)

Download WP-RESTful Tags Plugin (Version 0.1)

Follow me for real-time updates

Twitter

How does it work?

WP-RESTful uses OAuth, a widely, commonly and open source API implementation used all over the World (Wide Web).
The way it work is fairly simple.

First a Consumer registers with a Server. At this point the Server will provide the Consumer with 2 tokens, a public and a private token. The public token will be used to communicate and identify the Consumer with the Server while the private token will be stored locally for security and integrity reasons.
After this the Consumer will request the Server with a Request Token. This Request Token will be used to initiate the Authentication Protocol in where the Consumer will be required to authorize the Server.
The Server will create 2 new token (definitive tokens). They will be our authentication tokens.

I know this sounds and seems complicated but you won’t need to do anything as the Plugin will do almost everything for you (Registration and Authentication process are manual).

Plugin features

  • Add new Plugins to API Plugin to extend functionalities to any way you want/need. (See next group)
  • Fully manageable Client and Server side.
  • Ability to choose what fields are allowed to be returned to the consumer.
  • Ability to restrict modules to OAuth authentication process or liberated them and make them open.
  • Load balance system where you can specify how many requests a given consumer is allowed in a 60 minute timeframe.
  • Out of the box Post and Comments management.
  • And much more…

Plugins

As stated on “Plugin Features” you have the ability to develop and/or add new modules to your REST API. This means, for example, if you use a plugin like WP E-Commerce, you can develop a plugin for the REST API in order to provide support for WP E-Commerce resources.
The way these plugins are developed is very similar to how plugins for WordPress are developed.
You can see this video that explains how plugins work and how you can develop them.

Requirements?

All requirements for the plugin to work properly are addressed by the plugin itself, upon activation. You can see your system status on WP-RESTful link after activation the plugin.

How to install?

This plugin is installed like any other WordPress plugin out there.

  1. First you need to download it from WordPress Plugin Repository.
  2. Upload the contents of the compacted file to your plugin folder on your WordPress installation.
  3. Go to your WordPress Administration page and activate the Plugin (Plugins → Installed → WP-RESTful → Activate)
  4. Create a new page, name it API, set the permalink to /api and set the content as [REST_return] and save the page.
  5. Go to WP-RESTful → WP-RESTful to check your system status.

I need help!

Check these two videos. They will help you starting up.

This post will be updated, if needed, to reflect changes made to the plugin.

May 17 2010

WordPress Plugin – Parallel Loading System

Tagged Under : , , , , , , ,

Hello!

The WP-PLS (short for Parallel Loading System) is a WordPress plugin that will enhance the loading efficiency of your Blog. It’s very simple to use and it will only require a small amount of time to configure at the start.

Download from WordPress Plugin Repository (Updated to version 0.1.8)

Follow me for real-time updates

Twitter

Why use it?

If you have an image intensive Blog, or even if you don’t, this plugin will boost the loading time of your Blog. The more images you have the more it will improve.

The amount of people that will visit your website for the first time or visit with an empty cache or disabled cache is huge, therefore, the best your website performs on that first visit the more chances that person will remain to view your website.

It is also known that nowadays, Google (and other search engines), are taking into account, for ranking purposes, your website page speed. Google Bot does not conserve a cache when it visits your website, so, the faster your website loads the more chances you have to rank higher.

This plug will not change anything on your Blog. Every change that it makes will be processed in real time, right before the HTML code of your Blog is sent to the browser.

How does it work?

Standard HTTP v1.1 requests only allow 2 connections, at the same time, from the same domain.

This plugin will virtualize connections, through defined subdomains. You can have as many subdomains as you like, but I do recomend using a maximum of 5.

WP-PLS Comparison

Requirements?

The plugin is programmed to be aware of this requirements, and if not fulfilled it will not change anything on your Blog.
It will not break your Blog code!

  • Your server needs to have a working GD Library module for PHP.
  • You should have a PHP installation with a minimum version of 5.1.3
  • Access to your server Administration Painel (cPanel, DirectAdmin, Plesk) in order to create new sub-domains for your domain.
    Lets say your domain is wp-pls.com. You will need to create domains like
    image1.wp-pls.com
    image2.wp-pls.com

How to install?

This plugin is installed like any other WordPress plugin out there.

  1. First you need to download it from WordPress Plugin Repository.
  2. Upload the contents of the compacted file to your plugin folder on your WordPress installation.
  3. Go to your WordPress Administration page and activate the Plugin (Plugins → Installed → WP-PLS → Activate)
  4. Go to Settings → Parallel Loading System

Plugin features?

Some of the features that you can expect when using this plugin:

  • Automatic Image Optimization.
  • Parallelize HTTP connections.
  • Page speed improvement.
  • Auto-Path find (Automatically find server root path, sub-domain path, plugin resources path…).
  • Cache loss minimization.
  • Sub-domain real-time health tracking.
  • Auto recovery from resource files bad sync.
  • Ability to activate / deactivate sub-domains
  • Plugin Updates aware. (automatically re-sync files and database after an update)

What’s in the cooking pan?

This was only the first release of the plugin. I’ve got a lot of new ideas that I would like to see implemented on next releases.
Some of them are:

  • Also parallelize CSS and JavaScript loading.
  • Add support to also load external images. At the moment it will only load locally stored images.
  • Add real-time rewrite functions to CSS and JavaScript. That way, images that have been called from the CSS file will also be parallelized.
  • Overall improve of the code.
  • Add options to manage image quality rendering.
  • Bug fixes (when found or reported).
  • And much more…

If you have any features that you would like to see implemented, please don’t hesitate to comment this post, tweet me or mail me :)

I need help!

It’s normal if you run into problems and I’m here to tell you how to fix them.

If for any reason the plugin is telling you that it doesn’t have permissions to alter a given file you will need to access your server, using your favorite FTP Client (Filezilla, Cyberduck, FlashFXP…) and change the permissions of the file to 777. You can revert them back to 644 (normal permissions of a file) after the plugin finishes the modifications.

If you get a sub-domain health notification stating that your sub-domain is returning a 500 HTTP error code the most probable explanation is that your sub-domain folder has 777 permissions. Revert them back to 755 and you should be fine.

If you have any further questions please don’t hesitate to send me an email or add a comment on this post.

Creating sub-domains on cPanel?

Creating sub-domains on Plesk?

  1. Log in to Plesk
  2. Once logged in, click the ‘Home’ button in the left navigation frame.
  3. Click on the domain name you wish to create a subdomain for.
  4. Click on the ‘Subdomains’ button. This will take you to the subdomain manager.
  5. Add a new subdomain by clicking the corresponding button (Add New Subdomain).
  6. Enter the subdomain in the associated field. The SSL support checkbox is optional, and should be used if you intend on using SSL with your subdomain.
  7. If you’d like to use the same FTP information as your main domain to access the subdomain, skip down to the ‘Services’ section. If not, select the checkbox ‘Create a separate FTP user account for this subdomain’. Enter an FTP username and password, along with a hard disk quota. If you do not enter a hard disk quota, the subdomain will be allowed to use all resources included with your main domain.
  8. In the ‘Services’ section, it is advised to check all services. This will ensure that your subdomain can support all the features our hosting accounts offer.
  9. Click the ‘OK’ button to create the subdomain.

Creating sub-domains on DirectAdmin?

Creating sub-domains on manually on your server?

To create a sub-domain, if don’t use a Control Panel, edit your http.conf file (normally located on /etc/http/conf/http.conf) and add the following at the end:

NameVirtualHost *:443

<VirtualHost *:80>
ServerName YOUR SUBDOMAIN
DocumentRoot ROOT TO SUBDOMAIN PATH
ErrorLog ROOT TO SUBDOMAIN LOG
</VirtualHost>

<VirtualHost *:443>
ServerName YOUR SUBDOMAIN
DocumentRoot ROOT TO SUBDOMAIN PATH (SSL)
ErrorLog ROOT TO SUBDOMAIN LOG (SSL)
</VirtualHost>

This post will be updated, if needed, to reflect changes made to the plugin.


scarletbits.com 125x125 Are My Sites Up? Get Chitika Premium Job Board for Web Designers and Web Developers

Tag Cloud