So the other day I got an email from Google AdSense that was frustrating, to say the least…
…frustrating because admittedly until earlier this week, I haven’t even posted anything to Just Laugh for a good six months, so for the most part it’s barely even on my radar. Yet I use the same Google AdSense account for all of my sites and I don’t really want to get the thing suspended … what, for the whopping $100 in ad revenues that I somehow collect every year or so at a couple of bucks in random visitors each month! 😛
Also, it’s stupid because the post that apparently flagged this “mature content warning” was published a year and a half ago and never got a complaint until now, but whatever…
Now I just use simple text widgets to insert AdSense blocks around Just Laugh and being a WordPress site, it’s all done through templates so it wasn’t easy to just “remove ads from the violating pages.” I looked around, but surprisingly didn’t find any plugins that would allow you to omit specific URLs from receiving ad code, and apparently AdSense itself doesn’t have anything either – you can block advertisers, but not specific content on your site.
This seems weird and dumb because no doubt there are plenty of sites that publish “adult content” with “adult” meaning 18+ … not for kids and not here’s where you can buy vibrators and inflatable sex toys!
…I wonder if just mentioning those words will get this blog post flagged … in a year and a half…
Anyways, I found this simple write-up that basically has you create a new custom field and then uses an if/else condition in PHP to determine whether or not to display the ad code that you choose…
It’s not perfect – at least not in my layout – because I suppose if I really cared that much I wouldn’t want the Sponsors widget to display at all if it’s going to be empty anyways. An alternative would be for me to insert a house ad or something into that block so that it isn’t empty for that one post, but honestly according to my stats this specific post has gotten viewed a total of 39 times since it was published last spring, and 8 times this year … so I really don’t care right this second as long as it prevents Google from suspending my account whenever they get around to rescanning the page! 😛
One note – if you use a widget-based solution like I do, you’ll need a widget that can parse PHP because the regular Text widget in WordPress doesn’t and I made that mistake the first time around, not noticing it until I reloaded the page and saw the actual code everywhere. Fortunately I already had the Enhanced Text Widget plugin installed and it works great.
I suppose if I get more notices down the road about other inappropriate content, I can go back and add alternate ads to load as I flag the new posts, but if you just need something quick and dirty because Google randomly crawled an old post and is complaining about it, this works just fine in about 10 minutes time. 😉
You know what they say – any day that you launch a new website is a good day… 😉
This is one that I actually started kicking ideas around for earlier this year, but didn’t really have the time/content/procrastination for another project at the time to drive me there. I had a very brief mockup of what you see above running on a test site, but apparently today was the day that I actually mustered up the effort to both write the first post about the recent presidential debate as well as work out the kinks for the site design itself.
…although admittedly it wasn’t necessarily in that order! 😛
Anyways, the intent of this site – whether I managed to do it justice with the first post or not – is to give me a place to write in more depth about editorial-type topics that would normally otherwise be ranty-type posts on my regular blog. Kind of along the lines of some of the better quality posts you might find on a Medium or something of that nature, I was originally thinking about trying to host them there, but the whole huge audience/no pay thing is a problem for me and doing it myself gives me the control that I like to maintain with publishing my writing online nonetheless.
The plan isn’t really to post super-frequently – maybe one article a month, at best – but I really don’t want to force it just for the sake of keeping a writing schedule. Instead I want Scott’s Thoughts to be a place where I can elaborate on topics in a manner that feels a bit more professional so that there’s really a focus on the content itself rather than tying in my humor and other writing that might be seen on my blog as more of a distraction.
You’ll also see that I ended up pulling in a small handful of really old, but somewhat related articles that I wrote in this same vein more than a decade ago. Back when Comedic-Genius.com was my primary writing site, I had a bunch of different columns that I was writing – one of which was an editorial piece called Against the Grain… In truth there were upwards of 50 columns in the series before I ended it, but upon further review there simply weren’t nearly as many worth preserving from ten years later as I would’ve thought!
Hopefully the new series will fare a bit better, though I would argue that maybe that’s just another factor of getting older that one simply needs to get used to… 😉
* * * * * * * * * *
In geek news, this site is also my official foray into WordPress multisite-ing!
My testing earlier this summer was pretty unsuccessful, but before I let myself delete the install altogether, I tried one last test creating a new multisite environment with this blog and the new editorial subdomain, and it actually worked so I just decided to keep it. 😀
My multisite network currently consists of 4 sites total – the two previously mentioned and then two more test sites for more ideas that I haven’t gotten off the ground yet. For simplicity’s sake, I decided to only worry about sites that are actually subdomains of scottsevener.com right now, so humor and mouse and Just Laugh will all stay where they are … I’ve heard horror stories about trying to un-co-mingle sites once you go multisite, so no sense in adding new stress there!
Still lots to learn – the only real big dumb thing I’ve come across so far is the difference between Network Activating Plugins vs Network Enabling Themes because apparently doing the first forces activation of plugins network-wide (which is a neat feature for the ones I use everywhere) but the second simply makes themes available to activate on a given site … terms are just a little too close for my comfort, really.
I’m curious to see how performance ranks in comparison to the individual installs, but for now at least I was able to drop my install count down to under 20!!! 😯
I think I’m making progress, albeit in a number of avenues that I wasn’t necessarily expecting!
One thing standing out that is seeming to be more of a problem than I would’ve thought is that simply put – I’ve got a lot of WordPress installs on this server!!! Sorting through them all, I came up with something like 20 installs in total, which is amusing because I’ve only got like 10 domains currently registered … apparently I’ve built up a healthy list of test installs in addition to some really old ones that I never post to and thus don’t really think about.
Now I wouldn’t have thought this to be much of an issue until I was able to start digging into specific processes running slow along with their associated URLs and database queries, and it turns out that WordPress’s own cron function has been at least part of the source of my problems, for a couple of different reasons:
A) Across those 20 installs, a number of them weren’t up to date – some of them being so old that I had to update them manually (gasp!), and more prominently some outdated plugins that either also needed to be brought current or in some cases removed altogether for instances where I’m not even using them anymore (i.e. I used to heavily use a backup to Dropbox plugin, but I’ve since come to rely more on system-wide backups and I don’t even have Dropbox installed on my laptop today).
B) Also, I still need to learn more about how WP-Cron actually functions, but I think there may have been some cases where many sites were trying to all run at the same time, which is just a general recipe for disaster! From what I’ve read so far, it sounds like WP-Cron actually triggers based on page views … which confuses me how my test sites were even triggering … but one option here might be to disable WP-Cron and instead tie them into real cron jobs at the OS level so that I can scatter them throughout each hour instead of triggering arbitrarily.
I’m not entirely sold on B just yet, but realizing that I have so many separate installs definitely reinforces my curiosity around WordPress multi-site, which I was playing around with earlier this summer and actually abandoned when I decided not to redesign some of my sites. But from a resource management perspective it still might make sense, even if I just try to pull some of the like-minded sites into one install, or possibly even a bunch of the test sites, just to help get the numbers down!
All in all it’s a work in progress, but so far my last high load notification was at 5:50 pm last night and I updated a bunch of my installs in the hours since, so hopefully I’m starting to work through the issues and load is at least going down a bit! Mind you, it doesn’t help that I don’t really know what’s a reasonable daily page view volume that my current server should be able to handle … and granted, now that I’ve started playing around with routing some of my traffic through Cloudflare, I’m sadly reminded about how much junk traffic a server gets that never even becomes legitimate pages served (like brute force attacks, scanning, etc…).
One other tool that I’ve found that’s been helpful specifically in pinpointing the cron issues has been New Relic, which is actually a probe that I had to install under PHP on the server itself but then in turn monitors all sorts of neat stats about processing times and whatnot. I’m just using the free Lite version they offer now and it’s already been enlightening – definitely worth checking out!
I’ve been experimenting around with performance tuning on my web server the last couple of days to try and work out some bizarre, high usage issues when (unfortunately) in reality none of my sites really garner that much traffic to warrant the spikes that I’ve been seeing.
Some of it is common sense stuff like troubleshooting slow-performing WordPress plugins – for example, apparently W3 Total Cache was dragging down my response times even though it wasn’t active at the time, which lead me to reinstalling and then actually setting it up correctly because I think I disabled it a few months ago out of sheer frustration.
I also made some tweaks to my Apache/PHP build, thus resulting in my having to rebuild no less than a dozen times last night each time I’d find a new option that I could only enable by rebuilding! So if for some reason you found one of my sites down last night, that would be the reason why… 😛
In the midst of all of this, I’ve also been trying a number of different web page speed tests to try and gauge my progress through the whole mess – Google PageSpeed Insights is usually my go-to for general tuning, but I also like WebPageTest.org because it gives me waterfall graphs of every single element that needs to be loaded, and I also recently discovered GTmetrix, which is cool because it will run several tests at once and gives you the option to see results for multiple sites side-by-side … something I normally have to do in separate windows.
Anywho, one of the views that I found interesting from WebPageTest.org is where they breakdown the actual requests and bytes coming from each individual domain because obviously the lower # for either of those stats, the faster your page will load. Below is what Just Laugh’s homepage looks like…
What’s interesting here is that really only a select few of these domains are related to actual content – primarily justlaugh.com and then wp.com because our images use WordPress.com’s CDN via the Jetpack plugin.
All of the Facebook hits are for the single Like box in the footer, and the same with Twitter.
We also have a single ad widget for Amazon, along with a couple of Google Adsense units, and then we use both Google Analytics and WordPress Jetpack for analytics.
So really, totals breakdown something like this…
- Content – 75 requests for 509k
- Social Media – 51 requests for 667k
- Advertising – 51 requests for 634k
- Analytics – 10 requests for 18k
- GRAND TOTAL – 187 requests for 1,828k
Now don’t get me wrong – there’s certainly value that comes from each of those other three sources otherwise I wouldn’t use them in the first place, but it still says something interesting about web content in our times when social media & advertising tie-ins together make up more than double the actual real content that a website has to offer to drive those other things in the first place! And before you say that it’s really kind of my fault that the breakdown is like this because I designed the site, I would add that really, Just Laugh is extraordinarily conservative with regards to advertising compared to other media sites that still use pop-ups and wraparounds and those god-awful Taboola ads that currently infect 80% of the web today.
Of course, the real exercise here is simply how to improve on these numbers, which is tough because most of these requests are still measured in milliseconds and many are done in parallel. The whole page currently takes right around 10 seconds to render, which in some ways seems terrible but in comparison with sites like CNN and The Onion it’s actually about right in the middle.
Could I shave off a couple of seconds by eliminating the Facebook and Twitter widgets, or possibly even the Amazon widget???
Possibly, but would the savings really be worthwhile in the bigger picture when gaining Facebook and Twitter followers is also a worthwhile goal???
Clearly I have no idea, but it’s always fun to have real, actual data to wade through to consider things like that!
On the other hand, at least I can say for a fact that my caching is now working correctly because for repeat views, all of those 3rd party requests are pretty much the only things still getting reloaded… 😀
I’ve put off writing this post for a while now, partially because I’m still not sure that I understand it and partially to make sure that my “fixes” that I’ve put into place actually work! 🙄
So about a year ago I started having issues with the server that runs all of my websites running over-utilized. It was a big, nasty affair that we had a hard time tracking down, on top of being a nightmare because we were supposed to be celebrating my birthday over at Disney after having just started our second round of IVF with the embryo which would eventually become Christopher … needless to say, it was VERY stressful!
After we got things back up and running again, I spent about a week researching how to make sure that it never happened again and one thing that I dove heavy into was caching. There are some plugins that are decent, but you can also do caching at the server level on top of all that and this is where I met my new friend, APC…
Now, the good thing about my friend APC is that it’s extremely efficient at what it does – like, it’s one of the best PHP accelerators you can run. Facebook uses it, which sometimes you wouldn’t know, but still, even I can’t deny that they’ve got a fuckton more users than I’ll ever have, so I’ll take their word for it! 8)
Of course, the bad thing about APC is that you have to change the way that PHP runs on your server to enable it … or at least I did. And that’s where the problems began…
Normally most shared environments will run under the SuPHP handler because it’s secure in the way it runs scripts under the users that actually own them. For WordPress, this makes permissions simple because everything just works right out of the box as it always has for me for the past blorgteen years.
Now to run APC, however, I needed to switch over to DSO, which from a security standpoint didn’t seem like a big deal because I run on a VPS, not a shared server now, so there’s not really any risk of “other users” running anything on my machine because there simply aren’t any.
That said, what DSO does do is royally hose up permissions in WordPress because the settings that it needs to upload images, edit themes, update plugins, etc… don’t work because now the web server runs as a separate user (“nobody”) instead of whatever user happens to own the files that it’s trying to execute.
I finally decided to spend some time digging in to fix this. For a few months, I actually did this very much the wrong way by chmodding the uploads folders of the main sites I was using at the time to 777 … which is bad, so don’t do that!!!
Instead, it seems that the solution wasn’t too crazy after all – to fix the file uploads, I just did a chown -R nobody:nobody uploads and that cascaded the new ownership recursively through all of the subfolders … no need to change any actual permissions, except to change them back from 777, anyways!
I was also able to do this for my Disney site that runs NextGEN Gallery and the results were the same (sorry, can’t remember the specific folder, but it’s in there somewhere!).
Now as for plugins and theme updates, this got a little trickier because I tried the same above and that didn’t seem to work, and I really didn’t want to open up permissions on these folders … even though there’s apparently a way to mask them back to normal by inserting something like these into your wp-config.php file:
define('FS_CHMOD_FILE', 0755); define('FS_CHMOD_DIR', 0644);
Instead, I inserted these into my wp-config.php file…
define('FTP_HOST', 'localhost'); define('FTP_USER', 'username'); define('FTP_PASS', 'password');
You may have noticed as I did many times throughout this ordeal that if WordPress tries to make an update, but can’t because it doesn’t have the right permissions, it will jump to a screen asking for FTP credentials and then make the changes it wants to do via FTP instead. For the longest time I just entered these manually out of frustration, but now that I think I’ve settled on as close to a “solution” for this as I can get, the above three lines prevent it from prompting me for credentials and I’m now able to install, update, and delete plugins and themes from within WordPress just as if I was running under SuPHP!
Admittedly, I am a little curious to know if there are any other security flaws with having some folders owned by nobody, but from what I can tell it’s still feasible and loads safer than 777. And I get to keep running APC, which I’ve now thrown enough memory at to keep roughly 99% of the php files from all of my sites caching out of system memory instead of parsing off the disk, so that’s a nice little speed improvement that you may have noticed around here!
…but if you do know something I should know about setting up permissions and ownership this way, do be a good samaritan and let me know, though, would ya? Right now I’m cautiously content … so take that for what you will… 😕
I’ve been working on a new WordPress redesign for one of my sites this weekend because my head just hasn’t been in the place to get much writing done, and for whatever reason I somehow stumbled onto this article from a few years back that talks about the dangers of malware within a WordPress theme and why it’s so important to download your themes from trusted sources, or ideally directly from the free theme repository hosted by WordPress themselves…
I mean, I’ve come across the themes that use a little trickery to preserve the SEO spam links that they’ve sold and built into the footers where they typically create a function to look for those specific links that won’t display the site if it doesn’t find them, but reading through the example above, I never would’ve thought of something as elaborate as concealing a piece of code at the end of an otherwise expected preview image, then breaking it back out on the fly and searching for places to execute it to create a backdoor into the server that is triggered by the attacker setting a cookie and then simply visiting your site … it’s really a pretty crazy scenario if you’ve got a few minutes and you know enough about PHP to follow along!
I know that every so often when I notice something odd on my server, one of the first things my mind jumps to is whether I did something stupid that opened myself up to being hacked. So far I’ve kind of lucked out and they’ve been fairly benign – once I got a notice for sending spam because I had created a test email account a long time ago with “test” as the password (?!) and then forgotten about it … and somebody else found it. Another time I actually found a piece of malicious code in a random sub-directory that was a little creepy – again for sending out spam.
You like to think, “Bah – I’m nobody and my sites hardly see any traffic … who would bother targeting me?!” But a quick check of the logs is all it takes to reinforce that most web attacks aren’t really targeted at all … they’re just randomly scanning for machines that can be compromised, sometimes to be used for DDOS or spam boxes, and no doubt sometimes just as another notch in the bedpost to see who can infiltrate the most systems.
As if we didn’t have enough to worry about around this crazy, mixed up interweb! 😉
Some may have noticed that I’ve been kind of neglecting my humor column as of late.
It’s not that I’ve stopped writing it altogether, even though that’s pretty much what a look at the archives might suggest. I guess you could say that I’ve just been … busy … and humor hasn’t been getting the priority it deserves for about the last year or so.
For what it’s worth, I have still been writing … I’ve got bits and pieces scribbled down for a lot of the columns that I’ve missed, but it’s just going to take some time to organize and pull them all together. It’s going to be a ton of work, but that’s not what I wanted to write about here…
This weekend I started working on the next redesign of comedic-genius.com, and so far I think I really like what I have. It’s kind of a tricky redesign because right now there’s a bunch of really old stuff on that site that doesn’t directly relate to The Humor Column. It’s mostly other random columns and writing that I’ve done over the years, and even though none of them ever found the same traction as humor did, there’s still a sizable volume for a couple of them.
So part of the problem is that I don’t know what to do with that stuff. Some of them I honestly couldn’t care less about, but others I look back on and really appreciate for where I was in my life when I wrote them … and yet I’m not sure if they really belong on a site that’s supposed to be dedicated to humor writing going forward.
And yet on the other hand, I’m kind of really enjoying creating a site that’s solely dedicated to just that one feature because after almost 15 years of writing this stuff, there’s actually a lot of different things that I can do with all of that old content now! Not only does the new design that I have so far do a bit more to highlight by older recent columns beyond just the latest one, but I’m also looking forward to going back into my archives a bit to bring back to light some of that older content as well. This is the year when I’m going to break 500 humor columns published, which from what I’ve been told is a pretty big number for a weekly feature, so I want to take better advantage of that and not just show off whatever I’ve written most lately.
Of course, I also need to build a proper store into this site because the # of books that I’ll have for sale by the end of the year should be really getting up there … I’m not nearly as excited about building that simply because I’ve looked into it before and have yet to find a store plugin for WordPress that I really like. And it doesn’t help that a lot of them aren’t free, making it tough to try anything out because I’m not exactly going to drop $80 on a plugin that I don’t end up liking!
I think it’s going to be an interesting year, even if it still takes a couple more months to really get my humor game back where I want it to be. I’m not happy that I’m not publishing a weekly column at the moment, but I think when I finally get back in gear, it’s going to be a much better presentation and hopefully that will help keep me a little better motivated to stay on track in the future.
Frankly, I’m just as surprised as you are…
I hadn’t exactly given up on getting my comments imported from LiveJournal after migrating the rest of the blog over last fall, but at the same time, it was kind of out of my hands unless I was willing to go under the hood myself…
…which I was actually thinking about doing, even though I really have no idea how that API even works…
…but luckily, I didn’t have to because out of the blue, I saw an update to the import plugin yesterday so I decided to give it another try, and low and behold, it actually started doing stuff when it got to the comment import portion!
Mind you, the importer ran and ran for a long time, which I know that it technically anticipates with a warning at the top for those who have lots of comments (mine allegedly has 802), but apparently part of it was because somehow I ended up importing a ton of duplicates that I later had to go back in and wipe out. Sorry … I didn’t save the exact query, but I used something along the lines of this to weed out the couple of thousand extras that piled up on a handful of posts.
(You also need to refresh the comment count afterwards because that’s actually stored at the post level, fyi…)
So anyways, I’m definitely happy that this is finally completely done … I honestly don’t get a ton of comments or anything, but having migrated everything else over I kinda felt bad that the comment section hadn’t followed with the rest of my earlier posts as originally intended. Now this is truly a full copy of my original blog that I started way back in 2003, so it makes me feel better to know that if LJ eventually does go completely under one day, I’ll still have a snapshot in its entirety of my early years of blogging! 😉
If you’ve been having issues on importing comments from LiveJournal to WordPress for the same reason, it might be worth updating to the latest version of the plugin (0.5, as of now) and giving it another shot. Of course, be sure to backup your database before kicking it off, but I didn’t get any duplication with the posts that I’d already pulled in – just some weirdness with duplicate comments that took maybe an hour or so afterwards to resolve.
Well, check another one off the list, folks – what you see around you is as good as it’s gonna get! 😉
It’s kinda crazy that it’s been 8 months already since I first undertook the task of migrating my blog from LiveJournal over to WordPress … and for what it’s worth, it’s not like I’ve been working on it solid all of this time! Truth be told, aside from a few days here and there to get the kinks worked out of the header and the homepage, I haven’t really touched this thing to finish it up in quite a while. And yet it’s forever been another pair of checkboxes on my 2012 timeline, taunting me as I yearn for newer projects that actually have a chance of making me some money…
Anyways, what’s done is done, and I’m happy to say that this site – ScottSevener.com – is officially as done as it’s going to get until a year from now I feel like it’s grown horribly outdated once again and I’m faced with the task of gutting it and starting anew once more.
For what it’s worth, though, in this particular point in time here on July 3, 2012, I’m actually really happy with the way that it all turned out. I got the self-hosted home for my blog that I’ve been wanting, and I also got a pretty slick interface on the homepage to highlight all of my writing that’s taking place on other sites that I run! Plus, I can do some other cool stuff that a regular blog makes difficult, like these random lists of stuff that I like and my favorite things, and this favorite tag page that promotes some of my best along with a slightly different display of all the rest than most people are used to seeing.
Technically the one other thing that I still need to do is swap out a couple of images in the header menu for abandoned and replacement projects, but I can’t really do much about that until said other projects are actually further along…
I guess it’s sort of a funky mesh between personal and professional, plus it’s nice to be able to share some of these kinds of things a little more publicly than just throwing them up on Facebook where the same 122 friends are my entire audience. Here I’ve got the potential for, well, more, and hopefully over time other folks will grow to enjoy how I’ve brought everything me here together under one roof, too!
Now what was I supposed to be working on next??? 😯
This is something that I’ve wanted to do for a while, but just never sat down to actually put together. It’s kind of fun to not only speculate about the places that you’d like to visit in the future, but also review your favorites from places that you’ve already been.
Admittedly, I do kind of feel like I need some more on my to do list, especially from an international perspective, but for now I just put the ones that immediately came to mind – Australia, Japan, France, Egypt. I’m sure I’m missing lots of cool islands and places of vast cultural significance, but I think this is a good enough start to consider it a work in progress… 😉