How to search and replace with SED on a large file.

Sometimes you’ll end up with larger files that, when you try to run a simple find / replace operation, will error out or not start because there is insufficient memory. A solution I found in Ubuntu with the sed command is as follows: I’m using | as separator to support URLs. This is useful when […]

How to find and replace, incrementing the output by one each time

Recently had to fix a WordPress database with entries having a duplicate key. They were 1974 entries with the same key. And to fix that, as suggested by every resource online, you need to increment each key by one. Good luck doing that manually. Instead, in Ubuntu that can be done in a matter of […]

Today I pushed the first version of my plugin to WordPress.org

Yesterday, May 5th, 2023, I got an email from the WordPress Plugin Review Team notifying me that my plugin submission to the WordPress plugin repository was approved. It was no easy thing, and not on the first try (by a silly mistake from me). I submitted it on April 7th. Almost a month later, I […]

Get up to speed with Git in your project

Do you remember writing an essay on your computer and then, on each “major” change to the document, saving the same file like geography-essay.docx, geography-essay_edited.docx, geography-essay_almost-ready.docx? That is the reason you need Git in your software project. Git helps you keep track of your changes and, if something goes not as expected, go back to […]

How to enqueue scripts or styles only if a shortcode exists on a page

In general, it is a best practice to only enqueue a script or style on your website, only where you need it. Specifically, this helps with performance. And in any case, why would you need yourSocialLogin.css file in every page of your website anyway, right? So, let’s say you are adding a custom shortcode that […]

Add a custom button to CheckoutWC’s side cart

CheckoutWC side cart by default allows you to display a ‘Proceed to Checkout’ button and a Continue Shopping button. Sweet. But what if you want to add a custom button that does something different, or more interesting that just redirecting the user to the checkout page or back to the shop? You can add a […]

How to add a custom icon to each shipping method in WooCommerce

Shipping methods define how the purchase will be delivered to your customer. Commonly, the shipping service is taken care of by a company. Some of the shipping companies are larger than others. You can identify the Shipping Method with a label in the shipping method settings in WooCommerce. But if you feel the shipping label […]

Change the PDF certificate filename in LearnDash

The beauty of WordPress and open source is that virtually anything is customizable. And premium plugins like LearnDash are not an exception to the rule. In LearnDash, you can create certificates to reward your students after completing a quiz or finishing a course. These certificates are generated as a PDF file on the fly. After […]

In WordPress I’d change…

Sometimes I see people get asked what would you change about WordPress CMS? I have not been asked this yet, but if I were asked, first, I’d change how notifications are displayed to admins. This is a problem that has existed for years, and nowadays, notifications have lost their real purpose. Notifications in the core […]

Change the Billing fields position in CheckoutWC

In the WooCommerce standard checkout form, you are first asked for personal details like First Name, Last Name, Email Address, etc. Then, immediately you are asked to fill up the Billing Address. That’s nice in some cases, but it can be improved. CheckoutWC, by design, changes this behavior by switching priorities between the Billing Address […]