/**
     * Function that outputs the redirect page
     */
    public static function display()
    {
        global $wpseo_admin_pages;
        // Licensing part
        $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
        // Setup constant name
        $license_manager->set_license_constant_name('WPSEO_LICENSE');
        // Admin header
        $wpseo_admin_pages->admin_header(false);
        if ($license_manager->license_is_valid()) {
            ?>
			<div class="wpseo_content_cell">
				<iframe src="//fast.wistia.net/embed/playlists/anhtprp59b?media_0_0%5BautoPlay%5D=false&media_0_0%5BcontrolsVisibleOnLoad%5D=false&theme=bento&version=v1&videoOptions%5BautoPlay%5D=true&videoOptions%5BvideoHeight%5D=450&videoOptions%5BvideoWidth%5D=800&videoOptions%5BvolumeControl%5D=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_playlist" name="wistia_playlist" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="1107" height="488"></iframe>
				<br class="clear">
			</div>
			<br class="clear">
		<?php 
        } else {
            echo '<div class="wpseo-warning">';
            echo '<h2>' . __('WordPress SEO Premium is inactive.', 'wordpress-seo') . '</h2>';
            if (current_user_can('manage_options')) {
                echo '<p>' . __('Please activate WordPress SEO Premium to be able to see the videos.', 'wordpress-seo') . '</p></div>';
            } else {
                echo '<p>' . __('Please ask your site administrator to activate WordPress SEO Premium to be able to see the videos.', 'wordpress-seo') . '</p></div>';
            }
        }
        // Admin footer
        $wpseo_admin_pages->admin_footer(false);
    }
    /**
     * Function that outputs the redirect page
     */
    public static function display()
    {
        // Licensing part.
        $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
        // Setup constant name.
        $license_manager->set_license_constant_name('WPSEO_LICENSE');
        // Admin header.
        Yoast_Form::get_instance()->admin_header(false);
        if ($license_manager->license_is_valid()) {
            ?>
			<div class="wpseo_content_cell">
				<iframe src="//fast.wistia.net/embed/playlists/5t35e24abt?media_0_0%5BautoPlay%5D=false&amp;media_0_0%5BcontrolsVisibleOnLoad%5D=false&amp;theme=bento&amp;version=v1&amp;videoOptions%5BautoPlay%5D=true&amp;videoOptions%5BvideoHeight%5D=450&amp;videoOptions%5BvideoWidth%5D=800&amp;videoOptions%5BvolumeControl%5D=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_playlist" name="wistia_playlist" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="1107" height="450"></iframe>
				<br class="clear">
			</div>
			<br class="clear">
		<?php 
        } else {
            echo '<div class="wpseo-warning">';
            /* translators: %s: 'Yoast SEO Premium' */
            echo '<h2>' . sprintf(__('%s is inactive.', 'wordpress-seo-premium'), 'Yoast SEO Premium') . '</h2>';
            if (current_user_can('manage_options')) {
                /* translators: %s: 'Yoast SEO Premium' */
                echo '<p>' . sprintf(__('Please activate %s to be able to see the videos.', 'wordpress-seo-premium'), 'Yoast SEO Premium') . '</p></div>';
            } else {
                /* translators: %s: 'Yoast SEO Premium' */
                echo '<p>' . sprintf(__('Please ask your site administrator to activate %s to be able to see the videos.', 'wordpress-seo-premium'), 'Yoast SEO Premium') . '</p></div>';
            }
        }
        // Admin footer.
        Yoast_Form::get_instance()->admin_footer(false);
    }
        /**
         * Generates the sidebar for admin pages.
         */
        function admin_sidebar()
        {
            // No banners in Premium
            if (class_exists('WPSEO_Product_Premium')) {
                $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
                if ($license_manager->license_is_valid()) {
                    return;
                }
            }
            $service_banners = array(array('url' => 'https://yoast.com/hire-us/website-review/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=website-review-banner', 'img' => 'banner-website-review.png', 'alt' => 'Website Review banner'));
            $plugin_banners = array(array('url' => 'https://yoast.com/wordpress/plugins/seo-premium/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=premium-seo-banner', 'img' => 'banner-premium-seo.png', 'alt' => 'Banner WordPress SEO Premium'));
            if (!class_exists('wpseo_Video_Sitemap')) {
                $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/video-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=video-seo-banner', 'img' => 'banner-video-seo.png', 'alt' => 'Banner WordPress SEO Video SEO extension');
            }
            if (!class_exists('wpseo_Video_Manual')) {
                $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/video-manual-wordpress-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=video-manual-banner', 'img' => 'banner-video-seo-manual.png', 'alt' => 'Banner WordPress SEO Video manual');
            }
            if (class_exists('Woocommerce') && !class_exists('Yoast_WooCommerce_SEO')) {
                $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/yoast-woocommerce-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=woocommerce-seo-banner', 'img' => 'banner-woocommerce-seo.png', 'alt' => 'Banner WooCommerce SEO plugin');
            }
            if (!defined('WPSEO_LOCAL_VERSION')) {
                $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/local-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=local-seo-banner', 'img' => 'banner-local-seo.png', 'alt' => 'Banner Local SEO plugin');
            }
            if (!class_exists('WPSEO_News')) {
                $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/news-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=news-seo-banner', 'img' => 'banner-news-seo.png', 'alt' => 'Banner News SEO');
            }
            if (!class_exists('Post_Connector')) {
                $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/post-connector/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=post-connector-banner', 'img' => 'banner-post-connector.png', 'alt' => 'Banner Post Connector plugin');
            }
            shuffle($service_banners);
            shuffle($plugin_banners);
            ?>
			<div class="wpseo_content_cell" id="sidebar-container">
				<div id="sidebar">
			<?php 
            $service_banner = $service_banners[0];
            echo '<a target="_blank" href="' . esc_url($service_banner['url']) . '"><img width="261" height="190" src="' . plugins_url('images/' . $service_banner['img'], WPSEO_FILE) . '" alt="' . esc_attr($service_banner['alt']) . '"/></a><br/><br/>';
            $i = 0;
            foreach ($plugin_banners as $banner) {
                if ($i == 2) {
                    break;
                }
                echo '<a target="_blank" href="' . esc_url($banner['url']) . '"><img width="261" src="' . plugins_url('images/' . $banner['img'], WPSEO_FILE) . '" alt="' . esc_attr($banner['alt']) . '"/></a><br/><br/>';
                $i++;
            }
            ?>
					<?php 
            echo __('Remove these ads?', 'wordpress-seo') . '<br/>';
            echo '<a target="_blank" href="https://yoast.com/wordpress/plugins/seo-premium/#utm_source=wordpress-seo-config&utm_medium=textlink&utm_campaign=remove-ads-link">' . __('Upgrade to WordPress SEO Premium &raquo;', 'wordpress-seo') . '</a><br/><br/>';
            ?>
				</div>
			</div>
		<?php 
        }
 /**
  * Perform upgrade procedures to the settings
  */
 function upgrade()
 {
     // upgrade license options
     if ($this->license_manager && $this->license_manager->license_is_valid() == false) {
         if (isset($this->options['license-status'])) {
             $this->license_manager->set_license_status($this->options['license-status']);
         }
         if (isset($this->options['license'])) {
             $this->license_manager->set_license_key($this->options['license']);
         }
     }
     // upgrade to new wp seo option class
     $this->option_instance->clean();
 }
 /**
  * Setup the Yoast SEO premium plugin
  */
 private function setup()
 {
     // Setup autoloader.
     require_once dirname(__FILE__) . '/classes/class-premium-autoloader.php';
     $autoloader = new WPSEO_Premium_Autoloader();
     spl_autoload_register(array($autoloader, 'load'));
     $this->load_textdomain();
     $this->instantiate_redirects();
     if (is_admin()) {
         // Disable Yoast SEO
         add_action('admin_init', array($this, 'disable_wordpress_seo'), 1);
         // Add Sub Menu page and add redirect page to admin page array.
         // This should be possible in one method in the future, see #535.
         add_filter('wpseo_submenu_pages', array($this, 'add_submenu_pages'));
         // Add Redirect page as admin page.
         add_filter('wpseo_admin_pages', array($this, 'add_admin_pages'));
         // Post to Get on search.
         add_action('admin_init', array($this, 'list_table_search_post_to_get'));
         // Add input fields to page meta post types.
         add_action('wpseo_admin_page_meta_post_types', array($this, 'admin_page_meta_post_types_checkboxes'), 10, 2);
         // Add page analysis fields to variable array key patterns.
         add_filter('wpseo_option_titles_variable_array_key_patterns', array($this, 'add_variable_array_key_pattern'));
         // Filter the Page Analysis content.
         add_filter('wpseo_pre_analysis_post_content', array($this, 'filter_page_analysis'), 10, 2);
         // Settings.
         add_action('admin_init', array($this, 'register_settings'));
         // Check if we need to save files after updating options.
         add_action('update_option_wpseo_redirect', array($this, 'save_redirect_files'), 10, 2);
         // Catch option save.
         add_action('admin_init', array($this, 'catch_option_redirect_save'));
         // Screen options
         $query_var = ($page = filter_input(INPUT_GET, 'page')) ? $page : '';
         switch ($query_var) {
             case 'wpseo_redirects':
                 add_filter('set-screen-option', array('WPSEO_Page_Redirect', 'set_screen_option'), 11, 3);
                 break;
         }
         // Enqueue Post and Term overview script.
         add_action('admin_enqueue_scripts', array($this, 'enqueue_overview_script'));
         // Licensing part.
         $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
         // Setup constant name.
         $license_manager->set_license_constant_name('WPSEO_LICENSE');
         // Setup license hooks.
         $license_manager->setup_hooks();
         // Add this plugin to licensing form.
         add_action('wpseo_licenses_forms', array($license_manager, 'show_license_form'));
         if ($license_manager->license_is_valid()) {
             add_action('admin_head', array($this, 'admin_css'));
         }
         // Add Premium imports.
         $premium_import_manager = new WPSEO_Premium_Import_Manager();
         // Allow option of importing from other 'other' plugins.
         add_filter('wpseo_import_other_plugins', array($premium_import_manager, 'filter_add_premium_import_options'));
         // Handle premium imports.
         add_action('wpseo_handle_import', array($premium_import_manager, 'do_premium_imports'));
         // Add htaccess import block.
         add_action('wpseo_import_tab_content', array($premium_import_manager, 'add_htaccess_import_block'));
         add_action('wpseo_import_tab_header', array($premium_import_manager, 'htaccess_import_header'));
         // Only activate post and term watcher if permalink structure is enabled.
         if (get_option('permalink_structure')) {
             add_action('admin_init', array($this, 'init_watchers'));
             // Check if we need to display an admin message
             if ($redirect_created = filter_input(INPUT_GET, 'yoast-redirect-created')) {
                 // Message object
                 $message = new WPSEO_Message_Redirect_Created($redirect_created);
                 add_action('all_admin_notices', array($message, 'display'));
             }
         }
     } else {
         // Add 404 redirect link to WordPress toolbar.
         add_action('admin_bar_menu', array($this, 'admin_bar_menu'), 96);
         add_filter('redirect_canonical', array($this, 'redirect_canonical_fix'), 1, 2);
     }
 }
示例#6
0
 /**
  * Add a link to the settings page to the plugins list
  *
  * @staticvar string $this_plugin holds the directory & filename for the plugin
  *
  * @param    array  $links array of links for the plugins, adapted when the current plugin is found.
  * @param    string $file  the filename for the current plugin, which the filter loops through.
  *
  * @return    array    $links
  */
 function add_action_link($links, $file)
 {
     if (WPSEO_BASENAME === $file && WPSEO_Options::grant_access()) {
         $settings_link = '<a href="' . esc_url(admin_url('admin.php?page=wpseo_dashboard')) . '">' . __('Settings', 'wordpress-seo') . '</a>';
         array_unshift($links, $settings_link);
     }
     if (class_exists('Yoast_Product_WPSEO_Premium')) {
         $license_manager = new Yoast_Plugin_License_Manager(new Yoast_Product_WPSEO_Premium());
         if ($license_manager->license_is_valid()) {
             return $links;
         }
     }
     // add link to premium support landing page
     $premium_link = '<a href="https://yoast.com/wordpress/plugins/seo-premium/support/#utm_source=wordpress-seo-settings-link&utm_medium=text-link&utm_campaign=support-link">' . __('Premium Support', 'wordpress-seo') . '</a>';
     array_unshift($links, $premium_link);
     // add link to docs
     $faq_link = '<a href="https://yoast.com/wordpress/plugins/seo/faq/">' . __('FAQ', 'wordpress-seo') . '</a>';
     array_unshift($links, $faq_link);
     return $links;
 }
 /**
  * Setup the premium WordPress SEO plugin
  */
 private function setup()
 {
     // Setup autoloader
     require_once dirname(__FILE__) . '/classes/class-premium-autoloader.php';
     $autoloader = new WPSEO_Premium_Autoloader();
     spl_autoload_register(array($autoloader, 'load'));
     if (is_admin()) {
         // Upgrade Manager
         $plugin_updater = new WPSEO_Upgrade_Manager();
         $plugin_updater->check_update();
         // Create pages
         $this->page_gwt = new WPSEO_Page_GWT();
         // Disable WordPress SEO
         add_action('admin_init', array($this, 'disable_wordpress_seo'), 1);
         // Add Sub Menu page and add redirect page to admin page array
         // This should be possible in one method in the future, see #535
         add_filter('wpseo_submenu_pages', array($this, 'add_submenu_pages'));
         // Add Redirect page as admin page
         add_filter('wpseo_admin_pages', array($this, 'add_admin_pages'));
         // Post to Get on search
         add_action('admin_init', array($this, 'list_table_search_post_to_get'));
         // Add the GWT crawl error post type
         add_action('admin_init', array($this, 'register_gwt_crawl_error_post_type'));
         // Add input fields to page meta post types
         add_action('wpseo_admin_page_meta_post_types', array($this, 'admin_page_meta_post_types_checkboxes'), 10, 2);
         // Add page analysis fields to variable array key patterns
         add_filter('wpseo_option_titles_variable_array_key_patterns', array($this, 'add_variable_array_key_pattern'));
         // Filter the Page Analysis content
         add_filter('wpseo_pre_analysis_post_content', array($this, 'filter_page_analysis'), 10, 2);
         // Check if WPSEO_DISABLE_PHP_REDIRECTS is defined
         if (defined('WPSEO_DISABLE_PHP_REDIRECTS') && true === WPSEO_DISABLE_PHP_REDIRECTS) {
             // Change the normal redirect autoload option
             $normal_redirect_manager = new WPSEO_URL_Redirect_Manager();
             $normal_redirect_manager->redirects_change_autoload(false);
             // Change the regex redirect autoload option
             $regex_redirect_manager = new WPSEO_REGEX_Redirect_Manager();
             $regex_redirect_manager->redirects_change_autoload(false);
         } else {
             $options = WPSEO_Redirect_Manager::get_options();
             // If the disable_php_redirect option is not enabled we should enable auto loading redirects
             if ('off' == $options['disable_php_redirect']) {
                 // Change the normal redirect autoload option
                 $normal_redirect_manager = new WPSEO_URL_Redirect_Manager();
                 $normal_redirect_manager->redirects_change_autoload(true);
                 // Change the regex redirect autoload option
                 $regex_redirect_manager = new WPSEO_REGEX_Redirect_Manager();
                 $regex_redirect_manager->redirects_change_autoload(true);
             }
         }
         // Settings
         add_action('admin_init', array($this, 'register_settings'));
         // Check if we need to save files after updating options
         add_action('update_option_wpseo_redirect', array($this, 'save_redirect_files'), 10, 2);
         // Catch option save
         add_action('admin_init', array($this, 'catch_option_redirect_save'));
         // Screen options
         $query_var = !empty($_GET['page']) ? $_GET['page'] : '';
         switch ($query_var) {
             case 'wpseo_redirects':
                 add_filter('set-screen-option', array('WPSEO_Page_Redirect', 'set_screen_option'), 11, 3);
                 break;
             case 'wpseo_webmaster_tools':
                 add_filter('set-screen-option', array($this->page_gwt, 'set_screen_option'), 11, 3);
                 break;
         }
         // Enqueue Post and Term overview script
         add_action('admin_enqueue_scripts', array($this, 'enqueue_overview_script'));
         // Licensing part
         $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
         // Setup constant name
         $license_manager->set_license_constant_name('WPSEO_LICENSE');
         // Setup license hooks
         $license_manager->setup_hooks();
         // Add this plugin to licensing form
         add_action('wpseo_licenses_forms', array($license_manager, 'show_license_form'));
         if ($license_manager->license_is_valid()) {
             add_action('admin_head', array($this, 'admin_css'));
         }
         // Crawl Issue Manager AJAX hooks
         $crawl_issue_manager = new WPSEO_Crawl_Issue_Manager();
         add_action('wp_ajax_wpseo_ignore_crawl_issue', array($crawl_issue_manager, 'ajax_ignore_crawl_issue'));
         add_action('wp_ajax_wpseo_unignore_crawl_issue', array($crawl_issue_manager, 'ajax_unignore_crawl_issue'));
         // Add Premium imports
         $premium_import_manager = new WPSEO_Premium_Import_Manager();
         // Allow option of importing from other 'other' plugins
         add_filter('wpseo_import_other_plugins', array($premium_import_manager, 'filter_add_premium_import_options'));
         // Handle premium imports
         add_action('wpseo_handle_import', array($premium_import_manager, 'do_premium_imports'));
         // Add htaccess import block
         add_action('wpseo_import', array($premium_import_manager, 'add_htaccess_import_block'));
         // Only activate post and term watcher if permalink structure is enabled
         if (get_option('permalink_structure')) {
             // The Post Watcher
             $post_watcher = new WPSEO_Post_Watcher();
             // Add old URL field to post edit screen
             add_action('edit_form_advanced', array($post_watcher, 'old_url_field'), 10, 1);
             add_action('edit_page_form', array($post_watcher, 'old_url_field'), 10, 1);
             // Detect a post slug change
             add_action('post_updated', array($post_watcher, 'detect_slug_change'), 12, 3);
             // Detect a post trash
             add_action('trashed_post', array($post_watcher, 'detect_post_trash'));
             // Detect a post untrash
             add_action('untrashed_post', array($post_watcher, 'detect_post_untrash'));
             // Detect a post delete
             add_action('delete_post', array($post_watcher, 'detect_post_delete'));
             // The Term Watcher
             $term_watcher = new WPSEO_Term_Watcher();
             // Get all taxonomies
             $taxonomies = get_taxonomies();
             // Loop through all taxonomies
             if (count($taxonomies) > 0) {
                 foreach ($taxonomies as $taxonomy) {
                     // Add old URL field to term edit screen
                     add_action($taxonomy . '_edit_form_fields', array($term_watcher, 'old_url_field'), 10, 2);
                 }
             }
             // Detect the term slug change
             add_action('edited_term', array($term_watcher, 'detect_slug_change'), 10, 3);
             // Detect a term delete
             add_action('delete_term_taxonomy', array($term_watcher, 'detect_term_delete'));
             // Check if we need to display an admin message
             if (isset($_GET['yoast-redirect-created'])) {
                 // Message object
                 $message = new WPSEO_Message_Redirect_Created($_GET['yoast-redirect-created']);
                 add_action('all_admin_notices', array($message, 'display'));
             }
         }
     } else {
         // Catch redirect
         $normal_redirect_manager = new WPSEO_URL_Redirect_Manager();
         add_action('template_redirect', array($normal_redirect_manager, 'do_redirects'));
         // Catch redirect
         $regex_redirect_manager = new WPSEO_REGEX_Redirect_Manager();
         add_action('template_redirect', array($regex_redirect_manager, 'do_redirects'));
         // Add 404 redirect link to WordPress toolbar
         add_action('admin_bar_menu', array($this, 'admin_bar_menu'), 96);
         add_filter('redirect_canonical', array($this, 'redirect_canonical_fix'), 1, 2);
     }
     // Normal Redirect AJAX
     $redirect_manager = new WPSEO_URL_Redirect_Manager();
     add_action('wp_ajax_wpseo_save_redirect_url', array($redirect_manager, 'ajax_handle_redirect_save'));
     add_action('wp_ajax_wpseo_delete_redirect_url', array($redirect_manager, 'ajax_handle_redirect_delete'));
     add_action('wp_ajax_wpseo_create_redirect_url', array($redirect_manager, 'ajax_handle_redirect_create'));
     // Regex Redirect AJAX
     $redirect_manager = new WPSEO_REGEX_Redirect_Manager();
     add_action('wp_ajax_wpseo_save_redirect_regex', array($redirect_manager, 'ajax_handle_redirect_save'));
     add_action('wp_ajax_wpseo_delete_redirect_regex', array($redirect_manager, 'ajax_handle_redirect_delete'));
     add_action('wp_ajax_wpseo_create_redirect_regex', array($redirect_manager, 'ajax_handle_redirect_create'));
     // Add URL reponse code check AJAX
     add_action('wp_ajax_wpseo_check_url', array('WPSEO_Url_Checker', 'check_url'));
 }
示例#8
0
 /**
  * Add a link to the settings page to the plugins list
  *
  * @staticvar string $this_plugin holds the directory & filename for the plugin
  *
  * @param array  $links array of links for the plugins, adapted when the current plugin is found.
  * @param string $file  the filename for the current plugin, which the filter loops through.
  *
  * @return array $links
  */
 function add_action_link($links, $file)
 {
     if (WPSEO_BASENAME === $file && WPSEO_Utils::grant_access()) {
         $settings_link = '<a href="' . esc_url(admin_url('admin.php?page=' . self::PAGE_IDENTIFIER)) . '">' . __('Settings', 'wordpress-seo') . '</a>';
         array_unshift($links, $settings_link);
     }
     if (class_exists('WPSEO_Product_Premium')) {
         $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
         if ($license_manager->license_is_valid()) {
             return $links;
         }
     }
     // Add link to premium support landing page.
     $premium_link = '<a href="https://yoast.com/wordpress/plugins/seo-premium/support/#utm_source=wordpress-seo-settings-link&amp;utm_medium=textlink&amp;utm_campaign=support-link">' . __('Premium Support', 'wordpress-seo') . '</a>';
     array_unshift($links, $premium_link);
     // Add link to docs.
     $faq_link = '<a href="https://kb.yoast.com/kb/category/yoast-seo/#utm_source=wordpress-seo-faq-link&amp;utm_medium=textlink&amp;utm_campaign=faq-link">' . __('FAQ', 'wordpress-seo') . '</a>';
     array_unshift($links, $faq_link);
     return $links;
 }
 /**
  * Render the admin page footer with sidebar for the GA Plugin
  */
 public function content_footer()
 {
     do_action('yoast_ga_admin_footer');
     if (true == WP_DEBUG) {
         // Show the debug information if debug is enabled in the wp_config file
         echo '<div id="ga-debug-info" class="postbox"><h3 class="hndle"><span>' . __('Debug information', 'google-analytics-for-wordpress') . '</span></h3><div class="inside"><pre>';
         var_dump($this->options);
         echo '</pre></div></div>';
     }
     if (class_exists('Yoast_Product_GA_Premium')) {
         $license_manager = new Yoast_Plugin_License_Manager(new Yoast_Product_GA_Premium());
         if ($license_manager->license_is_valid()) {
             return;
         }
     }
     $banners = array();
     $banners[] = array('url' => 'https://yoast.com/hire-us/website-review/#utm_medium=banner&utm_source=gawp-config&utm_campaign=wpgaplugin', 'banner' => $this->plugin_url . 'assets/img/banner-website-review.png', 'title' => 'Get a website review by Yoast');
     $banners[] = array('url' => 'https://yoast.com/wordpress/plugins/google-analytics/#utm_medium=banner&utm_source=gawp-config&utm_campaign=wpgaplugin', 'banner' => $this->plugin_url . 'assets/img/banner-premium-ga.png', 'title' => 'Get the premium version of Google Analytics by Yoast!');
     $banners[] = array('url' => 'https://yoast.com/ebook-optimize-wordpress-site/#utm_medium=banner&utm_source=gawp-config&utm_campaign=wpgaplugin', 'banner' => $this->plugin_url . 'assets/img/eBook_261x130.png', 'title' => 'Get the Yoast ebook!');
     $banners[] = array('url' => 'https://yoast.com/wordpress/plugins/ga-ecommerce/#utm_medium=banner&utm_source=gawp-config&utm_campaign=wpgaplugin', 'banner' => $this->plugin_url . 'assets/img/banner-ga-ecommerce.png', 'title' => 'Get advanced eCommerce tracking for WooCommerce and Easy Digital Downloads!');
     shuffle($banners);
     require 'views/content-footer.php';
 }
示例#10
0
    /**
     * Generates the sidebar for admin pages.
     */
    public function admin_sidebar()
    {
        // No banners in Premium.
        if (class_exists('WPSEO_Product_Premium')) {
            $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
            if ($license_manager->license_is_valid()) {
                return;
            }
        }
        $service_banners = array(array('url' => 'https://yoast.com/hire-us/website-review/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=website-review-banner', 'img' => 'banner-website-review.png', 'alt' => 'Website Review banner'));
        $plugin_banners = array(array('url' => 'https://yoast.com/academy/course/basic-seo-training/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=basic-seo-training-banner', 'img' => 'banner-seo-training.png', 'alt' => 'Basic SEO Training banner'), array('url' => 'https://yoast.com/wordpress/plugins/seo-premium/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=premium-seo-banner', 'img' => 'banner-premium-seo.png', 'alt' => 'Banner Yoast SEO Premium'));
        if (!class_exists('wpseo_Video_Sitemap')) {
            $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/video-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=video-seo-banner', 'img' => 'banner-video-seo.png', 'alt' => 'Banner Yoast Video SEO plugin');
        }
        if (class_exists('Woocommerce') && !class_exists('Yoast_WooCommerce_SEO')) {
            $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/yoast-woocommerce-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=woocommerce-seo-banner', 'img' => 'banner-woocommerce-seo.png', 'alt' => 'Banner Yoast WooCommerce SEO plugin');
        }
        if (!defined('WPSEO_LOCAL_VERSION')) {
            $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/local-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=local-seo-banner', 'img' => 'banner-local-seo.png', 'alt' => 'Banner Yoast Local SEO plugin');
        }
        if (!class_exists('WPSEO_News')) {
            $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/news-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=news-seo-banner', 'img' => 'banner-news-seo.png', 'alt' => 'Banner Yoast News SEO plugin');
        }
        shuffle($service_banners);
        shuffle($plugin_banners);
        ?>
		<div class="wpseo_content_cell" id="sidebar-container">
			<div id="sidebar">
		<?php 
        $service_banner = $service_banners[0];
        echo '<a target="_blank" href="' . esc_url($service_banner['url']) . '"><img width="261" height="190" src="' . plugins_url('images/' . $service_banner['img'], WPSEO_FILE) . '" alt="' . esc_attr($service_banner['alt']) . '"/></a><br/><br/>';
        $i = 0;
        foreach ($plugin_banners as $banner) {
            if ($i == 2) {
                break;
            }
            echo '<a target="_blank" href="' . esc_url($banner['url']) . '"><img width="261" height="152" src="' . plugins_url('images/' . $banner['img'], WPSEO_FILE) . '" alt="' . esc_attr($banner['alt']) . '"/></a><br/><br/>';
            $i++;
        }
        ?>
				<strong><?php 
        _e('Remove these ads?', 'wordpress-seo');
        ?>
</strong><br/>
				<a target="_blank" href="https://yoast.com/wordpress/plugins/seo-premium/#utm_source=wordpress-seo-config&amp;utm_medium=textlink&amp;utm_campaign=remove-ads-link"><?php 
        /* translators: %1$s expands to Yoast SEO Premium */
        printf(__('Upgrade to %1$s &raquo;', 'wordpress-seo'), 'Yoast SEO Premium');
        ?>
</a><br/><br/>
			</div>
		</div>
	<?php 
    }
示例#11
0
 /**
  * Generates the sidebar for admin pages.
  */
 public function admin_sidebar()
 {
     // No banners in Premium.
     if (class_exists('WPSEO_Product_Premium')) {
         $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
         if ($license_manager->license_is_valid()) {
             return;
         }
     }
     $sidebar_renderer = new WPSEO_Admin_Banner_Sidebar_Renderer(new WPSEO_Admin_Banner_Spot_Renderer());
     $banner_renderer = new WPSEO_Admin_Banner_Renderer();
     $banner_renderer->set_base_path(plugins_url('images/banner/', WPSEO_FILE));
     $sidebar = new WPSEO_Admin_Banner_Sidebar(sprintf('%1s recommendations', 'Yoast'), $banner_renderer);
     $sidebar->initialize(new WPSEO_Features());
     echo $sidebar_renderer->render($sidebar);
 }
    /**
     * Generates the sidebar for admin pages.
     */
    public function admin_sidebar()
    {
        // No banners in Premium.
        if (class_exists('WPSEO_Product_Premium')) {
            $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
            if ($license_manager->license_is_valid()) {
                return;
            }
        }
        $service_banners = array(array('url' => 'https://yoast.com/hire-us/website-review/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=website-review-banner', 'img' => 'banner-website-review.png', 'alt' => __('Order a Website Review and we will tell you what to improve to attract more visitors!', 'wordpress-seo')), array('url' => 'https://yoast.com/hire-us/yoast-seo-configuration/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=configuration-service-banner', 'img' => 'banner-configuration-service.png', 'alt' => __('Let our experts set up your Yoast SEO Premium plugin!', 'wordpress-seo')), array('url' => 'https://yoast.com/academy/course/seo-copywriting-training/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=seo-copywriting-training-banner', 'img' => 'banner-seo-copywriting-training.png', 'alt' => __('Take the online SEO Copywriting Training course and learn how to write awesome copy that ranks!', 'wordpress-seo')), array('url' => 'https://yoast.com/academy/course/basic-seo-training/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=basic-seo-training-banner', 'img' => 'banner-basic-seo-training.png', 'alt' => __('Take the online Basic SEO Training course and learn the fundamentals of SEO!', 'wordpress-seo')), array('url' => 'https://yoast.com/academy/course/yoast-seo-wordpress-training/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=yoast-seo-plugin-training-banner', 'img' => 'banner-yoast-seo-for-wordpress-training.png', 'alt' => __('Take the Yoast SEO for WordPress Training course and become a certified Yoast SEO for WordPress expert!', 'wordpress-seo')));
        $plugin_banners = array(array('url' => 'https://yoast.com/wordpress/plugins/seo-premium/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=premium-seo-banner', 'img' => 'banner-premium-seo.png', 'alt' => __('Buy the Yoast SEO Premium plugin now and get access to extra features and 24/7 support!', 'wordpress-seo')));
        if (!class_exists('wpseo_Video_Sitemap')) {
            $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/video-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=video-seo-banner', 'img' => 'banner-video-seo.png', 'alt' => __('Buy the Yoast Video SEO plugin now and optimize your videos for video search results and social media!', 'wordpress-seo'));
        }
        if (class_exists('Woocommerce') && !class_exists('Yoast_WooCommerce_SEO')) {
            $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/yoast-woocommerce-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=woocommerce-seo-banner', 'img' => 'banner-woocommerce-seo.png', 'alt' => __('Buy the Yoast WooCommerce SEO plugin now and optimize your shop today to improve your product promotion!', 'wordpress-seo'));
        }
        if (!defined('WPSEO_LOCAL_VERSION')) {
            $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/local-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=local-seo-banner', 'img' => 'banner-local-seo.png', 'alt' => __('Buy the Yoast Local SEO plugin now to improve your site&#8217;s Local SEO and ranking in Google Maps!', 'wordpress-seo'));
        }
        if (!class_exists('WPSEO_News')) {
            $plugin_banners[] = array('url' => 'https://yoast.com/wordpress/plugins/news-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=news-seo-banner', 'img' => 'banner-news-seo.png', 'alt' => __('Buy the Yoast News SEO plugin now and start optimizing to get your site featured in Google News!', 'wordpress-seo'));
        }
        shuffle($service_banners);
        shuffle($plugin_banners);
        ?>
		<div class="wpseo_content_cell" id="sidebar-container">
			<div id="sidebar">
		<?php 
        $i = 0;
        foreach ($service_banners as $service_banner) {
            if ($i == 2) {
                break;
            }
            echo '<a target="_blank" href="' . esc_url($service_banner['url']) . '"><img width="261" height="190" src="' . plugins_url('images/' . $service_banner['img'], WPSEO_FILE) . '" alt="' . esc_attr($service_banner['alt']) . '"/></a><br/><br/>';
            $i++;
        }
        $i = 0;
        foreach ($plugin_banners as $banner) {
            if ($i == 2) {
                break;
            }
            echo '<a target="_blank" href="' . esc_url($banner['url']) . '"><img width="261" height="152" src="' . plugins_url('images/' . $banner['img'], WPSEO_FILE) . '" alt="' . esc_attr($banner['alt']) . '"/></a><br/><br/>';
            $i++;
        }
        ?>
				<p class="wpseo-remove-ads">
				<strong><?php 
        _e('Remove these ads?', 'wordpress-seo');
        ?>
</strong><br/>
				<a target="_blank" href="https://yoast.com/wordpress/plugins/seo-premium/#utm_source=wordpress-seo-config&amp;utm_medium=textlink&amp;utm_campaign=remove-ads-link"><?php 
        /* translators: %1$s expands to Yoast SEO Premium */
        printf(__('Upgrade to %1$s &raquo;', 'wordpress-seo'), 'Yoast SEO Premium');
        ?>
</a>
			</p>
			</div>
		</div>
	<?php 
    }
示例#13
0
 /**
  * Add a link to the settings page to the plugins list
  *
  * @staticvar string $this_plugin holds the directory & filename for the plugin
  *
  * @param	array	$links array of links for the plugins, adapted when the current plugin is found.
  * @param	string	$file  the filename for the current plugin, which the filter loops through.
  * @return	array	$links
  */
 function add_action_link($links, $file)
 {
     static $this_plugin;
     if (empty($this_plugin)) {
         $this_plugin = 'wordpress-seo/wp-seo.php';
     }
     if ($file == $this_plugin) {
         $settings_link = '<a href="' . esc_url(admin_url('admin.php?page=wpseo_dashboard')) . '">' . __('Settings', 'wordpress-seo') . '</a>';
         array_unshift($links, $settings_link);
     }
     if (class_exists('Yoast_Product_WPSEO_Premium')) {
         $license_manager = new Yoast_Plugin_License_Manager(new Yoast_Product_WPSEO_Premium());
         if ($license_manager->license_is_valid()) {
             return $links;
         }
     }
     // add link to premium support landing page
     $premium_link = '<a href="https://yoast.com/wordpress/plugins/seo-premium/support/#utm_source=wordpress-seo-settings-link&utm_medium=text-link&utm_campaign=support-link">' . __('Premium Support', 'wordpress-seo') . '</a>';
     array_unshift($links, $premium_link);
     return $links;
 }
<?php

global $yoast_ga_admin;
echo $yoast_ga_admin->content_head();
$has_extensions = false;
$extensions = array('ecommerce' => (object) array('url' => 'https://yoast.com/wordpress/plugins/google-analytics/', 'title' => __('Google Analytics', 'google-analytics-for-wordpress') . '<br />' . __('E-Commerce tracking', 'google-analytics-for-wordpress'), 'desc' => __('Track your E-Commerce data and transactions with this E-Commerce extension for Google Analytics.', 'google-analytics-for-wordpress'), 'status' => 'uninstalled'));
if (class_exists('Yoast_GA_eCommerce_Tracking')) {
    $has_extensions = true;
    $product = new Yoast_Product_GA_eCommerce();
    $license_manager = new Yoast_Plugin_License_Manager($product);
    if ($license_manager->license_is_valid()) {
        $extensions['ecommerce']->status = 'active';
    } else {
        $extensions['ecommerce']->status = 'inactive';
    }
}
?>
	<h2 id="yoast_ga_title"><?php 
echo __('Yoast Google Analytics: Extensions', 'google-analytics-for-wordpress');
?>
</h2>

	<h2 class="nav-tab-wrapper" id="ga-tabs">
		<a class="nav-tab active" id="extensions-tab" href="#top#extensions"><?php 
_e('Extensions', 'google-analytics-for-wordpress');
?>
</a>
		<a class="nav-tab" id="licenses-tab" href="#top#licenses"><?php 
_e('Licenses', 'google-analytics-for-wordpress');
?>
</a>