golden hour
/var/www/html/wp-content/plugins/the-events-calendar/common/src/Tribe
⬆️ Go Up
Upload
File/Folder
Size
Actions
Abstract_Deactivation.php
1.65 KB
Del
OK
Abstract_Plugin_Register.php
1.25 KB
Del
OK
Admin
-
Del
OK
Ajax
-
Del
OK
App_Shop.php
9.87 KB
Del
OK
Asset
-
Del
OK
Assets.php
24.69 KB
Del
OK
Assets_Pipeline.php
1.7 KB
Del
OK
Autoloader.php
8.31 KB
Del
OK
Cache.php
18.13 KB
Del
OK
Cache_Listener.php
5.92 KB
Del
OK
Changelog_Reader.php
1.5 KB
Del
OK
Container.php
11.36 KB
Del
OK
Context
-
Del
OK
Context.php
48.65 KB
Del
OK
Cost_Utils.php
16.44 KB
Del
OK
Credits.php
2.9 KB
Del
OK
Customizer
-
Del
OK
Customizer.php
25.29 KB
Del
OK
DB_Lock.php
10.04 KB
Del
OK
Data.php
5.21 KB
Del
OK
Date_Utils.php
48.59 KB
Del
OK
Db.php
876 B
Del
OK
Debug.php
1.54 KB
Del
OK
Debug_Bar
-
Del
OK
Dependency.php
16.47 KB
Del
OK
Deprecation.php
4.84 KB
Del
OK
Dialog
-
Del
OK
Documentation
-
Del
OK
Duplicate
-
Del
OK
Editor
-
Del
OK
Editor.php
6.58 KB
Del
OK
Error.php
4.51 KB
Del
OK
Exception.php
2.08 KB
Del
OK
Extension.php
13 KB
Del
OK
Extension_Loader.php
3.96 KB
Del
OK
Feature_Detection.php
7.51 KB
Del
OK
Field.php
22.38 KB
Del
OK
Field_Conditional.php
2.37 KB
Del
OK
Freemius.php
1.34 KB
Del
OK
Image
-
Del
OK
JSON_LD
-
Del
OK
Languages
-
Del
OK
Log
-
Del
OK
Log.php
11.33 KB
Del
OK
Main.php
23.13 KB
Del
OK
Meta
-
Del
OK
Models
-
Del
OK
Notices.php
1.49 KB
Del
OK
PUE
-
Del
OK
Plugin_Meta_Links.php
3.45 KB
Del
OK
Plugins.php
5.32 KB
Del
OK
Plugins_API.php
12.2 KB
Del
OK
Post_History.php
2.96 KB
Del
OK
Post_Transient.php
5.76 KB
Del
OK
Process
-
Del
OK
Promise.php
9.04 KB
Del
OK
Promoter
-
Del
OK
REST
-
Del
OK
Repository
-
Del
OK
Repository.php
100.06 KB
Del
OK
Rewrite.php
34.63 KB
Del
OK
Service_Providers
-
Del
OK
Settings.php
23.81 KB
Del
OK
Settings_Manager.php
9.78 KB
Del
OK
Settings_Tab.php
6.93 KB
Del
OK
Shortcode
-
Del
OK
Simple_Table.php
4.01 KB
Del
OK
Support
-
Del
OK
Support.php
14.43 KB
Del
OK
Tabbed_View
-
Del
OK
Tabbed_View.php
8.1 KB
Del
OK
Template.php
43.65 KB
Del
OK
Template_Factory.php
5.45 KB
Del
OK
Template_Part_Cache.php
2.74 KB
Del
OK
Templates.php
1.79 KB
Del
OK
Terms.php
1.51 KB
Del
OK
Timezones.php
18.21 KB
Del
OK
Tooltip
-
Del
OK
Tracker.php
12.51 KB
Del
OK
Traits
-
Del
OK
Updater.php
3.78 KB
Del
OK
Utils
-
Del
OK
Validate.php
16.54 KB
Del
OK
Validator
-
Del
OK
View_Helpers.php
9.64 KB
Del
OK
Widget
-
Del
OK
Edit: Feature_Detection.php
<?php /** * An abstraction layer to handle feature detection queries the plugin components * might need. * * @since 4.7.23 */ use Tribe__Utils__Array as Arr; /** * Class Tribe__Feature_Detection * * @since 4.7.23 */ class Tribe__Feature_Detection { /** * The name of the transient storing the support check results. * * @var string */ public static $transient = 'tribe_feature_detection'; /** * A set of example byte sizes of result sets. * * @since 4.10.2 * * @var array */ public static $example_size = [ 'post_result' => 6000, ]; /** * The name of the option that will be used to indicate a feature detection is running. * * @var string */ protected $lock_option_name; /** * Checks whether async, AJAX-based, background processing is supported or not. * * To avoid making this costly check on each load the result of this check is cached * in the `tribe_feature_detection` transient, under the `supports_async_process` key. * * @since 4.7.23 * * @param bool $force Whether to use the cache value, if available, or force the check * to be made again. * * @return bool Whether async, AJAX-based, background processing is supported or not. */ public function supports_async_process( $force = false ) { /** * Filters whether async, AJAX-based, processing is supported or not. * * Returning a non `null` value here will make this method bail and * return the filtered value immediately. * * @since 4.7.23 * * @param bool $supports_async_process Whether async, AJAX-based, processing is supported or not. * @param bool $force Whether the check is forcing the cached value to be refreshed * or not. */ $supports_async_process = apply_filters( 'tribe_supports_async_process', null, $force ); if ( null !== $supports_async_process ) { return (bool) $supports_async_process; } $cached = get_transient( self::$transient ); $this->lock_option_name = 'tribe_feature_support_check_lock'; if ( $force || false === $cached || ( is_array( $cached ) && ! isset( $cached['supports_async_process'] ) ) ) { if ( $this->is_locked() ) { // We're already running this check, bail and return the safe option for the time being. return false; } // Let's avoid race conditions by running two or more checks at the same time. $this->lock(); // Log that we're checking for AJAX-based async process support using the tester. tribe( 'logger' )->log( 'Checking for AJAX-based async processing support triggering a test request.', Tribe__Log::DEBUG ); /* * Build and dispatch the tester: if it works a transient should be set. */ $tester = new Tribe__Process__Tester(); tribe( 'logger' )->log( 'Dispatching AJAX-based async processing support test request.', Tribe__Log::DEBUG ); $tester->dispatch(); $wait_up_to = 10; $start = time(); $supports_async_process = false; $transient_name = Tribe__Process__Tester::TRANSIENT_NAME; while ( time() <= $start + $wait_up_to ) { // We want to force a refetch from the database on each check. wp_cache_delete( $transient_name, 'transient' ); $supports_async_process = (bool) get_transient( $transient_name ); if ( $supports_async_process ) { break; } sleep( $wait_up_to / 5 ); } // Remove it not to spoof future checks. delete_transient( $transient_name ); $this->unlock(); $cached['supports_async_process'] = $supports_async_process; if ( $supports_async_process ) { tribe( 'logger' )->log( 'AJAX-based async processing is supported.', Tribe__Log::DEBUG ); } else { tribe( 'logger' )->log( 'AJAX-based async processing is not supported; background processing will rely on WP Cron.', Tribe__Log::DEBUG ); } set_transient( self::$transient, $cached, WEEK_IN_SECONDS ); } return $cached['supports_async_process']; } /** * Sets the lock option to `1` to indicate a feature detection is running. * * @since 4.8.1 */ protected function lock() { update_option( $this->lock_option_name, '1' ); } /** * Deletes the lock option to indicate the current feature detection process is done. * * @since 4.8.1 */ protected function unlock() { delete_option( $this->lock_option_name ); } /** * Checks whether a feature detection lock is currently in place or not. * * @since 4.8.1 * * @return bool Whether a feature detection lock is currently in place or not. */ protected function is_locked() { $lock_option = get_option( $this->lock_option_name ); return ! empty( $lock_option ); } /** * Returns the value of the `max_allowed_packet` MYSQL variable, if set, or a default value. * * @since 4.10.2 * * @return int The byte size of the `max_allowed_packet` MYSQL variable. */ public function get_mysql_max_packet_size() { /** * Filters the value of the `max_allowed_packet` variable before it's read from the database. * * If the value returned from this filter is not `null`, then it will be assumed to be the value. * * @since 4.10.2 * * @param int $mysql_max_packet_size The value of the `max_allowed_packet` variable, initially `null`. */ $mysql_max_packet_size = apply_filters( 'tribe_max_allowed_packet_size', null ); if ( null !== $mysql_max_packet_size ) { return absint( $mysql_max_packet_size ); } /** @var Tribe__Cache $cache */ $cache = tribe( 'cache' ); $cached = $cache->get( 'max_allowed_packet' ); if ( false !== $cached ) { return $cached; } global $wpdb; $mysql_max_packet_size = $wpdb->get_var( "SHOW VARIABLES LIKE 'max_allowed_packet'", 1 ); // At min set it to 2 MBs. $mysql_max_packet_size = absint( max( absint( $mysql_max_packet_size ), 2097152 ) ); $cache->set( 'max_allowed_packet', $mysql_max_packet_size, WEEK_IN_SECONDS ); return $mysql_max_packet_size; } /** * Returns the suggested SQL LIMIT value, based on the `max_allowed_packet` size and example string length. * * This is useful to size "reasonable" LIMITs when dealing with either very long queries or potentially long * result sets. * * @since 4.10.2 * * @param string $example_string The example string. * * @return int The suggested LIMIT value. */ public function mysql_limit_for_string( $example_string ) { $byte_size = function_exists( 'mb_strlen' ) ? mb_strlen( $example_string ) : strlen( $example_string ); return $this->mysql_limit_for_size( $byte_size ); } /** * Returns the SQL LIMIT for a byte size, in relation to the `max_allowed_packet` value. * * @since 4.10.2 * * @param int $byte_size The byte size to check. * * @return int The SQL LIMIT value. */ public function mysql_limit_for_size( $byte_size ) { return absint( floor( $this->get_mysql_max_packet_size() / $byte_size ) * 0.8 ); } /** * Provides the SQL LIMIT value, in relation to the `max_allowed_packet` value, for a pre-existing example. * * Defaults to the complete post result example string if the example is not found. * * @since 4.10.2 * * @param string $example The name of the example to return. See the `Tribe__Feature_Detection::$example_sizes` * prop for the available examples. Defaults to the `post_result` one. * * @return int The SQL LIMIT value for the example. */ public function mysql_limit_for_example( $example ) { $example_size = Arr::get( static::$example_size, $example, static::$example_size['post_result'] ); return $this->mysql_limit_for_size( $example_size ); } }
Save