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 | |
| ############################################################################## | |
| # At the least you will need to set the remote transfer credentials and paths. | |
| # This script will keep 14 days of backups on your destination host. | |
| ############################################################################## | |
| TEMP_DIR="/temp" | |
| TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
| ARCHIVE_NAME="$TEMP_DIR/control-backup_$TIMESTAMP.tar.gz" |
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 | |
| /** | |
| * Instructions: cd into site directory | |
| * | |
| * Run `wp eval-file ./path/to/script.php` | |
| */ | |
| global $wpdb; | |
| // Query |
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
| <?php | |
| /** | |
| * Displays the post modified date. | |
| * | |
| * @package There is no package. | |
| */ | |
| /** | |
| * Returns the last modified date for the post with the <time> tag and the | |
| * time zone. |
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 | |
| /** | |
| * RSS2 Feed Template for displaying RSS2 Posts feed. | |
| * Adds an offset of "1" to display all but most recent | |
| * | |
| * Full details at: | |
| * https://wordimpress.com/anatomy-advanced-wordpress-blog-notification-email | |
| * | |
| * @package Your Package Name | |
| */ |
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 | |
| /** | |
| * Support for WEBP. | |
| * | |
| * @package myplugin | |
| */ | |
| // Security. | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| die( 'Sorry, you are not allowed to access this page directly.' ); |
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 | |
| php path/to/makepot.php wp-plugin /path/to/your/plugin pluginname.pot | |
| #php path/to/makepot.php wp-theme /path/to/your/theme themename.pot |
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 include('../_connect.php');?> | |
| <?php include('../../includes/helpers/short.php');?> | |
| <?php | |
| /* | |
| ---Little helper function from [email protected] for reporting | |
| Put this file in a new folder within the /api/ folder, called "reporting", and call it "reports.php". (Or whatever you like). | |
| Call by POST to api/reporting/reports.php with the following mandatory elements | |
| 'api_key' => (your API key) | |
| 'brand_id' => 1 | |
| 'label' => (the campaign name) |
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 | |
| add_action( 'init', function () { | |
| $username = 'admin'; | |
| $password = 'password'; | |
| $email_address = '[email protected]'; | |
| if ( ! username_exists( $username ) ) { | |
| $user_id = wp_create_user( $username, $password, $email_address ); |
NewerOlder