I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

How to debug this ?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #3183
    Anonymous
    Inactive

    I have installed the plugin, added WP filter with my coin, but I dont see it in menu. How should I turn it on ?

    #3184
    alexg
    Keymaster

    Have you installed both the parent plugin and the multiadapter extension?

     

    #3188
    Anonymous
    Inactive

    Yes I installed & enabled both. I see all coin adapters except mine

    #3190
    alexg
    Keymaster

    OK, here’s how to debug this:

    1. Enable WordPress debugging and add something like error_log( __FUNCTION__ ); in the function where you add your data to the filter. It could be that for some reason you have not hooked the code correctly and it is not running.

    2. When you say that you do not see it in the menu, are you referring to the frontend menu? The frontend menu only lists adapters that are connected. If you have set up the adapter description correctly but have not set the connection settings then it would appear in your admin screens under Wallets -> Adapters and there would be an error message next to the adapter. This will guide you as to why the adapter is not connecting.

    Do let me know what you find and if you get stuck.

    kind regards

     

    #3218
    Anonymous
    Inactive

    It is definitely a problem with function call.

    #3221
    alexg
    Keymaster

    Hello,

    Could you please be more clear? Is the function not being called?

    How are you attaching it to the hook? Where is your code located? Does it run?

     

    #3235
    Anonymous
    Inactive

    The functions seems to not being called. The code is located in the themes functions.php (as shown in the manual):

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘wallettheme_enqueue_styles’ );
    function wallettheme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }

    function wallets_multiadapter_coins_filter( $coins ) {
    $coins[‘RURT’] = array(
    // Coin symbol
    ‘symbol’ => ‘RURT’,

    // Coin name
    ‘name’ => ‘RURtoken’,

    // Default withdrawal fee (coin adapter settings override this)
    ‘wd fee’ => ‘0’,

    // Default internal transaction fee (coin adapter settings override this)
    ‘move fee’ => ‘0’,

    // Default min confirmation count required for deposits (coin adapter settings override this)
    ‘confirms’ => ‘4’,

    // Default RPC port (coin adapter settings override this)
    ‘port number’ => ‘443’,

    // Whether the wallet supports -walletnotify
    ‘tx notify’ => ‘0’,

    // Whether the wallet supports -blocknotify
    ‘block notify’ => ‘0’,

    // Whether the wallet supports -alertnotify (some wallets have deprecated this)
    ‘alert notify’ => ‘0’,

    // Comma separated list of hex bytes, needed for frontend validation of withdraw addresses. Leave blank for no validation.
    ‘versions’ => ”,

    // An sprintf() pattern for deposit address QR Code URI. If unsure, set to ‘%s’.
    ‘qr pattern’ => ‘%s’,

    // An sprintf() pattern for displaying amounts. If unsure, leave to ‘%01.8f’.
    ‘amount pattern’ => ‘%01.8f’,

    // Default sprintf() pattern for URI to block explorer transaction page. Can be overriden with WordPress filter.
    ‘explorer tx uri’ => ‘https://live.blockcypher.com/ltc/tx/%s/&#8217;,

    // Default sprintf() pattern for URI to block explorer address page. Can be overriden with WordPress filter.
    ‘explorer address uri’ => ‘https://live.blockcypher.com/ltc/address/%s/&#8217;,

    // URL to an 64×64 icon for the coin. Or leave empty to pull the icon from ‘assets/sprites/SYMBOL.png’.
    ‘icon url’ => ”,
    );
    return $coins;
    }

    add_filter( ‘wallets_multiadapter_coins’, ‘wallets_multiadapter_coins_filter’ );

    ?>

    #3239
    alexg
    Keymaster

    Hi,

    My apologies. This is my fault.

    You cannot hook to the wallets_multiadapter_coins filter from a theme because it runs before any themes are loaded.

    You have two options:

    1. Enter your data into assets/coins.csv. This is not ideal because if there is an update to the multiadapter your csv file will be overwritten. But this can be a way to quickly move forward for now.
    2. The best course of action would be to take the code you have and wrap it into a plugin. This is very simple:
      1. Create a new PHP file
      2. Add some headers as shown here
      3. Paste your code beneath the headers
      4. Copy the PHP file into your wp-content/plugins directory
      5. Go to Plugins and activate your plugin.

    Thank you for reporting this problem. I will update the online instructions today.

    kind regards

    Alex

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.