X7ROOT File Manager
Current Path:
/home/notabjze/pyirates.net/wp-content/plugins/woocommerce/includes
home
/
notabjze
/
pyirates.net
/
wp-content
/
plugins
/
woocommerce
/
includes
/
ðŸ“
..
ðŸ“
abstracts
ðŸ“
admin
ðŸ“
blocks
📄
class-wc-ajax.php
(114.64 KB)
📄
class-wc-auth.php
(12.69 KB)
📄
class-wc-autoloader.php
(3.13 KB)
📄
class-wc-background-emailer.php
(4.58 KB)
📄
class-wc-background-updater.php
(3.45 KB)
📄
class-wc-breadcrumb.php
(9.49 KB)
📄
class-wc-cache-helper.php
(11.17 KB)
📄
class-wc-cart-fees.php
(3.37 KB)
📄
class-wc-cart-session.php
(17.81 KB)
📄
class-wc-cart-totals.php
(28.25 KB)
📄
class-wc-cart.php
(66.4 KB)
📄
class-wc-checkout.php
(46.93 KB)
📄
class-wc-cli.php
(2.57 KB)
📄
class-wc-comments.php
(15.86 KB)
📄
class-wc-countries.php
(48.92 KB)
📄
class-wc-coupon.php
(37.88 KB)
📄
class-wc-customer-download-log.php
(3.37 KB)
📄
class-wc-customer-download.php
(10.34 KB)
📄
class-wc-customer.php
(29.68 KB)
📄
class-wc-data-exception.php
(1.29 KB)
📄
class-wc-data-store.php
(6.59 KB)
📄
class-wc-datetime.php
(2.26 KB)
📄
class-wc-deprecated-action-hooks.php
(6.59 KB)
📄
class-wc-deprecated-filter-hooks.php
(7.34 KB)
📄
class-wc-discounts.php
(35.04 KB)
📄
class-wc-download-handler.php
(28.38 KB)
📄
class-wc-emails.php
(25.09 KB)
📄
class-wc-embed.php
(4.18 KB)
📄
class-wc-form-handler.php
(44.65 KB)
📄
class-wc-frontend-scripts.php
(27.03 KB)
📄
class-wc-geo-ip.php
(30.41 KB)
📄
class-wc-geolite-integration.php
(1.99 KB)
📄
class-wc-geolocation.php
(10.44 KB)
📄
class-wc-https.php
(4.33 KB)
📄
class-wc-install.php
(100.99 KB)
📄
class-wc-integrations.php
(1.28 KB)
📄
class-wc-log-levels.php
(3.9 KB)
📄
class-wc-logger.php
(9.29 KB)
📄
class-wc-meta-data.php
(2.21 KB)
📄
class-wc-order-factory.php
(8.52 KB)
📄
class-wc-order-item-coupon.php
(4.08 KB)
📄
class-wc-order-item-fee.php
(8.85 KB)
📄
class-wc-order-item-meta.php
(5.8 KB)
📄
class-wc-order-item-product.php
(13.7 KB)
📄
class-wc-order-item-shipping.php
(7.85 KB)
📄
class-wc-order-item-tax.php
(6.49 KB)
📄
class-wc-order-item.php
(11.65 KB)
📄
class-wc-order-query.php
(2.55 KB)
📄
class-wc-order-refund.php
(5.63 KB)
📄
class-wc-order.php
(69.28 KB)
📄
class-wc-payment-gateways.php
(11.36 KB)
📄
class-wc-payment-tokens.php
(6.24 KB)
📄
class-wc-post-data.php
(20.89 KB)
📄
class-wc-post-types.php
(31.84 KB)
📄
class-wc-privacy-background-process.php
(1.67 KB)
📄
class-wc-privacy-erasers.php
(13.61 KB)
📄
class-wc-privacy-exporters.php
(14.69 KB)
📄
class-wc-privacy.php
(15.82 KB)
📄
class-wc-product-attribute.php
(6.97 KB)
📄
class-wc-product-download.php
(12.25 KB)
📄
class-wc-product-external.php
(4.84 KB)
📄
class-wc-product-factory.php
(3.58 KB)
📄
class-wc-product-grouped.php
(5.22 KB)
📄
class-wc-product-query.php
(2.18 KB)
📄
class-wc-product-simple.php
(2.64 KB)
📄
class-wc-product-variable.php
(22.07 KB)
📄
class-wc-product-variation.php
(16.87 KB)
📄
class-wc-query.php
(32.6 KB)
📄
class-wc-rate-limiter.php
(4 KB)
📄
class-wc-regenerate-images-request.php
(7.74 KB)
📄
class-wc-regenerate-images.php
(15.44 KB)
📄
class-wc-register-wp-admin-settings.php
(5.05 KB)
📄
class-wc-rest-authentication.php
(21.55 KB)
📄
class-wc-rest-exception.php
(276 B)
📄
class-wc-session-handler.php
(15.03 KB)
📄
class-wc-shipping-rate.php
(5.51 KB)
📄
class-wc-shipping-zone.php
(13.08 KB)
📄
class-wc-shipping-zones.php
(4.01 KB)
📄
class-wc-shipping.php
(11.57 KB)
📄
class-wc-shortcodes.php
(18.67 KB)
📄
class-wc-structured-data.php
(18.88 KB)
📄
class-wc-tax.php
(37.08 KB)
📄
class-wc-template-loader.php
(21.39 KB)
📄
class-wc-tracker.php
(37.42 KB)
📄
class-wc-validation.php
(5.79 KB)
📄
class-wc-webhook.php
(29.34 KB)
📄
class-woocommerce.php
(45.52 KB)
ðŸ“
cli
ðŸ“
customizer
ðŸ“
data-stores
ðŸ“
emails
ðŸ“
export
ðŸ“
gateways
ðŸ“
import
ðŸ“
integrations
ðŸ“
interfaces
ðŸ“
legacy
ðŸ“
libraries
ðŸ“
log-handlers
ðŸ“
payment-tokens
ðŸ“
product-usage
ðŸ“
queue
ðŸ“
react-admin
ðŸ“
rest-api
ðŸ“
shipping
ðŸ“
shortcodes
ðŸ“
theme-support
ðŸ“
tracks
ðŸ“
traits
ðŸ“
walkers
📄
wc-account-functions.php
(13.23 KB)
📄
wc-attribute-functions.php
(21.12 KB)
📄
wc-cart-functions.php
(19.9 KB)
📄
wc-conditional-functions.php
(13.92 KB)
📄
wc-core-functions.php
(80.68 KB)
📄
wc-coupon-functions.php
(2.75 KB)
📄
wc-deprecated-functions.php
(34.08 KB)
📄
wc-formatting-functions.php
(45.5 KB)
📄
wc-notice-functions.php
(8.02 KB)
📄
wc-order-functions.php
(38.93 KB)
📄
wc-order-item-functions.php
(5.03 KB)
📄
wc-page-functions.php
(8.3 KB)
📄
wc-product-functions.php
(53.13 KB)
📄
wc-rest-functions.php
(12.62 KB)
📄
wc-stock-functions.php
(16.64 KB)
📄
wc-template-functions.php
(123.9 KB)
📄
wc-template-hooks.php
(12.67 KB)
📄
wc-term-functions.php
(20.66 KB)
📄
wc-update-functions.php
(86.64 KB)
📄
wc-user-functions.php
(28.67 KB)
📄
wc-webhook-functions.php
(5.77 KB)
📄
wc-widget-functions.php
(2.01 KB)
ðŸ“
wccom-site
ðŸ“
widgets
Editing: class-wc-rate-limiter.php
<?php /** * Provide basic rate limiting functionality via WP Options API. * * Currently only provides a simple limit by delaying action by X seconds. * * Example usage: * * When an action runs, call set_rate_limit, e.g.: * * WC_Rate_Limiter::set_rate_limit( "{$my_action_name}_{$user_id}", $delay ); * * This sets a timestamp for future timestamp after which action can run again. * * * Then before running the action again, check if the action is allowed to run, e.g.: * * if ( WC_Rate_Limiter::retried_too_soon( "{$my_action_name}_{$user_id}" ) ) { * add_notice( 'Sorry, too soon!' ); * } * * @package WooCommerce\Classes * @version 3.9.0 * @since 3.9.0 */ defined( 'ABSPATH' ) || exit; /** * Rate limit class. */ class WC_Rate_Limiter { /** * Cache group. */ const CACHE_GROUP = 'wc_rate_limit'; /** * Hook in methods. */ public static function init() { add_action( 'woocommerce_cleanup_rate_limits', array( __CLASS__, 'cleanup' ) ); } /** * Constructs key name from action identifier. * Left in for backwards compatibility. * * @param string $action_id Identifier of the action. * @return string */ public static function storage_id( $action_id ) { return $action_id; } /** * Gets a cache prefix. * * @param string $action_id Identifier of the action. * @return string */ protected static function get_cache_key( $action_id ) { return WC_Cache_Helper::get_cache_prefix( 'rate_limit' . $action_id ); } /** * Retrieve a cached rate limit. * * @param string $action_id Identifier of the action. * @return bool|int */ protected static function get_cached( $action_id ) { return wp_cache_get( self::get_cache_key( $action_id ), self::CACHE_GROUP ); } /** * Cache a rate limit. * * @param string $action_id Identifier of the action. * @param int $expiry Timestamp when the limit expires. * @return bool */ protected static function set_cache( $action_id, $expiry ) { return wp_cache_set( self::get_cache_key( $action_id ), $expiry, self::CACHE_GROUP ); } /** * Returns true if the action is not allowed to be run by the rate limiter yet, false otherwise. * * @param string $action_id Identifier of the action. * @return bool */ public static function retried_too_soon( $action_id ) { global $wpdb; $next_try_allowed_at = self::get_cached( $action_id ); if ( false === $next_try_allowed_at ) { $next_try_allowed_at = $wpdb->get_var( $wpdb->prepare( " SELECT rate_limit_expiry FROM {$wpdb->prefix}wc_rate_limits WHERE rate_limit_key = %s ", $action_id ) ); self::set_cache( $action_id, $next_try_allowed_at ); } // No record of action running, so action is allowed to run. if ( null === $next_try_allowed_at ) { return false; } // Before the next run is allowed, retry forbidden. if ( time() <= $next_try_allowed_at ) { return true; } // After the next run is allowed, retry allowed. return false; } /** * Sets the rate limit delay in seconds for action with identifier $id. * * @param string $action_id Identifier of the action. * @param int $delay Delay in seconds. * @return bool True if the option setting was successful, false otherwise. */ public static function set_rate_limit( $action_id, $delay ) { global $wpdb; $next_try_allowed_at = time() + $delay; $result = $wpdb->replace( $wpdb->prefix . 'wc_rate_limits', array( 'rate_limit_key' => $action_id, 'rate_limit_expiry' => $next_try_allowed_at, ), array( '%s', '%d' ) ); self::set_cache( $action_id, $next_try_allowed_at ); return false !== $result; } /** * Cleanup expired rate limits from the database and clear caches. */ public static function cleanup() { global $wpdb; $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}wc_rate_limits WHERE rate_limit_expiry < %d", time() ) ); if ( class_exists( 'WC_Cache_Helper' ) ) { WC_Cache_Helper::invalidate_cache_group( self::CACHE_GROUP ); } } } WC_Rate_Limiter::init();
Upload File
Create Folder