PHP, __FILE__, and eval()

Posted by & filed under Programming.

Came across an odd error last week. And by odd, I mean that Googling for the error message only turned up one page. One of my scripts was using eval as a way to semi-protect the code. Yeah, not a great solution. But it’s not possible to install software on all of the users’ servers… Read more »

Hits on wp-login.php from the Netherlands

Posted by & filed under Blogging, Internet.

Noticed something looking through AWStats this afternoon. Traffic was coming from 146.0.74.234, an IP address in the Netherlands owned by a Russian. Sure, there will always be a few random hits like that, but this one has hit the login script 2,300 times this month. That’s a problem. A quick ad to the CSF deny list… Read more »

Sorting on version numbers with PHP

Posted by & filed under Programming.

Needed a quick way to sort on version numbers, and PHP has a usort function that makes it pretty easy. You’ll need an array to sort and call the usort function with a callback. Now the callback. We’re going to use version_compare. Only minor quirk is the * -1 to flip version compare. I wanted… Read more »

Amazon Images plugin for WordPress

Posted by & filed under Blogging, Programming.

Every now and then I like to link to Amazon products, along with an affiliate tag. Nothing spammy. But I figure if I’m going to link to something that they make money off of, I might as well try to make a bit as well, right? Downside is that the link builder inside Amazon typically… Read more »

Chrome not saving cPanel password since upgrade

Posted by & filed under Computers & Internet.

Last week my server updated WHM / cPanel. Only new thing I’ve noticed is the shiny blue login screen, although I’m sure there’s a lot more under the hood. The problem though is that at the same time Chrome stopped automatically loading saved passwords. Googling brought me to this post on the cPanel forums, which… Read more »

Editorial Calendar WordPress plugin

Posted by & filed under Blogging.

This is one of those plugins that I wish I’d been using for years. Those that “know” such things say that you’re supposed to spread your posts out and not dump a bunch on one day. Well, that’s pretty much what I’ve always done. I started using a small plugin that I wrote a few… Read more »

Count all post in a WordPress blog network

Posted by & filed under Blogging, Programming.

Needed this bit of code to keep count of the total number of posts in a network enabled WordPress site. It pulls the list of blogs and the goes through each, gets the post count, and sums it up. Certainly not real efficient, and doubtful you’d want it to run often on a large network…. Read more »

Comparing two SVN branches – thank you TortoiseSVN

Posted by & filed under Programming.

Updating the available pre-release version of ProofBuddy was on my to do list last weekend. A few months ago I wrote a script that pulls a specified version from a subversion tag and packages it up. For the last couple of weeks I’ve been sitting on a beta version to give testers a chance to… Read more »

Drag and Drop Uploading – Worth the upgrade just for that

Posted by & filed under Blogging.

Sure, I know there was more to the upgrade than just this; but the drag and drop uploading in the latest WordPress is an outstanding addition. Instead of having to browse through folders looking for the right file, it’s just a quick drag from Windows explorer to your browser. Yeah, I guess you’re still looking… Read more »