- create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf- edit /etc/redis-xxx.conf, illustrated as below
...| <?php | |
| // Create the stream context | |
| $context = stream_context_create(array( | |
| 'http' => array( | |
| 'timeout' => 3 // Timeout in seconds | |
| ) | |
| )); | |
| // Fetch the URL's contents |
| <?php | |
| /* | |
| * dl-file.php | |
| * | |
| * Protect uploaded files with login. | |
| * | |
| * @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in | |
| * | |
| * @author hakre <http://hakre.wordpress.com/> | |
| * @license GPL-3.0+ |
| #!/bin/bash | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
| # | |
| WP_OWNER=www-data # <-- wordpress owner | |
| WP_GROUP=www-data # <-- wordpress group | |
| WP_ROOT=$1 # <-- wordpress root directory |
| $fileName = 'Billing-Summary.csv'; | |
| header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); | |
| header('Content-Description: File Transfer'); | |
| header("Content-type: text/csv"); | |
| header("Content-Disposition: attachment; filename={$fileName}"); | |
| header("Expires: 0"); | |
| header("Pragma: public"); | |
| $fh = @fopen( 'php://output', 'w' ); |
| <?php | |
| Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/ | |
| //adjustments to wp-includes/http.php timeout values to workaround slow server responses | |
| add_filter('http_request_args', 'bal_http_request_args', 100, 1); | |
| function bal_http_request_args($r) //called on line 237 | |
| { | |
| $r['timeout'] = 15; | |
| return $r; | |
| } | |
| /* | |
| Add PMPro billing fields to the edit user profile page. | |
| You must Paid Memberships Pro and the Register Helper plugin installed: | |
| http://wordpress.org/extend/plugins/paid-memberships-pro | |
| https://github.com/strangerstudios/pmpro-register-helper | |
| */ | |
| function add_billing_fields_to_profile() | |
| { | |
| global $pmpro_countries; | |
$ cp /etc/redis.conf /etc/redis-xxx.conf...| <?php | |
| //Call this with the shown parameters (make sure $time and $end are integers and in Unix timestamp format!) | |
| //Get a link that will open a new event in Google Calendar with those details pre-filled | |
| function make_google_calendar_link($name, $begin, $end, $location, $details) { | |
| $params = array('&dates=', '/', '&details=', '&location=', '&sf=true&output=xml'); | |
| $url = 'https://www.google.com/calendar/render?action=TEMPLATE&text='; | |
| $arg_list = func_get_args(); | |
| for ($i = 0; $i < count($arg_list); $i++) { | |
| $current = $arg_list[$i]; |
| <?php | |
| /** | |
| * Plugin Name: Retroactive License Emails for EDD Software Licensing | |
| * Plugin URI: http://themeofthecrop.com | |
| * Description: Send an email with the license key to customers when retroactively generating licenses with Easy Digital Download's Software Licensing. | |
| * Version: 0.0.1 | |
| * Author: Theme of the Crop | |
| * Author URI: http://themeofthecrop.com | |
| * License: GNU General Public License v2.0 or later | |
| * License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| /** | |
| * Register Custom myCRED Hook | |
| * @since 1.0 | |
| * @version 1.0 | |
| */ | |
| add_filter( 'mycred_setup_hooks', 'Learndash_myCRED_Hook' ); | |
| function Learndash_myCRED_Hook( $installed ) { | |
| $installed['hook_learndash'] = array( | |
| 'title' => __( 'LearnDash', 'mycred' ), |