Changeset 3385612
- Timestamp:
- 10/28/2025 06:20:42 AM (3 months ago)
- Location:
- noncensible
- Files:
-
- 4 added
- 4 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from noncensible/trunk)
-
tags/1.2.0/languages (added)
-
tags/1.2.0/languages/noncensible.pot (added)
-
tags/1.2.0/noncensible.php (modified) (3 diffs)
-
tags/1.2.0/readme.txt (modified) (3 diffs)
-
trunk/languages (added)
-
trunk/languages/noncensible.pot (added)
-
trunk/noncensible.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
noncensible/tags/1.2.0/noncensible.php
r3081801 r3385612 3 3 Plugin Name: Noncensible 4 4 Description: Plugs some default WordPress functions to ensure nonces have a guaranteed lifespan. This ensures forms, actions, and URLs do not expire prematurely. 5 Version: 1. 1.05 Version: 1.2.0 6 6 Requires at least: 2.5.0 7 7 Requires PHP: 5.4.0 … … 11 11 */ 12 12 13 const NONCENSIBLE_TICKS_PER_NONCE_LIFE = 8; 13 if (!defined('NONCENSIBLE_TICKS_PER_NONCE_LIFE')) { 14 define('NONCENSIBLE_TICKS_PER_NONCE_LIFE', 8); 15 } 14 16 15 17 if ( 16 !( 18 is_int(NONCENSIBLE_TICKS_PER_NONCE_LIFE) 19 && !( 17 20 function_exists('wp_nonce_tick') 18 21 || function_exists('wp_verify_nonce') … … 23 26 * Returns the time-dependent variable for nonce creation. 24 27 * 25 * A nonce has a lifespan of eight ticks . Nonces in their fifth tick onwards26 * (equivalent to core's second tick) may be updated, e.g. by autosave.28 * A nonce has a lifespan of eight ticks (by default). Nonces in the second half of 29 * their lifespan (equivalent to core's second tick) may be updated, e.g. by autosave. 27 30 * 28 31 * @return float Float value rounded up to the next highest integer. -
noncensible/tags/1.2.0/readme.txt
r3081798 r3385612 3 3 Tags: nonce, optimize, cache, performance, stability, security 4 4 Requires at least: 2.5.0 5 Tested up to: 6. 5.26 Stable tag: 1. 1.05 Tested up to: 6.8.3 6 Stable tag: 1.2.0 7 7 Requires PHP: 5.4.0 8 8 License: GPLv2 or later … … 15 15 The core functions' documentation states that nonces, small validity tokens used throughout WordPress core and other plugins, have a lifespan of 1 day, however they can last as little as half that time. For common usage that may not be a problem, but if that lifespan is relied upon in any meaningful way, inexplicable failures can occur. For example, filters that shorten the lifespan may randomly make it difficult to complete some tasks before their nonce expires. Very long lifespans, such as those set by many caching and SEO optimization plugins, can result in forms and other actions suddenly breaking before the cached content expires and new nonces get generated. Imagine a contact form that's cached for a week but stops working after 4 days, then starts working again if that cache is cleared. A cursory search for terms like `caching nonce expired wordpress` yields many results for relevant problems. 16 16 17 This plugin guarantees a nonce will last _at least_ as long as it's intended to, but up to ⅛ of a lifepsan more. By default, this means a nonce will last from 24 up to 27 hours, rather than anywhere from 12 to 24 hours. It was created because it was inappropriate to change the behaviour of such old code (in [ticket #53236](https://core.trac.wordpress.org/ticket/53236)) becausethe functions are pluggable.17 This plugin guarantees a nonce will last _at least_ as long as it's intended to, but up to ⅛ of a lifepsan more. By default, this means a nonce will last from 24 up to 27 hours, rather than anywhere from 12 to 24 hours. It was created because changing the behaviour of such old code was deemed inappropriate (in [ticket #53236](https://core.trac.wordpress.org/ticket/53236)), given the functions are pluggable. 18 18 19 19 Hourglass icon by [mavadee](https://www.flaticon.com/authors/mavadee). … … 23 23 1. Install the plugin in the usual way, through the admin interface by uploading manually or searching on the **Plugins** page. 24 24 2. Clear *all* caching plugins' content. 25 3. Test that forms, etc. on your site are still working. You may need to force-reload affected pages , orclear your browser's cache.25 3. Test that forms, etc. on your site are still working. You may need to force-reload affected pages first, and clear your browser's cache. 26 26 27 27 == Changelog == 28 28 29 = 1.2.0 = 30 Make the `NONCENSIBLE_TICKS_PER_NONCE_LIFE` constant overridable in config, in case you want lower or higher resolution than 8, but still need the guaranteed lifespan. 31 29 32 = 1.1.0 = 30 33 Compatibility with WP v6.1: passing `wp_verify_nonce()`'s `$action` parameter to `wp_nonce_tick()`. -
noncensible/trunk/noncensible.php
r3081801 r3385612 3 3 Plugin Name: Noncensible 4 4 Description: Plugs some default WordPress functions to ensure nonces have a guaranteed lifespan. This ensures forms, actions, and URLs do not expire prematurely. 5 Version: 1. 1.05 Version: 1.2.0 6 6 Requires at least: 2.5.0 7 7 Requires PHP: 5.4.0 … … 11 11 */ 12 12 13 const NONCENSIBLE_TICKS_PER_NONCE_LIFE = 8; 13 if (!defined('NONCENSIBLE_TICKS_PER_NONCE_LIFE')) { 14 define('NONCENSIBLE_TICKS_PER_NONCE_LIFE', 8); 15 } 14 16 15 17 if ( 16 !( 18 is_int(NONCENSIBLE_TICKS_PER_NONCE_LIFE) 19 && !( 17 20 function_exists('wp_nonce_tick') 18 21 || function_exists('wp_verify_nonce') … … 23 26 * Returns the time-dependent variable for nonce creation. 24 27 * 25 * A nonce has a lifespan of eight ticks . Nonces in their fifth tick onwards26 * (equivalent to core's second tick) may be updated, e.g. by autosave.28 * A nonce has a lifespan of eight ticks (by default). Nonces in the second half of 29 * their lifespan (equivalent to core's second tick) may be updated, e.g. by autosave. 27 30 * 28 31 * @return float Float value rounded up to the next highest integer. -
noncensible/trunk/readme.txt
r3081798 r3385612 3 3 Tags: nonce, optimize, cache, performance, stability, security 4 4 Requires at least: 2.5.0 5 Tested up to: 6. 5.26 Stable tag: 1. 1.05 Tested up to: 6.8.3 6 Stable tag: 1.2.0 7 7 Requires PHP: 5.4.0 8 8 License: GPLv2 or later … … 15 15 The core functions' documentation states that nonces, small validity tokens used throughout WordPress core and other plugins, have a lifespan of 1 day, however they can last as little as half that time. For common usage that may not be a problem, but if that lifespan is relied upon in any meaningful way, inexplicable failures can occur. For example, filters that shorten the lifespan may randomly make it difficult to complete some tasks before their nonce expires. Very long lifespans, such as those set by many caching and SEO optimization plugins, can result in forms and other actions suddenly breaking before the cached content expires and new nonces get generated. Imagine a contact form that's cached for a week but stops working after 4 days, then starts working again if that cache is cleared. A cursory search for terms like `caching nonce expired wordpress` yields many results for relevant problems. 16 16 17 This plugin guarantees a nonce will last _at least_ as long as it's intended to, but up to ⅛ of a lifepsan more. By default, this means a nonce will last from 24 up to 27 hours, rather than anywhere from 12 to 24 hours. It was created because it was inappropriate to change the behaviour of such old code (in [ticket #53236](https://core.trac.wordpress.org/ticket/53236)) becausethe functions are pluggable.17 This plugin guarantees a nonce will last _at least_ as long as it's intended to, but up to ⅛ of a lifepsan more. By default, this means a nonce will last from 24 up to 27 hours, rather than anywhere from 12 to 24 hours. It was created because changing the behaviour of such old code was deemed inappropriate (in [ticket #53236](https://core.trac.wordpress.org/ticket/53236)), given the functions are pluggable. 18 18 19 19 Hourglass icon by [mavadee](https://www.flaticon.com/authors/mavadee). … … 23 23 1. Install the plugin in the usual way, through the admin interface by uploading manually or searching on the **Plugins** page. 24 24 2. Clear *all* caching plugins' content. 25 3. Test that forms, etc. on your site are still working. You may need to force-reload affected pages , orclear your browser's cache.25 3. Test that forms, etc. on your site are still working. You may need to force-reload affected pages first, and clear your browser's cache. 26 26 27 27 == Changelog == 28 28 29 = 1.2.0 = 30 Make the `NONCENSIBLE_TICKS_PER_NONCE_LIFE` constant overridable in config, in case you want lower or higher resolution than 8, but still need the guaranteed lifespan. 31 29 32 = 1.1.0 = 30 33 Compatibility with WP v6.1: passing `wp_verify_nonce()`'s `$action` parameter to `wp_nonce_tick()`.
Note: See TracChangeset
for help on using the changeset viewer.