/** * Abuse a filter to check if the current theme was updated and if so, test the updated theme * for the title and meta description tag * * @since 1.4.14 * * @param array $update_actions * @param mixed $updated_theme * * @return array $update_actions Unchanged array */ function YMBESEO_update_theme_complete_actions($update_actions, $updated_theme) { $options = get_option('wpseo'); // Break if admin_notice already in place. if ((isset($options['theme_has_description']) && $options['theme_has_description'] === true || $options['theme_description_found'] !== '') && $options['ignore_meta_description_warning'] !== true) { return $update_actions; } $theme = get_stylesheet(); if (is_object($updated_theme)) { /* Bulk update and $updated_theme only contains info on which theme was last in the list of updated themes, so go & test */ // Commented out? YMBESEO_title_test(); R. YMBESEO_description_test(); } elseif ($updated_theme === $theme) { /* Single theme update for the active theme */ // Commented out? YMBESEO_title_test(); R. YMBESEO_description_test(); } return $update_actions; }
/** * Initialize some options on first install/activate/reset * * @static * @return void */ public static function initialize() { /* Make sure title_test and description_test function are available even when called from the isolated activation */ require_once YMBESEO_PATH . 'inc/ymbeseo-non-ajax-functions.php'; // Commented out? YMBESEO_title_test(); R. YMBESEO_description_test(); /* Force WooThemes to use Yoast SEO data. */ if (function_exists('woo_version_init')) { update_option('seo_woo_use_third_party_data', 'true'); } }
} } else { YMBESEO_description_test(); $msg .= '<span class="warning">' . __('Earlier found meta description was not found in file. Renewed the description test data.', 'ymbeseo') . '</span>'; } add_settings_error('so_YMBESEO_dashboard_options', 'error', $msg, 'updated'); } } } // Clean up the referrer url for later use. if (isset($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = remove_query_arg(array('nonce', 'fixmetadesc'), $_SERVER['REQUEST_URI']); } } if (!isset($options['theme_has_description']) || (isset($options['theme_has_description']) && $options['theme_has_description'] === true || $options['theme_description_found'] !== '') || isset($_GET['checkmetadesc']) && check_admin_referer('wpseo-check-metadesc', 'nonce')) { YMBESEO_description_test(); // Renew the options after the test. $options = get_option('wpseo'); } if (isset($_GET['checkmetadesc'])) { // Clean up the referrer url for later use. if (isset($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = remove_query_arg(array('nonce', 'checkmetadesc'), $_SERVER['REQUEST_URI']); } } $yform = Yoast_Form::get_instance(); $yform->admin_header(true, 'wpseo'); do_action('YMBESEO_all_admin_notices'); if (is_array($options['blocking_files']) && count($options['blocking_files']) > 0) { echo '<p id="blocking_files" class="wrong">'; echo '<a href="javascript:wpseoKillBlockingFiles(\'', esc_js(wp_create_nonce('wpseo-blocking-files')), '\')" class="button fixit">', __('Fix it.', 'ymbeseo'), '</a>';