This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder