/**
  * Initializes the banner sidebar by setting its banner spots.
  *
  * @param WPSEO_Features $features Class regarding WPSEO Features.
  */
 public function initialize(WPSEO_Features $features)
 {
     if ($features->is_free()) {
         $this->add_banner_spot($this->get_premium_spot());
     }
     $this->add_banner_spot($this->get_services_spot());
     $extensions_spot = $this->get_extensions_spot($this->get_active_extensions());
     if ($extensions_spot->has_banners()) {
         $this->add_banner_spot($extensions_spot);
     }
     $this->add_banner_spot($this->get_courses_spot());
     $this->add_banner_spot($this->get_remove_banner_spot());
 }
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();
 }
 /**
  * Returns a premium upsell section if using the free plugin.
  *
  * @return string
  */
 protected function get_premium_upsell_section()
 {
     $features = new WPSEO_Features();
     if ($features->is_free()) {
         /* translators: %1$s expands anchor to premium plugin page, %2$s expands to </a> */
         return sprintf(__('By the way, did you know we also have a %1$sPremium plugin%2$s? It offers advanced features, like a redirect manager and support for multiple keywords. It also comes with 24/7 personal support.', 'wordpress-seo'), "<a href='https://yoa.st/premium-notification'>", '</a>');
     }
     return '';
 }