HEX
Server: Apache
System: Linux d5123.usc1.stableserver.net 5.14.0-570.17.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Sat May 24 12:53:17 EDT 2025 x86_64
User: d5123 (1001)
PHP: 8.4.21
Disabled: NONE
Upload Files
File: /home/d5123/myboofola_com/wp-content/plugins/defender-security/src/component/class-breadcrumbs.php
<?php
/**
 * Manages the display of Breadcrumbs.
 *
 * @package WP_Defender\Component
 */

namespace WP_Defender\Component;

use WP_Defender\Component;

/**
 * Use Breadcrumbs on different plugin pages.
 *
 * @since 5.2.0
 */
class Breadcrumbs extends Component {

	private const BREADCRUMBS_PREFIX_KEY = 'wd_';
	private const BREADCRUMBS_SUFFIX_KEY = '_breadcrumbs';

	/**
	 * Get the feature's slug.
	 *
	 * @return string
	 */
	private function get_feature_slug(): string {
		// Update value for the next feature.
		return self::BREADCRUMBS_PREFIX_KEY
			. \WP_Defender\Component\Fake_Bot_Detection::SCENARIO_FAKE_BOT . self::BREADCRUMBS_SUFFIX_KEY;
	}

	/**
	 * Get the previous feature's slug.
	 *
	 * @return string
	 */
	private function get_previous_feature_slug(): string {
		return self::BREADCRUMBS_PREFIX_KEY
		. \WP_Defender\Component\Fake_Bot_Detection::SCENARIO_FAKE_BOT . self::BREADCRUMBS_SUFFIX_KEY;
	}

	/**
	 * Update the feature's meta key.
	 *
	 * @return void
	 */
	public function update_meta_key(): void {
		// Add value for the next feature.
	}

	/**
	 * Get the feature's meta key.
	 *
	 * @return bool
	 */
	public function get_meta_key(): bool {
		return (bool) get_user_meta( get_current_user_id(), $this->get_feature_slug(), true );
	}

	/**
	 * Delete the feature's meta key.
	 *
	 * @return void
	 */
	public function delete_meta_key(): void {
		global $wpdb;

		$wpdb->delete( $wpdb->usermeta, array( 'meta_key' => $this->get_feature_slug() ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.SlowDBQuery
	}

	/**
	 * Delete the previous feature's meta key.
	 *
	 * @return void
	 */
	public function delete_previous_meta() {
		global $wpdb;

		$wpdb->delete( $wpdb->usermeta, array( 'meta_key' => $this->get_previous_feature_slug() ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.SlowDBQuery
	}
}