Database Bloat by Transients

When I set up this blog on the production server, I thought I was going to be able to eliminate some of the database bloat by removing all of the default themes and installing my custom theme before running the install. My theme has some code in the functions.php file that removes all of the admin dashboard feeds. It didn’t work. WordPress expects there to be an activated theme, and isn’t smart enough to use the only one there is in the themes directory. I probably could have accessed the database and changed the theme before doing the install, but I’m not sure I would have achieved what I set out to do.

Continue reading

Another Look at Rebuilding Image Tags

In a blog post I wrote last month, “Rebuilding Image Tags When Adding Media”, I discussed a technique that builds image tags instead of removing attributes that are undesirable. As it becomes more popular, a lot of web designers are going to want to incorporate Responsive Web Design, and removing an image’s width or height attribute may be essential.

There was a problem with my proposed code. If the image was sent to the editor inside an anchor or had a caption, and if using the visual editor, the caption would disappear on save, or the undesired attributes would not be removed. Unpredictable behavior would also occur when switching between the visual and text tabs. This is really not acceptable for the majority of WordPress users, so I thought I better try to figure out a better way to handle removing the width and height attributes of images.

Continue reading

Changing Comment Error Messages

WordPress offers many ways to customize itself, yet the error messages that are displayed when a site visitor unsuccessfully posts a comment leave a lot to be desired. At least when comments are closed the error message starts with a word that is capitalized, as seems proper.

While not the focus of this blog post, I’d like to point out that there are no back buttons on any of pages that display error messages for comment submissions. Why not? I’m going to show you how to add one.

Continue reading

Unnecessary Loading of Resources by Plugins

Why do so many WordPress plugins load javascript and CSS files when they are not needed? This was the question going through my head tonight as I looked at at least a half dozen code highlighting plugins.

If I install a plugin for a feature that is used in only a small percentage of my blog, why would I want site visitors to download a bunch of stuff they don’t need? The site visitor may have been referred by a search engine for a blog post that doesn’t need the plugin’s resources. Also, why would I want to make my blog slower with the extra HTTP requests? Loading resources for no reason doesn’t make sense.

Continue reading

The Comment Redlist Plugin

WordPress Comment RedlistComment spam is a huge issue for WordPress blog owners. I remember when I started my first blog, and it was shortly after that when I started seeing the comment spam pouring in. I took it personally, as if I was being targeted and attacked, but that was a misunderstanding of what was really happening. The true nature of how most spam comments are submitted to your blog is that they are generated by robots, who don’t know anything about you or your blog. By robots, which I will call “bots”, I mean computers that have been programmed to find blogs and comment on blog posts. You don’t really think a real person would waste their time trying to post that spam on your website, do you? Well, they don’t, and that’s why it’s going to be easy to stop.

Continue reading