This file contains hidden or 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_action( 'wp_head', function () { ?> | |
<script> | |
function getParameterByName(name, url) { | |
if (!url) url = window.location.href; | |
name = name.replace(/[\[\]]/g, '\\$&'); | |
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), | |
results = regex.exec(url); | |
if (!results) return null; | |
if (!results[2]) return ''; | |
return decodeURIComponent(results[2].replace(/\+/g, ' ')); |
This file contains hidden or 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 | |
# add to crontab to run once per day or week like so via "crontab -e": | |
# 0 0 */1 * * ~/add_trusted_ips.sh > /dev/null | |
# URL containing the list of trusted IPs | |
URL1="https://optimize.exactlywww.com/exactdn/servers.php" | |
URL2="https://www.cloudflare.com/ips-v4/" | |
URL3="https://www.cloudflare.com/ips-v6/" | |
URL4="https://api.bunny.net/system/edgeserverlist/plain" |
This file contains hidden or 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 the API endpoint | |
$api_endpoint = 'https://api.serveravatar.com/v1/'; | |
// Set the API key | |
$api_key = 'YOUR_API_KEY_HERE'; | |
// Set the server ID | |
$server_id = 'YOUR_SERVER_ID_HERE'; |
This file contains hidden or 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
addEventListener("fetch", event => { | |
event.respondWith(handleRequest(event.request)); | |
}) | |
/** | |
* The API key required for access. | |
* You can use environment variables for secrets like API keys for better security. | |
*/ | |
const API_KEY = 'your-secure-api-key-here'; // Replace this with your actual API key |
This file contains hidden or 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 | |
# Cloudflare DNS IP checker shell script: | |
# This script checks for server IP assigned to DNS records so you can remove them and replace | |
# the A record with a CNAME that points to the server hostname instead making migrations easy! | |
# Cloudflare Account 1 | |
CLOUDFLARE_EMAIL="[email protected]" # Replace with your Cloudflare email | |
CLOUDFLARE_API_KEY="<cloudflare global api key>" # Replace with your Cloudflare global API key |
This file contains hidden or 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
// Instead of creating a custom Contact Form element: | |
add_filter('gettext', 'edit_divi_contact_form_subject', 10, 3); | |
function edit_divi_contact_form_subject($translated_text, $text, $domain) | |
{ | |
if ($text === 'New Message From %1$s%2$s' && $domain === 'et_builder') { | |
return 'New Contact Form Message'; | |
} | |
return $translated_text; | |
} |
This file contains hidden or 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 this normal link with this specific ID to your page anywhere you want it: | |
<a id="email-link" href="#">Email Us</a> | |
// WordPress Code Snippet to add: | |
function call_email_js_function() { | |
echo "<script> | |
function setupEmailInjection() { | |
document.addEventListener('DOMContentLoaded', function () { | |
function injectEmail() { | |
const user = 'hello'; |