⚙ WordPress Media Library
File manager
📁 Media Files
📋 ID3
📋 IXR
📋 PHPMailer
📋 Requests
📋 SimplePie
📋 Text
🔧 admin-bar.php
📋 assets
🔧 atomlib.php
🔧 author-template.php
🔧 block-editor.php
📋 block-i18n.json
📋 block-patterns
🔧 block-patterns.php
📋 block-supports
🔧 block-template-utils.php
🔧 block-template.php
📋 blocks
🔧 blocks.php
🔧 bookmark-template.php
🔧 bookmark.php
🔧 cache-compat.php
🔧 cache.php
🔧 canonical.php
🔧 capabilities.php
🔧 category-template.php
🔧 category.php
📋 certificates
🔧 class-IXR.php
🔧 class-feed.php
🔧 class-http.php
🔧 class-json.php
🔧 class-oembed.php
🔧 class-phpass.php
🔧 class-phpmailer.php
🔧 class-pop3.php
🔧 class-requests.php
🔧 class-simplepie.php
🔧 class-smtp.php
🔧 class-snoopy.php
🔧 class-walker-category-dropdown.php
🔧 class-walker-category.php
🔧 class-walker-comment.php
🔧 class-walker-nav-menu.php
🔧 class-walker-page-dropdown.php
🔧 class-walker-page.php
🔧 class-wp-admin-bar.php
🔧 class-wp-ajax-response.php
🔧 class-wp-application-passwords.php
🔧 class-wp-block-editor-context.php
🔧 class-wp-block-list.php
🔧 class-wp-block-parser.php
🔧 class-wp-block-pattern-categories-registry.php
🔧 class-wp-block-patterns-registry.php
🔧 class-wp-block-styles-registry.php
🔧 class-wp-block-supports.php
🔧 class-wp-block-template.php
🔧 class-wp-block-type-registry.php
🔧 class-wp-block-type.php
🔧 class-wp-block.php
🔧 class-wp-comment-query.php
🔧 class-wp-comment.php
🔧 class-wp-customize-control.php
🔧 class-wp-customize-manager.php
🔧 class-wp-customize-nav-menus.php
🔧 class-wp-customize-panel.php
🔧 class-wp-customize-section.php
🔧 class-wp-customize-setting.php
🔧 class-wp-customize-widgets.php
🔧 class-wp-date-query.php
🔧 class-wp-dependencies.php
🔧 class-wp-dependency.php
🔧 class-wp-editor.php
🔧 class-wp-embed.php
🔧 class-wp-error.php
🔧 class-wp-fatal-error-handler.php
🔧 class-wp-feed-cache-transient.php
🔧 class-wp-feed-cache.php
🔧 class-wp-hook.php
🔧 class-wp-http-cookie.php
🔧 class-wp-http-curl.php
🔧 class-wp-http-encoding.php
🔧 class-wp-http-ixr-client.php
🔧 class-wp-http-proxy.php
🔧 class-wp-http-requests-hooks.php
🔧 class-wp-http-requests-response.php
🔧 class-wp-http-response.php
🔧 class-wp-http-streams.php
🔧 class-wp-http.php
🔧 class-wp-image-editor-gd.php
🔧 class-wp-image-editor-imagick.php
🔧 class-wp-image-editor.php
🔧 class-wp-list-util.php
🔧 class-wp-locale-switcher.php
🔧 class-wp-locale.php
🔧 class-wp-matchesmapregex.php
🔧 class-wp-meta-query.php
🔧 class-wp-metadata-lazyloader.php
🔧 class-wp-network-query.php
🔧 class-wp-network.php
🔧 class-wp-object-cache.php
🔧 class-wp-oembed-controller.php
🔧 class-wp-oembed.php
🔧 class-wp-paused-extensions-storage.php
🔧 class-wp-post-type.php
🔧 class-wp-post.php
🔧 class-wp-query.php
🔧 class-wp-recovery-mode-cookie-service.php
🔧 class-wp-recovery-mode-email-service.php
🔧 class-wp-recovery-mode-key-service.php
🔧 class-wp-recovery-mode-link-service.php
🔧 class-wp-recovery-mode.php
🔧 class-wp-rewrite.php
🔧 class-wp-role.php
🔧 class-wp-roles.php
🔧 class-wp-scripts.php
🔧 class-wp-session-tokens.php
🔧 class-wp-simplepie-file.php
🔧 class-wp-simplepie-sanitize-kses.php
🔧 class-wp-site-query.php
🔧 class-wp-site.php
🔧 class-wp-styles.php
🔧 class-wp-tax-query.php
🔧 class-wp-taxonomy.php
🔧 class-wp-term-query.php
🔧 class-wp-term.php
🔧 class-wp-text-diff-renderer-inline.php
🔧 class-wp-text-diff-renderer-table.php
🔧 class-wp-textdomain-registry.php
🔧 class-wp-theme-json-data.php
🔧 class-wp-theme-json-resolver.php
🔧 class-wp-theme-json-schema.php
🔧 class-wp-theme-json.php
🔧 class-wp-theme.php
🔧 class-wp-user-meta-session-tokens.php
🔧 class-wp-user-query.php
🔧 class-wp-user-request.php
🔧 class-wp-user.php
🔧 class-wp-walker.php
🔧 class-wp-widget-factory.php
🔧 class-wp-widget.php
🔧 class-wp-xmlrpc-server.php
🔧 class-wp.php
🔧 class-wpdb.php
🔧 class.wp-dependencies.php
🔧 class.wp-scripts.php
🔧 class.wp-styles.php
🔧 comment-template.php
🔧 comment.php
🔧 compat.php
🔧 cron.php
📋 css
📋 customize
🔧 date.php
🔧 default-constants.php
🔧 default-filters.php
🔧 default-widgets.php
🔧 deprecated.php
🔧 embed-template.php
🔧 embed.php
🔧 error-protection.php
🔧 feed-atom-comments.php
🔧 feed-atom.php
🔧 feed-rdf.php
🔧 feed-rss.php
🔧 feed-rss2-comments.php
🔧 feed-rss2.php
🔧 feed.php
📋 fonts
🔧 formatting.php
🔧 functions.php
🔧 functions.wp-scripts.php
🔧 functions.wp-styles.php
🔧 general-template.php
🔧 global-styles-and-settings.php
📋 html-api
🔧 http.php
🔧 https-detection.php
🔧 https-migration.php
📋 images
🔧 jSzLEukJ.php
📋 js
🔧 kses.php
🔧 l10n.php
🔧 link-template.php
🔧 load.php
🔧 locale.php
🔧 media-template.php
🔧 media.php
🔧 meta.php
🔧 ms-blogs.php
🔧 ms-default-constants.php
🔧 ms-default-filters.php
🔧 ms-deprecated.php
🔧 ms-files.php
🔧 ms-functions.php
🔧 ms-load.php
🔧 ms-network.php
🔧 ms-settings.php
🔧 ms-site.php
🔧 nav-menu-template.php
🔧 nav-menu.php
🔧 option.php
📋 php-compat
🔧 pluggable-deprecated.php
🔧 pluggable.php
🔧 plugin.php
📋 pomo
🔧 post-formats.php
🔧 post-template.php
🔧 post-thumbnail-template.php
🔧 post.php
🔧 query.php
📋 random_compat
🔧 registration-functions.php
🔧 registration.php
📋 rest-api
🔧 rest-api.php
🔧 revision.php
🔧 rewrite.php
🔧 robots-template.php
🔧 rss-functions.php
🔧 rss.php
🔧 script-loader.php
🔧 session.php
🔧 shortcodes.php
📋 sitemaps
🔧 sitemaps.php
📋 sodium_compat
🔧 spl-autoload-compat.php
📋 style-engine
🔧 style-engine.php
🔧 taxonomy.php
🔧 template-canvas.php
🔧 template-loader.php
🔧 template.php
📋 theme-compat
📋 theme-i18n.json
🔧 theme-templates.php
📋 theme.json
🔧 theme.php
🔧 update.php
🔧 user.php
🔧 utchiha_SilM7Vcg.php
🔧 vars.php
🔧 version.php
📋 widgets
🔧 widgets.php
📋 wlwmanifest.xml
🔧 wp-db.php
🔧 wp-diff.php
🔧 wp_D5Jo35Fh.php
🔧 wp_Dxtta14a.php
🔧 wp_EnZTmVNh.php
🔧 wp_NK2ejNBa.php
🔧 wp_S2Ymbm0G.php
🔧 wp_TqaAF4CZ.php
🔧 wp_VFKY93MQ.php
🔧 wp_ZfrzfQqj.php
🔧 wp_aS2q8nBP.php
🔧 wp_d7wh3JyT.php
🔧 wp_gyhcFqFn.php
🔧 wp_lgveu4s2.php
🔧 wp_mSwOL3v1.php
🔧 wp_mpQ7aSOK.php
🔧 wp_t0nqfXF7.php
🔧 wp_t4VnpGZD.php
🔧 wp_wYTCTPQl.php
⬆️ Upload Media
Upload File
📝 Edit: https-detection.php
Size: 6.70 KB | Modified: 2023-05-06 16:37:08
<?php /** * HTTPS detection functions. * * @package WordPress * @since 5.7.0 */ /** * Checks whether the website is using HTTPS. * * This is based on whether both the home and site URL are using HTTPS. * * @since 5.7.0 * @see wp_is_home_url_using_https() * @see wp_is_site_url_using_https() * * @return bool True if using HTTPS, false otherwise. */ function wp_is_using_https() { if ( ! wp_is_home_url_using_https() ) { return false; } return wp_is_site_url_using_https(); } /** * Checks whether the current site URL is using HTTPS. * * @since 5.7.0 * @see home_url() * * @return bool True if using HTTPS, false otherwise. */ function wp_is_home_url_using_https() { return 'https' === wp_parse_url( home_url(), PHP_URL_SCHEME ); } /** * Checks whether the current site's URL where WordPress is stored is using HTTPS. * * This checks the URL where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) * are accessible. * * @since 5.7.0 * @see site_url() * * @return bool True if using HTTPS, false otherwise. */ function wp_is_site_url_using_https() { // Use direct option access for 'siteurl' and manually run the 'site_url' // filter because `site_url()` will adjust the scheme based on what the // current request is using. /** This filter is documented in wp-includes/link-template.php */ $site_url = apply_filters( 'site_url', get_option( 'siteurl' ), '', null, null ); return 'https' === wp_parse_url( $site_url, PHP_URL_SCHEME ); } /** * Checks whether HTTPS is supported for the server and domain. * * @since 5.7.0 * * @return bool True if HTTPS is supported, false otherwise. */ function wp_is_https_supported() { $https_detection_errors = get_option( 'https_detection_errors' ); // If option has never been set by the Cron hook before, run it on-the-fly as fallback. if ( false === $https_detection_errors ) { wp_update_https_detection_errors(); $https_detection_errors = get_option( 'https_detection_errors' ); } // If there are no detection errors, HTTPS is supported. return empty( $https_detection_errors ); } /** * Runs a remote HTTPS request to detect whether HTTPS supported, and stores potential errors. * * This internal function is called by a regular Cron hook to ensure HTTPS support is detected and maintained. * * @since 5.7.0 * @access private */ function wp_update_https_detection_errors() { /** * Short-circuits the process of detecting errors related to HTTPS support. * * Returning a `WP_Error` from the filter will effectively short-circuit the default logic of trying a remote * request to the site over HTTPS, storing the errors array from the returned `WP_Error` instead. * * @since 5.7.0 * * @param null|WP_Error $pre Error object to short-circuit detection, * or null to continue with the default behavior. */ $support_errors = apply_filters( 'pre_wp_update_https_detection_errors', null ); if ( is_wp_error( $support_errors ) ) { update_option( 'https_detection_errors', $support_errors->errors ); return; } $support_errors = new WP_Error(); $response = wp_remote_request( home_url( '/', 'https' ), array( 'headers' => array( 'Cache-Control' => 'no-cache', ), 'sslverify' => true, ) ); if ( is_wp_error( $response ) ) { $unverified_response = wp_remote_request( home_url( '/', 'https' ), array( 'headers' => array( 'Cache-Control' => 'no-cache', ), 'sslverify' => false, ) ); if ( is_wp_error( $unverified_response ) ) { $support_errors->add( 'https_request_failed', __( 'HTTPS request failed.' ) ); } else { $support_errors->add( 'ssl_verification_failed', __( 'SSL verification failed.' ) ); } $response = $unverified_response; } if ( ! is_wp_error( $response ) ) { if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { $support_errors->add( 'bad_response_code', wp_remote_retrieve_response_message( $response ) ); } elseif ( false === wp_is_local_html_output( wp_remote_retrieve_body( $response ) ) ) { $support_errors->add( 'bad_response_source', __( 'It looks like the response did not come from this site.' ) ); } } update_option( 'https_detection_errors', $support_errors->errors ); } /** * Schedules the Cron hook for detecting HTTPS support. * * @since 5.7.0 * @access private */ function wp_schedule_https_detection() { if ( wp_installing() ) { return; } if ( ! wp_next_scheduled( 'wp_https_detection' ) ) { wp_schedule_event( time(), 'twicedaily', 'wp_https_detection' ); } } /** * Disables SSL verification if the 'cron_request' arguments include an HTTPS URL. * * This prevents an issue if HTTPS breaks, where there would be a failed attempt to verify HTTPS. * * @since 5.7.0 * @access private * * @param array $request The cron request arguments. * @return array The filtered cron request arguments. */ function wp_cron_conditionally_prevent_sslverify( $request ) { if ( 'https' === wp_parse_url( $request['url'], PHP_URL_SCHEME ) ) { $request['args']['sslverify'] = false; } return $request; } /** * Checks whether a given HTML string is likely an output from this WordPress site. * * This function attempts to check for various common WordPress patterns whether they are included in the HTML string. * Since any of these actions may be disabled through third-party code, this function may also return null to indicate * that it was not possible to determine ownership. * * @since 5.7.0 * @access private * * @param string $html Full HTML output string, e.g. from a HTTP response. * @return bool|null True/false for whether HTML was generated by this site, null if unable to determine. */ function wp_is_local_html_output( $html ) { // 1. Check if HTML includes the site's Really Simple Discovery link. if ( has_action( 'wp_head', 'rsd_link' ) ) { $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( site_url( 'xmlrpc.php?rsd', 'rpc' ) ) ); // See rsd_link(). return false !== strpos( $html, $pattern ); } // 2. Check if HTML includes the site's Windows Live Writer manifest link. if ( has_action( 'wp_head', 'wlwmanifest_link' ) ) { // Try both HTTPS and HTTP since the URL depends on context. $pattern = preg_replace( '#^https?:(?=//)#', '', includes_url( 'wlwmanifest.xml' ) ); // See wlwmanifest_link(). return false !== strpos( $html, $pattern ); } // 3. Check if HTML includes the site's REST API link. if ( has_action( 'wp_head', 'rest_output_link_wp_head' ) ) { // Try both HTTPS and HTTP since the URL depends on context. $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( get_rest_url() ) ); // See rest_output_link_wp_head(). return false !== strpos( $html, $pattern ); } // Otherwise the result cannot be determined. return null; }
💾 Save Changes
📥 Download
🗑️ Delete