/home/techb158/public_html/wp-content/plugins/wordpress-seo/src/helpers
NameSizeModeActions
open-graph/-0755rm
schema/-0755rm
twitter/-0755rm
aioseo-helper.php12660644editdlrm
asset-helper.php25720644editdlrm
attachment-cleanup-helper.php22940644editdlrm
author-archive-helper.php53750644editdlrm
blocks-helper.php23780644editdlrm
capability-helper.php21160644editdlrm
crawl-cleanup-helper.php82940644editdlrm
curl-helper.php6550644editdlrm
current-page-helper.php165120644editdlrm
date-helper.php32080644editdlrm
environment-helper.php7930644editdlrm
first-time-configuration-notice-helper.php54860644editdlrm
home-url-helper.php6810644editdlrm
image-helper.php119720644editdlrm
import-cursor-helper.php13920644editdlrm
import-helper.php7160644editdlrm
indexable-helper.php94590644editdlrm
indexable-to-postmeta-helper.php96300644editdlrm
indexing-helper.php129920644editdlrm
language-helper.php27160644editdlrm
lock-helper.php29080644editdlrm
meta-helper.php29820644editdlrm
notification-helper.php20570644editdlrm
options-helper.php47580644editdlrm
pagination-helper.php58150644editdlrm
permalink-helper.php16410644editdlrm
post-helper.php55530644editdlrm
post-type-helper.php73500644editdlrm
primary-term-helper.php13980644editdlrm
product-helper.php11030644editdlrm
redirect-helper.php17680644editdlrm
require-file-helper.php3260644editdlrm
robots-helper.php17770644editdlrm
robots-txt-helper.php34780644editdlrm
route-helper.php6940644editdlrm
sanitization-helper.php10560644editdlrm
score-icon-helper.php28460644editdlrm
short-link-helper.php36070644editdlrm
site-helper.php5660644editdlrm
social-profiles-helper.php109910644editdlrm
string-helper.php12180644editdlrm
taxonomy-helper.php51000644editdlrm
url-helper.php83240644editdlrm
user-helper.php40260644editdlrm
wincher-helper.php25690644editdlrm
woocommerce-helper.php13020644editdlrm
wordpress-helper.php5120644editdlrm
wpdb-helper.php9370644editdlrm
Edit: /home/techb158/public_html/wp-content/plugins/wordpress-seo/src/helpers/lock-helper.php (2908B)
store = $store; } /** * Acquires a lock, executes the callback, and releases the lock. * * @template T * * @param string $lock_key The lock key. * @param callable(): T $callback The callback to execute while holding the lock. * @param int $ttl_in_seconds The lock TTL in seconds. Defaults to 30. * @param int $max_attempts The maximum number of acquisition attempts. Defaults to 5. * @param int $retry_delay_microseconds The delay between attempts in microseconds. Defaults to 20000 (20ms). * * @return T The callback's return value. * @throws Lock_Timeout_Exception When the lock cannot be acquired within the allowed attempts. */ public function execute( string $lock_key, callable $callback, int $ttl_in_seconds = 30, int $max_attempts = 5, int $retry_delay_microseconds = 20_000 ) { $this->acquire( $lock_key, $ttl_in_seconds, $max_attempts, $retry_delay_microseconds ); try { return $callback(); } finally { $this->store->delete_for_multisite( $lock_key ); } } /** * Attempts to acquire the lock with retries. * * @param string $lock_key The lock key. * @param int $ttl_in_seconds The lock TTL in seconds. * @param int $max_attempts The maximum number of attempts. * @param int $retry_delay_microseconds The delay between attempts in microseconds. * * @return void * @throws Lock_Timeout_Exception When all attempts are exhausted. */ private function acquire( string $lock_key, int $ttl_in_seconds, int $max_attempts, int $retry_delay_microseconds ): void { for ( $attempt = 1; $attempt <= $max_attempts; $attempt++ ) { if ( $this->store->persist_if_absent_for_multisite( $lock_key, true, $ttl_in_seconds ) ) { return; } if ( $attempt < $max_attempts ) { \usleep( $retry_delay_microseconds ); } } // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- This is an exception message, not output. throw new Lock_Timeout_Exception( $lock_key, $max_attempts ); } }