Skip to content

Commit

Permalink
Version 2.0.7 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel committed Nov 8, 2021
1 parent 5c9fc78 commit 617174a
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 27 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Copyright (C) 2021 Tatum
Copyright (C) 2021 Hathoriel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: tatum, blockchain, nft, erc721, ethereum, celo, bsc, mint
Requires at least: 5.5
Requires PHP: 7.0
Tested up to: 5.7.1
Stable tag: 2.0.6
Stable tag: 2.0.7
License: MIT
License URI: https://opensource.org/licenses/MIT

Expand Down
2 changes: 1 addition & 1 deletion inc/base/others/cachebuster-lib.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/* This file was automatically generated by the `grunt libs:cachebuster` command (Mon Nov 08 2021 20:53:19 GMT+0100 (Central European Standard Time)). */
/* This file was automatically generated by the `grunt libs:cachebuster` command (Mon Nov 08 2021 21:40:53 GMT+0100 (Central European Standard Time)). */
return array(
'mobx' => '4.15.4',
'react' => '17.0.2',
Expand Down
2 changes: 1 addition & 1 deletion inc/base/others/cachebuster.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/* This file was automatically generated by the `grunt libs:cachebuster` command (Mon Nov 08 2021 20:53:19 GMT+0100 (Central European Standard Time)). */
/* This file was automatically generated by the `grunt libs:cachebuster` command (Mon Nov 08 2021 21:40:53 GMT+0100 (Central European Standard Time)). */
return array(
'src/public/dist/admin.js' => '91676d9e5af4f8ad7beeb660744b8c3f',
'src/public/dist/vendor-admin.js' => '3a0de1fe5709d597975e4e6993e9600a',
Expand Down
32 changes: 28 additions & 4 deletions inc/tatum/Ipfs.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,39 @@ private static function getProductImageNameAndContent($product_id) {
$attachment_url = wp_get_attachment_url($product->get_image_id());
$uploads = wp_upload_dir();
$file_path = str_replace($uploads['baseurl'], $uploads['basedir'], $attachment_url);
if (file_exists($file_path)) {
if (filesize($file_path) <= 52428800) {
return array('name' => basename($attachment_url), 'content' => file_get_contents($file_path));
if (substr($file_path, 0, 4) === "http") {
if (self::urlFileExists($file_path)) {
if (self::urlFileSize($file_path) <= 52428800) {
return array('name' => basename($attachment_url), 'content' => file_get_contents($file_path));
}
throw new \Exception('IPFS: Image is too big.');
}
} else {
if (file_exists($file_path)) {
if (filesize($file_path) <= 52428800) {
return array('name' => basename($attachment_url), 'content' => file_get_contents($file_path));
}
throw new \Exception('IPFS: Image is too big.');
}
throw new \Exception('IPFS: Image is too big.');
}
throw new \Exception('IPFS: Cannot find image.');
}

private static function urlFileExists($url) {
$options['http'] = array(
'method' => "HEAD",
'ignore_errors' => 1,
'max_redirects' => 0
);
$body = file_get_contents($url, NULL, stream_context_create($options));
sscanf($http_response_header[0], 'HTTP/%*d.%*d %d', $code);
return $code === 200;
}

private static function urlFileSize($url) {
$headers = get_headers($url, true);
return $headers['Content-Length'];
}

private static function buildDataFiles($boundary, $file) {
$data = '';
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Description: NFT Maker is the easiest and fastest free plugin to work with NFTs without any blockchain development experience.
* Author: Tatum
* Author URI: https://tatum.io
* Version: 2.0.6
* Version: 2.0.7
* Text Domain: tatum
* Domain Path: /languages
* License: MIT
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

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

return ComposerAutoloaderInitca38ed42bb78fd96011107c159caeffe::getLoader();
return ComposerAutoloaderInit972e818115428fd1a6fa2272f133fd5b::getLoader();
8 changes: 4 additions & 4 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitca38ed42bb78fd96011107c159caeffe
class ComposerAutoloaderInit972e818115428fd1a6fa2272f133fd5b
{
private static $loader;

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

require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInitca38ed42bb78fd96011107c159caeffe', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit972e818115428fd1a6fa2272f133fd5b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitca38ed42bb78fd96011107c159caeffe', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit972e818115428fd1a6fa2272f133fd5b', 'loadClassLoader'));

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

call_user_func(\Composer\Autoload\ComposerStaticInitca38ed42bb78fd96011107c159caeffe::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit972e818115428fd1a6fa2272f133fd5b::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInitca38ed42bb78fd96011107c159caeffe
class ComposerStaticInit972e818115428fd1a6fa2272f133fd5b
{
public static $prefixLengthsPsr4 = array (
'k' =>
Expand Down Expand Up @@ -70,9 +70,9 @@ class ComposerStaticInitca38ed42bb78fd96011107c159caeffe
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitca38ed42bb78fd96011107c159caeffe::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitca38ed42bb78fd96011107c159caeffe::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitca38ed42bb78fd96011107c159caeffe::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit972e818115428fd1a6fa2272f133fd5b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit972e818115428fd1a6fa2272f133fd5b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit972e818115428fd1a6fa2272f133fd5b::$classMap;

}, null, ClassLoader::class);
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/tatum/utils/vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

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

return ComposerAutoloaderInitf7361bbe595adda61517a2c8a420c030::getLoader();
return ComposerAutoloaderInit5e6c42dc1d791a19ee1e18545c2a81a6::getLoader();
8 changes: 4 additions & 4 deletions vendor/tatum/utils/vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitf7361bbe595adda61517a2c8a420c030
class ComposerAutoloaderInit5e6c42dc1d791a19ee1e18545c2a81a6
{
private static $loader;

Expand All @@ -22,15 +22,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInitf7361bbe595adda61517a2c8a420c030', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit5e6c42dc1d791a19ee1e18545c2a81a6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitf7361bbe595adda61517a2c8a420c030', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit5e6c42dc1d791a19ee1e18545c2a81a6', 'loadClassLoader'));

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

call_user_func(\Composer\Autoload\ComposerStaticInitf7361bbe595adda61517a2c8a420c030::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit5e6c42dc1d791a19ee1e18545c2a81a6::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
Expand Down
8 changes: 4 additions & 4 deletions vendor/tatum/utils/vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInitf7361bbe595adda61517a2c8a420c030
class ComposerStaticInit5e6c42dc1d791a19ee1e18545c2a81a6
{
public static $prefixLengthsPsr4 = array (
'H' =>
Expand Down Expand Up @@ -35,9 +35,9 @@ class ComposerStaticInitf7361bbe595adda61517a2c8a420c030
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitf7361bbe595adda61517a2c8a420c030::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitf7361bbe595adda61517a2c8a420c030::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitf7361bbe595adda61517a2c8a420c030::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit5e6c42dc1d791a19ee1e18545c2a81a6::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5e6c42dc1d791a19ee1e18545c2a81a6::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5e6c42dc1d791a19ee1e18545c2a81a6::$classMap;

}, null, ClassLoader::class);
}
Expand Down

0 comments on commit 617174a

Please sign in to comment.