Skip to content

Instantly share code, notes, and snippets.

View webhouse-dev's full-sized avatar

webhouse.dev webhouse-dev

View GitHub Profile
@webhouse-dev
webhouse-dev / Cloudlinux Redix via Unix socket.md
Last active November 14, 2024 15:10
Redis via Unix socket on CloudLinux with CageFS

It's not a secret that Redis service is a really great backend caching service. Normally people use that via TCP. It's fast and reliable. However if you do benchmark via unixsocket you will see that it will double amount of requests per second (of course depend on your server but much much faster than TCP). Redis via unixsocket is the best setup to go... however people using CageFS in Cloudlinux will struggle with permissions and they won't be able to connect to unixsocket. Here is the solution!

Step 1: change redis config to use unixsocket (still keeping TCP). In /etc/redis.conf uncomment and change lines:

# Unix socket.
#
# Specify the path for the Unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
@webhouse-dev
webhouse-dev / wp-images-day-folder
Last active January 21, 2021 18:47
Upload WordPress images to day folders
/**
* @snippet Upload WordPress images to day folders
* @how-to Add to functions.php or get plugin Code Snippets
* @author webhouse.dev
* @url https://webhouse.dev
*/
function upload_dir_filter($uploads){
$day = date('d');
$uploads['path'] .= '/' . $day;
@webhouse-dev
webhouse-dev / Auto Complete all WooCommerce orders
Last active January 21, 2021 19:19
Auto Complete all WooCommerce orders
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
$order->update_status( 'completed' );
}
@webhouse-dev
webhouse-dev / Blocksy Suggestions.md
Last active January 25, 2021 01:43
Blocksy Theme Feature Suggestions

WooCommerce

  • filters
  • category description option to move below content
  • option to change single product and single category width
  • adapt custom attributes in menus and taxonomy archives
  • category settings: display subcategory filter
  • category featured image

WordPress

  • add integration with Mailer Lite
@webhouse-dev
webhouse-dev / blocksy-logo-url.php
Last active January 25, 2021 16:06
Blocksy change logo URL
<?php
add_filter('blocksy:header:logo:url', function ($url) {
return 'YOUR_URL';
});
@webhouse-dev
webhouse-dev / blocksy-logo-noclick.css
Created January 25, 2021 16:06
Blocksy logo not clickable
.site-branding {
pointer-events: none;
}
@webhouse-dev
webhouse-dev / Remove FBCLID parameter
Created February 6, 2021 21:01
Remove FBCLID via .htaccess
RewriteCond %{QUERY_STRING} "fbclid=" [NC]
RewriteRule (.*) /$1? [R=301,L]