Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: WooCommerce Analytics - Custom Report Columns
* Description: This plugin adds a custom columns to the WooCommerce Analytics customer report csv export.
* Author: Saif Hassan
* Author URI: https://saif-hassan.com
* Version: 1.0.0
*/
@meorajrul
meorajrul / Laragon Multiple MySQL Database Version.md
Last active April 9, 2025 16:01
Laragon Multiple MySQL Database Version Setup

Pre-requisite

  1. Laragon
  2. Multiple DB are ready to install (look table below)
  3. Unzip tools like 7zip or Winrar
  4. Laragon installation path default is C:\laragon\, might be different depending on where you install this. However we will focus on laragon mysql directory folder which located on C:\laragon\bin\mysql

If you look at Laragon documentation on multiple DB it should be straight forward however i would like to make it as painless as possible with the setup

By default Laragon (Full version) comes with MySQL 8.0.* version. However we will install latest or older version of MySQL show how we switch to one another using Laragon system tray mysql version switch feature.

@itsmeow
itsmeow / tampermonkey-sheets-update-curseforge-rewards.user.js
Last active February 17, 2025 03:53
A tampermonkey script to update a google sheet with data from the CurseForge rewards transactions page.
// ==UserScript==
// @name CurseForge Rewards Transactions Page to Google Sheet
// @namespace github.com/itsmeow/ad3571ba50cde6a94b5ea36d0cdb263d
// @updateURL https://gist.githubusercontent.com/itsmeow/ad3571ba50cde6a94b5ea36d0cdb263d/raw/tampermonkey-sheets-update-curseforge-rewards.user.js
// @version 1.0.1
// @description Gathers data from your CurseForge rewards transactions and enters it into Google Sheets.
// @author itsmeowdev
// @match https://authors.curseforge.com/store/transactions
// @icon https://media.forgecdn.net/avatars/130/458/636460205549127215.png
// @grant none
add_filter( 'woocommerce_product_get_stock_status', 'my_plugin_set_stock_status', 10, 2 );
add_filter( 'woocommerce_product_variation_get_stock_status', 'my_plugin_set_stock_status', 10, 2 );
/**
* Set maximum back orders.
*
* @param $stock_status string product stock status.
* @param $product integer product.
*
* @return mixed|string
@tanaikech
tanaikech / submit.md
Created November 10, 2020 06:32
Downloading Google Spreadsheet as XLSX and PDF file by Clicking Button

Downloading Google Spreadsheet as XLSX and PDF file by Clicking Button

This is a sample script for downloading Google Spreadsheet to the local PC as a XLSX file and a PDF file when a button on the side bar and the dialog is clicked. This is created with Google Apps Script and HTML&Javascript.

Sample script

Please create new Google Spreadsheet and copy and paste the following scripts to the script editor. And please run openSidebar(). By this, the side bar is opened to the Spreadsheet.

@isaumya
isaumya / remove-woocommerce-bloat-marketing-hub.md
Last active March 1, 2025 15:05
Easily Remove WooCommerce Bloated Features like Marketing Hub from WordPress Admin Menu

Remove WooCommerce Bloated Features from WP Admin Menu

Recently WooCommerce has added a lot of improvements to the plugin which we really appriciate but at the same time a lot of bloated features has alos been added to the plugin like Marketing Hub, a completely useless menu taking extra space among the other important menu items. Now if you find Marketing Hub to be useful, you can keep it.

But just in case you are looking for a way to remove these features that you no longer need from your WordPress Admin menus, take a look at the following code snippets. Please note: though I will show you how you can remove the Marketing Hub from your WP Admin menu list completely and make sure WooCommerce doesn't execute codes for that feature you don't need, you can do the same for other WooCommerce features as well like Analytics.

How to remove Marketing Hub for WooCommerce <= v4.2

If you are using WooCommerce <= v4.2, you can simple add this one line of code in your theme's functions.php f

@pablo-sg-pacheco
pablo-sg-pacheco / functions.php
Created June 8, 2020 17:29
Booster for WooCommerce - Get info from Prices and Currencies by Country Module Options
<?php
add_action('wp_footer',function(){
if ( !WCJ()->modules['price_by_country']->is_enabled() ) {
return;
}
$country = WCJ()->modules['price_by_country']->core->get_customer_country_by_ip();
$group = WCJ()->modules['price_by_country']->core->get_customer_country_group_id();
$the_result = array('country'=>$country,'group'=>$group);
?>
<script>
@helgatheviking
helgatheviking / class-wc-kia-class-email.php
Last active August 6, 2024 03:08
Send a WooCommerce Customer email from the Order Admin Actions
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! class_exists( 'WC_KIA_Class_Email', false ) ) :
/**
* A custom Order WooCommerce Email class
*
* @since 0.1
* @extends \WC_Email
<?php
if ( ! function_exists( 'de_woo_email_social_icons' ) ) {
function de_woo_email_social_icons( $icons ) {
echo '<ul class="de-social-icons">
<li><a href="#" target="_blank"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-instagram" aria-hidden="true"></i></a></li>
</ul>
@joshuatf
joshuatf / disable-woocommerce-admin.php
Created March 11, 2020 09:44
A plugin to disable the new WooCommerce Admin package in WooCommerce
<?php
/**
* Plugin Name: Disable WooCommerce Admin
* Description: This plugin disables the new WooCommerce Admin package in WooCommerce.
* Version: 1.0
*/
add_filter( 'woocommerce_admin_disabled', '__return_true' );