GRAYBYTE WORDPRESS FILE MANAGER4057

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/chahida.co.in/wp-content/plugins/wp-optimize/optimizations/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/chahida.co.in/wp-content/plugins/wp-optimize/optimizations//orphandata.php
<?php

if (!defined('WPO_VERSION')) die('No direct access allowed');

class WP_Optimization_orphandata extends WP_Optimization {

	public $ui_sort_order = 10000;

	public $available_for_saving = true;

	public $support_preview = false;

	/**
	 * Do actions after optimize() function.
	 */
	public function after_optimize() {
		// translators: %s - number of deleted orphaned relationship data
		$message = sprintf(_n('%s orphaned relationship data deleted', '%s orphaned relationship data deleted', $this->processed_count, 'wp-optimize'), number_format_i18n($this->processed_count));

		if ($this->is_multisite_mode()) {
			// translators: %s - number of sites
			$message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
		}

		$this->logger->info($message);
		$this->register_output($message);
	}

	/**
	 * Do optimization.
	 */
	public function optimize() {
		$clean = "DELETE FROM `" . $this->wpdb->term_relationships . "` WHERE term_taxonomy_id=1 AND object_id NOT IN (SELECT id FROM `" . $this->wpdb->posts . "`);";

		$orphandata = $this->query($clean);
		$this->processed_count += $orphandata;
	}

	/**
	 * Do actions after get_info() function.
	 */
	public function after_get_info() {
		if ($this->found_count > 0) {
			// translators: %s - number of orphaned relationship data
			$message = sprintf(_n('%s orphaned relationship data in your database', '%s orphaned relationship data in your database', $this->found_count, 'wp-optimize'), number_format_i18n($this->found_count));
		} else {
			$message = __('No orphaned relationship data in your database', 'wp-optimize');
		}

		if ($this->is_multisite_mode()) {
			// translators: %s - number of sites
			$message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
		}

		$this->register_output($message);
	}

	/**
	 * Get count of unoptimized items.
	 */
	public function get_info() {
		$sql = "SELECT COUNT(*) FROM `{$this->wpdb->term_relationships}` WHERE term_taxonomy_id=%d AND object_id NOT IN (SELECT id FROM `{$this->wpdb->posts}`);";
		$orphandata = $this->wpdb->get_var($this->wpdb->prepare($sql, 1)); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- `$this->wpdb` is `$wpdb`

		$this->found_count += $orphandata;
	}
	
	public function settings_label() {
		return __('Clean orphaned relationship data', 'wp-optimize');
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:24
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:24
giriqfky / giriqfky
0644
attachments.php
3.147 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
autodraft.php
5.331 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
commentmeta.php
7.538 KB
May 01 2025 14:24:58
giriqfky / giriqfky
0644
inactive-tags.php
0.556 KB
February 20 2018 16:52:16
giriqfky / giriqfky
0644
optimizetables.php
6.644 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
orphandata.php
2.394 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
orphanedtables.php
5.421 KB
May 01 2025 14:24:58
giriqfky / giriqfky
0644
pingbacks.php
4.508 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
postmeta.php
4.561 KB
May 01 2025 14:24:58
giriqfky / giriqfky
0644
repairtables.php
4.381 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
revisions.php
8.074 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
spam.php
8.172 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
trackbacks.php
4.406 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
transient.php
14.432 KB
May 01 2025 14:24:58
giriqfky / giriqfky
0644
trash.php
6.781 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
unapproved.php
5.939 KB
March 03 2025 22:03:20
giriqfky / giriqfky
0644
usermeta.php
4.456 KB
May 01 2025 14:24:58
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF