Category Archives: Coding

The Easy Upload Renamer got updated: now in Spanish, French, German, Swedish and Finnish

The Easy Upload Renamer plugin The Easy Upload Renamer Plugin for WordPress got just updated to version 2.2.0. What’s new? Support for localization, included translations in Spanish, French, German, Swedish and Finnish, and a cleaner settings screen (see screenshow below).

I’m excited about the amount of downloads my little tool has received in the past couple of years. Check out the complete list of features over at CodeCanyon!

Easy Upload Renamer settings screenshot

Tagged , , ,

Conditional activation for plugins

In this post, I present a simple way to check for things on the server before allowing a plugin to be activated.

The users are pesky. They try to do things that the programmer cannot foresee. They happily install plugins without reading the readme files or the instructions. Then they complain, they downvote, they critizice. If only there was a way to check for these things: is the user running the plugin under the correct WordPress version, or if the necessary dependendencies are installed, or if PHP was compiled with such-and-such extensions. Then we’d let the user know about all this at the plugin activation time. What if this ability was coded as an easy-to-add drop-in class, instead of bloating existing plugin code? I couldn’t find it, so I made it, and now I’m sharing it with you. Continue reading

Tagged , ,

40 false assumptions about people’s names

Here’s a list of 40 assumptions that programmers make about people’s names, called “Falsehoods Programmers Believe About Names” by Patrick McKenzie of Kalzumeus Software. From rule 19 the British author Edwin Abbott Abbott springs to mind. Or the Finnish politician Yrjö Koskinen Yrjö-Koskinen.

Wandering Boxes: My plugin’s alert messages started moving down the page

I thought I was seeing things. When I was writing the admin page for a plugin, my notice and error boxes suddenly started moving around the page on their own. There’s an explanation for this behaviour, buried deep in the Javascript files. Continue reading

Tagged , ,

The difference between term_id and term_taxonomy_id

The Codex says:

  • term_id is the ID of a term in the terms table
  • term_taxonomy_id is a unique ID for the term+taxonomy pair

What does this mean?

A term is a word. It can belong to a taxonomy, such as tags, categories, or a custom taxonomy. The thing is: there can be several taxonomies containing the same term.

Let’s say you have a term called “fattening“. This word has an id number. This is the term_id. It doesn’t depend on how this word is used, i.e. in which taxonomies the term appears.

Now the word “fattening” as a post tag also has a number. This is the term_taxonomy_id. It corresponds to “the post tag ‘fattening’“.

Maybe you also have a category called “fattening”. While the term_id is the same, the term_taxonomy_id for “the category ‘fattening’” is different.

Got it? Simple. Or maybe not. That’s the way it is, anyway.

If this post was helpful, please let me know in the comments!

Tagged , ,

Funny business with add_rewrite_rule() and “external” rewrites

There’s some funny business going on when you try to add a custom rewrite rule to WordPress and it gets interpreted as an “external” rule. What’s going on? Continue reading

Tagged , ,

Unit testing plugins with different versions of WordPress

The nasty scenario: Your plugin depends on some WordPress functionality that doesn’t work as expected in another WP version. It’s possible to run unit tests under different versions of WordPress. Continue reading

Tagged , ,

Install several versions of WordPress

For plugin & theme development and testing, it can be useful to have different versions of WordPress available on your system. In this post, I’ll show how to achieve this on Windows. Continue reading

Tagged ,