Category Archives: wordpress

Center caption images not centered inside WordPress posts

Just got tired of how the images inside my posts didn’t get centered, but instead were aligned to the left, even if I had set them to be centered, and they were rendered to inside the WordPress WYSIWYG editor.

I use the Arclite theme, which lets you add personalized CSS styles inside the settings, but I guess you can use other methods to do the same with your them, or add them manually if it comes to that

What I added to the CSS was:

.aligncenter {margin-left:auto;margin-right:auto;}

which is apparently working, as I just did it, and the images are centered now in firefox. Didn’t bother to test IE.

  This article has been Digiproved

Protect your WordPress contents from plagiarism with a digital timestamp

Since a while ago, I decided to release all the contents I produce with a Creative Commons license. Why? Well, once I publish my stuff online, anyone with an internet connection can read it; so, if they like it and want to make it more widely available, a stricter copyright policy would compell them to ask me for permission and blah blah; if people like the contents I produce and distribute them around, I’m happy about it, as long as it’s made clear that I am the original author and noone else tries to take credit for my work (because that would obviously piss me off big time). The CC license I chose is the NC-SA, which also forbids any commercial use of my contents (if someone’s going to earn money out of my work, then I want my fair share), and allows re-use of the contents as long as they are released with the same license (I wouldn’t want someone to take my work, reassemble it at his own liking, and then lock it down even if it’s not really theirs).

Well, all’s good until now, but what if someone tries to “steal” your contents? The things you write are legally yours since the moment they are written (as long as they are original, naturally), yet you need to prove they’re yours in case of a dispute. If someone copies one or more articles off your website, he could very well decide to say that those contents are his, and you copied them off him; your word against his.

The only way to “prove” that a written text is yours, is to prove that it was in your possession before anyone else got it; “timestamping” is the keyword, a timestamp which is legally valid (meaning that noone would be able to prove it’s fake), and that binds the digital works with your identity; it’s best if you get a digital timestamp before releasing your work, in fact, if an “attacker” has the means to download the contents off your website and certify them before you do, he would become the new technical owner of your contents.

There are several ways to get a timestamp, free and paid, more and less solid. A free digital timestamp service is provided by Timemarker, but it’s only available for manual timestamping, that is you have to go to their site and provide them with your contents, then download their timestamp PGP signature. It’s good if you need to timestamp images, or archives.

On the other side, if the contents you want to timestamp are written posts on your WordPress blog (and this is all this article is about), the only real good service available to occasional bloggers like me (those who do not make a living with their website) is the free Copyright Proof WordPress Plugin (wordpress.org plugin repository has the most updated changelog), which gets you the best for its price. As soon as you register a free account on Digiprove (they also offer paid timestamping for professional, non-Wordpress users), you can insert your own API key in the plugin, and it will take care of everything: as soon as you hit the publish button in the WordPress editor, before actually publishing the article its written contents will be submitted to Digiprove server for secure timestamping, and once the timestamp information is obtained, the article will be online along with its certificate (you can control how the digiprove timestamp appears both on your website and on their servers, and you can also see the badge at the bottom of this post). Same thing happens when you edit the article, the certificate will be updated to reflect the changes on the article, and the older certificates, even if not linked anymore, will still be valid for the previous revisions of the article.

This service, again, is free, and does its job perfectly. Cian Kinsella, Digiprove’s CEO, told me they’re going to improve the way the plugin works, to make it dynamically create the certificate HTML code inside the post (it’s currently hardcoded, with CSS styling done inside the tags), and he also anticipated that, after this change has been done, they will be probably adding a feature I requested, that is a sort of “older certificates drawer”, thanks to which the reader can access the links to the older timestamps of the previous revisions of your page which reside on their servers, and are currently lost (the links, not the certificates); this will greatly improve the functionality of the plugin for those who prefer updating their older posts with newer info, instead of opening new posts.
By the way, even if Cian is CEO of two different companies, and I don’t know his daily schedule but I suppose it should be pretty busy, he still managed to personally reply to my mails to Digiprove’s support, which is good!

Since a while ago, I decided to release all the contents I produce with a Creative Commons license. Why? Well, once I publish my stuff online, anyone with an internet connection can read it; so, if they like it and want to make it more widely available, a stricter copyright policy would compell them to ask me for permission and blah blah; if people like the contents I produce and distribute them around, I’m happy about it, as long as it’s made clear that I am the original author and noone else tries to take credit for my work (because that would obviously piss me off big time). The CC license I chose is the NC-SA, which also forbids any commercial use of my contents (if someone’s going to earn money out of my work, then I want my fair share), and allows re-use of the contents as long as they are released with the same license (I wouldn’t want someone to take my work, reassemble it at his own liking, and then lock it down even if it’s not really theirs).

Well, all’s good until now, but what if someone tries to “steal” your contents? The things you write are legally yours from the moment they are written (as long as they are original, naturally), yet you need to prove they’re yours in case of a dispute. If someone copies one or more articles off your website, he could very well decide to say that those contents are his, and you copied them off him; your word against his.

The only way to “prove” that a written text is yours, is to prove that it was in your possession before anyone else got it; “timestamping” is the keyword, a timestamp which is legally valid (meaning that noone would be able to prove it’s fake), and that binds the digital works with your identity; it’s best if you get a digital timestamp before releasing your work, in fact, if an “attacker” has the means to download the contents off your website and certify them before you do, he would become the new technical owner of your contents.

There are several ways to get a timestamp, free and paid, more and less solid. A free digital timestamp service is provided by Timemarker, but it’s only available for manual timestamping, that is you have to go to their site and provide them with your contents, then download their timestamp signature. It’s good if you need to timestamp images, or archives.

On the other side, if the contents you want to timestamp are written posts on your WordPress blog (and this is all this article is about), the only real good service available to occasional bloggers like me (those who do not make a living with their website) is the free Copyright Proof WordPress Plugin (wordpress.org plugin repository has the most updated changelog), which gets you the best for its price. As soon as you register a free account on Digiprove (they also offer paid timestamping for professional, non-Wordpress users), you can insert your own API key in the plugin, and it will take care of everything: as soon as you hit the publish button in the WordPress editor, before actually publishing the article its written contents will be submitted to Digiprove server for secure timstamping, and once the timestamp information is obtained, the article will be online along with its certificate (you can control how the digiprove timestamp appears both on your website and on their servers, and you can also see the badge at the bottom of this post). Same thing happens when you edit the article, the certificate will be updated to reflect the changes on the article, and the older certificates, even if not linked anymore, will still be valid for the previous revisions of the article.

This service, again, is free, and does its job perfectly. Cian Kinsella, Digiprove’s CEO, told me they’re going to improve the way the plugin works, to make it dynamically create the certificate HTML code inside the post (it’s currently hardcoded, with CSS styling done inside the tags), and he also anticipated that, after this change has been done, they will be probably adding a feature I requested, that is a sort of “older certificates drawer”, thanks to which the reader can access the links to the older timestamps of the previous revisions of your page which reside on their servers, and are currently lost (the links, not the certificates); this will greatly improve the functionality of the plugin for those who prefer updating their older posts with newer info, instead of opening new posts.
By the way, even if Cian is CEO of two different companies, and I don’t know his daily schedule but I suppose it should be pretty busy, he still managed to personally reply to my mails to Digiprove’s support, which is good!

  This article has been Digiproved

reCAPTCHA Input error: Invalid referer and WordPress

Just today someone (thank you) pointed out there was an error with the recaptcha plugin in my WordPress comments. Checking it out, that “Input error: Invalid referer” is a generic error noone has ever pointed out to a single cause.

At first I made sure the keys used by the reCAPTCHA plugin were correct, and created a brand new website domain in the reCAPTCHA admin panel, and updated the values in the plugin settings. That way, I could see the captcha image correctly when loaded while being logged in, but as soon as I logged out the error was back there. I checkd the page source, and I noticed the “challenge” value of the HTML line that called the external javascript was different from the public key I updated in the plugin settings.

After some thinking, it turns out that the WP Super Cache plugin in some cases interferes with reCAPTCHA plugin, as it caches the old plublic key value which of course makes reCAPTCHA mad. Clearing the cache, thus reloading the whole page, solved the problem, and the captcha image was back there to be solved.

  This article has been Digiproved

How to fix Fatal error: Allowed memory size exhausted in WordPress 3

This error is nothing new, per se, as far as I know it was present also in previous versions of wordpress (I’m a fresh new user and I’ve been using v3+ for more than I’ve been with 2.9.7 (first one I installed).
When this error occurred in previous versions, all you needed to do was open the [WORDPRESS FOLDER] > wp-settings.php file, and change the maximum allowed allocable ram from there. And that’s what most guides still tell you to do now, leaving you stranded as that line you need to change is not there anymore.
What you see though, is that at the beginning of the wp-settings.php file there is a line that says:

require( ABSPATH . WPINC . '/default-constants.php' );

which pretty much says it all, unless you are not the least bit PHP savvy (hence, this guide is for you).
All you need to do is open the [WORDPRESS FOLDER] > wp-includes > default-constants.php file, and change the line:

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

into

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

or anything of your liking (may be 36M, 48M, or whatever depending on your setup); obviously, the lower the better for the performance of your server, especially if you’re on a shared hosting.

  This article has been Digiproved