Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 14-09-2016, 09:52 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Fix lỗi Table: wp-options is very big in wordpress - Too many wc_sessions in WooComme
Fix lỗi Table: wp-options is very big in wordpress


Cách fix lỗi:

Too many wc_sessions in WooCommerce?



In some cases, you can see that your wp_options table is growing too fast and is becoming huge because of WooCommerce. If so, you can see that the sql table is full of _wc_session_xxx and _wc_session_expires_xxx entries. These can happen because of two things:
  • Cron tasks aren’t working on your site
  • A bot is crawling your site and creates sessions on the fly
Hopefully, in the latest WooCommerce versions there’s a tool to delete



these sessions:



But sometimes, the database is so big, that the process fails because of the PHP max execution time, or because of a lack of memory. In that case you can use the following MySQL query directly in phpMyAdmin:


DELETE FROM wp_options WHERE option_name LIKE '_wc_session_%' OR option_name LIKE '_wc_session_expires_%'

And finally, to avoid the wp_options to become so big, make sure that cron aren’t disabled on your site, to do so check if your install does NOT contain this line of code:


define('DISABLE_WP_CRON', 'true');

If so, remove it.
One last thing, if you want, you can add the following code to the robots.txt file to avoid bots to create sessions while crawling your site:


User-agent: *

Disallow: /*add-to-cart=*



Tham khảo thêm

https://www.remicorson.com/too-many-...n-woocommerce/

http://wpfreaks.com/easily-reduce-cl...ble-wordpress/
  Trả lời ngay kèm theo trích dẫn này
Gửi trả lời


Công Cụ
Xếp Bài

Quyền Hạn Của Bạn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 11:49 PM. Giờ GMT +7



Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.