Plugin Directory

Changeset 2941101


Ignore:
Timestamp:
07/21/2023 05:20:27 AM (3 years ago)
Author:
dashedslug
Message:

Adding version 6.1.8 of wallets

Location:
wallets/trunk
Files:
20 added
20 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • wallets/trunk/adapters/abstract-wallet-adapter.php

    r2912451 r2941101  
    353353        }
    354354
     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
    355374        maybe_switch_blog();
    356375
  • wallets/trunk/adapters/class-bank-fiat-adapter.php

    r2940696 r2941101  
    158158
    159159    public function get_wallet_version(): string {
    160         return '6.1.7';
     160        return '6.1.8';
    161161    }
    162162
     
    683683                    get_asset_path( 'wallets-admin-deposit-tool' ),
    684684                    [ 'jquery' ],
    685                     '6.1.7',
     685                    '6.1.8',
    686686                    true
    687687                );
  • wallets/trunk/adapters/class-bitcoin-core-like-wallet-adapter.php

    r2940696 r2941101  
    600600                [
    601601                    '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',
    603603                    'headers'     => [
    604604                        'Accept-Encoding: gzip',
  • wallets/trunk/admin/assets.php

    r2940696 r2941101  
    2222                get_asset_path( 'wallets-admin', 'style' ),
    2323                [],
    24                 '6.1.7'
     24                '6.1.8'
    2525            );
    2626
     
    5252                get_asset_path( 'wallets-admin-menu-item' ),
    5353                [ 'jquery' ],
    54                 '6.1.7',
     54                '6.1.8',
    5555                true
    5656            );
     
    6060                get_asset_path( 'wallets-admin-cs-tool' ),
    6161                [ 'jquery-qrcode' ],
    62                 '6.1.7',
     62                '6.1.8',
    6363                true
    6464            );
     
    7575                get_asset_path( 'wallets-admin-capabilities' ),
    7676                [ 'jquery-ui-tabs' ],
    77                 '6.1.7',
     77                '6.1.8',
    7878                true
    7979            );
     
    8383                get_asset_path( 'wallets-admin-dashboard' ),
    8484                [ 'jquery-ui-tabs', 'jqcloud' ],
    85                 '6.1.7',
     85                '6.1.8',
    8686                true
    8787            );
     
    9191                get_asset_path( 'wallets-admin-docs' ),
    9292                [ 'jquery' ],
    93                 '6.1.7',
     93                '6.1.8',
    9494                true
    9595            );
     
    9999                get_asset_path( 'wallets-admin-editor' ),
    100100                [ 'suggest' ],
    101                 '6.1.7',
     101                '6.1.8',
    102102                true
    103103            );
  • wallets/trunk/admin/dashboard.php

    r2940696 r2941101  
    349349        global $wpdb;
    350350
    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';
    353353        $debug_data[ (string) __( 'Web Server', 'wallets' ) ]             = $_SERVER['SERVER_SOFTWARE'];
    354354        $debug_data[ (string) __( 'PHP version', 'wallets' ) ]            = PHP_VERSION;
  • wallets/trunk/admin/migration.php

    r2887566 r2941101  
    182182                    );
    183183
     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
    184194                }
    185195
  • wallets/trunk/admin/settings.php

    r2933770 r2941101  
    6464    add_ds_option( 'wallets_moves_max_batch_size',          DEFAULT_CRON_MOVES_MAX_BATCH_SIZE );
    6565    add_ds_option( 'wallets_cron_task_timeout',             DEFAULT_CRON_TASK_TIMEOUT );
     66    add_ds_option( 'wallets_deposit_cutoff',                0 );
    6667
    6768    set_ds_transient( 'wallets_wordpress_org_nag', true, MONTH_IN_SECONDS );
     
    271272            );
    272273
     274            add_settings_field(
     275                'wallets_deposit_cutoff',
     276                sprintf( (string) __( '%s Deposit cutoff timestamp', 'wallets' ), '&#x2607;' ),
     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
    273303        } // general
    274304
  • wallets/trunk/docs/migration.md

    r2857585 r2941101  
    4343
    4444If 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
     46When an admin initiates a balances-only migration, the setting _Deposit cutoff timestamp_ is set. See the _Settings_ section for details.
    4547
    4648### Revert
  • wallets/trunk/docs/settings.md

    r2933770 r2941101  
    3838A 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.
    3939
     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
     48This setting allows the plugin to reject any deposits with a timestamp earlier than a cutoff.
     49
     50This is useful for systems where balances migration has been performed from versions previous to `6.0.0`.
     51
     52Because on such systems, early deposits have not been migrated, if such deposits are notified again on the plugin, then
     53the deposits will be re-entered into the plugin's ledger, resulting in double counting of old deposits.
     54
     55This can happen for example if a Bitcoin core node is re-synced, and therefore it repeats walletnotify curl calls.
     56
     57When an admin initiates a *Balances-only migration*, this setting is set to the current timestamp. Thus, all deposits with
     58a timestamp before the start of the migration will never be counted twice.
     59
     60An admin can manually change this value, however this is not recommended.
     61
     62A value of `0` means that all deposits are accepted.
    4063
    4164## Exchange rates {#rates}
  • wallets/trunk/frontend/assets.php

    r2940696 r2941101  
    2323            get_asset_path( 'wallets', 'style' ),
    2424            [],
    25             '6.1.7'
     25            '6.1.8'
    2626        );
    2727
     
    8686            get_asset_path( 'jsqrcode' ),
    8787            [ 'jquery' ],
    88             '6.1.7',
     88            '6.1.8',
    8989            true
    9090        );
     
    128128            get_asset_path( 'wallets-front' ),
    129129            [ 'knockout', 'jquery', 'style-scoped', 'sprintf.js' ],
    130             '6.1.7',
     130            '6.1.8',
    131131            true
    132132        );
  • wallets/trunk/readme.txt

    r2940696 r2941101  
    66Tested up to: 6.2.2
    77Requires PHP: 5.6
    8 Stable tag: 6.1.7
     8Stable tag: 6.1.8
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    336336
    337337== 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.
    338342
    339343= 6.1.7 =
     
    15111515== Upgrade Notice ==
    15121516
    1513 Version `6.1.7` fixes two important user-reported bugs that affect usability. Please upgrade as soon as possible.
     1517Version `6.1.8` adresses a potential issue with balances-only migration and repeated blocknotify messages from Bitcoin core wallets.
    15141518
    15151519== Donating ==
  • wallets/trunk/uninstall.php

    r2857585 r2941101  
    11<?php
     2
     3use function DSWallets\delete_ds_option;
    24
    35if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
     
    5052                }
    5153            }
    52             foreach ( [ 'wallets_email_queue' ] as $o ) {
     54            foreach ( [
     55                'wallets_email_queue',
     56            ] as $o ) {
    5357                if ( delete_option( $o ) ) {
    5458                    error_log( "Deleted option: $o" );
  • wallets/trunk/wallets.php

    r2940696 r2941101  
    33 * Plugin Name:         Bitcoin and Altcoin Wallets
    44 * Description:         Custodial cryptocurrency wallets.
    5  * Version:             6.1.7
     5 * Version:             6.1.8
    66 * Plugin URI:          https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin
    77 * Requires at least:   5.0
Note: See TracChangeset for help on using the changeset viewer.