2023-12-30 14:28:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Bdp\Modules\Seo;
|
|
|
|
class Seo
|
|
|
|
{
|
2024-03-16 14:21:57 +01:00
|
|
|
public static function importVerificationKeys() {
|
|
|
|
$aioseoSetting = get_option('aioseo_options', null);
|
|
|
|
if (null === $aioseoSetting) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ('' !== $aioseoSetting && !is_object($aioseoSetting) && !is_array($aioseoSetting)){
|
|
|
|
$aioseoSetting = json_decode( $aioseoSetting );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!is_object($aioseoSetting) ||!isset($aioseoSetting->webmasterTools) ||!is_object($aioseoSetting->webmasterTools)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$webmasterTools = $aioseoSetting->webmasterTools;
|
|
|
|
if ('' !== get_option('kompass_seo_google_verification', '')) {
|
|
|
|
update_option('kompass_seo_google_verification', $webmasterTools->google);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ('' !== get_option('kompass_seo_bing_verification', '')) {
|
|
|
|
update_option('kompass_seo_bing_verification', $webmasterTools->bing);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-30 14:28:21 +01:00
|
|
|
public static function setup()
|
|
|
|
{
|
2024-03-16 14:21:57 +01:00
|
|
|
|
2023-12-30 14:28:21 +01:00
|
|
|
if (get_option('permalink_structure') === '') {
|
|
|
|
update_option('permalink_structure', '/%postname%/');
|
|
|
|
flush_rewrite_rules();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|