Software, Development, and WordPress

Category: Articles (Page 2 of 243)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

Writing for WordPress Has to Change (For Me)

When I first started writing on this blog, It was on October 3, 2010. That’s wild to think about. I know that those who read usually fall into one of three categories:

  • People who read regularly, for which I thank you,
  • People who are aware of it and check periodically, for which I thank you,
  • And people who are drivebys from searches from various search engines.

All of that is great and fine and I don’t think I ever would’ve thought I’d be writing roughly 12 years later.

But here we are.

Continue reading

Using Pipe Viewer for Large Migrations

In WordPress, most migrations can be easily done by:

  • Using a web-based utility such as Migrate DB Pro or PhpMyAdmin,
  • Using a database front-end application like TablePlus,
  • Or even using the mysql command-line for importing an SQL dump.

None of these are bad options but each present their own set of challenges especially with large migrations:

  • web-based applications can timeout,
  • front-end applications may lack some functionality for getting insight into what’s going on (or not giving clear information on what something such as a lock is during its process list),
  • and terminal applications like mysql can do the job but give very little insight on to where to status of the import stands.

If you’re working with a relatively small dataset, then any of the above options would be fine (and I’m usually partial to TablePlus 🙂) or the command-line but when importing a database that was roughly 30GB in size, I needed something else to help.

  • A web application would time out,
  • A front-end application lacked feedback on time or progress,
  • A terminal application was just waiting for the process to finish with no insight as to what’s going on.

And this is where pv comes into play.

Continue reading

A Beginner’s Guide to Querying the Slack API

Creating Slack applications can be as time-consuming and complex as writing any other type of application. What if you’re interested in querying the Slack API for your workspace and incorporating the results in a WordPress plugin? Here’s how you can get started.

Ultimately, all we need to make queries to the Web API is an OAuth token and a REST API client to make requests. From there, it’s a matter of programmatically implementing the functionality in your code.

But that’s not at what we’re aiming. Instead, this article is more about learning how to make requests to the Slack API and what’s required to get set up to do so.

Continue reading

Using Ray in WordPress Development: An Example of Classic Debugging

TL;DR: This final article will demonstrate how to use Ray in WordPress as an example of classic debugging.

No, it’s not the same as something such as Xdebug, but it demonstrates what we can do such as changing variables on the fly and changing the course of execution.

⚠️ If you’ve not already set up your environment, please read this post and make sure you have the free version of Ray installed.

Continue reading

Quick Tip: Find WordPress Users by Metadata

TL;DR: Here’s how you can use SQL to find WordPress users by metadata. This is useful when you have information such as their first name and last name and want to retrieve the full WP_User.

WordPress provides a number of functions that make it easy to retrieve a user based on certain information. One of the most popular functions (or most useful, maybe?) is get_user_by.

However, what if you’re working on a system that maintains the user’s first name and last name or some other type of data point in the usermeta table and you want to use that to retrieve the user’s information?

Continue reading
« Older posts Newer posts »

© 2022 Tom McFarlin

Theme by Anders NorenUp ↑