/
home
/
techb158
/
public_html
/
wp-content
/
plugins
/
wordpress-seo
/
src
/
helpers
/
/home/techb158/public_html/wp-content/plugins/wordpress-seo/src/helpers
mkdir
upload
Name
Size
Mode
Actions
open-graph/
-
0755
rm
schema/
-
0755
rm
twitter/
-
0755
rm
aioseo-helper.php
1266
0644
edit
dl
rm
asset-helper.php
2572
0644
edit
dl
rm
attachment-cleanup-helper.php
2294
0644
edit
dl
rm
author-archive-helper.php
5375
0644
edit
dl
rm
blocks-helper.php
2378
0644
edit
dl
rm
capability-helper.php
2116
0644
edit
dl
rm
crawl-cleanup-helper.php
8294
0644
edit
dl
rm
curl-helper.php
655
0644
edit
dl
rm
current-page-helper.php
16512
0644
edit
dl
rm
date-helper.php
3208
0644
edit
dl
rm
environment-helper.php
793
0644
edit
dl
rm
first-time-configuration-notice-helper.php
5486
0644
edit
dl
rm
home-url-helper.php
681
0644
edit
dl
rm
image-helper.php
11972
0644
edit
dl
rm
import-cursor-helper.php
1392
0644
edit
dl
rm
import-helper.php
716
0644
edit
dl
rm
indexable-helper.php
9459
0644
edit
dl
rm
indexable-to-postmeta-helper.php
9630
0644
edit
dl
rm
indexing-helper.php
12992
0644
edit
dl
rm
language-helper.php
2716
0644
edit
dl
rm
lock-helper.php
2908
0644
edit
dl
rm
meta-helper.php
2982
0644
edit
dl
rm
notification-helper.php
2057
0644
edit
dl
rm
options-helper.php
4758
0644
edit
dl
rm
pagination-helper.php
5815
0644
edit
dl
rm
permalink-helper.php
1641
0644
edit
dl
rm
post-helper.php
5553
0644
edit
dl
rm
post-type-helper.php
7350
0644
edit
dl
rm
primary-term-helper.php
1398
0644
edit
dl
rm
product-helper.php
1103
0644
edit
dl
rm
redirect-helper.php
1768
0644
edit
dl
rm
require-file-helper.php
326
0644
edit
dl
rm
robots-helper.php
1777
0644
edit
dl
rm
robots-txt-helper.php
3478
0644
edit
dl
rm
route-helper.php
694
0644
edit
dl
rm
sanitization-helper.php
1056
0644
edit
dl
rm
score-icon-helper.php
2846
0644
edit
dl
rm
short-link-helper.php
3607
0644
edit
dl
rm
site-helper.php
566
0644
edit
dl
rm
social-profiles-helper.php
10991
0644
edit
dl
rm
string-helper.php
1218
0644
edit
dl
rm
taxonomy-helper.php
5100
0644
edit
dl
rm
url-helper.php
8324
0644
edit
dl
rm
user-helper.php
4026
0644
edit
dl
rm
wincher-helper.php
2569
0644
edit
dl
rm
woocommerce-helper.php
1302
0644
edit
dl
rm
wordpress-helper.php
512
0644
edit
dl
rm
wpdb-helper.php
937
0644
edit
dl
rm
Edit:
/home/techb158/public_html/wp-content/plugins/wordpress-seo/src/helpers/lock-helper.php
(2908B)
<?php namespace Yoast\WP\SEO\Helpers; use Yoast\WP\SEO\Exceptions\Locking\Lock_Timeout_Exception; use Yoast\WP\SEO\Expiring_Store\Application\Expiring_Store; /** * Distributed exclusive lock backed by the expiring store. * * Acquires a network-scoped lock in the expiring store table, executes the * callback, and releases the lock in a finally block. * * The lock has a TTL so that it self-expires if the owning process crashes without * releasing it. Other processes retry with a configurable delay between attempts. */ class Lock_Helper { /** * The expiring store. * * @var Expiring_Store */ private $store; /** * The constructor. * * @param Expiring_Store $store The expiring store. */ public function __construct( Expiring_Store $store ) { $this->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 ); } }
Save
cmd:
run