Skip to content

Instantly share code, notes, and snippets.

http://goaccess.io/man
** install **
apt-get install goaccess
cd /var/log/nginx
**main logs**
zcat access.log.*.gz | goaccess access.log --log-format=COMBINED -o /var/www/sitename.com/htdocs/report-server.html
<?php
// Change attribute rewrite rules
add_action('woocommerce_register_taxonomy', 'razorfrog_woo_register_taxonomy');
function razorfrog_woo_register_taxonomy() {
global $razorfrog_woo_attribute_labels;
$razorfrog_woo_attributes_labels = array();
if ( $attribute_taxonomies = wc_get_attribute_taxonomies() ) {
foreach ( $attribute_taxonomies as $tax ) {
<?php
// Set minimum quantity per product before checking out
function razorfrog_set_min_qty_per_product() {
// Only run in the Cart or Checkout pages
if( is_cart() || is_checkout() ) {
// Product Id and Min. Quantities per Product
$product_min_qty = array(
20 => 100,
<?php
// Set minimum quantity per product before checking out
add_action( 'woocommerce_check_cart_items', 'spyr_set_min_qty_per_product' );
function spyr_set_min_qty_per_product() {
// Only run in the Cart or Checkout pages
if( is_cart() || is_checkout() ) {
global $woocommerce;
// Mobile navigation menu and footer dark mode toggle button styling.
.rf-darkmode-toggle {
label {
width: 120px;
height: 45px;
position: relative;
display: block;
background-color: $color-n1;
border-radius: 200px;
<?php
// Dark Mode Shortcode for Main Navigation Menu.
add_shortcode( 'dark-mode-toggle-nav', 'dark_mode_toggle_nav_shortcode' );
function dark_mode_toggle_nav_shortcode() {
return '<div class="rf-darkmode-toggle">
<button data-theme-toggle-nav class="container" aria-label="Light mode is active" title="Toggle color mode">
<img class="sun visible" src="/wp-content/themes/razorfrog/svg/dark-mode/sun-light-mode-toggle-icon.svg" />
<img class="moon" src="/wp-content/themes/razorfrog/svg/dark-mode/moon-dark-mode-toggle-icon.svg" />
<?php
////////////////////////////////////////////////////////////
// additional customer info
// https://razorfrog.com/woocommerce-user-order-data-columns/
////////////////////////////////////////////////////////////
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
function add_user_details_columns($columns) {
<?php
////////////////////////////////////////////////////////////
// deregister default punch fonts
////////////////////////////////////////////////////////////
add_action( 'wp_print_styles', 'rzf_deregister_punch', 100 );
function rzf_deregister_punch() {
wp_deregister_style( 'tp-open-sans' );
wp_deregister_style( 'tp-raleway' );
wp_deregister_style( 'tp-droid-serif' );
@razorfrog
razorfrog / gravityforms-to-groupsio.php
Last active April 4, 2024 16:22
Gravity Forms to Groups.IO subgroup signup
<?php
/////////////////////////////////////////////////////////////
// Gravity Forms to groups.io subgroup signup
// API details: https://groups.io/api/20190816#login
// Code details: https://razorfrog.com
/////////////////////////////////////////////////////////////
add_action( 'gform_after_submission_2', 'post_to_third_party', 10, 2 ); // Edit the "_2" to the correct form ID
function post_to_third_party( $entry, $form ) {
@razorfrog
razorfrog / gist:a78bcb374c98ee61b92013ad37600208
Created December 18, 2022 23:05
gp doctor for all sites
for wpconfig in /var/www/*/wp-config.php; do \
echo; site=${wpconfig%\/wp-config.php}; site=${site#\/var\/www\/}; \
gp wp $site doctor check --all
echo
done