Archive for April, 2014

29 April, 2014 — Development

Debitoor API Helper Class Version 2.0

Last year I published a PHP API Helper class for the ever-growing Debitoor accounting software. The API is a RESTful API meaning it responds to JSON and HTTPS requests.

As I have got to use this class in projects of mine, I have built upon this class adding improvements and a new Debitoor class that will process your requests for you returning a clean PHP array ready for you to use.

So what has changed?

You can find a list below of what I changed in this release and some newly added files.

Example.php

//Debitoor API Class
// Code by Daniel Roizer - http://thatblogger.co
// v2.0

define(req_code, "REQUEST_CODE");
define(clientID, "CLIENT_ID");
define(clientSecret, "SECRET_KEY");
define(token, "TOKEN_FROM_API");
define(apiURL, "https://app.debitoor.com/api/v1.0/");

require_once("debitoorapi.class.php");
require_once("debitoor.class.php");

$debitoor = new Debitoor();

// Get list of clients as an array()
print_r($debitoor->GetCustomers());

// Get list of products as an array()
print_r($debitoor->GetProducts());

// Add a client
print_r($debitoor->AddClient($name, $address, $phone, $email, $homepage, $cinumber, $vatnumber, $countrycode));

Download Now

You can download version 2.0 of the helper class over at GitHub!
– OR –
View on GitHub

This is not part of Debitoor and is code written by myself. If you wish to have something added or have any questions please comment below or submit a ticket over a GitHub.

25 April, 2014 — Snippets, WordPress

Increase WordPress Memory Limit

If you use WordPress often or have a lot of plugins installed you may have come across a PHP memory limit error. This happens when WordPress doesn’t have enough memory to achieve what you are trying to do.

In version 2.5 the WordPress core team added a wp-config.php option WP_MEMORY_LIMIT which allows you to configure the maximum amount of memory that can be used by PHP.

Changing this option in the wp-config.php will only affect your WordPress site and not any other PHP sites.

The default memory allocated to WordPress is 40MB for normal WordPress installations and 64MB for multisite installs. The core will also take into account the php.ini file if there is one and if this number is greater than the default 40MB allocated by WordPress the higher number will then be used.

To change the WordPress memory limit you just add the following into the wp-config.php.

define('WP_MEMORY_LIMIT', '64M');

If this doesn’t change your allocated memory limit your hosts may not allow you change this setting, if this is the case you should contact your hosting company.

24 April, 2014 — Development, Life

A new look for ThatBlogger

As you might have been ThatBlogger has been quite quiet recently. This is because since the start of the year I have been extremely busy working on new projects, a new business venture and general life events.

I recently took some time to redesign That Blogger to give it a fresh new look and to finally get round to blogging again!

The New Theme

Having spent some time looking around the net for a theme to fork, saving me time designing and building a new theme. I stumbled upon a theme I really liked. It was clean, simple and used Post Formats, something I had wanted to use for a while to give my posts a facelift. This theme was Sorbet by Automattic. I knew I would have to fork a theme and adapt the code to work the way I wanted and take out the code I didn’t need for That Blogger. However after forking the code I decided to work from the ground up and build a Sorbet based theme using the Bootstrap Framework. What you see now if my finished product.

Take a look at what the theme looks like if you downloaded it right from WordPress.org and you’ll see the difference.

What else has changed?

I have been through and fixed broken links in posts so you don’t need to worry about clicking a link and the website behind it has gone! The next thing to be removed is adverts, I decided to ditch all adverts, this was simply because I want the website to be as clean as it can be to really focus on the content.

I have also made some minor speed improvements in the new theme.

Let me know what you think about the new look in the comments below. I’d love to hear your thoughts.