File Editor
Directories:
.. (Back)
exceptions
options
sitemaps
Files:
class-addon-manager.php
class-my-yoast-api-request.php
class-post-type.php
class-rewrite.php
class-upgrade-history.php
class-upgrade.php
class-wpseo-admin-bar-menu.php
class-wpseo-content-images.php
class-wpseo-custom-fields.php
class-wpseo-custom-taxonomies.php
class-wpseo-image-utils.php
class-wpseo-installation.php
class-wpseo-meta.php
class-wpseo-primary-term.php
class-wpseo-rank.php
class-wpseo-replace-vars.php
class-wpseo-replacement-variable.php
class-wpseo-shortlinker.php
class-wpseo-statistics.php
class-wpseo-utils.php
class-yoast-dynamic-rewrites.php
date-helper.php
index.php
interface-wpseo-wordpress-ajax-integration.php
interface-wpseo-wordpress-integration.php
language-utils.php
wpseo-functions-deprecated.php
wpseo-functions.php
wpseo-non-ajax-functions.php
Create New File
Create
Edit File: class-wpseo-installation.php
<?php /** * WPSEO plugin file. * * @package WPSEO\Internals * @since 3.6 */ /** * This class checks if the wpseo option doesn't exists. In the case it doesn't it will set a property that is * accessible via a method to check if the installation is fresh. */ class WPSEO_Installation { /** * Checks if Yoast SEO is installed for the first time. */ public function __construct() { $is_first_install = $this->is_first_install(); if ( $is_first_install && WPSEO_Utils::is_api_available() ) { add_action( 'wpseo_activate', [ $this, 'set_first_install_options' ] ); } } /** * When the option doesn't exist, it should be a new install. * * @return bool */ private function is_first_install() { return ( get_option( 'wpseo' ) === false ); } /** * Sets the options on first install for showing the installation notice and disabling of the settings pages. * * @return void */ public function set_first_install_options() { $options = get_option( 'wpseo' ); $options['show_onboarding_notice'] = true; $options['first_activated_on'] = time(); update_option( 'wpseo', $options ); } }
Save Changes
Rename File
Rename