Yoast\WP\SEO\Introductions\Application
Delayed_Premium_Upsell::should_show_after_delay
Determines if the introduction should show based on the self:DELAY_DAY delay from installation or update.
Метод класса: Delayed_Premium_Upsell{}
Хуков нет.
Возвращает
bool. Whether the introduction should show after the delay.
Использование
// private - только в коде основоного (родительского) класса $result = $this->should_show_after_delay(): bool;
Код Delayed_Premium_Upsell::should_show_after_delay() Delayed Premium Upsell::should show after delay Yoast 28.7
private function should_show_after_delay(): bool {
$delay = ( self::DELAY_DAYS * \DAY_IN_SECONDS );
$current_time = \time();
$previous_version = $this->options_helper->get( 'previous_version' );
$first_activated_on = $this->options_helper->get( 'first_activated_on' );
// Case where the user has installed the plugin for the first time and the delay has passed.
if ( $previous_version === '' ) {
return ( $current_time - $first_activated_on ) >= $delay && $this->is_last_introduction_seen_older_than_a_week();
}
// Case where the user has updated the plugin and the delay has passed since the last update.
$last_updated_on = $this->options_helper->get( 'last_updated_on' );
$uniform_last_updated_on = \is_int( $last_updated_on ) ? $last_updated_on : 0;
if ( ( $current_time - $uniform_last_updated_on ) >= $delay ) {
return $this->is_last_introduction_seen_older_than_a_week();
}
return false;
}