| Server IP : 151.101.66.159 / Your IP : 216.73.216.66 Web Server : Flywheel/5.1.0 System : Linux wordpress 6.12.113+ #1 SMP Thu Oct 22 02:38:20 UTC 2026 x86_64 User : root ( ) PHP Version : 7.4.33.18 Disable Function : disk_free_space,diskfreespace,dl,exec,fpassthru,getmypid,getmyuid,highlight_file,link,opcache_compile_file,opcache_get_configuration,opcache_is_script_cached,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,phpinfo,popen,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,socket_listen,source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wp-content/plugins/wordpress-seo/admin/import/plugins/ |
Upload File : |
<?php
/**
* File with the class to handle data from All in One SEO Pack, versions 3 and under.
*
* @package WPSEO\Admin\Import\Plugins
*/
/**
* Class with functionality to import & clean All in One SEO Pack post metadata, versions 3 and under.
*/
class WPSEO_Import_AIOSEO extends WPSEO_Plugin_Importer {
/**
* The plugin name.
*
* @var string
*/
protected $plugin_name = 'All In One SEO Pack';
/**
* Meta key, used in SQL LIKE clause for delete query.
*
* @var string
*/
protected $meta_key = '_aioseop_%';
/**
* OpenGraph keys to import.
*
* @var array
*/
protected $import_keys = [
'aioseop_opengraph_settings_title' => 'opengraph-title',
'aioseop_opengraph_settings_desc' => 'opengraph-description',
'aioseop_opengraph_settings_customimg' => 'opengraph-image',
'aioseop_opengraph_settings_customimg_twitter' => 'twitter-image',
];
/**
* Array of meta keys to detect and import.
*
* @var array
*/
protected $clone_keys = [
[
'old_key' => '_aioseop_title',
'new_key' => 'title',
],
[
'old_key' => '_aioseop_description',
'new_key' => 'metadesc',
],
[
'old_key' => '_aioseop_noindex',
'new_key' => 'meta-robots-noindex',
'convert' => [ 'on' => 1 ],
],
[
'old_key' => '_aioseop_nofollow',
'new_key' => 'meta-robots-nofollow',
'convert' => [ 'on' => 1 ],
],
];
/**
* Import All In One SEO meta values.
*
* @return bool Import success status.
*/
protected function import() {
$status = parent::import();
if ( $status ) {
$this->import_opengraph();
}
return $status;
}
/**
* Imports the OpenGraph and Twitter settings for all posts.
*
* @return bool
*/
protected function import_opengraph() {
$query_posts = new WP_Query( 'post_type=any&meta_key=_aioseop_opengraph_settings&order=ASC&fields=ids&nopaging=true' );
if ( ! empty( $query_posts->posts ) ) {
foreach ( array_values( $query_posts->posts ) as $post_id ) {
$this->import_post_opengraph( $post_id );
}
}
return true;
}
/**
* Imports the OpenGraph and Twitter settings for a single post.
*
* @param int $post_id Post ID.
*
* @return void
*/
private function import_post_opengraph( $post_id ) {
$meta = get_post_meta( $post_id, '_aioseop_opengraph_settings', true );
$meta = maybe_unserialize( $meta );
foreach ( $this->import_keys as $old_key => $new_key ) {
$this->maybe_save_post_meta( $new_key, $meta[ $old_key ], $post_id );
}
}
}