Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
wordpress-seo
/
admin
/
config-ui
/
File Content:
class-configuration-storage.php
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin\ConfigurationUI */ /** * Class WPSEO_Configuration_Storage. */ class WPSEO_Configuration_Storage { /** * Holds the configuration options adapter. * * @var \WPSEO_Configuration_Options_Adapter */ protected $adapter; /** * Holds the configuration fields. * * @var \WPSEO_Config_Field[] */ protected $fields = []; /** * Add default fields. */ public function add_default_fields() { $fields = [ new WPSEO_Config_Field_Success_Message(), new WPSEO_Config_Field_Mailchimp_Signup(), new WPSEO_Config_Field_Environment(), new WPSEO_Config_Field_Site_Type(), new WPSEO_Config_Field_Multiple_Authors(), new WPSEO_Config_Field_Title_Intro(), new WPSEO_Config_Field_Site_Name(), new WPSEO_Config_Field_Separator(), new WPSEO_Config_Field_Profile_URL_Facebook(), new WPSEO_Config_Field_Profile_URL_Twitter(), new WPSEO_Config_Field_Profile_URL_Instagram(), new WPSEO_Config_Field_Profile_URL_LinkedIn(), new WPSEO_Config_Field_Profile_URL_MySpace(), new WPSEO_Config_Field_Profile_URL_Pinterest(), new WPSEO_Config_Field_Profile_URL_YouTube(), new WPSEO_Config_Field_Profile_URL_Wikipedia(), new WPSEO_Config_Field_Company_Or_Person(), new WPSEO_Config_Field_Company_Info_Missing(), new WPSEO_Config_Field_Company_Name(), new WPSEO_Config_Field_Company_Logo(), new WPSEO_Config_Field_Person(), new WPSEO_Config_Field_Post_Type_Visibility(), new WPSEO_Config_Field_Tracking_Intro(), new WPSEO_Config_Field_Tracking(), ]; $post_type_factory = new WPSEO_Config_Factory_Post_Type(); $fields = array_merge( $fields, $post_type_factory->get_fields() ); foreach ( $fields as $field ) { $this->add_field( $field ); } } /** * Allow for field injections. * * @param WPSEO_Config_Field $field Field to add to the stack. */ public function add_field( WPSEO_Config_Field $field ) { $this->fields[] = $field; if ( isset( $this->adapter ) ) { $field->set_adapter( $this->adapter ); } } /** * Set the adapter to use. * * @param WPSEO_Configuration_Options_Adapter $adapter Adapter to use. */ public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) { $this->adapter = $adapter; foreach ( $this->fields as $field ) { $field->set_adapter( $this->adapter ); } } /** * Retrieve the current adapter. * * @return WPSEO_Configuration_Options_Adapter */ public function get_adapter() { return $this->adapter; } /** * Retrieve the registered fields. * * @return array List of settings. */ public function retrieve() { $output = []; foreach ( $this->fields as $field ) { $build = $field->to_array(); $data = $this->get_field_data( $field ); if ( ! is_null( $data ) ) { $build['data'] = $data; } $output[ $field->get_identifier() ] = $build; } return $output; } /** * Save the data. * * @param array $data_to_store Data provided by the API which needs to be processed for saving. * * @return string Results */ public function store( $data_to_store ) { $output = []; foreach ( $this->fields as $field ) { $field_identifier = $field->get_identifier(); if ( ! array_key_exists( $field_identifier, $data_to_store ) ) { continue; } $field_data = []; if ( isset( $data_to_store[ $field_identifier ] ) ) { $field_data = $data_to_store[ $field_identifier ]; } $result = $this->adapter->set( $field, $field_data ); $build = [ 'result' => $result, ]; // Set current data to object to be displayed. $data = $this->get_field_data( $field ); if ( ! is_null( $data ) ) { $build['data'] = $data; } $output[ $field_identifier ] = $build; } return $output; } /** * Filter out null input values. * * @param mixed $input Input to test against. * * @return bool */ protected function is_not_null( $input ) { return ! is_null( $input ); } /** * Get data from a specific field. * * @param WPSEO_Config_Field $field Field to get data for. * * @return array|mixed */ protected function get_field_data( WPSEO_Config_Field $field ) { $data = $this->adapter->get( $field ); if ( is_array( $data ) ) { $defaults = $field->get_data(); // Remove 'null' values from input. $data = array_filter( $data, [ $this, 'is_not_null' ] ); // Merge defaults with data. $data = array_merge( $defaults, $data ); } if ( is_null( $data ) ) { // Get default if no data was set. $data = $field->get_data(); return $data; } return $data; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
components
---
0755
factories
---
0755
fields
---
0755
.DS_Store
10234 bytes
0644
20200616130143_ReplacePermalinkHashIndex.php
2293 bytes
0644
AjaxController.php
2162 bytes
0644
DownloadConfController.php
945 bytes
0644
JsonSerializable-20260707002754.php
577 bytes
0644
JsonSerializable.php
577 bytes
0644
LimitStream.php
4209 bytes
0644
README.md
2555 bytes
0644
base.php
2793 bytes
0644
class-admin-utils.php
2147 bytes
0644
class-configuration-components.php
1593 bytes
0644
class-configuration-endpoint.php
2071 bytes
0644
class-configuration-options-adapter.php
5015 bytes
0644
class-configuration-page.php
7222 bytes
0644
class-configuration-service.php
4484 bytes
0644
class-configuration-storage.php
4635 bytes
0644
class-configuration-structure.php
3464 bytes
0644
class-configuration-translations.php
1263 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class.pack.database.php
30838 bytes
0644
class.u.json.php
4832 bytes
0644
ctrl.package.php
17073 bytes
0644
define.php
4567 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260624185532.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
exceptions.php
708 bytes
0644
image-helper.php
10231 bytes
0644
inc.validator.php
5401 bytes
0644
index.php
157663 bytes
0644
loco.php
5626 bytes
0644
loco.xml
657 bytes
0644
meta-fields-presenter.php
1600 bytes
0644
module.php
1297 bytes
0644
partial-notifications-errors.php
1139 bytes
0644
quick-edit-handler-1650.js
1848 bytes
0644
request-methods-header.php
1127 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
wp-seo-main.php
17504 bytes
0644
N4ST4R_ID | Naxtarrr