Feb 18

Quick tip – Checking how much time your javascript needs to run

I don’t often run into things where it surprises me how easy a solution easy. Much less so with Javascript. This quick tip may be for you.

Recently I had some performance issues with runtime javascript taking a long time. You can use the following commands to check how long it takes for something to run :


someFunction(); // or some code


The console neatly spits out the amount of miliseconds it took. Nice.

Apr 15

Updating term counts in WordPress / Woocommerce

Last week I had a short hickup of Woocommerce regarding the numbers count of a few custom taxonomies. Then I noticed there is actually no function in WordPress to easily recount terms in WordPress. In Woocommerce settings there is a ‘recount terms’ function, but it looks like it doens’t recount any custom taxonomies you have working with Woo, only it’s own terms. Other than that, there is no button of the sorts to recounts terms anywhere.

Continue reading →

Jan 13

Regular expressions – test online

I have been fiddling around with Regular Expressions these days. As most people who ever tried it know that you can do about anything but it is at the same time nearly impossible.

Instead of making a test page, altering and refreshing minor changes all day I decided to look around a bit for a handy tool. There are a lot of them out there but I found a nice one.

The cool thing is you can easily switch between modes, modifiers and it automatically refreshed. The only minor point is that it is sometimes hard to see the difference between no match and an expression crash.

Check it out: Online regular expressions tester

Let me know if you found a better one!

Nov 12

PHP 5.4 and call-time-pass-by-reference

A word of warning. I just updated to PHP 5.4 which broke my installation because call-time-pass-by-reference has been removed in this version. See: passing by reference.

Along with some other functions you shouldn’t be using anymore anyway. See the incompatible list.

For up-to-date plugins and software this shouldn’t be a problem since it was deprecated for a while already.

For me it notably breaks the Feedwordpress plugin in WordPress and gives a fatal error, which is annoying. A simple solution is present but you need to dive into the code and replace a few lines. See the solution here.

I fear older plugins of various kinds are also vulnerable for this problem, so I advice to check your installation locally against a new php version to see if any problems arise before your host decides to upgrade their installation!

Nov 12

WordPress Update_option and serialize

I ran into this interesting feature yesterday I was not aware of. If you are trying to put options WordPress using Update_option serializing the data before actually causes unexpected behaviour.

The catch is that WordPress already serializes data send to the function. When invoking get_option the data will be unserialized. Obviously this causes an error if you try to unserialize the whole thing after that.

In short, just push an unserialized array unto update_option and everything will be fine!

$foobar = get_option("stuff");

See this blog post for more backgrounds.