On the page where they explain how to create tables for your plugin, there’s a link to the register_activation_hook function, which is run when the plugin is activated. However, right in the first section, it says:
Note: Don’t use activation hooks (especially for multisite). Do this instead:
It’s far better to use an upgrade routine fired on admin_init, and handle that per-site, basing it on a stored option.
That links to another page, which repeats the information, but doesn’t tell you how to do this. Here’s one way. Continue reading WordPress Plugin Update and Install Functions
Everyone loves the parallax effect, and I’ve been swiping snippets of code to do it for a long time, but never really thinking about it too much. You load it, set some parameters, and that’s it. I was having a little glitch with one, and was tweaking it, and I started to wonder why the effect didn’t just start at one end of my image, and end at the other end.
After all, if I don’t show all the pixels, I’ve “wasted” all those network bytes to load the data, and all the memory to hold the data.
This parallax effect is stingy with network bytes.
Continue reading Yet Another Parallax Effect, but This One Wastes Fewer Pixels and Bytes.
I’m shocked at how many businesses still have websites that don’t work in mobile. For the average person, reading web pages on a smartphone is the primary way they read content on the web.
Though I’m not 100% on board with “mobile first”, it should soon be the norm. To CSS hackers, “mobile first” just means implementing the mobile layout first, then making the wider-screen layout the exception.
Continue reading Responsive Design + Mobile First = Automated Layouts
I’ve been doing a lot of WP hacking, but my website was on a very old copy of Drupal (version 6!) so I thought it best to transition to using WP for my personal blog.
The old site is here.
They’re both good platforms, but the WP market just seems to be dominating, especially for lower-cost sites.
WP’s core code is still a maze.
Every time I get a grip on one part of the codebase, I go into another part, and it’s completely different. The code quality has improved, though, so, it’s pleasant.
ERROR 1698 (28000): Access denied for user ‘root’@’localhost’ started showing up with the system upgrade to Ubuntu 15 and MariaDB.
Continue reading ERROR 1698 (28000): Access denied for user ‘root’@’localhost’
This is a revision of an old article, from the old website, describing some things I learned about collecting names.
Several years ago, for the Obama elections, I had to manage a bunch of sign-in sheet info. To perform the data entry, I did a few things to make life easier (for me).
Continue reading A Volunteer Sign-In Tool
This article describes how to use Python’s logging
library to send logs to syslog. Then, using rsyslog,
a fancier syslog, we produce a log of pre-filtered
Continue reading End the Chaos, Get with the Program: Python Logging to Syslog, and Filtering with RSyslog