MD5 in Java Compatible With PHP md5() Function

The request was to have a Java function generating the same MD5 string generated by PHP when using the md5() function. Here the code snippet:

Please, note the check on the “toString()” result which must be padded with a zero if needed.

Have a nice hashing!

MD5 in SQLServer 2005+ Compatible With PHP md5() Function

The request was: replace the clear password on a big account database with its MD5 version as a string like the one we get with the md5() PHP function. There are a lot of suggestions on Stack Overflow, but many of them work only with SQLServer 2008 or greater version. Of course before to understand that limit I tried all the tips on my database (ok, not knowing it was a 2005 version).

But in the end there is a simple and definitive and tested (by me) solution to this stupid problem. Here the query to execute to replace a field with its own MD5 has like the one returned by PHP.

Of course you should replace the “users” table with your own, and the “password” fields with your own. Pay attention the password field is repeated in two place inside the query.

Hope this can be of help! For who work on SQLServer 2008 or greater there are simpler version of this query using the “convert” T-SQL function.

Donations From April 2015 To June 2016

Long time since my last donation of donations, but it has been a complicated period. What matters is to keep on tracks, even if a little bit late! The total amount of donations is 300 euros (about 340 dollars), donated to Save The Children.

As you know I think the right for a “normal” childhood is what can change tomorrow World.

Thank you, Stefano.

Comment Plus 1.4.3

This new version fixes the issue when an administrator replies to a comment directly from the administration console and the notification is not sent. Now should work correctly with the latest WP version.

Header and Footer: Inject In The Middle Of The Post

This new fabulous feature of Header and Footer has been requested few times and I introduced it for a my personal need on a big blog I manage.

How does it work?

Rather simple: a generic block of code (in my case a snippet of JavaScript) had to be included just before the first <h2> subtitle in posts but only if the <h2> subtitle was “enough” far away from the post main title.

It is not easy to control all that in a scientific was, but we are not scientists, we need only to put an ad in the middle of a post.

So the natural rule were: add this piece of cool code just before the first <h2> you find but start searching for it after 700 characters from the start of the post. You know a post contains HTML tag so 700 characters and actually not 700 human readable characters, but still we are no scientists.

This rule is so clear that it toke to me few minutes to implement (of course using the code already written in that big blog in a custom plugin…).

Another interesting way to find an injection point is the <p> tag, or the closing </p> tag. For example you may want to add something just after the first post paragraph. The rule will be: add that just after the first </p>, of course starting to search from the top of the article.

Why to inject before or after an HTML tag? Rather simple, because you don’t want to break up your so carefully written article, right?

There are special case on may want to manage: what if the <h2>tag is not found on a specific article? Maybe we want to recycle that code and inject it at least on top or bottom of the article (you know, loose ad impressions is not good). The rule has an option for that as well.

Now it’s up to you: add your own rules and inject the ads in the most profitable position and… share with me your results!

Header and Footer 2.0.0

This is a really important Header and Footer release since you will find a new interface, CodeMirror with syntax highlight, better mobile codes management. Hopefully without too many bugs even if it is a major release.

The most important new feature is the injection in the middle of the post, or better an engine that injects following you own rules. More on this topic will follow with a couple of articles.

Injection on bbPress forums, posts and replies should be more stable and easy to configure. There are even generic injections which search for some code in the generated page and replace them. More on that on next articles.



FLV Auto Player End of Support

Few years ago I wrote FLV auto player, a plugin which was able to replace a link to an uploaded .flv file with a player. Exactly what recently has been introduced in WP for .mp4 and other video formats.

Since the support for flash is day by day disappearing, the plugin has no more sense and so there is no reason to support it for more time. It does a very good jobs on my blogs, now is time to retire!


Hyper Cache 3.2.5

The new release introduces a even better integration with Autoptimizer a very smart plugin which optimize your javascript, css and html. Hyper Cache works very well with Autoptimize and used together they boost the blog performances.

Hyper Cache is a caching plugin for WordPress aimed to be lite and simple to use. Give it a try and anyway always use a caching plugin ’cause they make your blog more environment friendly.