>backup['taxonomies'][ $taxonomy ]['social']['facebook'], [ 'social', 'facebook', 'general', 'taxonomies', $taxonomy ] );
unset( $this->backup['taxonomies'][ $taxonomy ]['social']['facebook'] );
$this->shouldBackup = true;
}
}
}
/**
* Restores the dynamic Archives options.
*
* @since 4.1.3
*
* @return void
*/
protected function restoreArchives() {
foreach ( $this->archives as $postType ) {
// Restore the archives for Search Appearance.
if ( ! empty( $this->backup['archives'][ $postType ]['searchAppearance'] ) ) {
$this->restoreOptions( $this->backup['archives'][ $postType ]['searchAppearance'], [ 'searchAppearance', 'archives', $postType ] );
unset( $this->backup['archives'][ $postType ]['searchAppearance'] );
$this->shouldBackup = true;
}
}
}
/**
* Restores the backuped options.
*
* @since 4.1.3
*
* @param array $backupOptions The options to be restored.
* @param array $groups The group that the option should be restored.
* @return void
*/
protected function restoreOptions( $backupOptions, $groups ) {
$groupPath = $this->options;
foreach ( $groups as $group ) {
if ( ! isset( $groupPath[ $group ] ) ) {
return false;
}
$groupPath = $groupPath[ $group ];
}
$options = aioseo()->dynamicOptions->noConflict();
foreach ( $backupOptions as $setting => $value ) {
// Check if the option exists by checking if the type is defined.
$type = ! empty( $groupPath[ $setting ]['type'] ) ? $groupPath[ $setting ]['type'] : '';
if ( ! $type ) {
continue;
}
foreach ( $groups as $group ) {
$options = $options->$group;
}
$options->$setting = $value;
}
}
/**
* Maybe backup the options if it has disappeared.
*
* @since 4.1.3
*
* @param array $newOptions An array of options to check.
* @return void
*/
public function maybeBackup( $newOptions ) {
$this->maybeBackupPostType( $newOptions );
$this->maybeBackupTaxonomy( $newOptions );
$this->maybeBackupArchives( $newOptions );
}
/**
* Maybe backup the Post Types.
*
* @since 4.1.3
*
* @param array $newOptions An array of options to check.
* @return void
*/
protected function maybeBackupPostType( $newOptions ) {
// Maybe backup the post types for Search Appearance.
foreach ( $newOptions['searchAppearance']['postTypes'] as $dynamicPostTypeName => $dynamicPostTypeSettings ) {
$found = in_array( $dynamicPostTypeName, $this->postTypes, true );
if ( ! $found ) {
$this->backup['postTypes'][ $dynamicPostTypeName ]['searchAppearance'] = $dynamicPostTypeSettings;
$this->shouldBackup = true;
}
}
// Maybe backup the post types for Social Networks.
foreach ( $newOptions['social']['facebook']['general']['postTypes'] as $dynamicPostTypeName => $dynamicPostTypeSettings ) {
$found = in_array( $dynamicPostTypeName, $this->postTypes, true );
if ( ! $found ) {
$this->backup['postTypes'][ $dynamicPostTypeName ]['social']['facebook'] = $dynamicPostTypeSettings;
$this->shouldBackup = true;
}
}
}
/**
* Maybe backup the Taxonomies.
*
* @since 4.1.3
*
* @param array $newOptions An array of options to check.
* @return void
*/
protected function maybeBackupTaxonomy( $newOptions ) {
// Maybe backup the taxonomies for Search Appearance.
foreach ( $newOptions['searchAppearance']['taxonomies'] as $dynamicTaxonomyName => $dynamicTaxonomySettings ) {
$found = in_array( $dynamicTaxonomyName, $this->taxonomies, true );
if ( ! $found ) {
$this->backup['taxonomies'][ $dynamicTaxonomyName ]['searchAppearance'] = $dynamicTaxonomySettings;
$this->shouldBackup = true;
}
}
}
/**
* Maybe backup the Archives.
*
* @since 4.1.3
*
* @param array $newOptions An array of options to check.
* @return void
*/
protected function maybeBackupArchives( $newOptions ) {
// Maybe backup the archives for Search Appearance.
foreach ( $newOptions['searchAppearance']['archives'] as $archiveName => $archiveSettings ) {
$found = in_array( $archiveName, $this->archives, true );
if ( ! $found ) {
$this->backup['archives'][ $archiveName ]['searchAppearance'] = $archiveSettings;
$this->shouldBackup = true;
}
}
}
}
Fatal error: Uncaught Error: Class 'AIOSEO\Plugin\Common\Options\DynamicBackup' not found in /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php:286
Stack trace:
#0 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load()
#1 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init()
#2 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(387): AIOSEO\Plugin\AIOSEO::instance()
#3 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php(97): aioseo()
#4 /home/kordian1/domains/ostrabrama.pl/public_html/wp-settings.php(522): include_once('/home/kordian1/...')
#5 /home/kordian1/domains/ostrabrama.pl/public_html/wp-config.php(81): require_once('/home/kordian1/...')
#6 /home/kordian1/domains/ostrabrama.pl/public_html/wp- in /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php on line 286