PATH:
home
/
sarkas88.com
/
public_html
/
wp-content
/
plugins
/
wordpress-seo
/
src
/
helpers
<?php namespace Yoast\WP\SEO\Helpers; use Yoast\WP\Lib\Model; /** * A helper object for the cleanup of attachments. */ class Attachment_Cleanup_Helper { /** * Removes all indexables for attachments. * * @param bool $suppress_errors Whether to suppress db errors when running the cleanup query. * * @return void */ public function remove_attachment_indexables( $suppress_errors ) { global $wpdb; if ( $suppress_errors ) { // If migrations haven't been completed successfully the following may give false errors. So suppress them. $show_errors = $wpdb->show_errors; $wpdb->show_errors = false; } $indexable_table = Model::get_table_name( 'Indexable' ); $delete_query = "DELETE FROM $indexable_table WHERE object_type = 'post' AND object_sub_type = 'attachment'"; // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: No relevant caches. // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery -- Reason: Most performant way. // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared -- Reason: Is it prepared already. $wpdb->query( $delete_query ); // phpcs:enable if ( $suppress_errors ) { $wpdb->show_errors = $show_errors; } } /** * Cleans all attachment links in the links table from target indexable ids. * * @param bool $suppress_errors Whether to suppress db errors when running the cleanup query. * * @return void */ public function clean_attachment_links_from_target_indexable_ids( $suppress_errors ) { global $wpdb; if ( $suppress_errors ) { // If migrations haven't been completed successfully the following may give false errors. So suppress them. $show_errors = $wpdb->show_errors; $wpdb->show_errors = false; } $links_table = Model::get_table_name( 'SEO_Links' ); $query = "UPDATE $links_table SET target_indexable_id = NULL WHERE type = 'image-in'"; // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: No relevant caches. // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery -- Reason: Most performant way. // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared -- Reason: Is it prepared already. $wpdb->query( $query ); // phpcs:enable if ( $suppress_errors ) { $wpdb->show_errors = $show_errors; } } }
[-] indexing-helper.php
[open]
[-] wordpress-helper.php
[open]
[-] string-helper.php
[open]
[-] social-profiles-helper.php
[open]
[-] short-link-helper.php
[open]
[-] sanitization-helper.php
[open]
[-] curl-helper.php
[open]
[-] permalink-helper.php
[open]
[-] notification-helper.php
[open]
[-] environment-helper.php
[open]
[-] pagination-helper.php
[open]
[+]
open-graph
[-] url-helper.php
[open]
[-] primary-term-helper.php
[open]
[-] user.cursor.php
[open]
[-] redirect-helper.php
[open]
[-] home-url-helper.php
[open]
[-] wpdb-helper.php
[open]
[-] require-file-helper.php
[open]
[-] site-helper.php
[open]
[-] post-type-helper.php
[open]
[-] asset-helper.php
[open]
[-] date-helper.php
[open]
[+]
schema
[-] options-helper.php
[open]
[-] import-cursor-helper.php
[open]
[-] taxonomy-helper.php
[open]
[-] post-helper.php
[open]
[-] attachment-cleanup-helper.php
[open]
[-] robots-txt-helper.php
[open]
[-] import-helper.php
[open]
[-] meta-helper.php
[open]
[-] score-icon-helper.php
[open]
[-] woocommerce-helper.php
[open]
[+]
twitter
[-] blocks-helper.php
[open]
[-] indexable-to-postmeta-helper.php
[open]
[-] language-helper.php
[open]
[+]
..
[-] user-helper.php
[open]
[-] wincher-helper.php
[open]
[-] author-archive-helper.php
[open]
[-] crawl-cleanup-helper.php
[open]
[-] image-helper.php
[open]
[-] first-time-configuration-notice-helper.php
[open]
[-] robots-helper.php
[open]
[-] route-helper.php
[open]
[-] product-helper.php
[open]
[-] capability-helper.php
[open]
[-] aioseo-helper.php
[open]
[-] indexable-helper.php
[open]
[-] current-page-helper.php
[open]