/** * What encoding types to accept and their priority values. * * @since 2.8.0 * * @param string $url * @param array $args * @return string Types of encoding to accept. */ public static function accept_encoding( $url, $args ) { $type = array(); $compression_enabled = self::is_available(); if ( ! $args['decompress'] ) { // Decompression specifically disabled. $compression_enabled = false; } elseif ( $args['stream'] ) { // Disable when streaming to file. $compression_enabled = false; } elseif ( isset( $args['limit_response_size'] ) ) { // If only partial content is being requested, we won't be able to decompress it. $compression_enabled = false; } if ( $compression_enabled ) { if ( function_exists( 'gzinflate' ) ) { $type[] = 'deflate;q=1.0'; } if ( function_exists( 'gzuncompress' ) ) { $type[] = 'compress;q=0.5'; } if ( function_exists( 'gzdecode' ) ) { $type[] = 'gzip;q=0.5'; } } /** * Filters the allowed encoding types. * * @since 3.6.0 * * @param string[] $type Array of what encoding types to accept and their priority values. * @param string $url URL of the HTTP request. * @param array $args HTTP request arguments. */ $type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args ); return implode( ', ', $type ); } /** * What encoding the content used when it was compressed to send in the headers. * * @since 2.8.0 * * @return string Content-Encoding string to send in the header. */ public static function content_encoding() { return 'deflate'; } /** * Whether the content be decoded based on the headers. * * @since 2.8.0 * * @param array|string $headers All of the available headers. * @return bool */ public static function should_decode( $headers ) { if ( is_array( $headers ) ) { if ( array_key_exists( 'content-encoding', $headers ) && ! empty( $headers['content-encoding'] ) ) { return true; } } elseif ( is_string( $headers ) ) { return ( stripos( $headers, 'content-encoding:' ) !== false ); } return false; } /** * Whether decompression and compression are supported by the PHP version. * * Each function is tested instead of checking for the zlib extension, to * ensure that the functions all exist in the PHP version and aren't * disabled. * * @since 2.8.0 * * @return bool */ public static function is_available() { return ( function_exists( 'gzuncompress' ) || function_exists( 'gzdeflate' ) || function_exists( 'gzinflate' ) ); } } ( $response ); $blocked = ( 200 !== $response_code ); } /** * Filters whether the REST API response is considered to be blocked. * * @since 6.6.3 * * @param bool $blocked Whether the REST API response is blocked. * @param array|WP_Error $response The response from the REST API. */ return apply_filters( 'tec_events_rest_api_response_blocked', $blocked, $response ); } /** * Checks if the WP_Error response is blocking. * * @since 6.6.3 * * @param WP_Error $response The response from the REST API. * * @return bool */ private function is_wp_error_response_blocking( WP_Error $response ): bool { switch ( $response->get_error_code() ) { case 'http_request_failed': $message = $response->get_error_message(); // If the site is in development mode, we allow cURL error 60. if ( str_starts_with( $message, 'cURL error 60' ) && $this->is_site_development_mode() ) { $blocked = false; } elseif ( str_starts_with( $message, 'cURL error 28: Operation timed out' ) ) { /** * Filters whether the REST API response is considered to be blocked due to a timeout. * * @since 6.6.3 * * @param bool $blocked Whether the REST API response is blocked. * @param WP_Error $response The response from the REST API. */ $blocked = (bool) apply_filters( 'tec_events_rest_api_response_blocked_due_to_timeout', false, $response ); } else { $blocked = true; } break; default: $blocked = true; break; } return $blocked; } /** * Get the routes to check for possible REST API blocking. * * @since 6.6.3 * * @return array */ private function get_routes_to_check(): array { $routes = []; $v1_main = tribe( 'tec.rest-v1.main' ); // Ensure that what we got from tribe() is the instance we expect. if ( $v1_main instanceof V1 ) { $routes[] = rest_url( $v1_main->get_events_route_namespace() ); } $routes[] = rest_url( V2::ROOT_NAMESPACE ); return $routes; } }
Fatal error: Uncaught Error: Call to a member function hook() on string in /htdocs/wp-content/plugins/the-events-calendar/src/Events/Admin/Notice/Provider.php:41 Stack trace: #0 /htdocs/wp-content/plugins/the-events-calendar/src/Events/Admin/Notice/Provider.php(31): TEC\Events\Admin\Notice\Provider->add_actions() #1 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(427): TEC\Events\Admin\Notice\Provider->register() #2 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(63): TEC\Common\lucatume\DI52\Container->register('TEC\\Events\\Admi...') #3 /htdocs/wp-content/plugins/the-events-calendar/src/Events/Controller.php(100): TEC\Common\Contracts\Container->register('TEC\\Events\\Admi...') #4 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Provider/Controller.php(48): TEC\Events\Controller->do_register() #5 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(427): TEC\Common\Contracts\Provider\Controller->register() #6 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(63): TEC\Common\lucatume\DI52\Container->register('TEC\\Events\\Cont...') #7 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Container.php(306): TEC\Common\Contracts\Container->register('TEC\\Events\\Cont...') #8 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Main.php(705): tribe_register_provider('TEC\\Events\\Cont...') #9 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Main.php(552): Tribe__Events__Main->bind_implementations() #10 /htdocs/wp-includes/class-wp-hook.php(324): Tribe__Events__Main->bootstrap('') #11 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #12 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #13 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Main.php(132): do_action('tribe_common_lo...') #14 /htdocs/wp-includes/class-wp-hook.php(324): Tribe__Main->plugins_loaded('') #15 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #16 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #17 /htdocs/wp-settings.php(578): do_action('plugins_loaded') #18 /htdocs/wp-config.php(101): require_once('/htdocs/wp-sett...') #19 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #20 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #21 /htdocs/index.php(17): require('/htdocs/wp-blog...') #22 {main} thrown in /htdocs/wp-content/plugins/the-events-calendar/src/Events/Admin/Notice/Provider.php on line 41