/**
  * Returns info about the Yoast SEO plugin version and license
  *
  * @return string
  */
 private function get_yoast_seo_info()
 {
     $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
     $out = '<table>';
     $out .= '<tr><td>Version</td><td>' . WPSEO_VERSION . '</td></tr>';
     $out .= '<tr><td>License</td><td>' . '<a href=" ' . admin_url('admin.php?page=wpseo_licenses#top#licenses') . ' ">' . $license_manager->get_license_key() . '</a>' . '</td></tr>';
     $out .= '<tr><td>Status</td><td>' . $license_manager->get_license_status() . '</td></tr>';
     $out .= '</table>';
     return $out;
 }
 /**
  * Returns info about the Yoast SEO plugin version and license
  *
  * @param Yoast_Product $product The product to return information for.
  *
  * @return string
  */
 private function get_product_info(Yoast_Product $product)
 {
     if (!class_exists('Yoast_Plugin_License_Manager')) {
         return 'License manager could not be loaded';
     }
     $license_manager = new Yoast_Plugin_License_Manager($product);
     $out = '<table>';
     $out .= '<tr><td>Version</td><td>' . WPSEO_VERSION . '</td></tr>';
     $out .= '<tr><td>License</td><td>' . '<a href=" ' . admin_url('admin.php?page=wpseo_licenses#top#licenses') . ' ">' . $license_manager->get_license_key() . '</a>' . '</td></tr>';
     $out .= '<tr><td>Status</td><td>' . $license_manager->get_license_status() . '</td></tr>';
     $out .= '</table>';
     return $out;
 }
Ejemplo n.º 3
0
 /**
  * Execute upgrade actions when needed
  */
 function upgrade()
 {
     $options = get_option('wpseo_video');
     // early bail if dbversion is equal to current version
     if (isset($options['dbversion']) && version_compare($options['dbversion'], WPSEO_VIDEO_VERSION, '==')) {
         return;
     }
     $yoast_product = new Yoast_Product_WPSEO_Video();
     $license_manager = new Yoast_Plugin_License_Manager($yoast_product);
     // upgrade to license manager
     if ($license_manager->get_license_key() === '') {
         if (isset($options['yoast-video-seo-license'])) {
             $license_manager->set_license_key($options['yoast-video-seo-license']);
         }
         if (isset($options['yoast-video-seo-license-status'])) {
             $license_manager->set_license_status($options['yoast-video-seo-license-status']);
         }
         update_option('wpseo_video', $options);
     }
     // upgrade to new option & meta classes
     if (!isset($options['dbversion']) || version_compare($options['dbversion'], '1.6', '<')) {
         $this->option_instance->clean();
         WPSEO_Meta::clean_up();
         // Make sure our meta values are cleaned up even if WP SEO would have been upgraded already
     }
     // Re-add missing durations
     if (!isset($options['dbversion']) || version_compare($options['dbversion'], '1.7', '<') && version_compare($options['dbversion'], '1.6', '>')) {
         WPSEO_Meta_Video::re_add_durations();
     }
     // Recommend re-index
     if (isset($options['dbversion']) && version_compare($options['dbversion'], '1.8', '<')) {
         set_transient('video_seo_recommend_reindex', 1);
     }
     // Make sure version nr gets updated for any version without specific upgrades
     $options = get_option('wpseo_video');
     // re-get to make sure we have the latest version
     if (version_compare($options['dbversion'], WPSEO_VIDEO_VERSION, '<')) {
         $options['dbversion'] = WPSEO_VIDEO_VERSION;
         update_option('wpseo_video', $options);
     }
 }