Tuesday, May 21, 2024

WooCommerce Perform Bulk Operations from the Database

 SQL queries to perform following bulk operations from the database:


Bulk Delete All Orders

DELETE FROM wp_woocommerce_order_itemmeta;

DELETE FROM wp_woocommerce_order_items;

DELETE FROM wp_comments WHERE comment_type = 'order_note';

DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'shop_order' );

DELETE FROM wp_posts WHERE post_type = 'shop_order';

Bulk Delete All Products

DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type IN ( 'product', 'product_variation' ));

DELETE FROM wp_posts WHERE post_type IN ( 'product', 'product_variation' );



Bulk Delete All Trashed Products

DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'product' AND post_status = 'trash' );

DELETE FROM wp_posts WHERE post_type = 'product' AND post_status = 'trash';


Bulk Delete All Order Notes

DELETE FROM wp_commentmeta WHERE comment_id IN ( SELECT ID FROM wp_comments WHERE comment_type = 'order_note' );

DELETE FROM wp_comments WHERE comment_type = 'order_note';




Wednesday, April 24, 2024

Increase the maximum upload file size in WordPress

 There are several ways to increase the maximum upload file size in WordPress, and  one of the most straightforward approaches is editing the .htaccess file.

Steps to Increase Maximum Upload File Size

1. Access Your WordPress Site Directory

2. Locate the .htaccess File

3. Edit the .htaccess File

4. Insert the following Code Snippet after </IfModule>:

php_value upload_max_filesize 500M

php_value post_max_size 500M

php_value memory_limit 500M

php_value max_execution_time 0

php_value max_input_time 300

 

Explanation of Code Snippet

php_value upload_max_filesize 500M: This line sets the maximum size for uploaded files to 500 megabytes (M). You can adjust the value to meet your specific requirements.

php_value post_max_size 500M: Similarly, this line sets the maximum size for post data (including file uploads) to 500 megabytes.

php_value memory_limit 500M: This line defines the maximum amount of memory a script can allocate to 500 megabytes.

php_value max_execution_time 0: Setting the maximum execution time to zero (0) removes any time limit, ensuring that scripts can run for an unlimited duration.

php_value max_input_time 300: This line sets the maximum time in seconds that a script is allowed to parse input data, such as POST and GET requests.




Tuesday, January 30, 2024

Windows - Move App From Non Existent Monitor

Issue:

My laptop was linked to a second monitor the last time I used RSA SecureID Token application. I used the program on the second monitor, shut it, and opened it again on the laptop without the second display while I was out of the house. The application doesn't show up on the desktop, even if it is displayed in the taskbar.

Although the app can show up there if I reconnect the second monitor at home, I'm looking for a way to make it work in situations where I forget to move the app before leaving the house.

So, I need to transfer it back to the laptop.

This issue usually occurs with following applications: Postman, RSA SecureID Token.

Cause:

RSA was opening up minimized.

Solution:

Open Task Manager

click on Process tab.

Locate RSA SecureID Software Token Client

Expand it to see Windows - RSA SecureID Token

Right click on it and click on Maximize.