jakemorrow
Forum Replies Created
-
I mean, isn’t it would be better to show qr code as inline base64-encoded png image instead of rewriting png file on the storage device every time?
I checked the table on a different installation. This time hd_mode is in place. Interesting.
BTW, there is another bug. Qrcodes seems to be broken. It uses the same img_qrcode.png file for a various checkout pages. It seems to me that the plugin regenerates qr code each time the page is displayed. But what will happen if two users will request it simultaneously?
- This reply was modified 6 years, 7 months ago by jakemorrow.
Aha. I see.
I just checked – the value of nmm_hd_table_version in my database is 1.1.
So either it was 1.1 from the start and your code which alters the table never had a chance to execute, or, alternatively, that code somehow failed but nmm_hd_table_version was updated to 1.1 regardless.I am looking into nnm.log right now and see that blockexplorer.com was down at least one time (it was using cloudflare ddos protection). So it is kinda scary to use this in production. Is there any other data providers available in the plugin in case if blockexplorer.com is down?
- This reply was modified 6 years, 7 months ago by jakemorrow.
Anyways, there is a bug for sure.
The missing field in the database.
The “hd_mode” field.Thanks!
Hmm… adding wp-cron.php into the exception from Basic Authorization seems to be working.
<FilesMatch “(wp-cron.php)$”>
Satisfy Any
Order allow,deny
Allow from all
Deny from none
</FilesMatch>Yet it is unclear why the event didn’t produce any logs when I called it manually.
And it is also unclear how the wp cron scheduler actually working – why it cannot work under basic authorization.
Uncommented the log function from the NMM_Util.php module. Can’t see any nmm.log file yet.
Installed plugin WP-Control to monitor what is going on with job scheduler of WP. It seems that scheduler wasn’t working.
There was a problem spawning a call to the WP-Cron system on your site. This means WP-Cron events on your site may not work. The problem was:
Unexpected HTTP response code: 401So the scheduler requires an access to specific webserver url in order to work?
… started job manually:
Successfully executed the cron event NMM_cron_hook
Again, can’t see any logs.
- This reply was modified 6 years, 7 months ago by jakemorrow.
- This reply was modified 6 years, 7 months ago by jakemorrow.
The log above might be unrelated to the issue.
I just don’t quite understand how K can debug it. There suppose to be some task scheduler for wordpress. In Linux these kind of things supposed to be handled by programs like cron. But apparently in WordPress that kind of scheduler is not used and instead, apparently, the scheduler is triggered by php – i.e. by client. If that is so, then – is it triggered by login to the admin panel of WP? Or by the user browsing a page with order? So, how I can trigger the plugin to check the balance of the order? And how I can catch debug logs from it?
Logs:
69 2019-10-18T22:10:04+00:00 CRITICAL Uncaught Error: Call to a member function get_id() on null in /var/holland/gui/wordpress/wp-content/plugins/nomiddleman-crypto-payments-for-woocommerce/src/NMM_Gateway.php:167
70 Stack trace:
71 #0 /var/holland/gui/wordpress/wp-includes/class-wp-hook.php(286): NMM_Gateway->thank_you_page(53)
72 #1 /var/holland/gui/wordpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
73 #2 /var/holland/gui/wordpress/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
74 #3 /var/holland/gui/wordpress/wp-content/plugins/woocommerce/templates/checkout/thankyou.php(77): do_action(‘wooco mmerce_tha…’, 53)
75 #4 /var/holland/gui/wordpress/wp-content/plugins/woocommerce/includes/wc-core-functions.php(249): include(‘/var/holland/gu…’)
76 #5 /var/holland/gui/wordpress/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php(2 48): wc_get_template(‘checkout/thanky…’, Array)
77 #6 /var/holland/gui/wordpress/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.p in /var/holland/gui/wordpress/wp-content/plugins/nomiddleman-crypto-payments-for-woocommerce/src/NMM_Gateway.php on l ine 167
78Next issue with Bitcoin setup.
Plugin is set for Privacy Mode MPK. Addressed being served. All good.
Privacy Mode Required Confirmations set to 0 (zero)Test purchase has been made to given address. Blockchain shows that transfer alright. But order status in Woocommerce is still ‘On Hold’.
Note inside the order:
‘Privacy Mode (HD wallet) address BITCOIN-ADDRESS is awaiting payment of 0.0005 BTC. Order status changed from Pending payment to On hold.’Transfer has no confirmations yet, but 30 minutes has elapsed since it’s visible in blockchain.
What seems to be a problem here?
Dear author, apparently you forgot to add a field “hd_mode” into the table with addresses derived from MPK (*_nmmpro_hd_addresses). At least in my case the addresses were not displaying on the purchase form without that field – the records couldn’t get inserted or selected without it.
Yes, that’s was the case. Thank you!
What PHP version are you using and what modules are required BTW?
I cannot see any log files whatsoever.
I thought that the problem is because of permissions, but the owner of the wp-content directory is apache user (and it has write permissions) and my php-fpm is configured to run as apache user.So that’s why I did this additionally:
define( 'WP_DEBUG_DISPLAY', true ); @ini_set( 'display_errors', 1 );But I can’t see any errors still. Tried to delete MPK, save it, insert it again and save it. Still the same thing – the MPK is accepted but it can’t generate any addresses.
@nomiddleman I’ve got a typo in my previous post. I meant not Master Private Key, but Master Public Key of course.
First I generated MPK myself via bx tool as described here: https://bitcoin.stackexchange.com/questions/84116/get-master-private-key-from-bip39-seed
After your plugin throw an error that MPK is invalid, I checked your code and realized that the prefix supposed to start either with xpub6, ypub6 or zpub6. So apparently you require what is called extended public key. So I picked it up
from a program Bitcoin.com wallet and tried again. The plugin accepted it (so it is starting with xpub6 and has a length of 111 characters), but address generation failed.For exapmle let’s pick up extended public key from here:
https://bitcoin.stackexchange.com/a/80454/93412
xpub661MyMwAqRbcFJwcugErEvzSgeKwGgHeLyzWKKK4C3edVRDbCU8o2pueJ5S26cXgPQQVRxQXyuoKrScnNKzohc4YNefs4zXg8tAhSLfnFo7
I am inserting it into “Privacy Mode MPK” field, pressing “Save Changes”. No error thrown. But then I see “Address creation failed, please check your mpk.” in the fields where the addresses supposed to be.
Any idea how to debug it?
- This reply was modified 6 years, 7 months ago by jakemorrow.
- This reply was modified 6 years, 7 months ago by jakemorrow.