Changeset 2941101
- Timestamp:
- 07/21/2023 05:20:27 AM (3 years ago)
- Location:
- wallets/trunk
- Files:
-
- 20 added
- 20 deleted
- 13 edited
-
adapters/abstract-wallet-adapter.php (modified) (1 diff)
-
adapters/class-bank-fiat-adapter.php (modified) (2 diffs)
-
adapters/class-bitcoin-core-like-wallet-adapter.php (modified) (1 diff)
-
admin/assets.php (modified) (7 diffs)
-
admin/dashboard.php (modified) (1 diff)
-
admin/migration.php (modified) (1 diff)
-
admin/settings.php (modified) (2 diffs)
-
assets/scripts/bs58check-6.1.7.min.js (deleted)
-
assets/scripts/bs58check-6.1.7.min.js.map (deleted)
-
assets/scripts/bs58check-6.1.8.min.js (added)
-
assets/scripts/bs58check-6.1.8.min.js.map (added)
-
assets/scripts/wallets-admin-capabilities-6.1.7.min.js (deleted)
-
assets/scripts/wallets-admin-capabilities-6.1.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-capabilities-6.1.8.min.js (added)
-
assets/scripts/wallets-admin-capabilities-6.1.8.min.js.map (added)
-
assets/scripts/wallets-admin-cs-tool-6.1.7.min.js (deleted)
-
assets/scripts/wallets-admin-cs-tool-6.1.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-cs-tool-6.1.8.min.js (added)
-
assets/scripts/wallets-admin-cs-tool-6.1.8.min.js.map (added)
-
assets/scripts/wallets-admin-dashboard-6.1.7.min.js (deleted)
-
assets/scripts/wallets-admin-dashboard-6.1.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-dashboard-6.1.8.min.js (added)
-
assets/scripts/wallets-admin-dashboard-6.1.8.min.js.map (added)
-
assets/scripts/wallets-admin-deposit-tool-6.1.7.min.js (deleted)
-
assets/scripts/wallets-admin-deposit-tool-6.1.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-deposit-tool-6.1.8.min.js (added)
-
assets/scripts/wallets-admin-deposit-tool-6.1.8.min.js.map (added)
-
assets/scripts/wallets-admin-docs-6.1.7.min.js (deleted)
-
assets/scripts/wallets-admin-docs-6.1.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-docs-6.1.8.min.js (added)
-
assets/scripts/wallets-admin-docs-6.1.8.min.js.map (added)
-
assets/scripts/wallets-admin-editor-6.1.7.min.js (deleted)
-
assets/scripts/wallets-admin-editor-6.1.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-editor-6.1.8.min.js (added)
-
assets/scripts/wallets-admin-editor-6.1.8.min.js.map (added)
-
assets/scripts/wallets-admin-menu-item-6.1.7.min.js (deleted)
-
assets/scripts/wallets-admin-menu-item-6.1.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-menu-item-6.1.8.min.js (added)
-
assets/scripts/wallets-admin-menu-item-6.1.8.min.js.map (added)
-
assets/scripts/wallets-front-6.1.7.min.js (deleted)
-
assets/scripts/wallets-front-6.1.7.min.js.map (deleted)
-
assets/scripts/wallets-front-6.1.8.min.js (added)
-
assets/scripts/wallets-front-6.1.8.min.js.map (added)
-
assets/styles/wallets-6.1.7.min.css (deleted)
-
assets/styles/wallets-6.1.8.min.css (added)
-
assets/styles/wallets-admin-6.1.7.min.css (deleted)
-
assets/styles/wallets-admin-6.1.8.min.css (added)
-
docs/migration.md (modified) (1 diff)
-
docs/settings.md (modified) (1 diff)
-
frontend/assets.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
uninstall.php (modified) (2 diffs)
-
wallets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wallets/trunk/adapters/abstract-wallet-adapter.php
r2912451 r2941101 353 353 } 354 354 355 // We don't want the plugin to be re-processing any deposits 356 // having timestamps earlier than the start of the last migration. 357 if ( $potential_deposit->timestamp ?? 0 ) { 358 $deposit_cutoff = get_ds_option( 'wallets_deposit_cutoff', 0 ); 359 if ( $deposit_cutoff ) { 360 if ( $potential_deposit->timestamp < $deposit_cutoff ) { 361 362 throw new \Exception( 363 sprintf( 364 '%s: Received deposit with timestamp %d which is earlier than deposit cutoff %d', 365 __METHOD__, 366 $potential_deposit->timestamp, 367 $deposit_cutoff 368 ) 369 ); 370 } 371 } 372 } 373 355 374 maybe_switch_blog(); 356 375 -
wallets/trunk/adapters/class-bank-fiat-adapter.php
r2940696 r2941101 158 158 159 159 public function get_wallet_version(): string { 160 return '6.1. 7';160 return '6.1.8'; 161 161 } 162 162 … … 683 683 get_asset_path( 'wallets-admin-deposit-tool' ), 684 684 [ 'jquery' ], 685 '6.1. 7',685 '6.1.8', 686 686 true 687 687 ); -
wallets/trunk/adapters/class-bitcoin-core-like-wallet-adapter.php
r2940696 r2941101 600 600 [ 601 601 'timeout' => absint( get_ds_option( 'wallets_http_timeout', 5 ) ), 602 'user-agent' => 'Bitcoin and Altcoin Wallets version 6.1. 7',602 'user-agent' => 'Bitcoin and Altcoin Wallets version 6.1.8', 603 603 'headers' => [ 604 604 'Accept-Encoding: gzip', -
wallets/trunk/admin/assets.php
r2940696 r2941101 22 22 get_asset_path( 'wallets-admin', 'style' ), 23 23 [], 24 '6.1. 7'24 '6.1.8' 25 25 ); 26 26 … … 52 52 get_asset_path( 'wallets-admin-menu-item' ), 53 53 [ 'jquery' ], 54 '6.1. 7',54 '6.1.8', 55 55 true 56 56 ); … … 60 60 get_asset_path( 'wallets-admin-cs-tool' ), 61 61 [ 'jquery-qrcode' ], 62 '6.1. 7',62 '6.1.8', 63 63 true 64 64 ); … … 75 75 get_asset_path( 'wallets-admin-capabilities' ), 76 76 [ 'jquery-ui-tabs' ], 77 '6.1. 7',77 '6.1.8', 78 78 true 79 79 ); … … 83 83 get_asset_path( 'wallets-admin-dashboard' ), 84 84 [ 'jquery-ui-tabs', 'jqcloud' ], 85 '6.1. 7',85 '6.1.8', 86 86 true 87 87 ); … … 91 91 get_asset_path( 'wallets-admin-docs' ), 92 92 [ 'jquery' ], 93 '6.1. 7',93 '6.1.8', 94 94 true 95 95 ); … … 99 99 get_asset_path( 'wallets-admin-editor' ), 100 100 [ 'suggest' ], 101 '6.1. 7',101 '6.1.8', 102 102 true 103 103 ); -
wallets/trunk/admin/dashboard.php
r2940696 r2941101 349 349 global $wpdb; 350 350 351 $debug_data[ (string) __( 'Plugin version', 'wallets' ) ] = '6.1. 7';352 $debug_data[ (string) __( 'Git SHA', 'wallets' ) ] = ' 0941bbfd';351 $debug_data[ (string) __( 'Plugin version', 'wallets' ) ] = '6.1.8'; 352 $debug_data[ (string) __( 'Git SHA', 'wallets' ) ] = 'b2bc5bfc'; 353 353 $debug_data[ (string) __( 'Web Server', 'wallets' ) ] = $_SERVER['SERVER_SOFTWARE']; 354 354 $debug_data[ (string) __( 'PHP version', 'wallets' ) ] = PHP_VERSION; -
wallets/trunk/admin/migration.php
r2887566 r2941101 182 182 ); 183 183 184 if ( 'balances' == $_POST['wallets_migration_type'] ) { 185 186 // We don't want the plugin to be re-processing any deposits 187 // having timestamps earlier than the start of the last migration. 188 $deposit_cutoff = get_ds_option( 'wallets_deposit_cutoff', 0 ); 189 if ( time() > $deposit_cutoff ) { 190 update_ds_option( 'wallets_deposit_cutoff', time() ); 191 } 192 } 193 184 194 } 185 195 -
wallets/trunk/admin/settings.php
r2933770 r2941101 64 64 add_ds_option( 'wallets_moves_max_batch_size', DEFAULT_CRON_MOVES_MAX_BATCH_SIZE ); 65 65 add_ds_option( 'wallets_cron_task_timeout', DEFAULT_CRON_TASK_TIMEOUT ); 66 add_ds_option( 'wallets_deposit_cutoff', 0 ); 66 67 67 68 set_ds_transient( 'wallets_wordpress_org_nag', true, MONTH_IN_SECONDS ); … … 271 272 ); 272 273 274 add_settings_field( 275 'wallets_deposit_cutoff', 276 sprintf( (string) __( '%s Deposit cutoff timestamp', 'wallets' ), '☇' ), 277 __NAMESPACE__ . '\numeric_cb', 278 "wallets_settings_{$tab}_page", 279 "wallets_{$tab}_section", 280 [ 281 'label_for' => 'wallets_deposit_cutoff', 282 'description' => __( 283 'The plugin will reject any deposits with timestamps before this cutoff. ' . 284 'This is set automatically by the migration tool when initiating a new balances-only migration. ' . 285 'The cutoff ensures that no deposits before a balance migration are repeated ' . 286 'if the plugin receives notifications for them. ' . 287 'Do not change this value unless you know what you are doing.', 288 'wallets' 289 ), 290 'min' => 0, 291 'max' => time(), 292 'step' => 1, 293 'default' => 0, 294 ] 295 ); 296 297 register_setting( 298 "wallets_{$tab}_section", 299 'wallets_deposit_cutoff' 300 ); 301 302 273 303 } // general 274 304 -
wallets/trunk/docs/migration.md
r2857585 r2941101 43 43 44 44 If you choose to migrate the balances only, then for each user and each coin with non-zero balance, one transaction will be recorded. The user history will not be transferred, but all the user balances will be migrated correctly, and this can be done a lot faster. On each cron job run, once per minute, the balances of a few coins for one user can be transferred. Unless you have many coins and users, this will run in minutes to hours at most, even with many transactions on the ledger. This is because all transactions per user and coin are summed into one balance transfer. 45 46 When an admin initiates a balances-only migration, the setting _Deposit cutoff timestamp_ is set. See the _Settings_ section for details. 45 47 46 48 ### Revert -
wallets/trunk/docs/settings.md
r2933770 r2941101 38 38 A test transient is set to expire in one minute, with the current timestamp. If the transient is found one minute after it has been created according to its timestamp, this means that it did not expire when it should, and this option is set to `on`. Otherwise you can keep it off. 39 39 40 ### Deposit cutoff timestamp 41 42 | | | 43 | --- | --- | 44 | *Option* | `wallets_deposit_cutoff` | 45 | *Default* | `0` | 46 | *Description* | *The plugin will reject any deposits with timestamps before this cutoff. This is set automatically by the migration tool when initiating a new balances-only migration. The cutoff ensures that no deposits before a balance migration are repeated if the plugin receives notifications for them. Do not change this value unless you know what you are doing.* | 47 48 This setting allows the plugin to reject any deposits with a timestamp earlier than a cutoff. 49 50 This is useful for systems where balances migration has been performed from versions previous to `6.0.0`. 51 52 Because on such systems, early deposits have not been migrated, if such deposits are notified again on the plugin, then 53 the deposits will be re-entered into the plugin's ledger, resulting in double counting of old deposits. 54 55 This can happen for example if a Bitcoin core node is re-synced, and therefore it repeats walletnotify curl calls. 56 57 When an admin initiates a *Balances-only migration*, this setting is set to the current timestamp. Thus, all deposits with 58 a timestamp before the start of the migration will never be counted twice. 59 60 An admin can manually change this value, however this is not recommended. 61 62 A value of `0` means that all deposits are accepted. 40 63 41 64 ## Exchange rates {#rates} -
wallets/trunk/frontend/assets.php
r2940696 r2941101 23 23 get_asset_path( 'wallets', 'style' ), 24 24 [], 25 '6.1. 7'25 '6.1.8' 26 26 ); 27 27 … … 86 86 get_asset_path( 'jsqrcode' ), 87 87 [ 'jquery' ], 88 '6.1. 7',88 '6.1.8', 89 89 true 90 90 ); … … 128 128 get_asset_path( 'wallets-front' ), 129 129 [ 'knockout', 'jquery', 'style-scoped', 'sprintf.js' ], 130 '6.1. 7',130 '6.1.8', 131 131 true 132 132 ); -
wallets/trunk/readme.txt
r2940696 r2941101 6 6 Tested up to: 6.2.2 7 7 Requires PHP: 5.6 8 Stable tag: 6.1. 78 Stable tag: 6.1.8 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 336 336 337 337 == Changelog == 338 339 = 6.1.8 = 340 - Add: New setting allows for deposits to be ignored if they have a timestamp earlier than a set cutoff value. 341 - Add: When initiating an addresses and balances-only migration, the deposit cutoff value is set to the current timestamp. 338 342 339 343 = 6.1.7 = … … 1511 1515 == Upgrade Notice == 1512 1516 1513 Version `6.1. 7` fixes two important user-reported bugs that affect usability. Please upgrade as soon as possible.1517 Version `6.1.8` adresses a potential issue with balances-only migration and repeated blocknotify messages from Bitcoin core wallets. 1514 1518 1515 1519 == Donating == -
wallets/trunk/uninstall.php
r2857585 r2941101 1 1 <?php 2 3 use function DSWallets\delete_ds_option; 2 4 3 5 if ( ! function_exists( 'is_plugin_active_for_network' ) ) { … … 50 52 } 51 53 } 52 foreach ( [ 'wallets_email_queue' ] as $o ) { 54 foreach ( [ 55 'wallets_email_queue', 56 ] as $o ) { 53 57 if ( delete_option( $o ) ) { 54 58 error_log( "Deleted option: $o" ); -
wallets/trunk/wallets.php
r2940696 r2941101 3 3 * Plugin Name: Bitcoin and Altcoin Wallets 4 4 * Description: Custodial cryptocurrency wallets. 5 * Version: 6.1. 75 * Version: 6.1.8 6 6 * Plugin URI: https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin 7 7 * Requires at least: 5.0
Note: See TracChangeset
for help on using the changeset viewer.