Commit Graph

20 Commits

Author SHA1 Message Date
roykho fac6d3a246
Remove do_update_woocommerce query arg to prevent actions taken on it 2021-01-05 14:16:46 -08:00
roykho 4a2943d452
Defer nonce creation until displayed by WC Admin closes #27424 2020-12-04 13:17:24 -08:00
Christopher Allford 30d2e278b9 Replaced the deprecated `WC_Admin_Note` class 2020-11-12 13:26:30 -08:00
Konstantin Kovshenin a100ed67b2 Fix race conditions in WC_Install
In an environment with persistent object caching, concurrent calls
to delete_option() + add_option() can result in the option value
leaking out of the alloptions cache key, and into its own cache
item under the options group, while deleting the value from the
database.

This causes future function calls to add_option() to fail, since
the value already exists in cache (under the wrong key). It also
causes calls to delete_option() to fail, since the value is not
in the database.

This commit forces update_option() instead of the delete + add
combination, as well as removes multiple unnecessary calls to
update the woocommerce_db_version from admin notes and notices.
2020-09-17 11:59:50 +03:00
Claudio Sanches c9f52a45eb New wc_get_current_admin_url() function 2020-07-29 20:52:36 -03:00
Claudio Sanches e26076af7b Return to the current page after enabled or disabling db update notices 2020-07-29 20:37:27 -03:00
Claudio Sanches 2874915339
Merge pull request #26553 from szepeviktor/patch-2
Fix PHPDoc in WC_Notes_Run_Db_Update
2020-07-01 12:46:48 -03:00
Peter Fabian bb2cf2e8dc Removed deprecated method call. 2020-06-16 13:18:05 +02:00
Viktor Szépe 90c34a26a0
Fix PHPDoc in WC_Notes_Run_Db_Update
and correct a newbie mistake
2020-05-19 19:21:57 +02:00
Peter Fabian 0934f4a147 Merged should_show_notice and show_reminder and simplified logic.
Removed redundant calls to the same functions as this code runs on each admin pageload.
2020-05-15 10:24:30 +02:00
Peter Fabian 2f141eca77 PHPCS 2020-05-15 09:40:23 +02:00
Peter Fabian 50e386cbe8 Corrected the comment. 2020-05-15 09:26:17 +02:00
Peter Fabian 6b11451b88 Replaced repeated code from get_current_notice with the function call. 2020-05-13 16:36:09 +02:00
Peter Fabian a2f985414e Added freshness check also for 'done' notice. 2020-05-13 16:34:23 +02:00
Peter Fabian ed64c0c731 Y U no nonce here? 2020-05-13 16:33:27 +02:00
Peter Fabian eb0879cd1a Extracted actions to the beginning of the function to allow usage in note_up_to_date check. 2020-05-13 16:32:42 +02:00
Peter Fabian a7203ec4d0 Added clean up of duplicate notes, if there are any.
There has been some reports about duplicate notes in the db, so this should remove the duplicates and keep the first one.
2020-05-13 15:00:04 +02:00
vedanshujain 4b3977868b Display only wc-admin notices when enabled to avoid duplicate notices 2020-03-05 16:53:10 +05:30
Peter Fabian f3dceae5df Added more exclusions for the DB notice show_reminder method.
Also, moved `woocommerce_hide_update_notice` outside those exclusions in case
it would get triggered from cron or via AJAX.
2020-02-25 14:51:09 +01:00
Peter Fabian 7ec65a1b35 Added the WC Admin enabled db update notice. 2020-02-23 21:59:03 +01:00