isters a font collection from the Font Library. * * @since 6.5.0 * * @param string $slug Font collection slug. * @return bool True if the font collection was unregistered successfully, else false. */ function wp_unregister_font_collection( string $slug ) { return WP_Font_Library::get_instance()->unregister_font_collection( $slug ); } /** * Retrieves font uploads directory information. * * Same as wp_font_dir() but "light weight" as it doesn't attempt to create the font uploads directory. * Intended for use in themes, when only 'basedir' and 'baseurl' are needed, generally in all cases * when not uploading files. * * @since 6.5.0 * * @see wp_font_dir() * * @return array See wp_font_dir() for description. */ function wp_get_font_dir() { return wp_font_dir( false ); } /** * Returns an array containing the current fonts upload directory's path and URL. * * @since 6.5.0 * * @param bool $create_dir Optional. Whether to check and create the font uploads directory. Default true. * @return array { * Array of information about the font upload directory. * * @type string $path Base directory and subdirectory or full path to the fonts upload directory. * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory. * @type string $subdir Subdirectory * @type string $basedir Path without subdir. * @type string $baseurl URL path without subdir. * @type string|false $error False or error message. * } */ function wp_font_dir( $create_dir = true ) { /* * Allow extenders to manipulate the font directory consistently. * * Ensures the upload_dir filter is fired both when calling this function * directly and when the upload directory is filtered in the Font Face * REST API endpoint. */ add_filter( 'upload_dir', '_wp_filter_font_directory' ); $font_dir = wp_upload_dir( null, $create_dir, false ); remove_filter( 'upload_dir', '_wp_filter_font_directory' ); return $font_dir; } /** * A callback function for use in the {@see 'upload_dir'} filter. * * This function is intended for internal use only and should not be used by plugins and themes. * Use wp_get_font_dir() instead. * * @since 6.5.0 * @access private * * @param string $font_dir The font directory. * @return string The modified font directory. */ function _wp_filter_font_directory( $font_dir ) { if ( doing_filter( 'font_dir' ) ) { // Avoid an infinite loop. return $font_dir; } $font_dir = array( 'path' => untrailingslashit( $font_dir['basedir'] ) . '/fonts', 'url' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts', 'subdir' => '', 'basedir' => untrailingslashit( $font_dir['basedir'] ) . '/fonts', 'baseurl' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts', 'error' => false, ); /** * Filters the fonts directory data. * * This filter allows developers to modify the fonts directory data. * * @since 6.5.0 * * @param array $font_dir { * Array of information about the font upload directory. * * @type string $path Base directory and subdirectory or full path to the fonts upload directory. * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory. * @type string $subdir Subdirectory * @type string $basedir Path without subdir. * @type string $baseurl URL path without subdir. * @type string|false $error False or error message. * } */ return apply_filters( 'font_dir', $font_dir ); } /** * Deletes child font faces when a font family is deleted. * * @access private * @since 6.5.0 * * @param int $post_id Post ID. * @param WP_Post $post Post object. */ function _wp_after_delete_font_family( $post_id, $post ) { if ( 'wp_font_family' !== $post->post_type ) { return; } $font_faces = get_children( array( 'post_parent' => $post_id, 'post_type' => 'wp_font_face', ) ); foreach ( $font_faces as $font_face ) { wp_delete_post( $font_face->ID, true ); } } /** * Deletes associated font files when a font face is deleted. * * @access private * @since 6.5.0 * * @param int $post_id Post ID. * @param WP_Post $post Post object. */ function _wp_before_delete_font_face( $post_id, $post ) { if ( 'wp_font_face' !== $post->post_type ) { return; } $font_files = get_post_meta( $post_id, '_wp_font_face_file', false ); $font_dir = untrailingslashit( wp_get_font_dir()['basedir'] ); foreach ( $font_files as $font_file ) { wp_delete_file( $font_dir . '/' . $font_file ); } } /** * Register the default font collections. * * @access private * @since 6.5.0 */ function _wp_register_default_font_collections() { wp_register_font_collection( 'google-fonts', array( 'name' => _x( 'Google Fonts', 'font collection name' ), 'description' => __( 'Install from Google Fonts. Fonts are copied to and served from your site.' ), 'font_families' => 'https://s.w.org/images/fonts/wp-6.7/collections/google-fonts-with-preview.json', 'categories' => array( array( 'name' => _x( 'Sans Serif', 'font category' ), 'slug' => 'sans-serif', ), array( 'name' => _x( 'Display', 'font category' ), 'slug' => 'display', ), array( 'name' => _x( 'Serif', 'font category' ), 'slug' => 'serif', ), array( 'name' => _x( 'Handwriting', 'font category' ), 'slug' => 'handwriting', ), array( 'name' => _x( 'Monospace', 'font category' ), 'slug' => 'monospace', ), ), ) ); } ! \is_string( $url ) || $url === '' ) { return $url; } if ( $this->is_relative( $url ) === true ) { return $this->build_absolute_url( $url ); } return $url; } /** * Parse the home URL setting to find the base URL for relative URLs. * * @param string|null $path Optional path string. * * @return string */ public function build_absolute_url( $path = null ) { $path = \wp_parse_url( $path, \PHP_URL_PATH ); $url_parts = \wp_parse_url( \home_url() ); $base_url = \trailingslashit( $url_parts['scheme'] . '://' . $url_parts['host'] ); if ( ! \is_null( $path ) ) { $base_url .= \ltrim( $path, '/' ); } return $base_url; } /** * Returns the link type. * * @param array $url The URL, as parsed by wp_parse_url. * @param array|null $home_url Optional. The home URL, as parsed by wp_parse_url. Used to avoid reparsing the home_url. * @param bool $is_image Whether or not the link is an image. * * @return string The link type. */ public function get_link_type( $url, $home_url = null, $is_image = false ) { // If there is no scheme and no host the link is always internal. // Beware, checking just the scheme isn't enough as a link can be //yoast.com for instance. if ( empty( $url['scheme'] ) && empty( $url['host'] ) ) { return ( $is_image ) ? SEO_Links::TYPE_INTERNAL_IMAGE : SEO_Links::TYPE_INTERNAL; } // If there is a scheme but it's not http(s) then the link is always external. if ( \array_key_exists( 'scheme', $url ) && ! \in_array( $url['scheme'], [ 'http', 'https' ], true ) ) { return ( $is_image ) ? SEO_Links::TYPE_EXTERNAL_IMAGE : SEO_Links::TYPE_EXTERNAL; } if ( \is_null( $home_url ) ) { $home_url = \wp_parse_url( \home_url() ); } // When the base host is equal to the host. if ( isset( $url['host'] ) && $url['host'] !== $home_url['host'] ) { return ( $is_image ) ? SEO_Links::TYPE_EXTERNAL_IMAGE : SEO_Links::TYPE_EXTERNAL; } // There is no base path and thus all URLs of the same domain are internal. if ( empty( $home_url['path'] ) ) { return ( $is_image ) ? SEO_Links::TYPE_INTERNAL_IMAGE : SEO_Links::TYPE_INTERNAL; } // When there is a path and it matches the start of the url. if ( isset( $url['path'] ) && \strpos( $url['path'], $home_url['path'] ) === 0 ) { return ( $is_image ) ? SEO_Links::TYPE_INTERNAL_IMAGE : SEO_Links::TYPE_INTERNAL; } return ( $is_image ) ? SEO_Links::TYPE_EXTERNAL_IMAGE : SEO_Links::TYPE_EXTERNAL; } /** * Recreate current URL. * * @param bool $with_request_uri Whether we want the REQUEST_URI appended. * * @return string */ public function recreate_current_url( $with_request_uri = true ) { $current_url = 'http'; if ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ) { $current_url .= 's'; } $current_url .= '://'; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- We know this is scary. $suffix = ( $with_request_uri && isset( $_SERVER['REQUEST_URI'] ) ) ? $_SERVER['REQUEST_URI'] : ''; if ( isset( $_SERVER['SERVER_NAME'] ) && ! empty( $_SERVER['SERVER_NAME'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- We know this is scary. $server_name = $_SERVER['SERVER_NAME']; } else { // Early return with just the path. return $suffix; } $server_port = ''; if ( isset( $_SERVER['SERVER_PORT'] ) && $_SERVER['SERVER_PORT'] !== '80' && $_SERVER['SERVER_PORT'] !== '443' ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- We know this is scary. $server_port = $_SERVER['SERVER_PORT']; } if ( ! empty( $server_port ) ) { $current_url .= $server_name . ':' . $server_port . $suffix; } else { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- We know this is scary. $current_url .= $server_name . $suffix; } return $current_url; } /** * Parses a URL and returns its components, this wrapper function was created to support unit tests. * * @param string $parsed_url The URL to parse. * @return array The parsed components of the URL. */ public function parse_str_params( $parsed_url ) { $array = []; // @todo parse_str changes spaces in param names into `_`, we should find a better way to support them. \wp_parse_str( $parsed_url, $array ); return $array; } }
Fatal error: Uncaught Error: Class "ITSEC_Storage" not found in /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/lib/settings.php:312 Stack trace: #0 /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/lib/settings.php(23): ITSEC_Settings->load() #1 /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/lib/Config_Settings.php(8): ITSEC_Settings->__construct(Object(iThemesSecurity\Module_Config)) #2 /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/modules/global/settings.php(102): iThemesSecurity\Config_Settings->__construct(Object(iThemesSecurity\Module_Config)) #3 /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/modules.php(768): include_once('/htdocs/accraon...') #4 /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/modules.php(226): ITSEC_Modules::load_module_file('settings.php', Array) #5 /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/modules.php(304): ITSEC_Modules::get_settings_obj('global') #6 /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/core.php(653): ITSEC_Modules::get_setting('global', 'build') #7 /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/core.php(577): ITSEC_Core::get_saved_plugin_build() #8 /htdocs/accraonline.info/wp-includes/class-wp-hook.php(322): ITSEC_Core->handle_upgrade() #9 /htdocs/accraonline.info/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #10 /htdocs/accraonline.info/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #11 /htdocs/accraonline.info/wp-settings.php(559): do_action('plugins_loaded') #12 /htdocs/accraonline.info/wp-config.php(106): require_once('/htdocs/accraon...') #13 /htdocs/accraonline.info/wp-load.php(50): require_once('/htdocs/accraon...') #14 /htdocs/accraonline.info/wp-blog-header.php(13): require_once('/htdocs/accraon...') #15 /htdocs/accraonline.info/index.php(17): require('/htdocs/accraon...') #16 {main} thrown in /htdocs/accraonline.info/wp-content/plugins/better-wp-security/core/lib/settings.php on line 312