Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / remove duplicate FKCart conversion rows.
Created June 12, 2026 09:19
remove duplicate FKCart conversion rows.
/**
* ONE-TIME cleanup: remove duplicate FKCart conversion rows.
* Keeps the earliest row per order; backs up removed rows first (reversible).
*
* Admin only:
* /wp-admin/?fkcart_dedupe_conversions=report → counts only, no changes
* /wp-admin/?fkcart_dedupe_conversions=delete → backs up, then removes duplicates
* /wp-admin/?fkcart_dedupe_conversions=restore → undo (re-inserts from backup)
*
* Remove this snippet (and drop the *_dedup_bak tables) once you're done.
@xlplugins
xlplugins / FB_coupon_diagnostics.php
Created June 12, 2026 07:59
FB_coupon_diagnostics.php
class FB_Coupon_Diagnostics {
/** Logger source / log-file slug. */
private static $source = 'fb-coupon-diagnostics';
/** Per-request correlation id — unique to one HTTP request. */
private static $rid = null;
@xlplugins
xlplugins / restrict coupon on sublium item
Last active June 11, 2026 15:27
restrict coupon on sublium item
<?php
/**
* Sublium - Coupon restrictions for Subscribe & Save items
*
* Rules:
* - Percentage coupons do not apply to Subscribe & Save items.
* - Fixed coupons are blocked when a Subscribe & Save item exists in cart.
* - Fixed coupons already applied are automatically removed.
* - Percentage coupons are invalid when all cart items are Subscribe & Save items.
*/
@xlplugins
xlplugins / disable_browser_auto_translate.php
Created June 11, 2026 12:15
Disable Browser auto translate
/**
* Disable Google / Chrome auto-translate on FunnelKit Checkout pages only.
* Adds Google's page-level opt-out meta tag to the checkout <head>.
*/
add_action( 'wfacp_checkout_page_found', function ( $checkout_id ) {
add_action( 'wp_head', function () {
echo '<meta name="google" content="notranslate">' . "\n";
}, 1 );
@xlplugins
xlplugins / mollie mandate find for order
Created June 11, 2026 08:58
mollie mandate find for order
/**
* TEMP DIAGNOSTIC — check Mollie mandates for a given order's customer right now.
* Run on the LIVE site as an admin: /wp-admin/?fk_check_mandate=5644
* Remove after testing.
*/
add_action( 'admin_init', function () {
if ( ! isset( $_GET['fk_check_mandate'] ) || ! current_user_can( 'manage_woocommerce' ) ) {
return;
}
@xlplugins
xlplugins / Relocate billing_company
Last active June 11, 2026 09:04
Relocate billing_company
/**
* Relocate billing_company / shipping_company on FunnelKit Checkout —
* ONLY on the checkout IDs you list below.
*/
add_filter( 'wfacp_get_fieldsets', function ( $fieldsets ) {
/* ---- EDIT THIS ----------------------------------------------------
* 1) Which checkouts should this run on? Put their checkout IDs here.
* Find the ID in the editor URL: admin.php?page=wfacp&wfacp_id=123
*/
@xlplugins
xlplugins / one button accepts ALL products in the offer
Created June 9, 2026 13:54
one button accepts ALL products in the offer
/**
* WFOCU – one button accepts ALL products in the offer.
*
* Add the CSS class `wfocu-accept-all` to one Accept Offer button.
* Clicking it adds every product from the offer's Products tab and charges
* them in one order.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@xlplugins
xlplugins / fk_fb_every_4_minute_cron_interval.php
Created June 8, 2026 15:06
fk_fb_every_4_minute_cron_interval.php
/**
* Modify WFOCU cron schedule interval from 4 minutes to 20 minutes.
*
* The plugin registers a custom cron schedule 'wfocu_cron_schedule_times' at 4-minute
* intervals. This filter runs at priority 10000 (after WFOCU's own registration) to
* override the interval. The change takes effect on the next execution of the
* 'fk_fb_every_4_minute' event without requiring a manual reschedule.
*/
add_filter( 'cron_schedules', function( $schedules ) {
if ( isset( $schedules['wfocu_cron_schedule_times'] ) ) {
@xlplugins
xlplugins / Reload WFACP checkout once when wfacp_* session data is missing.
Last active June 5, 2026 14:57
Reload WFACP checkout once when wfacp_* session data is missing.
if ( ! class_exists( 'WFACP_Session_Guard' ) ) {
class WFACP_Session_Guard {
private static $instance = null;
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
@xlplugins
xlplugins / Create Klarna Element if not available on.
Created May 29, 2026 11:53
Create Klarna Element if not available on.
add_action( 'wp_footer', function() {
if ( ! is_product() && ! is_cart() && ! is_checkout() ) {
return;
}
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
if (!document.getElementById('kec-pay-button')) {
var el = document.createElement('div');
el.id = 'kec-pay-button';