Skip to content

Instantly share code, notes, and snippets.

@planetahuevo
planetahuevo / sec-scan-v6.sh
Created January 30, 2021 19:32 — forked from CapWebSolutions/sec-scan-root.sh
Latest iteration of security scanning script for MainWP instance.
#
# This script is executed from a terminal prompt at the root of your MainWP WordPress website.
# It uses the same services as WP CLI, so if WP CLI runs, this should also.
#
# 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.
rm -f sec-scan-auto.sh
@planetahuevo
planetahuevo / stripParamsWorker.js
Created January 5, 2021 23:23 — forked from rohenaz/stripParamsWorker.js
cloudflare worker - strip referral query parameters such as fbclid
/**
* Define regular expressions at top to have them precompiled.
*/
const urlRegex = new RegExp('^(refreshce|gclid|cx|ie|cof|siteurl|zanpid|origin|utm_[a-z]+|fbid|fbclid|mr:[A-z]+|ref(id|src))$');
addEventListener('fetch', event => {
event.passThroughOnException()
event.respondWith(handleRequest(event.request))
})
@planetahuevo
planetahuevo / hide-edd-coupons.php
Created November 10, 2020 17:01 — forked from bekarice/hide-edd-coupons.php
Hide EDD Coupon fields and codes at checkout
/**
* Snippets to hide EDD coupon fields & codes during the checkout process - handy if you use URLs to apply discounts instead
* Tutorial: http://www.sellwithwp.com/easy-digital-downloads-hide-coupons/
*/
// Removes the field to enter a discount at checkout
remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 );
// Changes the discount code in the checkout summary to display "Discount applied - " instead of the code
@planetahuevo
planetahuevo / cookie-policy.md
Created December 10, 2019 20:41 — forked from maddisondesigns/cookie-policy.md
eCommerce Terms & Conditions and Privacy Templates
@planetahuevo
planetahuevo / yuzo-related-post-hacked.md
Created April 10, 2019 12:34 — forked from mrnonz/yuzo-related-post-hacked.md
Zero Day Vulnerability Yuzo Related Post plugin. I try to find where injected code into my Database

SELECT * FROM wp_options WHERE option_value LIKE '%eval(String.fromCharCode%';

and I got these value.

@planetahuevo
planetahuevo / Price Breakdown.md
Created February 28, 2019 16:53 — forked from justjanne/Price Breakdown.md
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@planetahuevo
planetahuevo / custom-client-reports-tokens.php
Created January 3, 2019 17:45 — forked from bogdan-mainwp/custom-client-reports-tokens.php
Custom code snippet for creating custom tokens for the Client Reports Extension
<?php
// Add the following code snippet to the functions.php file of the MainWP Customisations plugin
// Download MainWP Customisations here: https://github.com/mainwp/mainwp-customisations
// More about the plugin: https://mainwp.com/mainwp-customisations/
// Create Custom Client Report tokens
add_filter( 'mainwp_client_reports_tokens_groups', 'mycustom_reports_tokens_groups' );
function mycustom_reports_tokens_groups( $tokens ) {
// examples
@planetahuevo
planetahuevo / bash_profile.sh
Created December 13, 2018 18:05 — forked from kjbrum/bash_profile.sh
My personal bash profile
#---------------------------------------------------------------------------------------------------------------------------------------
#
# Author: Kyle Brumm
# Description: File used to hold Bash configuration, aliases, functions, completions, etc...
#
# Sections:
# 1. ENVIRONMENT SETUP
# 2. MAKE TERMINAL BETTER
# 3. FOLDER MANAGEMENT
# 4. MISC ALIAS'
@planetahuevo
planetahuevo / .htaccess
Created October 9, 2018 17:05 — forked from Zodiac1978/.htaccess
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
<IfModule mod_autoindex.c>
@planetahuevo
planetahuevo / functions.php
Created October 2, 2018 17:15 — forked from nickcernis/functions.php
Genesis Simple Share Shortcode
<?php
// Adds a [social-icons] shortcode to output Genesis Simple Share icons in posts
// https://wordpress.org/plugins/genesis-simple-share/
// Add the code below to your active theme's functions.php file,
// or use in a site-specific plugin.
// The shortcode takes no attributes; change your icon settings via Genesis → Simple Share.
add_shortcode( 'social-icons', 'gss_shortcode' );