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/sh | |
| THESITE= "SITE-NAME" | |
| THEDB="DATABASE-NAME" | |
| THEDBUSER="DATABASE-USER" | |
| THEDBPW="DATABASE-USER-PASSWORD" | |
| THEDATE=`date +%d%m%y%H%M` | |
| # export database | |
| mysqldump -u $THEDBUSER -p${THEDBPW} $THEDB | gzip > /var/www/_backups/dbbackup_${THEDB}_${THEDATE}.bak.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
| <?php | |
| defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); | |
| /* | |
| Plugin Name: Plugin x | |
| */ | |
| add_action( 'wp_footer', 'example_plugin_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', 'example_session_start', 1 ); | |
| add_action( 'wp_login', 'example_session_regenerate' ); | |
| add_action( 'wp_logout', 'example_session_end' ); | |
| function example_session_start() { | |
| if ( !session_id() ) { | |
| session_save_path( '/mnt/data/www/example.com/sessions' ); | |
| session_name( uniqid( 'example-', true ) ); |
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 | |
| // Activate WordPress Maintenance Mode | |
| function maintenance_mode(){ | |
| if(!current_user_can('edit_themes') || !is_user_logged_in()){ | |
| wp_die('<h1 style="color:red">Website under Maintenance</h1><br />We are performing scheduled maintenance. We will be back online shortly!'); | |
| } | |
| } | |
| add_action('get_header', 'maintenance_mode'); |
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 | |
| function xmlrpc_remove_methods( $methods ) { | |
| unset( $methods['system.multicall'] ); | |
| return $methods; | |
| } | |
| add_filter( 'xmlrpc_methods', 'xmlrpc_remove_methods'); |
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
| // Set number of shortcodes to generate | |
| $shortcodes = 10000000; | |
| // Loop through and create unique shortcodes | |
| while ($shortcodes) { | |
| $shortcode = generateShortcode(); | |
| $checkSQL = "SELECT shortcode FROM shortcodes WHERE shortcode = '" . $shortcode . "'"; | |
| $checkResult = $mysqli->query($checkSQL); | |
| // If doesn't exist, insert into database |
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
| #!/usr/bin/php | |
| <?php | |
| // USAGE: | |
| // $ php update_moodle_photo.php <user-id-number> | |
| // | |
| // to be able to run this file as command line script | |
| define('CLI_SCRIPT', true); | |
| // include config.php from your moodle's docroot | |
| require_once('/var/www/moodle/config.php'); |
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 | |
| /** | |
| * | |
| */ | |
| function force_template_redirect() { | |
| if ( (is_page( 'acessar-conta' ) || is_page( 'criar-uma-conta' )) | |
| && is_user_logged_in() ) { | |
| wp_redirect( home_url( '/meus-dados/' ) ); | |
| exit(); |
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( 'admin_init', 'disable_autosave' ); | |
| function disable_autosave() { | |
| wp_deregister_script( 'autosave' ); | |
| } |
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
| <script> | |
| $(document).ready(function(){ | |
| if(window.console || "console" in window) { | |
| console.log("%c WARNING!!!", "color:#FF8F1C; font-size:40px;"); | |
| console.log("%c This browser feature is for developers only. Please do not copy-paste any code or run any scripts here. It may cause your PayPal account to be compromised.", "color:#003087; font-size:12px;"); | |
| console.log("%c For more information, http://en.wikipedia.org/wiki/Self-XSS", "color:#003087; font-size:12px;"); | |
| } | |
| }); | |
| </script> |