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('the_content', function( $content ){ | |
//--Remove all inline styles-- | |
$content = preg_replace('/ style=("|\')(.*?)("|\')/','',$content); | |
return $content; | |
}, 20); |
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://magento.stackexchange.com/questions/40649/magento-direct-sql-query-for-coupon-based-orders | |
SELECT coupon_rule_name AS 'Promotion Used' | |
, coupon_code AS 'Code Used' | |
, COUNT(coupon_code) AS 'Times Used / Number of Orders' | |
, SUM(subtotal) AS 'Cumulative Price' | |
, SUM(total_paid) AS 'Cumulative Paid with Coupon' | |
, AVG(total_paid) AS 'Average Order Total (W/ Coupon)' | |
, AVG(subtotal) AS 'Average Order Total (W/O Coupon)' |
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
/** | |
* Scan Gravity Forms uploads with ClamAV | |
* Based on 'Custom Scan AV function by Kris Chase' | |
* https://krischase.com/detect-and-prevent-malware-in-gravity-forms-file-upload-with-php-clamav/ | |
* Requires clamav and php-clamav installed and enabled | |
*/ | |
function myfunc_uploads_clamav( $validation_result ) { | |
if ( $_FILES ) { | |
$form = $validation_result['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
SELECT sfo.customer_id AS customer, ce.email, GROUP_CONCAT(cev.value SEPARATOR ' ') as name, | |
sfo.entity_id, sfo.increment_id,scu.times_used,sc.coupon_id,sc.rule_id,sc.code FROM sales_flat_order sfo | |
LEFT JOIN salesrule_coupon_usage scu ON sfo.customer_id = scu.customer_id LEFT JOIN salesrule_coupon sc | |
ON sc.coupon_id = scu.coupon_id LEFT JOIN customer_entity ce ON ce.entity_id = sfo.customer_id | |
LEFT JOIN customer_entity_varchar cev ON cev.entity_id = sfo.customer_id WHERE (cev.attribute_id IN (5,7) | |
OR cev.attribute_id IS NULL) GROUP BY sfo.increment_id ORDER BY sfo.increment_id; |
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
59 23 * * * /usr/local/bin/wp post update 1310 --post_status=draft --path="/home/username/public_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
#! /bin/bash | |
#----------------------------------------------------------------------------------------------# | |
# addMonitorToUptimeRobot.sh v1.0 (#0 2016-05-05) # | |
# # | |
# This script will loop through all users on WHM server, # | |
# retreive associated domains and add them to Uptime Robot # | |
############################## Modification Log ############################## # | |
# Date Who Version Description # | |
# 20160505 KChase 1.0 Initial Release # |
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
#!/bin/bash | |
# Script by Kris Chase | |
# http://krischase.com | |
# | |
# robotsDeploy.sh is a script which will take a templated robots.txt file | |
# and deploy it to all users accounts on the current system | |
# Meant for systems running WHM | |
#Initialize variables counters. | |
v_cpanel_accounts=0 |