Skip to content

Commit 6c37320

Browse files
committed
Update from b03101d
1 parent f38bd86 commit 6c37320

24 files changed

+165
-117
lines changed

README.txt

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: tatum, blockchain, nft, erc721, ethereum, celo, bsc, mint
55
Requires at least: 5.5
66
Requires PHP: 7.0
77
Tested up to: 5.7.1
8-
Stable tag: 2.0.11
8+
Stable tag: 2.0.12
99
License: MIT
1010
License URI: https://opensource.org/licenses/MIT
1111

@@ -14,42 +14,62 @@ License URI: https://opensource.org/licenses/MIT
1414
== Description ==
1515
If you want to sell NFTs but don’t want to build an entire NFT marketplace from scratch, then NFT Maker is the plugin you’ve been waiting for.
1616

17-
Lazy Minting. Free IPFS Storage. Forever. Supports Ethereum, Polygon, Binance Smart Chain, Celo, and Harmony.
17+
Lazy Minting. Free IPFS Storage, forever. Supports Ethereum, Polygon, Binance Smart Chain, Celo, and Harmony.
1818

19-
NFT Maker by Tatum allows you to turn your Woocommerce store into an NFT store with a simple plugin. Install our plugin, follow your usual WordPress product publishing flow, and only tick an extra box — make NFT.
19+
NFT Maker by Tatum allows you to turn your Woocommerce store into an NFT store with a simple plugin. Install our plugin, follow your usual WordPress product publishing flow, and just tick which blockchain you’d like to mint your NFTs on.
2020

21-
You are welcome to add your pull request to the [repository](https://github.com/tatumio/woocommerce-plugin). If you have any questions just shoot [Discord](https://discord.gg/Mg2vdtD4JQ)
21+
You are welcome to add your pull request to our Github [repository](https://github.com/tatumio/woocommerce-plugin). If you have any questions just drop us a line on the Tatum [Discord](https://discord.gg/Mg2vdtD4JQ).
2222
Or feel free to contact developer via [Telegram](https://t.me/LukasKotol).
2323

2424
== Installation ==
2525

2626
This section describes how to install the Tatum plugin and get it working.
2727

28-
1. Create an account in the [Tatum Dashboard](https://dashboard.tatum.io/login) and obtain paid API key.
29-
2. Install [Woocommerce plugin](https://wordpress.org/plugins/woocommerce/) if you don't have already installed it yet.
30-
3. Submit your API key.
31-
4. You are ready to mint NFT tokens! In the overview, you can see info about your API key.
32-
5. Create Woocommerce product. Don't forget to select chain on which NFT will be minted.
33-
6. Don't forget to set an NFT image. Only images up to 50 MB are available for storing. If you don't set an image your NFT will not be minted!
34-
7. After you create product can see it in the list of lazy minted NFTs.
35-
8. If your customer adds product to the cart and proceed to checkout, he/she will need to submit blockchain address to which will be NFT minted.
36-
9. After successful purchase of the NFT customer will see the blockchain transaction.
37-
10. Blockchain transaction links can redirect customer to the blockchain explorer to see NFT mint transaction details.
38-
11. Admin can also see all sold and minted NFT.
28+
1. Download and install the [Woocommerce plugin](https://wordpress.org/plugins/woocommerce/) if you haven’t already.
29+
2. Click “Get your Tatum API key.”
30+
3. Login to the Tatum dashboard and purchase a paid plan.
31+
4. When you have completed your purchase, you will be directed back to the Tatum dashboard. Next to your newly created API key, click “Show” and copy your API key.
32+
5. Now, back in the NFT Maker dashboard, paste your API key in the field labeled “Paste your API key below.”
33+
6. Okay, you’re all ready to mint NFT tokens! In the overview, you can see info about your API key.
34+
7. Open the “Product” tab in the left-hand column of your WordPress dashboard.
35+
8. Click “Add product.”
36+
9. Name your NFT.
37+
10. Set its price in the “General” tab of the “Product data” box.
38+
11. In the “NFT Maker” tab of the same box, select the blockchain on which to mint the NFT upon purchase.
39+
12. Upload an image by clicking “Set product image” in the “Product Image” field in the right-hand column of the screen.
40+
13. Click “Publish” to create your product. Now it is available for purchase in your e-shop. You can also view it in your list of lazy-minted NFTs. You will not consume any credits from your paid plan for gas fees until someone purchases your NFT and it is minted on the blockchain you have selected.
41+
14. When a buyer adds the NFT to their cart and proceeds to checkout, they will have to enter a blockchain address on the blockchain to which the NFT will be minted.
42+
15. After a successful purchase of the NFT, the customer will be shown a link to the blockchain transaction.
43+
16. The blockchain transaction link redirects the customer to the blockchain explorer of the respective blockchain where they can view NFT mint transaction details.
44+
17. Admins of the WordPress shop can also view all lazy-minted and sold NFTs.
3945

4046
== Frequently Asked Questions ==
4147

42-
= Can I use the Tatum plugin for selling NFTs? =
48+
= Why do I need an API key? =
49+
Normally, to create NFTs on different blockchains, you would need to have access to blockchain nodes and create wallets on each blockchain.
50+
With NFT Maker, you can simply use an API key to connect to different blockchains through Tatum, and everything else is taken care of for you.
51+
52+
= Do I need to generate a blockchain wallet on each blockchain I want to mint NFTs on? =
53+
No, since NFTs are lazy-minted, you do not need to create wallets on any blockchain. Once an NFT is purchased, it is minted directly to the buyer’s blockchain address.
4354

44-
Yes, the Tatum plugin is made for selling and minting NFTs without any blockchain experience.
55+
= Do I have to choose which blockchain I will mint all of my NFTs on during setup? =
56+
No, you can choose which NFT to mint on which blockchain when you are setting up each product.
57+
You can select one blockchain per product, but you can also create multiple NFTs of the same image for multiple blockchains if you so choose.
4558

4659
= Is the plugin free? =
60+
Yes, the NFT Maker plugin itself is completely free. However, in order to pay for the gas fees necessary to mint NFTs, you must buy a paid plan in the [Tatum Dashboard](https://dashboard.tatum.io/).
61+
Each paid plan has different credit amounts, and credits will be consumed when your NFTs are purchased and minted to the blockchain, based on the current gas fees of the given blockchain.
4762

48-
No, you must buy paid plan in [Tatum Dashboard](https://dashboard.tatum.io/).
63+
= If I don’t use all my credits within a month, do they carry over to the next month? =
64+
At the moment, no, unused credits do not carry over to the following month.
4965

50-
= Can customers sell their NFT? =
66+
= Can my users sell their NFTs with NFT Maker? =
67+
NFT Maker can only be used to sell NFTs created by admins to customers.
68+
To create NFT marketplaces that allow users to sell their own NFTs, please refer to Tatum’s [How to build p2p NFT marketplaces guide.](https://docs.tatum.io/tutorials/how-to-create-a-peer-to-peer-nft-marketplace)
5169

52-
No. The plugin could be only used to sell the NFT created by Admin to the customers.
70+
= Can I sell my existing NFTs on my e-shop using NFT Maker? =
71+
No, again, NFT Maker can only be used to sell NFTs created with the plugin.
72+
For a complete guide on how to build the backend to an NFT marketplace from scratch, please refer to Tatum’s How to build [NFT marketplaces part 2 - Backend guide.](https://blog.tatum.io/how-to-build-nft-marketplaces-part-2-backend-899f7d804066)
5373

5474
== Screenshots ==
5575
1. Create an account in the [Tatum Dashboard](https://dashboard.tatum.io/login) and obtain paid API key.
@@ -87,6 +107,9 @@ No. The plugin could be only used to sell the NFT created by Admin to the custom
87107
= 2.0.11 =
88108
* Fixed Safari date bug
89109

110+
= 2.0.12 =
111+
* Fixed error with changing blockchain of NFT & Added videos & FAQ
112+
90113
== Upgrade Notice ==
91114

92115
= 1.0.0 =

inc/Activator.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,25 @@ public function deactivate() {
4040
* @param boolean $errorlevel If true throw errors
4141
*/
4242
public function dbDelta($errorlevel) {
43-
// TODO: remove tatum options from DB
44-
// Your table installation here...
45-
/*$table_name = $this->getTableName();
46-
$sql = "CREATE TABLE $table_name (
47-
id mediumint(9) NOT NULL AUTO_INCREMENT,
48-
UNIQUE KEY id (id)
49-
) $charset_collate;";
50-
dbDelta( $sql );
43+
global $wpdb;
44+
45+
$lazy_nft_name = $this->getTableName("lazy_nft");
46+
$prepared_nft_name = $this->getTableName("prepared_nft");
47+
$sql = "ALTER TABLE $lazy_nft_name ADD COLUMN chain ENUM('CELO', 'ETH', 'BSC', 'ONE', 'MATIC');";
48+
$wpdb->query($sql);
49+
50+
$sql = "SELECT * FROM $prepared_nft_name;";
51+
52+
$prepared_nfts = $wpdb->get_results($sql);
53+
54+
foreach ($prepared_nfts as $prepared_nft) {
55+
$sql = "UPDATE $lazy_nft_name SET chain = '" . $prepared_nft->chain . "' WHERE prepared_nft_id = " . $prepared_nft->id . ";";
56+
$wpdb->query($sql);
57+
}
5158

5259
if ($errorlevel) {
5360
$wpdb->print_error();
54-
}*/
61+
}
5562
}
5663

5764
private function initDatabase() {

inc/base/others/cachebuster-lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
/* This file was automatically generated by the `grunt libs:cachebuster` command (Sun Nov 14 2021 20:15:09 GMT+0000 (Coordinated Universal Time)). */
2+
/* This file was automatically generated by the `grunt libs:cachebuster` command (Tue Nov 23 2021 18:54:55 GMT+0000 (Coordinated Universal Time)). */
33
return array(
44
'mobx' => '4.15.4',
55
'react' => '17.0.2',

inc/base/others/cachebuster.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
2-
/* This file was automatically generated by the `grunt libs:cachebuster` command (Sun Nov 14 2021 20:15:09 GMT+0000 (Coordinated Universal Time)). */
2+
/* This file was automatically generated by the `grunt libs:cachebuster` command (Tue Nov 23 2021 18:54:55 GMT+0000 (Coordinated Universal Time)). */
33
return array(
4-
'src/public/dist/admin.js' => '303d41e0b74eadbfdd45c9c63ee2f2d3',
5-
'src/public/dist/vendor-admin.js' => 'cf7bcffd2127b22b8e586ad7991b134e',
4+
'src/public/dist/admin.js' => '8b4434a06c26f543c93c6cd61acbbdcb',
5+
'src/public/dist/vendor-admin.js' => '544a5b292e9bff3de00321a3d11b0984',
66
'src/public/dist/vendor-widget.js' => '9e3cdc863b954ff97d9e44bdb8f0384a',
77
'src/public/dist/widget.js' => '55dc633ed835f64258416aab9b31c9dc',
8-
'src/public/dist/admin.css' => 'c8c6de5a905a89565b1e5b9c39b79a13',
8+
'src/public/dist/admin.css' => '171a52746ca0ae79e591dd7535306dc5',
99
'src/public/dist/widget.css' => '1479e83e34ea80c5596ab0fa32dfa6e5',
1010
);

inc/hooks/Admin.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ public function productSave($product_id) {
111111
// run your code here!
112112
if (isset($_POST['tatum_chain'])) {
113113
$this->lazyMint->deletePrepared($product_id);
114-
$this->lazyMint->insertPrepared($product_id, $_POST['tatum_chain']);
114+
115+
if (empty($this->lazyMint->getPreparedByProduct($product_id))) {
116+
$this->lazyMint->insertPrepared($product_id, $_POST['tatum_chain']);
117+
} else {
118+
$this->lazyMint->updatePrepared($product_id, $_POST['tatum_chain']);
119+
}
115120
}
116121
}
117122
set_transient($updating_product_id, $product_id, 2); // change 2 seconds if not enough

inc/hooks/PublicHooks.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,22 @@ private function mintProduct($product_id, $order_id, $api_key, $url) {
9090
$recipient_address = get_post_meta($order_id, 'recipient_blockchain_address_' . $preparedNft->chain, true);
9191

9292
if ($recipient_address) {
93-
$transfer_body = array('to' => $recipient_address, 'chain' => $preparedNft->chain, 'url' => "ipfs://$url");
93+
$mint_body = array('to' => $recipient_address, 'chain' => $preparedNft->chain, 'url' => "ipfs://$url");
9494
if ($preparedNft->chain === 'CELO') {
95-
$transfer_body['feeCurrency'] = 'CELO';
95+
$mint_body['feeCurrency'] = 'CELO';
9696
}
97-
$response = Connector::mint_nft($transfer_body, $api_key);
98-
97+
$response = Connector::mint_nft($mint_body, $api_key);
9998
if (isset($response['txId'])) {
100-
$this->lazyMint->insertLazyNft($preparedNft->id, $order_id, $recipient_address, $response['txId']);
99+
$this->lazyMint->insertLazyNft($preparedNft->id, $order_id, $recipient_address, $preparedNft->chain, $response['txId']);
101100
} else {
102-
$this->resolveNftError($product_id, $order_id, 'Cannot mint NFT. Check recipient address or contact support.', $recipient_address);
101+
$this->resolveNftError($product_id, $order_id, $preparedNft->chain, 'Cannot mint NFT. Check recipient address or contact support.', $recipient_address);
103102
}
104103
}
105104
}
106105
}
107106

108-
private function resolveNftError($order_id, $error_message, $preparedNft, $recipient_address) {
109-
$this->lazyMint->insertLazyNft($preparedNft->id, $order_id, $recipient_address, null, $error_message);
107+
private function resolveNftError($order_id, $error_message, $chain, $preparedNft, $recipient_address) {
108+
$this->lazyMint->insertLazyNft($preparedNft->id, $order_id, $recipient_address, $chain, null, $error_message);
110109
}
111110

112111
public function updateThankYouPage($thank_you_title, $order) {

inc/tatum/LazyMint.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ public function insertPrepared($productId, $chain) {
2626
$this->wpdb->insert($this->preparedNft, array('product_id' => $productId, 'chain' => $chain));
2727
}
2828

29-
public function insertLazyNft($preparedId, $orderId, $recipientAddress, $transactionId = null, $errorCause = null) {
29+
public function updatePrepared($productId, $chain) {
30+
$this->wpdb->update($this->preparedNft, array('chain' => $chain), array('product_id' => $productId));
31+
}
32+
33+
public function insertLazyNft($preparedId, $orderId, $recipientAddress, $chain, $transactionId = null, $errorCause = null) {
3034
$this->wpdb->insert($this->lazyNft, array(
3135
'prepared_nft_id' => $preparedId,
3236
'order_id' => $orderId,
3337
'transaction_id' => $transactionId,
3438
'error_cause' => $errorCause,
35-
'recipient_address' => $recipientAddress
39+
'recipient_address' => $recipientAddress,
40+
'chain' => $chain
3641
));
3742
}
3843

@@ -74,7 +79,7 @@ public function getPrepared() {
7479
}
7580

7681
public function getMinted() {
77-
$nfts = $this->wpdb->get_results("SELECT * FROM $this->lazyNft INNER JOIN $this->preparedNft ON $this->lazyNft.prepared_nft_id = $this->preparedNft.id;");
82+
$nfts = $this->wpdb->get_results("SELECT * FROM $this->preparedNft INNER JOIN $this->lazyNft ON $this->lazyNft.prepared_nft_id = $this->preparedNft.id;");
7883
return self::formatMintedNfts($nfts);
7984
}
8085

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Description: NFT Maker is the easiest and fastest free plugin to work with NFTs without any blockchain development experience.
99
* Author: Tatum
1010
* Author URI: https://tatum.io
11-
* Version: 2.0.11
11+
* Version: 2.0.12
1212
* Text Domain: tatum
1313
* Domain Path: /languages
1414
* License: MIT

languages/tatum.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is distributed under the MIT.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: NFT Maker 2.0.8\n"
5+
"Project-Id-Version: NFT Maker 2.0.12\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/src\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <LL@li.org>\n"

public/dist/admin.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/admin.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/admin.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/admin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/vendor-admin.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/vendor-admin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
require_once __DIR__ . '/composer/autoload_real.php';
66

7-
return ComposerAutoloaderInit9cc9c21ad052306750030a742100409b::getLoader();
7+
return ComposerAutoloaderInit3b439705bf37abb72a44ac29eb6f17c9::getLoader();

vendor/composer/autoload_real.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInit9cc9c21ad052306750030a742100409b
5+
class ComposerAutoloaderInit3b439705bf37abb72a44ac29eb6f17c9
66
{
77
private static $loader;
88

@@ -24,15 +24,15 @@ public static function getLoader()
2424

2525
require __DIR__ . '/platform_check.php';
2626

27-
spl_autoload_register(array('ComposerAutoloaderInit9cc9c21ad052306750030a742100409b', 'loadClassLoader'), true, true);
27+
spl_autoload_register(array('ComposerAutoloaderInit3b439705bf37abb72a44ac29eb6f17c9', 'loadClassLoader'), true, true);
2828
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29-
spl_autoload_unregister(array('ComposerAutoloaderInit9cc9c21ad052306750030a742100409b', 'loadClassLoader'));
29+
spl_autoload_unregister(array('ComposerAutoloaderInit3b439705bf37abb72a44ac29eb6f17c9', 'loadClassLoader'));
3030

3131
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
3232
if ($useStaticLoader) {
3333
require __DIR__ . '/autoload_static.php';
3434

35-
call_user_func(\Composer\Autoload\ComposerStaticInit9cc9c21ad052306750030a742100409b::getInitializer($loader));
35+
call_user_func(\Composer\Autoload\ComposerStaticInit3b439705bf37abb72a44ac29eb6f17c9::getInitializer($loader));
3636
} else {
3737
$classMap = require __DIR__ . '/autoload_classmap.php';
3838
if ($classMap) {

vendor/composer/autoload_static.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Composer\Autoload;
66

7-
class ComposerStaticInit9cc9c21ad052306750030a742100409b
7+
class ComposerStaticInit3b439705bf37abb72a44ac29eb6f17c9
88
{
99
public static $prefixLengthsPsr4 = array (
1010
'k' =>
@@ -70,9 +70,9 @@ class ComposerStaticInit9cc9c21ad052306750030a742100409b
7070
public static function getInitializer(ClassLoader $loader)
7171
{
7272
return \Closure::bind(function () use ($loader) {
73-
$loader->prefixLengthsPsr4 = ComposerStaticInit9cc9c21ad052306750030a742100409b::$prefixLengthsPsr4;
74-
$loader->prefixDirsPsr4 = ComposerStaticInit9cc9c21ad052306750030a742100409b::$prefixDirsPsr4;
75-
$loader->classMap = ComposerStaticInit9cc9c21ad052306750030a742100409b::$classMap;
73+
$loader->prefixLengthsPsr4 = ComposerStaticInit3b439705bf37abb72a44ac29eb6f17c9::$prefixLengthsPsr4;
74+
$loader->prefixDirsPsr4 = ComposerStaticInit3b439705bf37abb72a44ac29eb6f17c9::$prefixDirsPsr4;
75+
$loader->classMap = ComposerStaticInit3b439705bf37abb72a44ac29eb6f17c9::$classMap;
7676

7777
}, null, ClassLoader::class);
7878
}

vendor/composer/installed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'type' => 'library',
66
'install_path' => __DIR__ . '/../../',
77
'aliases' => array(),
8-
'reference' => '463ea819e5af8af565c9add0eca3b9e94efc79fe',
8+
'reference' => 'b03101d9bbbdb40cfc91f0560e5b9ea7036f3ee6',
99
'name' => '__root__',
1010
'dev' => false,
1111
),
@@ -16,7 +16,7 @@
1616
'type' => 'library',
1717
'install_path' => __DIR__ . '/../../',
1818
'aliases' => array(),
19-
'reference' => '463ea819e5af8af565c9add0eca3b9e94efc79fe',
19+
'reference' => 'b03101d9bbbdb40cfc91f0560e5b9ea7036f3ee6',
2020
'dev_requirement' => false,
2121
),
2222
'kornrunner/keccak' => array(

0 commit comments

Comments
 (0)