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 @olddomain = "'olddomain.dev'"; | |
SET @newdomain = "'newdomain.com'"; | |
SET @prefix = "wp_"; | |
SET @postmeta = CONCAT('UPDATE ', @prefix, 'postmeta SET meta_value = REPLACE(meta_value,', @olddomain, ',',@newdomain,')'); | |
SET @excerpt = CONCAT('UPDATE ', @prefix, 'posts SET post_excerpt = REPLACE(post_excerpt,', @olddomain, ',',@newdomain,')'); | |
SET @content = CONCAT('UPDATE ', @prefix, 'posts SET post_content = REPLACE(post_content,', @olddomain, ',',@newdomain,')'); | |
SET @guid = CONCAT('UPDATE ', @prefix, 'posts SET guid = REPLACE(guid,', @olddomain, ',',@newdomain,')'); | |
SET @options = CONCAT('UPDATE ', @prefix, 'options SET option_value = REPLACE(option_value,', @olddomain, ',',@newdomain,') WHERE option_name = "siteurl" OR option_name = "home"'); |
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 get_ip_address() { | |
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'); | |
foreach ($ip_keys as $key) { | |
if (array_key_exists($key, $_SERVER) === true) { | |
$items = explode(',', $_SERVER[$key]); |