From b59a0c045f34cb31ca00de169c6112aa6c1407dc Mon Sep 17 00:00:00 2001 From: Jan-Niclas Loosen Date: Mon, 19 Oct 2026 23:52:38 +0200 Subject: [PATCH] =?UTF-8?q?fix(audit=20L6,=20L5):=20DesignLock=20atomar=20?= =?UTF-8?q?(INSERT=20IGNORE,=20Token,=20=C3=9Cbernahme=20per=20UPDATE,=20R?= =?UTF-8?q?elease=20nur=20mit=20eigenem=20Token);=20Farben=20und=20Theme-O?= =?UTF-8?q?ptionen=20teilen=20eine=20Sperre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- src/Integrations/Divi/Design/DesignLock.php | 74 +++++++++++++---- src/Uninstaller.php | 2 +- tests/Support/LockTable.php | 61 ++++++++++++++ .../Divi/Design/DesignChangeTest.php | 45 ++++------ .../Divi/Design/DesignLockTest.php | 82 ++++++++++++------- .../Divi/Design/DiviColorsSetAbilityTest.php | 4 +- .../Design/DiviDesignDetachAbilityTest.php | 4 +- .../Design/DiviDesignRestoreAbilityTest.php | 4 +- .../Design/DiviPresetsDeleteAbilityTest.php | 4 +- .../Divi/Design/DiviPresetsSetAbilityTest.php | 4 +- .../DiviThemeOptionsUpdateAbilityTest.php | 4 +- .../Design/DiviVariablesSetAbilityTest.php | 4 +- tests/Unit/UninstallTest.php | 1 - tests/Unit/UninstallerTest.php | 1 - 14 files changed, 206 insertions(+), 88 deletions(-) create mode 100644 tests/Support/LockTable.php diff --git a/src/Integrations/Divi/Design/DesignLock.php b/src/Integrations/Divi/Design/DesignLock.php index aaaf926..747d1fb 100644 --- a/src/Integrations/Divi/Design/DesignLock.php +++ b/src/Integrations/Divi/Design/DesignLock.php @@ -9,9 +9,13 @@ use InvalidArgumentException; defined('ABSPATH') || exit; /** - * One confirmed change per design area at a time (final review I-5): an option lit_mcp_lock_ (never - * autoloaded) holds the time the lock was taken. add_option() is atomic – it fails while the option exists. A lock - * older than STALE_AFTER seconds (a request that died) is removed and taken once more. + * One confirmed change per lock at a time (final review I-5). Colors and theme options share ONE lock (audit L5): + * both rewrite the whole et_divi array through et_update_option(). The lock is a row lit_mcp_lock_ (never + * autoloaded) in the options table holding "