Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
wordpress-seo
/
admin
/
import
/
plugins
/
File Content:
class-import-squirrly.php
<?php /** * File with the class to handle data from Squirrly. * * @package WPSEO\Admin\Import\Plugins */ /** * Class with functionality to import & clean Squirrly post metadata. */ class WPSEO_Import_Squirrly extends WPSEO_Plugin_Importer { /** * The plugin name. * * @var string */ protected $plugin_name = 'Squirrly SEO'; /** * Holds the name of the table Squirrly uses to store data. * * @var string */ protected $table_name; /** * Meta key, used in SQL LIKE clause for delete query. * * @var string */ protected $meta_key = '_sq_post_keyword'; /** * Data to import from (and the target to field) the serialized array stored in the SEO field in the Squirrly table. * * @var array */ protected $seo_field_keys = [ 'noindex' => 'meta-robots-noindex', 'nofollow' => 'meta-robots-nofollow', 'title' => 'title', 'description' => 'metadesc', 'canonical' => 'canonical', 'cornerstone' => '_yst_is_cornerstone', 'tw_media' => 'twitter-image', 'tw_title' => 'twitter-title', 'tw_description' => 'twitter-description', 'og_title' => 'opengraph-title', 'og_description' => 'opengraph-description', 'og_media' => 'opengraph-image', 'focuskw' => 'focuskw', ]; /** * WPSEO_Import_Squirrly constructor. */ public function __construct() { parent::__construct(); global $wpdb; $this->table_name = $wpdb->prefix . 'qss'; } /** * Imports the post meta values to Yoast SEO. * * @return bool Import success status. */ protected function import() { $results = $this->retrieve_posts(); foreach ( $results as $post ) { $return = $this->import_post_values( $post->identifier ); if ( ! $return ) { return false; } } return true; } /** * Retrieve the posts from the Squirrly Database. * * @return array Array of post IDs from the DB. */ protected function retrieve_posts() { global $wpdb; return $wpdb->get_results( $wpdb->prepare( $this->retrieve_posts_query(), get_current_blog_id() ) ); } /** * Returns the query to return an identifier for the posts to import. * * @return string Query to get post ID's from the DB. */ protected function retrieve_posts_query() { return "SELECT post_id AS identifier FROM {$this->table_name} WHERE blog_id = %d"; } /** * Removes the DB table and the post meta field Squirrly creates. * * @return bool Cleanup status. */ protected function cleanup() { global $wpdb; // If we can clean, let's clean. $wpdb->query( "DROP TABLE {$this->table_name}" ); // This removes the post meta field for the focus keyword from the DB. parent::cleanup(); // If we can still see the table, something went wrong. if ( $this->detect() ) { $this->cleanup_error_msg(); return false; } return true; } /** * Detects whether there is post meta data to import. * * @return bool Boolean indicating whether there is something to import. */ protected function detect() { global $wpdb; $result = $wpdb->get_var( "SHOW TABLES LIKE '{$this->table_name}'" ); if ( is_wp_error( $result ) || is_null( $result ) ) { return false; } return true; } /** * Imports the data of a post out of Squirrly's DB table. * * @param mixed $post_identifier Post identifier, can be ID or string. * * @return bool Import status. */ private function import_post_values( $post_identifier ) { $data = $this->retrieve_post_data( $post_identifier ); if ( ! $data ) { return false; } if ( ! is_numeric( $post_identifier ) ) { $post_id = url_to_postid( $post_identifier ); } if ( is_numeric( $post_identifier ) ) { $post_id = (int) $post_identifier; $data['focuskw'] = $this->maybe_add_focus_kw( $post_identifier ); } foreach ( $this->seo_field_keys as $squirrly_key => $yoast_key ) { $this->import_meta_helper( $squirrly_key, $yoast_key, $data, $post_id ); } return true; } /** * Retrieves the Squirrly SEO data for a post from the DB. * * @param int $post_identifier Post ID. * * @return array|bool Array of data or false. */ private function retrieve_post_data( $post_identifier ) { global $wpdb; if ( is_numeric( $post_identifier ) ) { $post_identifier = (int) $post_identifier; $query_where = 'post_id = %d'; } if ( ! is_numeric( $post_identifier ) ) { $query_where = 'URL = %s'; } $replacements = [ get_current_blog_id(), $post_identifier, ]; $data = $wpdb->get_var( $wpdb->prepare( "SELECT seo FROM {$this->table_name} WHERE blog_id = %d AND " . $query_where, $replacements ) ); if ( ! $data || is_wp_error( $data ) ) { return false; } $data = maybe_unserialize( $data ); return $data; } /** * Squirrly stores the focus keyword in post meta. * * @param int $post_id Post ID. * * @return string The focus keyword. */ private function maybe_add_focus_kw( $post_id ) { $focuskw = get_post_meta( $post_id, '_sq_post_keyword', true ); if ( $focuskw ) { $focuskw = json_decode( $focuskw ); return $focuskw->keyword; } return ''; } }
Edit
Rename
Chmod
Delete
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