e' => esc_html__( 'Current Year', 'rank-math' ),
'description' => esc_html__( 'Current server year', 'rank-math' ),
'variable' => 'currentyear',
'example' => $this->get_current_year(),
],
[ $this, 'get_current_year' ]
);
}
/**
* Setup time variables.
*/
private function setup_time_variables() {
$this->register_replacement(
'currenttime',
[
'name' => esc_html__( 'Current Time', 'rank-math' ),
'description' => esc_html__( 'Current server time', 'rank-math' ),
'variable' => 'currenttime',
'example' => $this->get_current_time(),
],
[ $this, 'get_current_time' ]
);
$this->register_replacement(
'currenttime_args',
[
'name' => esc_html__( 'Current Time (advanced)', 'rank-math' ),
'description' => esc_html__( 'Current server time with custom formatting pattern.', 'rank-math' ),
'variable' => 'currenttime(F jS, Y)',
'example' => $this->get_current_time( 'F jS, Y' ),
],
[ $this, 'get_current_time' ]
);
}
/**
* Setup site info variables.
*/
private function setup_organization_variables() {
$this->register_replacement(
'org_name',
[
'name' => esc_html__( 'Organization Name', 'rank-math' ),
'description' => esc_html__( 'The Organization Name added in Local SEO Settings.', 'rank-math' ),
'variable' => 'org_name',
'example' => $this->get_org_name(),
],
[ $this, 'get_org_name' ]
);
$this->register_replacement(
'org_logo',
[
'name' => esc_html__( 'Organization Logo', 'rank-math' ),
'description' => esc_html__( 'Organization Logo added in Local SEO Settings.', 'rank-math' ),
'variable' => 'org_logo',
'example' => $this->get_org_logo(),
],
[ $this, 'get_org_logo' ]
);
$this->register_replacement(
'org_url',
[
'name' => esc_html__( 'Organization URL', 'rank-math' ),
'description' => esc_html__( 'Organization URL added in Local SEO Settings.', 'rank-math' ),
'variable' => 'org_url',
'example' => $this->get_org_url(),
],
[ $this, 'get_org_url' ]
);
}
/**
* Get the separator to use as a replacement.
*
* @return string
*/
public function get_sep() {
$sep = $this->do_filter( 'settings/title_separator', Helper::get_settings( 'titles.title_separator' ) );
return htmlentities( $sep, ENT_COMPAT, 'UTF-8', false );
}
/**
* Get the site name to use as a replacement.
*
* @return string|null
*/
public function get_sitename() {
if ( $this->in_cache( 'sitename' ) ) {
return $this->get_cache( 'sitename' );
}
$sitename = wp_strip_all_tags( get_bloginfo( 'name' ), true );
if ( '' !== $sitename ) {
$this->set_cache( 'sitename', $sitename );
}
return $sitename;
}
/**
* Get the site tag line to use as a replacement.
*
* @return string|null
*/
public function get_sitedesc() {
if ( $this->in_cache( 'sitedesc' ) ) {
return $this->get_cache( 'sitedesc' );
}
$sitedesc = wp_strip_all_tags( get_bloginfo( 'description' ) );
if ( '' !== $sitedesc ) {
$this->set_cache( 'sitedesc', $sitedesc );
}
return $sitedesc;
}
/**
* Get the current search query to use as a replacement.
*
* @return string|null
*/
public function get_search_query() {
if ( $this->in_cache( 'search_query' ) ) {
return $this->get_cache( 'search_query' );
}
$search = get_search_query();
if ( '' !== $search ) {
$this->set_cache( 'search_query', $search );
}
return $search;
}
/**
* Get the counter for the given variable.
*
* @param string $name The name of field.
*
* @return string|null
*/
public function get_count( $name ) {
if ( ! is_string( $name ) ) {
return null;
}
if ( ! isset( $this->counters[ $name ] ) ) {
$this->counters[ $name ] = 0;
}
return ++$this->counters[ $name ];
}
/**
* Get the filename of the attachment to use as a replacement.
*
* @return string|null
*/
public function get_filename() {
if ( empty( $this->args->filename ) ) {
return null;
}
$name = \pathinfo( $this->args->filename );
// Remove size if embedded.
$name = explode( '-', $name['filename'] );
if ( Str::contains( 'x', end( $name ) ) ) {
array_pop( $name );
}
// Format filename.
$name = join( ' ', $name );
$name = trim( str_replace( '_', ' ', $name ) );
return '' !== $name ? $name : null;
}
/**
* Get the current time to use as a replacement.
*
* @param string $format (Optional) PHP date format.
*
* @return string
*/
public function get_current_time( $format = '' ) {
$format = $format ? $format : get_option( 'time_format' );
return $this->date_i18n( $format );
}
/**
* Get the current date to use as a replacement.
*
* @param string $format (Optional) PHP date format.
*
* @return string
*/
public function get_current_date( $format = '' ) {
$format = $format ? $format : get_option( 'date_format' );
return $this->date_i18n( $format );
}
/**
* Get the current day to use as a replacement.
*
* @return string
*/
public function get_current_day() {
return $this->date_i18n( 'j' );
}
/**
* Get the current month to use as a replacement.
*
* @return string
*/
public function get_current_month() {
return $this->date_i18n( 'F' );
}
/**
* Get the current year to use as a replacement.
*
* @return string
*/
public function get_current_year() {
return $this->date_i18n( 'Y' );
}
/**
* Get the Organization Name to use as a replacement.
*
* @return string
*/
public function get_org_name() {
return Helper::get_settings( 'titles.knowledgegraph_name', get_bloginfo( 'name' ) );
}
/**
* Get the Organization Logo to use as a replacement.
*
* @return string
*/
public function get_org_logo() {
return Helper::get_settings( 'titles.knowledgegraph_logo', '' );
}
/**
* Get the Organization URL to use as a replacement.
*
* @return string
*/
public function get_org_url() {
return Helper::get_settings( 'titles.url', home_url() );
}
/**
* Return localized date.
*
* @param string $format (Optional) PHP date format.
*
* @return string
*/
private function date_i18n( $format = '' ) {
$key = 'date_i18n_' . sanitize_key( $format );
if ( $this->in_cache( $key ) ) {
return $this->get_cache( $key );
}
$date = date_i18n( $format );
$this->set_cache( $key, $date );
return $date;
}
}
Fatal error: Uncaught Error: Class "RankMath\Replace_Variables\Basic_Variables" not found in /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-term-variables.php:21
Stack trace:
#0 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(576): include()
#1 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#2 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-author-variables.php(20): Composer\Autoload\ClassLoader->loadClass()
#3 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(576): include('...')
#4 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#5 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-advanced-variables.php(21): Composer\Autoload\ClassLoader->loadClass()
#6 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(576): include('...')
#7 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#8 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php(23): Composer\Autoload\ClassLoader->loadClass()
#9 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(576): include('...')
#10 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#11 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-manager.php(25): Composer\Autoload\ClassLoader->loadClass()
#12 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(576): include('...')
#13 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/code-snippets/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#14 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/rank-math.php(294): Composer\Autoload\ClassLoader->loadClass()
#15 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/rank-math.php(185): RankMath->instantiate()
#16 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/rank-math.php(164): RankMath->setup()
#17 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/rank-math.php(542): RankMath::get()
#18 /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/rank-math.php(546): rank_math()
#19 /home/alibiuro/domains/alibiuro.pl/public_html/wp-settings.php(545): include_once('...')
#20 /home/alibiuro/domains/alibiuro.pl/public_html/wp-config.php(113): require_once('...')
#21 /home/alibiuro/domains/alibiuro.pl/public_html/wp-load.php(50): require_once('...')
#22 /home/alibiuro/domains/alibiuro.pl/public_html/wp-blog-header.php(13): require_once('...')
#23 /home/alibiuro/domains/alibiuro.pl/public_html/index.php(17): require('...')
#24 {main}
thrown in /home/alibiuro/domains/alibiuro.pl/public_html/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-term-variables.php on line 21