is_premium() public method

Checks if the premium constant exists to make sure if plugin is the premium one.
public is_premium ( ) : boolean
return boolean
 /**
  * Checks if the notice should be added or removed.
  */
 public function initialize()
 {
     $features = new WPSEO_Features();
     if ($features->is_premium() || $this->is_notice_dismissed()) {
         $this->remove_notification();
         return;
     }
     if ($this->should_add_notification()) {
         $this->add_notification();
     }
 }
Ejemplo n.º 2
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     $this->options = WPSEO_Options::get_option('wpseo');
     WPSEO_Options::maybe_set_multisite_defaults(false);
     if (version_compare($this->options['version'], '1.5.0', '<')) {
         $this->upgrade_15($this->options['version']);
     }
     if (version_compare($this->options['version'], '2.0', '<')) {
         $this->upgrade_20();
     }
     if (version_compare($this->options['version'], '2.1', '<')) {
         $this->upgrade_21();
     }
     if (version_compare($this->options['version'], '2.2', '<')) {
         $this->upgrade_22();
     }
     if (version_compare($this->options['version'], '2.3', '<')) {
         $this->upgrade_23();
     }
     if (version_compare($this->options['version'], '3.0', '<')) {
         $this->upgrade_30();
     }
     if (version_compare($this->options['version'], '3.3', '<')) {
         $this->upgrade_33();
     }
     if (version_compare($this->options['version'], '3.6', '<')) {
         $this->upgrade_36();
     }
     // Since 3.7.
     $features = new WPSEO_Features();
     if (!$features->is_premium()) {
         $upsell_notice = new WPSEO_Product_Upsell_Notice();
         $upsell_notice->set_upgrade_notice();
     }
     /**
      * Filter: 'wpseo_run_upgrade' - Runs the upgrade hook which are dependent on Yoast SEO
      *
      * @deprecated Since 3.1
      *
      * @api        string - The current version of Yoast SEO
      */
     do_action('wpseo_run_upgrade', $this->options['version']);
     $this->finish_up();
 }