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 | |
/** | |
* Create Custom Column in the Manage Sites table for Last Secirty Scan date | |
* ref: https://meta.mainwp.com/t/solved-add-second-field-to-dashboard/3015 | |
* ref: https://meta.mainwp.com/t/display-group-s-column-in-the-manage-sites-table/2932 | |
* ref: https://meta.mainwp.com/t/create-custom-column-in-the-manage-sites-table-with-data-from-client-data/2877 | |
*/ | |
add_filter( 'mainwp_sitestable_getcolumns', 'mycustom_mainwp_sitestable_getcolumns', 10, 1 ); |
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
add_filter('wp_feed_cache_transient_lifetime', 'cws_shorten_rss_feed_timeout'); | |
function cws_shorten_rss_feed_timeout( $interval, $url ) { | |
if( 'https://<example.com>/feed' == $url ) | |
return 3600; | |
return $interval; | |
} |
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
https://gtmetrix.com/ | |
https://gtmetrix.com/blog/how-to-read-a-waterfall-chart-for-beginners/ | |
https://www.webpagetest.org/ | |
https://wordpress.org/plugins/query-monitor/ | |
https://github.com/crstauf/query-monitor-extend | |
https://newrelic.com/products/application-monitoring | |
https://help.nexcess.net/74095-wordpress/configure-new-relic-monitoring | |
https://wordpress.org/plugins/wp-newrelic/ |
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
DELETE FROM wp_commentmeta WHERE comment_id IN ( SELECT ID FROM wp_comments WHERE comment_type = 'order_note' ); | |
DELETE FROM wp_comments WHERE comment_type = 'order_note'; |
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
add_filter( 'manage_edit-product_columns', 'tax_status_product_column'); | |
function tax_status_product_column($columns){ | |
$new_columns = []; | |
foreach( $columns as $key => $column ){ | |
$new_columns[$key] = $columns[$key]; | |
if( $key == 'is_in_stock' ) { | |
$new_columns['tax_status'] = __( 'Tax status','woocommerce'); | |
} | |
} | |
return $new_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 | |
add_action( 'wp_enqueue_scripts', 'capweb_woocommerce_style_cleaner', 99 ); | |
/** | |
* Manage WooCommerce styles and scripts to get a performance boost. | |
* ref: https://docs.woocommerce.com/document/disable-the-default-stylesheet/ | |
* Added 4/30/21 | |
*/ | |
function capweb_woocommerce_style_cleaner() { | |
// Unless we're in the store, remove all the stuff! |
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
# | |
# This script is executed from a terminal prompt at the root of your MainWP WordPress website | |
# | |
# Execute MainWP CLI command to generate a list of all configured sites in MainWP | |
# Pipe output through filter to remove columns 3 and 4 of output. These columns hold the 2 digit site number. Adjust if more than 99 sites. | |
# Pipe that output to get rid of the comment lines in the site listing. | |
# Pipe that output through the SED editor inserting the security scan command at the beginning of the line | |
# Send everything to a shell script to be executed. | |
wp mainwp sites | cut -c3-4 | grep -E '([0-9]|[0-9][0-9])' | sed 's/^/wp mainwp-sucuri scan /' > sec-scan-auto.sh | |
# |
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
/* Don't forget to add alt tag to images | |
*/ | |
img:not([alt]){ | |
border: 5px solid red; | |
} |
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
/** | |
* WooCommerce add text to the thank you page to direct online class order to book class | |
*/ | |
add_action( 'woocommerce_thankyou', 'wsm_add_content_thankyou'); | |
function wsm_add_content_thankyou( $order_id ) { | |
$cat_in_order = false; | |
$order = wc_get_order( $order_id ); | |
$order_items = $order->get_items(); |
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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @capwebsolutions | |
# ver 20200413 | |
# Forked from salcode ver 20170228 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/CapWebSolutions/91abad7201ca8ec092e558c15691bd62/raw/.gitignore | |
# to download this file | |
# | |
# By default all files are ignored. You'll need to whitelist |