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 | |
// function to access node <package> which is above <hotel> | |
// https://www.wpallimport.com/documentation/code-snippets/#access-data-above-element-chosen-on-step-2 | |
function wpai_pmxi_before_xml_import( $importID ) { | |
// output all activity to a debug log, so we can see where script is failing | |
defined('PDD_DEBUG') or define('PDD_DEBUG', 1); // set to 1 for ON | |
defined('PDD_LOG_FILE') or define('PDD_LOG_FILE', WP_CONTENT_DIR . '/errors-pdd.log'); |
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
# Block Bad Bots in CSF and MOD SEC - easy | |
# 1) install CSF and Mod Sec | |
# 2) Set up the mod sec rules - instructions here (note these are for Direct admin, they will likely work on other systems too) | |
# https://www.vpsbasics.com/security/how-to-block-bad-bots-using-modsecurity-with-directadmin/ | |
# 3) get bad bots list from Ultimate Bad Bot | |
# 3.1) Go Here: https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/tree/master/_generator_lists | |
# 3.2) Open the latest bad-user-agents-htaccess.list and view the "raw" | |
# 3.3) copy to your bad-botlist.txt file | |
# 4) install - then restart csf and ldf and watch your logs... | |
# hint: if you set LF_MODSEC in the csf firewall ( e.g. set it as LF_MODSEC = 5 and LF_MODSEC_PERM = 86400 (which is 24hrs) then CSF will add persistent offenders to the block list.... |
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
# Setting up mod_ratelimit on cPanel Server | |
# Provides additional stability on the server by rate limiting bandwidth, thereby slowing down connections and helping to stabilise server | |
# Useful help: https://usavps.com/blog/13241/ | |
# Useful help: https://httpd.apache.org/docs/2.4/mod/mod_ratelimit.html | |
# Useful help: https://maj0rmil4d.medium.com/how-to-limit-bandwidth-per-connection-on-apache-ratelimit-d59e8057ca7b | |
# 1) Check you have installed modules via easyapache; mod_ratelimit and mod_env | |
# 2) go to WHM > Apach config > include editor > pre-virtual hosts |
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 Bookings: Woocommerce bookings - amend cut off time for daily tour | |
* Problem Scenario: Bike Hire bookable over several days, The default Woo Bookings cut off time for booking is midnight the day before. | |
* There's no easy way to modify this in the booking product set up, unless you change the set up to be bookable blocks of time (e.g. | |
* 8hrs at a time?) - which is fine, for some cases, however, in this case, we wanted to stay with bookable days so client can book | |
* multiple days hire if they wish, rather than multiple blocks of time. In this scenario, the cut off time for last bookings for the | |
* Daily Tour should be 8am on the day (2pm for a singular specific tour type per the ID ) - this allows for late arrivals and last | |
* minute walk ups etc. and yet, retains the Daily Tour settings. | |
* Note: this snippet will only work where the tour is set to daily blocks, not blocks of time. Min block will be 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
/* | |
// original snippet URL: https://gist.github.com/solaceten/7f03aed8c3b232742b1f6fb7777d8776 | |
// Author solaceten. You are free to do what you want with this but not sell it or make any money from its use. | |
// | |
// Explainer: | |
// Below is a custom function to add a custom variable into automate woo. | |
// This example enables the use of a new variable: order.billing_email - as a variable in the workflow ACTION section, email TO field. | |
// As at Dec 2024, in automatewoo, this variable is working after adding the following code. | |
// | |
// While this code allows you to use the new variable {{ order.billing_email }} in your Workflow, note that in the main queue admin table, |