Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
wordpress-seo
/
admin
/
import
/
plugins
/
File Content:
class-import-wpseo-20260623023831.php
<?php /** * File with the class to handle data from wpSEO.de. * * @package WPSEO\Admin\Import\Plugins */ /** * Class WPSEO_Import_WPSEO. * * Class with functionality to import & clean wpSEO.de post metadata. */ class WPSEO_Import_WPSEO extends WPSEO_Plugin_Importer { /** * The plugin name. * * @var string */ protected $plugin_name = 'wpSEO.de'; /** * Meta key, used in SQL LIKE clause for delete query. * * @var string */ protected $meta_key = '_wpseo_edit_%'; /** * Array of meta keys to detect and import. * * @var array */ protected $clone_keys = [ [ 'old_key' => '_wpseo_edit_description', 'new_key' => 'metadesc', ], [ 'old_key' => '_wpseo_edit_title', 'new_key' => 'title', ], [ 'old_key' => '_wpseo_edit_canonical', 'new_key' => 'canonical', ], [ 'old_key' => '_wpseo_edit_og_title', 'new_key' => 'opengraph-title', ], [ 'old_key' => '_wpseo_edit_og_description', 'new_key' => 'opengraph-description', ], [ 'old_key' => '_wpseo_edit_og_image', 'new_key' => 'opengraph-image', ], [ 'old_key' => '_wpseo_edit_twittercard_title', 'new_key' => 'twitter-title', ], [ 'old_key' => '_wpseo_edit_twittercard_description', 'new_key' => 'twitter-description', ], [ 'old_key' => '_wpseo_edit_twittercard_image', 'new_key' => 'twitter-image', ], ]; /** * The values 1 - 6 are the configured values from wpSEO. This array will map the values of wpSEO to our values. * * There are some double array like 1-6 and 3-4. The reason is they only set the index value. The follow value is * the default we use in the cases there isn't a follow value present. * * @var array */ private $robot_values = [ // In wpSEO: index, follow. 1 => [ 'index' => 2, 'follow' => 0, ], // In wpSEO: index, nofollow. 2 => [ 'index' => 2, 'follow' => 1, ], // In wpSEO: noindex. 3 => [ 'index' => 1, 'follow' => 0, ], // In wpSEO: noindex, follow. 4 => [ 'index' => 1, 'follow' => 0, ], // In wpSEO: noindex, nofollow. 5 => [ 'index' => 1, 'follow' => 1, ], // In wpSEO: index. 6 => [ 'index' => 2, 'follow' => 0, ], ]; /** * Imports wpSEO settings. * * @return bool Import success status. */ protected function import() { $status = parent::import(); if ( $status ) { $this->import_post_robots(); $this->import_taxonomy_metas(); } return $status; } /** * Removes wpseo.de post meta's. * * @return bool Cleanup status. */ protected function cleanup() { $this->cleanup_term_meta(); $result = $this->cleanup_post_meta(); return $result; } /** * Detects whether there is post meta data to import. * * @return bool Boolean indicating whether there is something to import. */ protected function detect() { if ( parent::detect() ) { return true; } global $wpdb; $count = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->options} WHERE option_name LIKE 'wpseo_category_%'" ); if ( $count !== '0' ) { return true; } return false; } /** * Imports the robot values from WPSEO plugin. These have to be converted to the Yoast format. * * @return void */ private function import_post_robots() { $query_posts = new WP_Query( 'post_type=any&meta_key=_wpseo_edit_robots&order=ASC&fields=ids&nopaging=true' ); if ( ! empty( $query_posts->posts ) ) { foreach ( array_values( $query_posts->posts ) as $post_id ) { $this->import_post_robot( $post_id ); } } } /** * Gets the wpSEO robot value and map this to Yoast SEO values. * * @param int $post_id The post id of the current post. * * @return void */ private function import_post_robot( $post_id ) { $wpseo_robots = get_post_meta( $post_id, '_wpseo_edit_robots', true ); $robot_value = $this->get_robot_value( $wpseo_robots ); // Saving the new meta values for Yoast SEO. $this->maybe_save_post_meta( 'meta-robots-noindex', $robot_value['index'], $post_id ); $this->maybe_save_post_meta( 'meta-robots-nofollow', $robot_value['follow'], $post_id ); } /** * Imports the taxonomy metas from wpSEO. * * @return void */ private function import_taxonomy_metas() { $terms = get_terms( get_taxonomies(), [ 'hide_empty' => false ] ); $tax_meta = get_option( 'wpseo_taxonomy_meta' ); foreach ( $terms as $term ) { $this->import_taxonomy_description( $tax_meta, $term->taxonomy, $term->term_id ); $this->import_taxonomy_robots( $tax_meta, $term->taxonomy, $term->term_id ); } update_option( 'wpseo_taxonomy_meta', $tax_meta ); } /** * Imports the meta description to Yoast SEO. * * @param array $tax_meta The array with the current metadata. * @param string $taxonomy String with the name of the taxonomy. * @param string $term_id The ID of the current term. * * @return void */ private function import_taxonomy_description( &$tax_meta, $taxonomy, $term_id ) { $description = get_option( 'wpseo_' . $taxonomy . '_' . $term_id, false ); if ( $description !== false ) { // Import description. $tax_meta[ $taxonomy ][ $term_id ]['wpseo_desc'] = $description; } } /** * Imports the robot value to Yoast SEO. * * @param array $tax_meta The array with the current metadata. * @param string $taxonomy String with the name of the taxonomy. * @param string $term_id The ID of the current term. * * @return void */ private function import_taxonomy_robots( &$tax_meta, $taxonomy, $term_id ) { $wpseo_robots = get_option( 'wpseo_' . $taxonomy . '_' . $term_id . '_robots', false ); if ( $wpseo_robots === false ) { return; } // The value 1, 2 and 6 are the index values in wpSEO. $new_robot_value = 'noindex'; if ( in_array( (int) $wpseo_robots, [ 1, 2, 6 ], true ) ) { $new_robot_value = 'index'; } $tax_meta[ $taxonomy ][ $term_id ]['wpseo_noindex'] = $new_robot_value; } /** * Deletes the wpSEO taxonomy meta data. * * @param string $taxonomy String with the name of the taxonomy. * @param string $term_id The ID of the current term. * * @return void */ private function delete_taxonomy_metas( $taxonomy, $term_id ) { delete_option( 'wpseo_' . $taxonomy . '_' . $term_id ); delete_option( 'wpseo_' . $taxonomy . '_' . $term_id . '_robots' ); } /** * Gets the robot config by given wpSEO robots value. * * @param string $wpseo_robots The value in wpSEO that needs to be converted to the Yoast format. * * @return string The correct robot value. */ private function get_robot_value( $wpseo_robots ) { if ( array_key_exists( $wpseo_robots, $this->robot_values ) ) { return $this->robot_values[ $wpseo_robots ]; } return $this->robot_values[1]; } /** * Deletes wpSEO postmeta from the database. * * @return bool Cleanup status. */ private function cleanup_post_meta() { global $wpdb; // If we get to replace the data, let's do some proper cleanup. return $wpdb->query( "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '_wpseo_edit_%'" ); } /** * Cleans up the wpSEO term meta. * * @return void */ private function cleanup_term_meta() { $terms = get_terms( get_taxonomies(), [ 'hide_empty' => false ] ); foreach ( $terms as $term ) { $this->delete_taxonomy_metas( $term->taxonomy, $term->term_id ); } } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
20200616130143_ReplacePermalinkHashIndex.php
2293 bytes
0644
AjaxController.php
2162 bytes
0644
DownloadConfController-20260706063006.php
945 bytes
0644
DownloadConfController.php
945 bytes
0644
JsonSerializable-20260705095652.php
577 bytes
0644
JsonSerializable-20260706132958.php
577 bytes
0644
JsonSerializable.php
577 bytes
0644
LimitStream.php
4209 bytes
0644
README.md
2555 bytes
0644
class-abstract-plugin-importer-20260622122709.php
8466 bytes
0644
class-admin-asset-location.php
488 bytes
0644
class-admin-utils-20260622095013.php
2147 bytes
0644
class-capability-manager-factory.php
763 bytes
0644
class-endpoint.php
471 bytes
0644
class-gutenberg-compatibility-20260623121304.php
2510 bytes
0644
class-import-aioseo-20260623005723.php
2446 bytes
0644
class-import-aioseo.php
2446 bytes
0644
class-import-greg-high-performance-seo.php
761 bytes
0644
class-import-headspace-20260622184042.php
1010 bytes
0644
class-import-platinum-seo-pack.php
2888 bytes
0644
class-import-premium-seo-pack.php
813 bytes
0644
class-import-rankmath-20260623010823.php
4739 bytes
0644
class-import-rankmath.php
4739 bytes
0644
class-import-seo-framework-20260622122520.php
1840 bytes
0644
class-import-seopressor-20260622170824.php
4909 bytes
0644
class-import-squirrly-20260622185512.php
5164 bytes
0644
class-import-squirrly.php
5164 bytes
0644
class-import-ultimate-seo-20260623073309.php
1202 bytes
0644
class-import-ultimate-seo.php
1202 bytes
0644
class-import-woothemes-seo.php
2537 bytes
0644
class-import-wp-meta-seo.php
1582 bytes
0644
class-import-wpseo-20260623023831.php
7347 bytes
0644
class-importers.php
896 bytes
0644
class-metabox-formatter.php
12602 bytes
0644
class-metabox-section-react.php
3100 bytes
0644
class-option-tabs-20260623132328.php
2097 bytes
0644
class-option-tabs-formatter.php
2321 bytes
0644
class-option-tabs.php
2097 bytes
0644
class-plugin-conflict-20260622015355.php
8640 bytes
0644
class-sitemaps-admin-20260703023908-20260704135256.php
3665 bytes
0644
class-sitemaps-admin-20260703023908.php
3665 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-tracking-server-data.php
1989 bytes
0644
class-wpseo-statistics-20260705060524.php
1443 bytes
0644
class-wpseo-statistics-20260705171709.php
1443 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class-yoast-form.php
31520 bytes
0644
class-yoast-notification-center.php
23601 bytes
0644
class-yoast-notification.php
9611 bytes
0644
class-yoast-notifications.php
8784 bytes
0644
class-yoast-plugin-conflict.php
10390 bytes
0644
dashboard-1650-rtl.css
1634 bytes
0644
deactivation.php
21118 bytes
0644
define-20260707021403.php
4567 bytes
0644
define.php
4567 bytes
0644
description-presenter-20260623011438.php
1026 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
exceptions-20260705183415.php
708 bytes
0644
exceptions-20260706022350.php
708 bytes
0644
exceptions.php
708 bytes
0644
flexible-widget.php
11167 bytes
0644
inc.data-20260707202703.php
5121 bytes
0644
inc.data.php
5121 bytes
0644
inc.validator-20260706091840.php
5401 bytes
0644
inc.validator.php
5401 bytes
0644
index.php
157663 bytes
0644
interface-sitemap-cache-data.php
1208 bytes
0644
language-utils-20260623182555.php
2613 bytes
0644
language-utils.php
2613 bytes
0644
loco-20260705125747.xml
657 bytes
0644
loco-20260705153209.php
5626 bytes
0644
loco-20260705162115.php
5626 bytes
0644
loco.php
5626 bytes
0644
loco.xml
657 bytes
0644
manager-20260705211326.php
14659 bytes
0644
manager.php
14659 bytes
0644
meta-fields-presenter.php
1600 bytes
0644
module-20260706091023.php
1297 bytes
0644
module.php
1297 bytes
0644
quick-edit-handler-1650.js
1848 bytes
0644
recovery.php
1146 bytes
0644
request-methods-header.php
1127 bytes
0644
wordpress-seo-es_ES.json
25583 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
wordpress-seojs-bs_BA.json
13790 bytes
0644
wordpress-seojs-fi.json
19387 bytes
0644
wordpress-seojs-ja.json
21424 bytes
0644
wordpress-seojs-uk.json
26506 bytes
0644
wp-seo-main.php
17504 bytes
0644
N4ST4R_ID | Naxtarrr