How to Impersonate Users in WordPress (Or See What They See)

Related

View the short version of this video.

Transcription

In today’s video, I’ll be showing you a plugin that allows you to impersonate other users, which I find especially helpful when it comes around to helping a user that’s encountering a certain issue, maybe they can’t see something, or something’s not – doesn’t look right to them.

So in the WordPress dashboard, in the Plugins section, let’s click Add New Plugin, and here we’re gonna search for “user switching” and press enter. The first option is going to be by John Blackbourn & contributors, at least that’s the case right now. You’ll know it’s the right one if it has these contributors and the title is User Switching, so I’m going to click install now – and I’m going to click Activate.

Once it’s activated, what you can do is simply go to the users list, and then in the users list, if you hover on any user (apart from yourself because that doesn’t make sense), you will be able to see a new option, it’ll say “Switch to” – see this right here? So if I switch to this user, I’m going to be seeing the world from the perspective of John Doe, and John Doe is a Subscriber, not an Administrator. Not only will I see the world from his perspective, I will be able to act as him, so let’s click.

Okay? So I am now John Doe. You know that because in the top right corner, it says Howdy, John Doe, also, you can tell that I have a lot less options, because I’m a Subscriber now and not an Administrator. Now, again, when I am viewing the world like this, I’m actually able to behave as him, so for example, so if I go to the Hello World post, I can go to the bottom here and leave a comment – and that actually will be posted on his behalf. So we have to be real careful with a plugin like this because we don’t want to do things that will negatively affect the user. I personally rather use it just to see what they’re seeing, to see if there’s maybe a permission issue, maybe there’s something they’re not seeing that they’re supposed to be seeing. That’s my preferred use case.

Now whenever you’re done working with a user, all you have to do to go back to the real world, that is, your actual identity – is to hover in the top-right corner, and then click “Switch back to (your username)”, here.

Now bear in mind – if you have multiple tabs open in your browser, some of those other tabs might still seem like they’re logged in as the old user, but that’s just because they need to be refreshed, that’s it.

And so that’s how it works. Another thing I’ll show you is if you go into the dashboard here, and click Users, okay? You’ll notice that I can actually click through to the user to see the actual full page, and the same option is here – User Switching – Switch to. That’s another way to do it.

And so that’s it. If you guys have any questions or comments, don’t hesitate to let me know.

How to Filter Out Beeping/Buzzing With Audacity (Microphone Glitch Known as “Frying Mosquitoes”)

Description

Here’s the Audacity post.

Transcription

When I record YouTube videos, these days, I always use the same Blue Yeti microphone, let me show you what it looks like. So this is the microphone I’ve been using the years, I think it looks great, it works pretty well, the only problem is, when I start a recording, and I finish my video, I actually record the whole thing, in Audacity, I can tell that there’s a persistent buzzing in beeping in the track, and even when I’m saying nothing, there’s a persistent buzzing and beeping sound. I never quite figured out how to solve this, I also didn’t really know how to search for this, because it sounds so strange – like how do you describe it? Before I tell you more about this, listen to what it sounds like I’ll use some editing magic so you know what it’s like when it’s unfiltered.

You see what I’m talking about? Even when I’m speaking, you hear it, but it’s best understood when I say nothing.

So I’ve been dealing with this sound by simply editing it out using Audacity, and that’s the trick I’d like to show you today because I thought it was pretty useful. But first let’s talk briefly about what this is called, because this was weird, when I found it. People call it frying mosquitoes. That’s right… frying mosquitoes… how could I have not have guessed that? But of course from hearing it, you have a sense now that it kind of sounds like we’re frying mosquitoes, there’s this weird mosquito effect to it.

In any case, this right here is a post from a moderator that’s essentially answering that there’s no solution. “Frying mosquitoes is caused by the digital data stream getting into, infecting the analog sound.” So there’s a bunch of notes here, but the gist is that you have to keep changing computers until you find one that actually works. That’s not great – so it sounds like the way that I’m dealing with it now, which is filtering it out via Audacity, is a pretty good way to do it. I’ll leave a link in the description in case you guys want to read this post fully, it has to do with I think the power source affecting the USB data stream, so we’ll just leave it at that for now, and I’ll show you how to deal with it.

Okay, alright, so let’s open up Audacity. Okay, so what we have to do in Audacity, and it’s going to be a bit difficult for me to show you, because I’m using Audacity to record myself in another window, so I’ll have to kind of illustrate part of this without being able to demonstrate it fully. So basically you’d have to click a portion of the waveform and actually press play, to hear. And you’re going to hear the buzzing and the beeping, but once you know it’s there, you need to also select a good portion of it.

And then you need to playback that selection, make sure that within it, you have just the beeping, just the buzzing. You need that pattern uninterrupted, because we’re going to be teaching Audacity to identify that pattern and reduce it across the waveform. So for example, if I were to do this instead, it will consider this part of the pattern, but that’s not related to the pattern. The problem that we have is the buzzing and the beeping that is persistent in the background, so we really need to teach Audacity well. So I would select something like this, I would double-check by pressing spacebar, pressing play, that this audio contains just the buzzing and beeping, and typically I try to give it, you know, like half a second of audio, a good uninterrupted portion, so it sees the repetition in the pattern.

And once I’ve done that, all I have to do is go to Effect, Noise Removal and Repair, Noise Reduction. And now what we do is we click Get Noise Profile. Okay? Now we have the noise profile, that’s helpful, but the next step is that we need to select all, which I’m going to do CTRL+A to achieve that, and then I’m going to go back up to Effect, going to click Noise Removal and Repair again, Noise Reduction again, but I’m not going to click Get Noise Profile, I’m going to actually go to the bottom here and just click OK.

Now, this had an effect. I can’t actually show you right now, because I can’t press play. But it actually went through the recording once and tried to clean it, okay? So the exercise now would be to actually play the recording, and see, hmmm, did it remove enough? Do you still hear the buzzing and the beeping? If you need to do it again, I would recommend that you take another sample, where you hear the buzzing and the beeping. And it’s going to be not as bad as it was before, because we just removed it across the whole track.

And at that point, what we’re going to do is, we’re going to again go to Effect, click Noise Removal and Repair, Noise Reduction, we’re going to get a new sample. And then we’re going to select all again, we’re going to go back to Effect, Noise Removal and Repair, Noise Reduction, and we’re going to click OK. And that goes through yet another time. And you do it as many times as you need, but in my case I do it twice. And then typically when I’m listening to the recording, I can still tell the beeping is there when I’m speaking, and that’s because Audacity struggles a bit when it’s in the middle of speech, because the waveform, there’s other stuff happening there. So it can like cleanly remove that without hurting my speech.

And then typically after making these modifications, I will save the project, save the project as, and give it a different name, something like example clean, as opposed to example raw, just so I can tell the difference. Yeah, so that’s how I clean up my audio. I’ll play the before and after at the end of this video just so you can see the difference it makes. As always, if you have any questions, don’t hesitate to reach out, I’m here to help.

This is what it looks like when I speak in the middle of my recording, and then if I click the mouse, and press on the keyboard.

This is what it looks like when I speak in the middle of my recording, and then if I click the mouse, and press on the keyboard.

This is what it looks like when I speak in the middle of my recording, and then if I click the mouse, and press on the keyboard.

How to Convert Multiple Images to WebP Using Google’s CWebP Tool (JPG/PNG/TIFF)

Description

You can grab the batch file here.

Transcription

Earlier this year, I was looking at my web application and looking for ways to improve performance, which is something I do fairly regularly, and it occurred to me that was I still using JPGs and PNGs as an image format in my application where I could have adopted Google’s new WebP format. Now, Google’s WebP format is superior because with smaller sizes, which you see here, 26% smaller in size compared to PNGs, and 25-34% smaller than JPGs, I could pass those savings onto my users – it would mean they would have less to download when using my application, and thus things would just be a quicker, a better experience for them.

So when this opportunity became clear to me, I went on Google’s website that you see right here, scrolled down, and then in the WebP Converter Download section, I found this link to the Linux, Windows and MacOS executables, and here I went down to libwebp windows x64, downloaded that, and then I extracted it on my C: drive, okay? So what’s important here is that this package comes with cwebp, which actually does the conversion from JPG, PNG, and TIFF also, it seems, into WebP. I really needed it for JPG and PNG.

So, like I said, I extracted it onto my C: drive, and the location that I placed it in is right here. And if you look here, you see the file in question, cwebp.exe, and in the article here you can also tell that dwebp.exe decodes them back into PNG, for example. That’s cool, but I wouldn’t really need it – because what I needed was a one-way conversion from the archaic format of JPG/PNG, to WebP.

Now that the tool is here, let’s get a sense for how it works. Cwebp.exe -help. Okay. So here we see the syntax. It says Cwebp, then you can put in some options. But it also says -q, quality, and if you look below it says where the quality is between 0 for poor, or 100 for very good, and a typical value should be around 80, okay? So the lower the value, the worse the image is going to look, probably. And then after that you see the input.png, so that’s the file you want to convert. And then, -o, and then a space, and then another file, output.webp. So this is a really clear syntax.

So we can go ahead and actually test this – there’s a few ways to do this, but I’ll start by just doing it manually. So I’m going to start by going to the root, then go to Users, then go the current user, the Desktop, and then go to the Images folder. And… here we are. So that’s the Images folder on my desktop, here, you can tell there’s 3 files in it, so JPG, a JPG, well, basically 3 JPGs, and they’re 2.4, 2.3, and 2.2 megs each. So let’s try to use this Google tool to make them smaller. Because we’re in this folder on the desktop and my executable is on the C: drive, we’re going to actually path to it, right? So I’m going to go here C:, libwebp, then it’s going to be bin, cwebp.exe.

So that should be it, as a test I’m just going to say help, there you go, you have the actual output. Then I’m going to press up arrow to make the last command come up, and now using the instructions on the screen, let’s test it! I’m going to type q, quality we’re going to do 80, because that’s what they recommend – um, or they say it’s around 80 typically. And then after that I’m going to point to a.jpg, the output should be a.webp. And I’m going to press ENTER – and if I did everything right, okay, so you see it processed it, the file, the dimensions, block count, okay… and I’m going to go take a look now because we’re still in the same directory, right, so I’m going to press dir.

Okay, so this is pretty good, you see it went from 2.4 megabytes to 0.5 megabytes, that’s a pretty good gain, so let’s take a look at the images folder through Windows, and if I take the image and throw it in a browser, you’ll actually see it. Okay, so this is what it looks like. But we’re actually looking at a webp image right now, that’s what we’re doing.

Okay, so back to command prompt. That’s nice and all, very useful tool, but my web application had hundreds of images, so how am I going to convert hundreds of images. Well, I have a little surprise here, I wrote a quick batch script, it’s really nothing amazing, but let me delete this webp. I wrote a quick batch file, I’ve posted it to my GitHub, so that anybody can download it, here’s what it is called. I just wrote cwebp-all-files-in-folder, and as you can tell, let’s go back to command prompt here, we’re still in the Images folder, okay? But now we have a script. So I will just do cwebp, tab to complete, press ENTER and you actually see, it’s processing them all. It says 3 files have been processed.

So I wrote this quickly so that it would convert all my JPG images to WebP. For my latest code check out the link in the description, you can download the same batch file and see the source code. But it’s super simple, and like I said, it’s kind of dumb, I just did it quickly so that I could solve my problem, I didn’t make it the most flexible script there is.

That’s how I used Google’s cwebp.exe to convert all my images from the JPG format and PNG format, that I used in my web development project into WebP so that my users could get a performance benefit.

Another way I can run the script I just showed you is by simply going to the images folder on my desktop, hovering on it, holding SHIFT, right-clicking, and then click Open PowerShell window here. This opens up a PowerShell window in the exact location I specified, the Images folder. So now what I can do is just type the same command, directory, to see all my stuff. I don’t have to do this, but it’s just to show you, I’m in the right place. The next thing I can do is simply type .cwebp, tab, okay, to complete the filename and just press ENTER, and you’ll notice this runs the same script. So that’s just another way to do it.

If you have any questions or comments, don’t hesitate to reach out, I’m here to help.

How to Track User Login Activity in WordPress Using the Activity Log Plugin

Transcription

So for today’s video, I have a plugin showcase for you. That plugin is called Activity Log, so I’m going to actually show you which one it is, it’s this one right here, Activity Log, and the author is Activity Log Team. It’s of course available in the standard WordPress repository. In my case, I’ve already activated it, so when I go back to my dashboard, you’ll notice I have an Activity Log entry on the left.

What this plugin does, is it adds a feature I wish existed from the start in WordPress, you actually get to see what happened to each user as they’re using the site. You see when they logged in, when they logged out, you see when they’re failing to log in, you see when certain things happen like their profiles are updated, things like that. And this can be super useful when you’re trying to help someone that’s struggling to log into your site, especially if you work in IT support.

So for example, if I were to search for the user “jdoe” up here, I would see a list of everything that happened to this person. So he was first registered by me, then he failed to log in, then he logged in, then he logged out, then he failed to log in again, then he updated his profile, maybe he forgot his password and changed it. So this tells you really the story.

If you have a user that contacts you and says hey, I’m having trouble logging into your site – and then you help them, by resetting their password, or whatever, you can then check later to see if they logged in successfully. This is useful because users don’t always tell you when their problem is solved, they just go about their life. It’s of course best if they tell you, but if they don’t, well, you have a tool where you can see if they’re okay. And you can validate that what you did for them actually solved their problem.

So there’s another use to Activity Log that I didn’t cover yet. I’m going to go back here, and here when we scroll down, I’ll bring your attention to this line, where it says username “admin” – now this is interesting because I don’t have a user called admin, so the IP address that’s listed here, is someone that tried to connect to an account that doesn’t exist, and if they’re trying to connect to the admin account, hmmm, they’re probably malicious. So I can act on this information and block that IP, for example – now you’d need another plugin for this, or you’d have to use some .htaccess features on the Apache side, and I’ll cover that in another video, but the point is, this can give you some valuable information.

So as a final step I’ll just show you some of the dropdowns at the top. So you can filter by different actions, failed login, activated, registered, updated – you also can filter by topic, so we’ve got plugins, users. You can filter by role, as you can see here, and you can filter by when this action occurred, so naturally the sooner you install this plugin the sooner you start collecting logs which can help you build a history of what’s happening to your users.

And then finally let’s take a look at the settings here on the left hand side, I’m going to click settings – so here you have some settings, keep the logs for, by default, it says 30 days – note here that you could put a giant number or leave it blank like they say here – “Leave blank to keep the activity forever”, but they don’t recommend it, and I kind of understand – you don’t want a database that continuously keeps growing and growing, so depending on how many users you have, think about how many days you care about here. I’m inclined to do 6 months, something like that, or 90 days, you know, a value like that, but not, not forever.

And this setting, keep failed login logs, I do recommend keeping that, and so do they, it seems like, because it’s interesting like we just saw to see when people failed to log in, because what username are they entering, right? And then there’s visitor IP detected, which I would leave to remote address, because having that IP is interesting, again, if you have a malicious actor, you may want to block that IP address. And then here you have a reset in case you want to wipe out every activity in the database.

So that’s it guys, that was the activity log plugin – if you guys have a better option, a better plugin that does this, don’t hesitate to let me know, I’m always interested. And as always, don’t hesitate to reach out if you need help with anything, or have any additional questions or comments. Have a great day.

How to Boost WordPress Website Performance with WebP Images

Transcription

Hello, everybody. I’m here today to share a quick WordPress tip that will help anybody running a WordPress site.

It’s becoming increasingly important on the web to have really fast performing websites because the response time is one of those signals that Google uses to determine whether your site appears above other sites. Not to mention that having a quick site is just a really good experience for users.

Now there’s many ways to improve performance, but why I’m here today is to promote the use of alternate image formats. So for example, you might be familiar with JPGs and PNGs, but I’m here to talk about WebP. WebP is a Google-developed format, I’m going to show the website right here, and it’s not really new, but I want to help you adopt this format.

So as it says here, compared to PNGs, WebP images are 26% smaller, and compared to JPGs, WebP images are 25-34% smaller – that size reduction is going to make a difference in how fast your page loads. So how can you take advantage of this? How do you start using WebP images? Well on that front I have really good news – there’s a WordPress plugin for it, and not just any WordPress plugin. Check this out… so if we go into the Dashboard, and then go into Plugins, and then click Add a New Plugin. Here you can search for any WordPress plugins in the repository, so I would recommend searching for “Performance Lab”, and then you press ENTER.

Now, here’s what’s really interesting about this one, Performance Lab, it includes, you know, “a collection of standalone performance modules” – I can tell you that within there, there is a WebP module, we’ll take a look, but here’s what I find really great: when you right-click WordPress Performance Team, where are you led? This is actually from WordPress… they actually have a team that focuses on performance. So you’re not like downloading a plugin made by some random person out there… well, I mean technically you’re downloading a plugin made by some random person, but it’s a random person that probably works on the WordPress Core team, so there’s a good rep there, in my opinion, they’re related to the actual WordPress development effort.

Let’s go back to the Add Plugins screen, and click Install Now. OK, so the plugin’s installed, I’m just going to activate it. And there it is, it’s activated! Now we’re going to go check out the settings… here there’s a few different settings, but the one I’m really interested in is this, WebP uploads, enable WebP uploads. “Create WebP versions for new JPEG image uploads if supported by the server.” Whoa. So you know what this means? This means you can just upload images to WordPress like you always used to, and it will convert it to WebP. And that’s great for performance, because as we just saw, we’re talking 25-35% roughly, per image uploaded. Okay?

So I’ll show you how that’s done, but it really is as simple as it sounds. So if we go to the library here, and I go and drag my little example JPG that’s conveniently on the desktop here and dump it here, it uploads the file, okay? But if I actually look at the size of my example JPG, you’ll notice it’s 2.3mb, right? So let’s see what WordPress does, I’m going to click on this… okay, it’s down to 234kb, as a scaled WebP image. Okay, that’s cool.

Now let’s take a look on the server. So if I go to my server, you’ll notice I’m in the uploads folder, right? So I’m going to go to the current folder, and I’ll expand here. So here you’ll notice that yes, I uploaded the JPG, but all the different versions of this graphic that WordPress would generally generate are in WebP format. Now that’s a great advantage for you – so the idea is that you continue using WordPress like you always used it, the only difference is, upload JPGs. And as long as you upload JPGs, they’re going to convert in WebP, you’ll get a performance gain from that, it’s just seamless.

So now you might ask yourself, okay, that sounds great, Matt, but do all browsers support this? Well, if you check out this tab that I have open here – so there’s this website I really like and it’s called CanIUse.com – in this case I looked up can I use WebP image formats, and as you can see here, all the browsers here seem to support it – so if you look down here, at the very bottom, the latest versions of browsers support it, other than Internet Explorer 11, but there’s no reason to support that these days, it’s too old. So this is pretty much a technology that’s available everywhere, now. So it’s time to jump on the bandwagon.

And if you have any doubts about this, let’s go back to the demo site that we have, right? So the actual WordPress website we’re testing with. This is the default theme that comes with WordPress as of this date, okay? This is December 2023. And if I scroll down then right-click this image and click Inspect, let’s look at this – oh look, it’s in WebP format, why? Because the WordPress developers know, that’s where it’s at – this is the format to move forward with right now. Now in the future, there might be a new format, but these days, WebP’s the way to go.

So guys, that’s just a quick tip to speed up your websites, and all you have to do is download a plugin from the actual WordPress Performance Team. It’s the type of thing that if it becomes popular enough, it might actually get pulled into the WordPress Core, and I like that.

Try it out guys and let me know if you need any help.

Yes, And…

I watched a Q&A video recently featuring Adam Savage, a special effects expert best known for being on MythBusters, a show where, according to Wikipedia, they “used elements of the scientific method to test the validity of rumors, myths, movie scenes, adages, Internet videos, and news stories.” It was precisely the focus on the scientific method that made it one of my favorite shows, combined also with how playfully the two hosts interacted. In this particular video, Adam responds to the following viewer question:

“As a mentor/teacher, how do you get people to believe in themselves and to encourage them to take those first steps into a new process and skill set?”

You can watch his response below – it starts at 2:50:

In case you can’t watch a video right now, and also for the sake of commentary, I’ll include specific quotes here – but the video is a far richer experience if you have the time. I also added bold styling below to emphasize a certain part.

“You know, I once wanted to learn a new skill, and I had a friend who was a master practitioner of this skill […] and I found a version of this thing that I wanted to try out, and I told them, I texted them and was like, I’m gonna learn this skill, I’m trying to learn this skill and I’m trying to learn it under this framework. And they were like “That’s not the framework – that’s the wrong framework you’re using” – that’s not the right way to encourage somebody. That is the wrong way… because I immediately felt shame, I’m talking to a master of this craft and they’re like, “WRONG.” That’s bullshit. I don’t have time for that.””

Boy, does Adam ever see things exactly the same way I do, in this case. There’s enough negativity in the world as is, the last thing you need when putting effort towards trying something new is even more negativity. Even if I don’t understand why someone is passionate about something, I know how incredibly powerful that kind of enthusiasm is when it comes to productivity, and deeper than that, how it might play a role in discovering what a person really wants to do in life.

I remember back when I lived with my parents, I was becoming really fascinated with the one computer my father had, and I would try to learn about it whenever I could. However, he did quite a bit to prevent me from pursuing this interest. The classic quote I will always remember is “a computer is for work, not for play” – what he failed to understand, of course, is that it was by playing around on the computer that I would become more familiar with it. He also failed to consider that perhaps my unrelenting interest was a sign of something deeper within me, a natural compatibility with the field. I also think part of his opposition had to do with him not understanding or anticipating the prominent role that computer science would play in the future – to him, it was a waste of time.

My father delayed my growth, there’s no doubt about it, but eventually, I learned to code on my scientific calculator in high school, thanks to a supportive friend of mine, Dan, who had already ventured into that territory. (The moment I learned how to write something as simple as an “if” statement on my calculator blew my mind, and I will never forget where I was and what it felt like.) Eventually, I also managed to buy my own computer, largely eliminating the barriers I had at home, thereby accelerating my learning to the point where I was far ahead of my class by the time I was in college – I was coding in languages that weren’t even covered by the curriculum.

I still wonder from time to time how much faster I could have taken up the craft, and how much more advanced I would have been, if not for my father’s opposition. Needless to say, should I procreate, I will be especially attentive to these “tells” – where interest, enthusiasm and passion reveal something deeper. It wouldn’t be about me, at all, but instead, a moment where I can support another human in the exploration of their interests, and getting that much closer to understanding what they like and don’t like, and what they may want to do for a living. (To be fair, I should say that when I was in my late twenties, my father realized the error of his ways and apologized for not understanding what I saw in computers early on.)

Though not exactly the same, you can surely see how this relates to Adam’s anecdote. I’m like Adam – I think those negative responses are awful, and I fully agree with what he suggests instead – which starts at 5:11:

And again here’s the transcript if you need it:

“That’s like “you could do it that way, but you’re WRONG”, as opposed to, I love your enthusiasm, that trick, that thing that you want to do, that technique you want to learn, it’s a little beyond you, you don’t see that yet, let me shepherd you through the early stages so that you can understand this technique. Or, yes, go try it! Come back to me after a while, when you’ve learned exactly why this isn’t the right thing for you to start with.

And there’s so many frames, but in improv, in comedy improv, the central ethos of comedy improv, […] is yes, and. And that’s the opposite of “no, but” – “yes, and” it takes everything in, and it adds to it. That’s how potentially you can start to help people believe in themselves.”

And that’s exactly it – rather than strip the person of their enthusiasm, one of the most potent propellants, why not add to it? And that, my friends, is one of the key principles I stand for in life – I will always support passion and enthusiasm.