WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WPSEO_Tracking::should_send_tracking() protected Yoast 1.0

Determines whether to send the tracking data.

Returns false if tracking is disabled or the current page is one of the admin plugins pages. Returns true when there's no tracking data stored or the data was sent more than two weeks ago. The two weeks interval is set when instantiating the class.

{} Это метод класса: WPSEO_Tracking{}

Хуков нет.

Возвращает

true/false. True when tracking data should be sent.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->should_send_tracking( $ignore_time_treshhold );
$ignore_time_treshhold(true/false)
Whether to send the tracking data ignoring the two weeks time treshhold.
По умолчанию: false

Код WPSEO_Tracking::should_send_tracking() Yoast 15.2

<?php
protected function should_send_tracking( $ignore_time_treshhold = false ) {
	global $pagenow;

	// Only send tracking on the main site of a multi-site instance. This returns true on non-multisite installs.
	if ( ! is_main_site() ) {
		return false;
	}

	// Because we don't want to possibly block plugin actions with our routines.
	if ( in_array( $pagenow, [ 'plugins.php', 'plugin-install.php', 'plugin-editor.php' ], true ) ) {
		return false;
	}

	$last_time = get_option( $this->option_name );

	// When tracking data haven't been sent yet or when sending data is forced.
	if ( ! $last_time || $ignore_time_treshhold ) {
		return true;
	}

	return $this->exceeds_treshhold( $this->current_time - $last_time );
}