Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / Wpb flush
Created April 23, 2026 05:31
Wpb flush
/**
* DB connection sync (shutdown)
* Description: Clears any pending MySQL result set on the default connection before other shutdown hooks run, reducing "Commands out of sync" errors from Action Scheduler, WooCommerce batch processing, Jetpack, and cron.
* Version: 1.0.0
*
* @package
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@xlplugins
xlplugins / Tropics fields — FunnelKit checkout
Created April 21, 2026 05:53
Tropics fields — FunnelKit checkout
add_action(
'wp_enqueue_scripts',
static function () {
if ( ! function_exists( 'is_checkout' ) || ! is_checkout() || is_order_received_page() ) {
return;
}
/* FunnelKit not active — nothing to bridge. */
if ( ! class_exists( 'WFACP_Common' ) ) {
return;
@xlplugins
xlplugins / Register Paypal btn before the apple and gpay at funnelkit checkout
Created April 20, 2026 14:52
Register Paypal btn before the apple and gpay at funnelkit checkout
add_action( 'init', function () {
if( class_exists('\FunnelKit\PayPal\Compatibilities\FunnelKit\Checkout') ){
$instance = \FunnelKit\PayPal\Compatibilities\FunnelKit\Checkout::get_instance();
remove_filter( 'wfacp_smart_buttons', array( $instance, 'register_smart_button' ), 99 );
add_filter( 'wfacp_smart_buttons', array( $instance, 'register_smart_button' ), 10 );
}
} );
@xlplugins
xlplugins / Add_to_cart_open_slide_cart_on_elementor_button.php
Created April 20, 2026 11:32
Add to cart and open slide cart on elementor button.php
add_action('wp_footer',function(){
?>
<script>
jQuery(function ($) {
$('body').on('click', '.elementor-button-link', function (e) {
e.preventDefault();
var $button = $(this);
@xlplugins
xlplugins / Flexible Invoices — invoice before NIP order
Created April 20, 2026 10:19
Flexible Invoices — invoice before NIP order
<?php
/**
* Plugin Name: Aero + Flexible Invoices — invoice before NIP order
* Description: Flexible Invoices can give the invoice checkbox and VAT/NIP the same priority as billing_company; WooCommerce then sorts them unpredictably. This sets stable priorities: company, then invoice checkbox, then NIP. Remove this file to disable.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_filter(
add_action(
'wp_enqueue_scripts',
static function () {
if ( ! wp_script_is( 'wfacp_checkout_js', 'registered' ) ) {
return;
}
wp_register_script( 'wfacp-restore-prefilled-names', false, array( 'jquery', 'wfacp_checkout_js' ), '1.3', true );
wp_enqueue_script( 'wfacp-restore-prefilled-names' );
$js = <<<'JS'
@xlplugins
xlplugins / Simple Sticky Add To Cart For WooCommerce conflict with fkcart
Created April 16, 2026 12:27
Simple Sticky Add To Cart For WooCommerce conflict with fkcart
add_action( 'wp_footer', function () {
if ( ! is_product() ) {
return;
}
?>
<script>
document.addEventListener('click', function (e) {
var a = e.target.closest('a.wsatc-add-to-cart');
var wrap = document.getElementById('wsatc-stick-cart-wrapper');
if (!a || !wrap || !wrap.classList.contains('simple')) {
@xlplugins
xlplugins / Sublium: Display plan Selector instead of subscribe and save button
Created April 13, 2026 06:45
Sublium: Display plan Selector instead of subscribe and save button Working from 1.0.1 Vision
add_filter('sublium_wcs_render_show_plan_selector',function(){
return true;
});
@xlplugins
xlplugins / Sublium: Display plan Selector instead of subscribe and save button
Created April 13, 2026 06:45
Sublium: Display plan Selector instead of subscribe and save button Working from 1.0.1 Vision
add_filter('sublium_wcs_render_show_plan_selector',function(){
return true;
});
@xlplugins
xlplugins / Shipping Insurance Manager for WooCommerce running shimmer on change
Created April 8, 2026 09:09
Shipping Insurance Manager for WooCommerce running shimmer on change
add_action(
'wp_enqueue_scripts',
static function (): void {
if ( ! wp_script_is( 'wfacp_checkout_js', 'enqueued' ) ) {
return;
}
wp_add_inline_script(
'wfacp_checkout_js',
<<<'JS'