A Short-Guide to Changing Valet’s Top-Level Domain

For years, developers have used the dev top-level domain as a way to work with local development versions of their projects.

But Google changed all of that last year.

If you’re interested in reading a bit more into this, check out the post by Justin from WebDevStudios does a good job of going into some of the details (as does this post via Daryl Koopersmith – previously working on WordPress, now working at Medium).

But for this post, I’m trying to keep it short and pragmatic. So, the former is this:

If you’re using HTTPS and a dev domain on your local machine, it’s likely going to stop working. Yes, you can add an exception with some browsers, but not all.

Changing Valet's Top-Level Domain: Firefox Security Exception

If you’ve read this blog for any particular length of time, then you know that I’m a fan of using Valet as part of my local development environment. Part of doing that means that I also secure the local sites to simulate, as much as possible, but staging and production are going to be like.

By default, Valet uses dev as it’s top-level domain, so how do we change that? Luckily, it’s pretty easy.

Read More

Writing Unit Tests with PHPUnit, Part 2: The Tear Down

Late last month, I started talking about writing unit tests in PHPUnit for WordPress-based code. This primarily included the idea of setting up PHPUnit, the setUp function, and writing basic tests.

This did not, however, discuss what I know about the tearDown function which is still an important feature of writing using tests. Further, there’s also two ways to consider writing tests for WordPress projects.

Namely:

  1. writing tests specifically for plugins and application-layer functionality,
  2. running unit tests against the WordPress application.

Before moving forward with this particular post, though, I recommend catching up on what I’ve covered thus far. This includes the following posts:

  1. A WordPress Development Environment (Using a Package Manager)
  2. An IDE for WordPress Development
  3. Working with User Settings in Visual Studio Code
  4. Writing Unit Tests with PHPUnit, Part 1: The Set Up

Once you’ve done that, return to this post and let’s continue discussing the tearDown function and what unit tests in the context of WordPress actually look like.

Read More

Should We Set Weekend Autoresponders?

Remember when vacation responders or auto-responders were first introduced to email? It was awesome.

Or so it seemed.

I mean it gave us an automated way to tell other people that we were out of the office or would be unavailable for a set period so we could set an expectation as to when we’d be available to follow-up.

It was like next-level answering machines or something.

Weekend Autoresponders: Answering Machine

But as email has become so ingrained in what we do on a day-to-day basis, we have some companies who have people who are solely dedicated to answering email. On top of that, there are some who are told to “expect an email by the weekend” for something.

That’s a bit backwards though, isn’t it?

Read More

Code Quality Per Language Settings in Visual Studio Code

In previous posts, I’ve talked a bit about Visual Studio Code, and though I’ve tried a variety of other editors, I keep coming back to this particular IDE.

An IDE For WordPresss Development: Visual Studio Code

Over time, it’s matured quite a bit, continues to do so, and allows plenty of customization especially for those of us working in PHP, Sass, JavaScript, and, more generally speaking, WordPress.

If you use any linters, though, you’ll find that one of the things each will talk about is the amount of whitespace that should exist before a given line of code.

So if you’re using Visual Studio Code, these are the extensions and the settings I recommend for making sure your code is up to par with whatever code quality tools you’re using.

Read More

Customizing the WordPress Administration Menu (For User Experience)

For some projects, there are going to be times where there’s not a lot of new stuff to explore, you know? You get the requirements, you know how to solve the problems, and then you move forward with building the solution.

Then other projects that come your way and though you may not know how to do them at the beginning of the project, you know you’ll be able to do so programmatically because if it’s written in code, it’s going to be possible.

And the more you become familiar with a given set of tools or platform (like WordPress), then the more likely you are to “think in terms” of that platform, right?

Perhaps one case in point is working with the administration menu in WordPress. When it comes to projects that others build, I don’t know if they aim to create as positive experience on the front-end as the back-end, but I think it’s import to consider the entire application as an experience for the user.

Customizing the WordPress Administration Menu

And that’s why when it comes to little things – even the menu, for example – that it’s important. But what do I mean by that?

Read More