/** * @package Freemius * @copyright Copyright (c) 2015, Freemius, Inc. * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 * @since 1.0.9 */ if ( ! defined( 'ABSPATH' ) ) { exit; } class FS_Subscription extends FS_Entity { #region Properties /** * @var number */ public $user_id; /** * @var number */ public $install_id; /** * @var number */ public $plan_id; /** * @var number */ public $license_id; /** * @var float */ public $total_gross; /** * @var float */ public $amount_per_cycle; /** * @var int # of months */ public $billing_cycle; /** * @var float */ public $outstanding_balance; /** * @var int */ public $failed_payments; /** * @var string */ public $gateway; /** * @var string */ public $external_id; /** * @var string|null */ public $trial_ends; /** * @var string|null Datetime of the next payment, or null if cancelled. */ public $next_payment; /** * @since 2.3.1 * * @var string|null Datetime of the cancellation. */ public $canceled_at; /** * @var string|null */ public $vat_id; /** * @var string Two characters country code */ public $country_code; #endregion Properties /** * @param object|bool $subscription */ function __construct( $subscription = false ) { parent::__construct( $subscription ); } static function get_type() { return 'subscription'; } /** * Check if subscription is active. * * @author Vova Feldman (@svovaf) * @since 1.0.9 * * @return bool */ function is_active() { if ( $this->is_canceled() ) { return false; } return ( ! empty( $this->next_payment ) && strtotime( $this->next_payment ) > WP_FS__SCRIPT_START_TIME ); } /** * @author Vova Feldman (@svovaf) * @since 2.3.1 * * @return bool */ function is_canceled() { return ! is_null( $this->canceled_at ); } /** * Subscription considered to be new without any payments * if the next payment should be made within less than 24 hours * from the subscription creation. * * @author Vova Feldman (@svovaf) * @since 1.0.9 * * @return bool */ function is_first_payment_pending() { return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->next_payment ) - strtotime( $this->created ) ); } /** * @author Vova Feldman (@svovaf) * @since 1.1.7 */ function has_trial() { return ! is_null( $this->trial_ends ); } }.blog-layout-1 { /* 2 - Blog Thumbnail Styles */ } .blog-layout-1 .post-thumb .posted-on { position: absolute; top: 0; } .blog-layout-1 .post-thumb .posted-on .entry-date span { display: block; width: 100%; text-align: center; } .blog-layout-1.ast-no-thumb .posted-on { position: relative; display: inline-block; } .ast-separate-container .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .square .posted-on { margin-left: calc(-1 * var(--ast-container-default-xlg-padding)); } @media (max-width: 1200px) { .ast-separate-container .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .square .posted-on { margin-left: calc(-1 * var(--ast-container-default-lg-padding)); } } .ast-separate-container .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .circle .posted-on { margin-left: calc(-1 * var(--ast-container-default-slg-padding)); } @media (max-width: 1200px) { .ast-separate-container .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .circle .posted-on { margin-left: calc(-1 * var(--ast-container-default-xxs-padding)); } } .ast-separate-container .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .square .posted-on { margin-top: calc(-1 * var(--ast-container-default-md-padding)); } @media (max-width: 1200px) { .ast-separate-container .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .square .posted-on { margin-top: calc(-1 * var(--ast-container-default-sm-padding)); } } .ast-separate-container .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .circle .posted-on { margin-top: calc(-1 * var(--ast-container-default-slg-padding)); } @media (max-width: 1200px) { .ast-separate-container .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .circle .posted-on { margin-top: calc(-1 * var(--ast-container-default-xs-padding)); } } .ast-separate-container .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-content .ast-blog-featured-section:first-child .post-thumb-img-content { margin-top: calc(-1 * var(--ast-container-default-md-padding)); } @media (max-width: 1200px) { .ast-separate-container .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-content .ast-blog-featured-section:first-child .post-thumb-img-content { margin-top: calc(-1 * var(--ast-container-default-sm-padding)); } } .ast-separate-container .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-thumb-img-content { margin-left: calc(-1 * var(--ast-container-default-xlg-padding)); margin-right: calc(-1 * var(--ast-container-default-xlg-padding)); } @media (max-width: 1200px) { .ast-separate-container .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-thumb-img-content { margin-left: calc(-1 * var(--ast-container-default-xs-padding)); margin-right: calc(-1 * var(--ast-container-default-xs-padding)); } } .ast-separate-container .ast-article-single.remove-featured-img-padding .single-layout-1 .entry-header .post-thumb-img-content:first-child { margin-top: calc(-1 * var(--ast-container-default-md-padding)); } @media (max-width: 1200px) { .ast-separate-container .ast-article-single.remove-featured-img-padding .single-layout-1 .entry-header .post-thumb-img-content:first-child { margin-top: calc(-1 * var(--ast-container-default-sm-padding)); } } .ast-separate-container .ast-article-single.remove-featured-img-padding .single-layout-1 .post-thumb-img-content { margin-left: calc(-1 * var(--ast-container-default-xlg-padding)); margin-right: calc(-1 * var(--ast-container-default-xlg-padding)); } @media (max-width: 1200px) { .ast-separate-container .ast-article-single.remove-featured-img-padding .single-layout-1 .post-thumb-img-content { margin-left: calc(-1 * var(--ast-container-default-xs-padding)); margin-right: calc(-1 * var(--ast-container-default-xs-padding)); } } .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .square .posted-on, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .square .posted-on, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .square .posted-on { margin-left: -1.5em; margin-right: -1.5em; } @media (max-width: 1200px) { .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .square .posted-on, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .square .posted-on, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .square .posted-on { margin-left: -1.5em; margin-right: -1.5em; } } .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .circle .posted-on, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .circle .posted-on, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .circle .posted-on { margin-left: -0.5em; margin-right: -0.5em; } @media (max-width: 1200px) { .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .circle .posted-on, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .circle .posted-on, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section .circle .posted-on { margin-left: -0.5em; margin-right: -0.5em; } } .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .square .posted-on, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .square .posted-on, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .square .posted-on { margin-top: -1.5em; } @media (max-width: 1200px) { .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .square .posted-on, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .square .posted-on, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .square .posted-on { margin-top: -1.5em; } } .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .circle .posted-on, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .circle .posted-on, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .circle .posted-on { margin-top: -0.5em; } @media (max-width: 1200px) { .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .circle .posted-on, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .circle .posted-on, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding.has-post-thumbnail .blog-layout-1 .post-content .ast-blog-featured-section:first-child .circle .posted-on { margin-top: -0.5em; } } .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-content .ast-blog-featured-section:first-child .post-thumb-img-content, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-content .ast-blog-featured-section:first-child .post-thumb-img-content, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-content .ast-blog-featured-section:first-child .post-thumb-img-content { margin-top: -1.5em; } @media (max-width: 1200px) { .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-content .ast-blog-featured-section:first-child .post-thumb-img-content, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-content .ast-blog-featured-section:first-child .post-thumb-img-content, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-content .ast-blog-featured-section:first-child .post-thumb-img-content { margin-top: -1.5em; } } .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-thumb-img-content, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-thumb-img-content, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-thumb-img-content { margin-left: -1.5em; margin-right: -1.5em; } @media (max-width: 1200px) { .ast-separate-container.ast-blog-grid-2 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-thumb-img-content, .ast-separate-container.ast-blog-grid-3 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-thumb-img-content, .ast-separate-container.ast-blog-grid-4 .ast-article-post.remove-featured-img-padding .blog-layout-1 .post-thumb-img-content { margin-left: -1.5em; margin-right: -1.5em; } }