sses, Expiration Date, User Agent (Browser/OS), and Last Login. Settings — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database. Share your knowledge in the WordPress support forums. Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website. Slug — The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens. Template — Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu. Test new releases and proposed features for the block editor. The parent theme could not be found. You will need to install the parent theme, %s, before you can use this child theme. Themes and Plugins — To update individual themes or plugins from this screen, use the checkboxes to make your selection, then click on the appropriate “Update” button. To update all of your themes or plugins at once, you can check the box at the top of the section to select all before clicking the update button. Themes — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the Network Themes screen. Title — Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit. Translate WordPress into your local language. Translations — The files translating WordPress into your language are updated for you whenever any other updates occur. But if these files are out of date, you can click the “Update Translations” button. Trash removes your post from this list and places it in the Trash, from which you can permanently delete it. Users — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network. Version %1$s addressed %2$s bug. Version %1$s addressed %2$s bugs. Version %1$s addressed a security issue and fixed %2$s bug. Version %1$s addressed a security issue and fixed %2$s bugs. Version %1$s addressed some security issues and fixed %2$s bug. Version %1$s addressed some security issues and fixed %2$s bugs. Version %s addressed one security issue. Version %s addressed some security issues. View takes you to a public author archive which lists all the posts published by the user. View will take you to a public display page for that file. Warning: Making changes to active plugins is not recommended. Warning: This plugin has not been tested with your current version of WordPress. Warning: these pages should not be the same as your Privacy Policy page! Warning: these pages should not be the same! Welcome — Shows links for some of the most common tasks when setting up a new site. WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the Wordgs_page_optimize-webfonts' ) {
wp_enqueue_script(
self::OMGF_ADMIN_JS_HANDLE,
plugin_dir_url( OMGF_PLUGIN_FILE ) . 'assets/js/omgf-admin.js',
[ 'jquery' ],
filemtime( OMGF_PLUGIN_DIR . 'assets/js/omgf-admin.js' ),
true
);
wp_enqueue_style(
self::OMGF_ADMIN_CSS_HANDLE,
plugin_dir_url( OMGF_PLUGIN_FILE ) . 'assets/css/omgf-admin.css',
[],
filemtime( OMGF_PLUGIN_DIR . 'assets/css/omgf-admin.css' )
);
}
}
/**
* Add notice to admin screen.
*
* @codeCoverageIgnore
*/
public function print_notices() {
Notice::print_notices();
}
/**
* @see OMGF::admin_optimized_fonts()
* @since v5.0.5 Forces get_option() to fetch a fresh copy of omgf_optimized_fonts from the database,
* we're doing plenty to limit reads from the DB already. So, this is warranted.
*
* @param array $alloptions
*
* @return array
*/
public function force_optimized_fonts_from_db( $alloptions ) {
if ( isset( $alloptions[ Settings::OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS ] ) &&
! $alloptions[ Settings::OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS ] ) {
unset( $alloptions[ Settings::OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS ] );
}
return $alloptions;
}
/**
* Triggered when unload settings is changed, cleans up old cache files.
* TODO: Clean up doesn't work on 2nd run?
*/
public function clean_up_cache( $value, $old_value ) {
if ( $old_value == $value ) {
return; // @codeCoverageIgnore
}
if ( $old_value == null ) {
return; // @codeCoverageIgnore
}
$cache_keys = explode( ',', $old_value );
foreach ( $cache_keys as $key ) {
$entries = array_filter( (array) glob( OMGF_UPLOAD_DIR . "/*$key" ) );
foreach ( $entries as $entry ) {
OMGF::delete( $entry );
}
}
}
/**
* Shows notice if $option_name is in $show_notice array.
*
* @see $show_message
*
* @param $old_values
* @param $values
*
* @return void
*/
public function maybe_show_stale_cache_notice( $old_values, $values ) {
/**
* Don't show this message on the Main tab.
*/
if ( ! array_key_exists( 'tab', $_GET ) || ( $_GET[ 'tab' ] === Settings::OMGF_SETTINGS_FIELD_OPTIMIZE ) ) {
return; // @codeCoverageIgnore
}
/**
* If either of these isn't an array, this means they haven't been set before.
*/
if ( ! is_array( $old_values ) || ! is_array( $values ) ) {
return; // @codeCoverageIgnore
}
/**
* Fetch options from array, so we can compare both.
*/
$old = array_filter(
$old_values,
function ( $key ) {
return in_array( $key, $this->stale_cache_options, true );
},
ARRAY_FILTER_USE_KEY
);
$new = array_filter(
$values,
function ( $key ) {
return in_array( $key, $this->stale_cache_options, true );
},
ARRAY_FILTER_USE_KEY
);
$diff = $this->array_diff( $new, $old );
if ( empty( $diff ) ) {
return;
}
global $wp_settings_errors;
$show_message = true;
if ( ! empty( $wp_settings_errors ) ) {
foreach ( $wp_settings_errors as $error ) {
if ( str_contains( $error[ 'code' ], 'omgf' ) ) {
$show_message = false;
break;
}
}
if ( $show_message ) {
$wp_settings_errors = []; // @codeCoverageIgnore
}
}
if ( $show_message ) {
OMGF::update_option( Settings::OMGF_CACHE_IS_STALE, true );
add_settings_error(
'general',
'omgf_cache_stale',
sprintf(
__(
'OMGF\'s cached stylesheets don\'t reflect the current settings. Refresh the cache from the Task Manager.',
'host-webfonts-local'
),
admin_url( Settings::OMGF_OPTIONS_GENERAL_PAGE_OPTIMIZE_WEBFONTS )
),
'success'
);
}
}
/**
* Recursively compares two arrays.
*
* @param array $array1
* @param array $array2
*
* @return bool Whether $array1 contains different values, $compared to array2.
*/
private function array_diff( $array1, $array2 ) {
$diff = false;
foreach ( $array1 as $key => $value ) {
if ( is_array( $value ) ) {
$diff = $this->array_diff( $value, $array2[ $key ] );
if ( $diff ) {
break;
}
continue;
}
$diff = ! isset( $array2[ $key ] ) || $value !== $array2[ $key ];
if ( $diff ) {
break;
}
}
return $diff;
}
}