How to Show a Warning if a Customer's Credit Card is About to Expire in WooCommerce
Many payments in WooCommerce just fail because a credit card wasn’t updated recently when WooCommerce Subscriptions or another plugin tried to bill the account. It’s better if this issue is avoided whenever possible. It’s way better to inform your customers that their...
How to Show a Notice to all WooCommerce Customers in the My Account Section
Let’s say you want to show the same message to all of your customers. WooCommere has lots of hooks that we can use to show the message. Since it’s a message that applies to all of your customers then it makes sense to put it in one central location so you can update...
How to Find the Latest Day of The Month in PHP
If you ever need to find the last day of the month in php this is how to do it. You convert to seconds the current year and month and then let date() function to find what's the last day of that selected month. <?php $year = 2024; $month = 2; $last_day_of_month =...
Adminer Login "Session expired, please login again"
Did you have the same problem? Well, do make sure that adminer can access the session folder or if there's a restriction such as openbase dir.(php open_basedir). To check you may need to create a temporary file called 000info.php with the following contents.You can...
How to Redirect using RedirectMatch in Apache .htaccess
We've been making some progress on the WPGigs.net project. It's about WordPress jobs. For some reason the RankMath plugin decides to expose the root custom post type in a sitemap. To avoid duplicate content we redirect /project => /projects. We use RedirectMatch...
How to get Customer Downloads from a WooCommerce Order via PHP
Have you tried called $order->get_downloadable_items() and it returns an empty array? We had the same issue. Are you trying to get the user downloads from a WooCommerce order? The following code snippet is meant to be run after init or even better woocommerce_init...
Short Links in WordPress Without a Plugin
Have you ever wanted to have short links (example.com/123) to your blog post, so the links are not cut off in social media posts or emails? Over the years we came up with the following Apache rewrite rules that you can insert into your .htaccess file. As always backup...
How to Increase PHP Max Input Vars, Max Execution Time and Memory Limit in LiteSpeed
Create an .htaccess file in the document root folder and paste the following. You may use the file manager from your control panel or using your favourite FTP program to edit the files. As always make backups! We're using <IfModule litespeed> ......
How to Export All WooCommerce Orders using WP-CLI
Introduction Effective order management is a cornerstone of success in the e-commerce domain. For businesses utilizing WooCommerce on WordPress, sifting through extensive order data can be a significant challenge. This article introduces a streamlined approach to...
Email Efficiency: Why Single Topic Emails are Better
In the dynamic world of WordPress and Web Development professionals often encounter a common yet overlooked issue: the chaos of lengthy email threads encompassing numerous project questions and answers and sometimes related and sometimes different topics. This chaos...