`ro1719481396.M966890P1078671.r24,S=429045,W=435010Ml``ro1719484580.M278349P1105360.r24,S=54261,W=54985Nl`ro1719484822.M600274P1106979.r24,S=4987799,W=5052625Pl`ro1719487003.M828331P1124555.r24,S=62194,W=63686Ql@aro1719488025.M530424P1131637.r24,S=41710,W=42319Rlaro1719491419.M131176P1163187.r24,S=18333,W=18751Slaro1719493733.M45812P1183758.r24,S=12453,W=12735Tlbro1719496132.M729389P1201049.r24,S=7724,W=7882Ul`bro1719497363.M218000P1216594.r24,S=9218,W=9345Vlbro1719499576.M98639P1232329.r24,S=19282,W=19774Wlbro1719501296.M106303P1246078.r24,S=22595,W=23117Xl8cro1719502413.M4128P1252613.r24,S=653854,W=662422Ylcro1719502722.M505844P1254597.r24,S=9468,W=9634Zlcro1719502752.M686852P1254765.r24,S=221660,W=224601[ldro1719508041.M34448P1292828.r24,S=11457,W=11715_l`dro1719524241.M450019P1435791.r24,S=137952,W=141768dldro1719547213.M165116P1689613.r24,S=3287,W=3352eldro1719547585.M180410P1692096.r24,S=4885,W=4969fl@ero1719551068.M656311P1780450.r24,S=13093,W=13327glero1719553144.M205886P2023801.r24,S=22837,W=23167hlero1719553295.M607067P2030294.r24,S=45932,W=46547ilfro1719553672.M516777P2046123.r24,S=68207,W=69143jl`fro1719555516.M58691P2236371.r24,S=15162,W=15432klfro1719557379.M394978P2566503.r24,S=15435,W=15712llfro1719558227.M419820P2715131.r24,S=39580,W=40111ml8gro1719558742.M38957P2820094.r24,S=107009,W=108509nlgro1719562210.M425137P3215872.r24,S=102808,W=104679rlgro1719565595.M199143P3382840.r24,S=56044,W=56791slhro1719566707.M514331P3390266.r24,S=94237,W=95580vl`hro1719569358.M19600P3412950.r24,S=10256,W=10569wlhro1719570945.M689493P3425064.r24,S=9715,W=9903xlhro1719571794.M66730P3431614.r24,S=4427931,W=4485908yl@iro1719577957.M231048P3474709.r24,S=47561,W=48201zliro1719578263.M541124P3476747.r24,S=105665,W=107477{liro1719579070.M261123P3486515.r24,S=9582,W=9767}l jro1719582558.M664500P3516210.r24,S=22193,W=22500~lhjro1719583518.M496773P3523331.r24,S=105957,W=107505ljro1719586704.M270208P3546759.r24,S=15945,W=16170lkro1719594979.M516177P3598030.r24,S=9611,W=9797lHkro1719603083.M151055P3641900.r24,S=9559,W=9745lkro1719607359.M938441P3664824.r24,S=57552,W=58319lkro1719614189.M468833P3709430.r24,S=56018,W=56765l lro1719615643.M760357P3719033.r24,S=56460,W=57203lhlro1719616512.M339678P3725059.r24,S=1306543,W=1323546llro1719633613.M243439P3909717.r24,S=3287,W=3352lmro1719639025.M489578P4187913.r24,S=106307,W=107791lPmro1719640702.M550142P159878.r24,S=9679,W=9867lmro1719644550.M884354P799584.r24,S=39583,W=40115lmro1719644556.M491060P799664.r24,S=39577,W=40109l(nro1719645283.M655023P884825.r24,S=11039,W=11257lpnro1719678174.M898583P1529139.r24,S=10412,W=10617lnro1719711551.M416607P1795180.r24,S=458954,W=465629loro1719720013.M106469P1913879.r24,S=3288,W=3353lPoro1719726464.M187492P2317392.r24,S=451830,W=457716loro1719736327.M677762P3620234.r24,S=14689,W=14964loro1719736546.M436189P36220 * * @since 5.0.6 * * @param mixed $value If anything diff than null it will short-circuit. * @param string $key Key for the option we are trying to get. * @param mixed $default Default value when the option is either expired or not-set. * @param bool $force If we should expire cache and fetch from the database. * @param bool $cache If the value was pulled from cache. */ return apply_filters( 'tec_common_timed_option_value', $this->data[ $key ]['value'], $key, $default, $force, true ); } $timed_option = null; if ( $this->is_active() ) { $timed_option_name = $this->get_option_name( $key ); if ( true === $force ) { wp_cache_delete( $timed_option_name, 'options' ); } $timed_option = get_option( $timed_option_name, null ); } // Bail with default when non-existent. if ( empty( $timed_option ) ) { if ( $this->is_active() ) { // Avoids next request check, forces auto-loading. $this->set( $key, null, 0 ); } return $default; } // Bail with default when expired. if ( $time >= $timed_option['expiration'] ) { $this->delete( $key ); return $default; } $this->data[ $key ] = $timed_option; /** * Allows the filtering of the value of the timed option. * * @since 5.0.6 * * @param mixed $value If anything diff than null it will short-circuit. * @param string $key Key for the option we are trying to get. * @param mixed $default Default value when the option is either expired or not-set. * @param bool $force If we should expire cache and fetch from the database. * @param bool $cache If the value was pulled from cache. */ return apply_filters( 'tec_common_timed_option_value', $timed_option['value'], $key, $default, $force, false ); } /** * Delete a given timed option based on a key. * Will also clear local cache. * * @since 5.0.6 * * @param string $key Which timed option we are checking. * * @return bool */ public function delete( $key ): bool { $key = (string) $key; $updated = false; if ( $this->is_active() ) { $timed_option_name = $this->get_option_name( $key ); $updated = update_option( $timed_option_name, null, true ); wp_cache_delete( $timed_option_name, 'options' ); } // Bail with default when non-existent. if ( ! isset( $this->data[ $key ] ) ) { return $updated; } unset( $this->data[ $key ] ); return $updated; } /** * Checks if a given timed option exists. * * @since 5.0.6 * * @param string $key Which timed option we are checking. * @param bool $force Clears the cache before get_option() * * @return bool */ public function exists( $key, bool $force = false ): bool { /** * Allows the filtering to short-circuit the whole exists logic. * * @since 5.0.6 * * @param mixed|null $pre If anything diff than null it will short-circuit. * @param string $key Key for the option we are trying to get. * @param bool $force If we should expire cache and fetch from the database. */ $pre = apply_filters( 'tec_common_timed_option_pre_exists', null, $key, $force ); if ( null !== $pre ) { return (bool) $pre; } $time = time(); $cached = false; $timed_option = null; // If we have a stored value that is not expired, use it. if ( ! $force && isset( $this->data[ $key ] ) && is_numeric( $this->data[ $key ]['expiration'] ) && $time < $this->data[ $key ]['expiration'] ) { $cached = true; $timed_option = $this->data[ $key ]; } elseif ( $this->is_active() ) { $timed_option_name = $this->get_option_name( $key ); if ( true === $force ) { wp_cache_delete( $timed_option_name, 'options' ); } $timed_option = get_option( $timed_option_name, null ); } $exists = true; if ( null === $timed_option ) { $exists = false; } if ( ! is_array( $timed_option ) ) { $exists = false; } if ( ! isset( $timed_option['expiration'] ) || ! is_numeric( $timed_option['expiration'] ) ) { $exists = false; } /** * Does a particular timed option key exists. * * @since 5.0.6 * * @param mixed $exists If anything diff than null it will short-circuit. * @param string $key Key for the option we are trying to get. * @param bool $force If we should expire cache and fetch from the database. * @param bool $cached If the value was pulled from cache. */ return (bool) apply_filters( 'tec_common_timed_option_exists', $exists, $key, $force, $cached ); } /** * Update the value of a timed option on the database and on local cache. * * @since 5.0.6 * * @param string $key Key for this option. * @param mixed $value Value stored for this option. * @param int $expiration Expiration in seconds for this timed option. * * @return bool */ public function set( $key, $value, int $expiration = DAY_IN_SECONDS ): bool { $key = (string) $key; $data = [ 'key' => $key, 'value' => $value, 'expiration' => time() + $expiration, ]; $this->data[ $key ] = $data; $updated = true; if ( $this->is_active() ) { $updated = update_option( $this->get_option_name( $key ), $data, true ); } return $updated; } }