rex2630 / codeswholesale-for-woocommerce

CodesWholesale integration plugin for WooCommerce
3 stars 1 forks source link

random imports #6

Open scarecr0w12 opened 4 years ago

scarecr0w12 commented 4 years ago

So i've installed this version of the plugin, import doesn't seem to work as it still sits at the "awaiting". But if i just leave the system alone, it just.............imports random products? Leaving it overnight its imported the same product 11 times, and about 1000 some odd other products.

rex2630 commented 4 years ago

hm... So it's not only me having this issue, i had this even on old version, dont know what happened there

scarecr0w12 commented 4 years ago

I would assume that wp-cron trigger the plugin uses is causing it to import items. but i see no pattern or anything as to what or when it imports.

rex2630 commented 4 years ago

Yeah, its super weird issue, i was searching in Cron events, but i didnt seen anything suspicious

scarecr0w12 commented 4 years ago

Yeah, it appears that its not on every occurrence either. I've been playing around with my site, having it use the default cron triggering, rather than a cronjob, Nothing new imported. However, between the last time i cleaned out products, and now, a roughly 10 hour period, it had imported approximately 1600 items. All of them duplicates (As in each individual item has at least 6-7 duplicates), no categories unlike the properly imported ones i can see, and no images.

This is different than when i initiated an import, and let it sit 24 hours. When i did that, it imported 24k products, many of them having proper images, descriptions, and so on. So it seems a manually triggered import does import but doesn't show it is. But letting it sit, it randomly imports "Bad info", but no rhyme or reason as to what or why.

Hopefully, that information helps track it down. I don't know PHP myself, so im of no help there.

rex2630 commented 4 years ago

I will see what i can do. I just need to know if u have released version or are u using master?

scarecr0w12 commented 4 years ago

I am using the master version at this moment, copied over top of the release (as the release contains the actual SDK and codeswholesale files in vendor)

rex2630 commented 4 years ago

Maybe it's fixed here: https://github.com/rex2630/codeswholesale-for-woocommerce/releases/tag/2.6.8

toxicclowd commented 4 years ago

So, between trying to get my account activated, and then trying to get the plugin they provide to actually import products I've been getting jerked around by the staff at codeswholesale for almost 2 months. Then finally they reply to my ticket today saying that the plugin is no longer developed or supported and that I should create my own implementation. Well shouldn't they take it off the website then? anyway, I thought about modifying the plugin but I'm a php noob, but I figured someone else probably has done so already, which led me to this fork, which seems to be the most active. So I appreciate whatever work you put into this and I will try it after I feed my kids dinner and report my results. hopefully I can finally get my site launched.

rex2630 commented 4 years ago

Yeah, they gave up on these plugins some time ago. Im not PHP Pro too, but im trying to fix some things with my little knowledge. But with import it doesnt look so good, so maybe for a long time u will need bojjet plugin to make it working.

toxicclowd commented 4 years ago

Sorry if this is a stupid question, but what is the bojjet plugin and how would I get it? in still going to try your plugin first and if I get some different results ill let you know, maybe it'll help you along.

scarecr0w12 commented 4 years ago

@rex2630 So weird thing.

So over the past few days, probably since about 21st or so, NO NEW imports have come in since i had last cleared out any errent ones. I am left with exactly 5184 products. These are all products that had been imported with atleast a category attached to them from the import. Few have images, even fewer have descriptions. So not sure what changed, but there ya go.

Mind you, the above was before any release had been provided, but after the alphabetic listing update was included.

I'm currently working in a staging site now to test some things, and activing the newly created release comes up with teh following error:

WordPress version 5.5.1
Current theme: Vikinger - BuddyPress Social Community (version 1.0.0)
Current plugin: CodesWholesale for WooCommerce (version 2.6.8)
PHP version 7.3.21

Error Details
=============
An error of type E_ERROR was caused in line 113 of the file /home/gamingrepublic/staging.gamingrepublic.net/wp-content/plugins/codeswholesale-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php. Error message: Uncaught GuzzleHttp\Exception\ServerException: Server error: `POST https://sandbox.codeswholesale.com/oauth/token` resulted in a `502 Proxy Error` response:

502 Proxy Error

Proxy E (truncated...)
 in /home/gamingrepublic/staging.gamingrepublic.net/wp-content/plugins/codeswholesale-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /home/gamingrepublic/staging.gamingrepublic.net/wp-content/plugins/codeswholesale-for-woocommerce/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /home/gamingrepublic/staging.gamingrepublic.net/wp-content/plugins/codeswholesale-for-woocommerce/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /home/gamingrepublic/staging.gamingrepublic.net/wp-content

Mind you, i am running the same PHP version on my "Production" site, which has the current release working, which was already preactivated by the original codewholesale plugin, and your releases copied over top.

scarecr0w12 commented 4 years ago

However, looking at the error, since its giving a 502 error, that might be due to codewholesales side, and not the plugin.

toxicclowd commented 4 years ago

So, i tried the plugin. the first try i got rejected. the second try it just kept saying "awaiting" but it actually did import about 1000 products, but they had no prices, no description or product images, and were showing out of stock even though the stock numbers actually did import over. basically though, they were mostly blank products. Now, when i set up the plugin it gave me an error, something about not being able to connect to currency server or something like that. Then that error went away and two minutes later i tried the second time and that's when it imported the empty products.

below are my import history entries. I have suspected from the beginning however that a large part of the problem lies on codeswholesale end since i tried to download the .csv price list and got this message "{"status":500,"code":90001,"message":"An error has occurred. We'll fix it soon.","developerMessage":"An error has occurred. We'll fix it soon.","moreInfo":"errors/90001"}" and when i reported it a week ago they said that it was being worked on.

Import ID: 21 CodesWholesale ID: Status: REJECT User: James Jeffries Created on: 2020-10-26 22:44 Handled: 0 Created: 0 Updated: 0 Type: by_filters Platform: PSN, Epic Store, Rockstar Games Launcher, Xbox Live, Bethesda.net, ubi.com, Windows Store, iTunes, Rockstar Social Club, Switch, Official website, Uplay, Battle.net, GOG.com, Origin, Steam Region: US, WORLDWIDE Language: en, Multilanguage Client error:POST https://api.codeswholesale.com/v2/importsresulted in a400 Bad Request` response: {"status":400,"code":12005,"message":"Territory has not been found","developerMessage":"Territory has not been found","m (truncated...)
Get details Remove

Import ID: 22 CodesWholesale ID: e845509c-6508-486a-92ce-0dea7f9e06f2 Status: AWAITING User: James Jeffries Created on: 2020-10-26 22:46 Handled: 0 Created: 0 Updated: 0 Type: by_filters Platform: PSN, Epic Store, Rockstar Games Launcher, Xbox Live, Bethesda.net, ubi.com, Windows Store, iTunes, Rockstar Social Club, Switch, Official website, Uplay, Battle.net, GOG.com, Origin, Steam Region: US, WORLDWIDE Language: en, Multilanguage Cancel `

anyway, that's all i have to report at the moment.

rex2630 commented 4 years ago

Oh, i see that u actually have CodesWholesaleId in that import history and i dont, thanks for info so far, if u will find something more, feel free to post it

rex2630 commented 4 years ago

And about that csv, it works ok, but since whole import is not triggered properly then it wont work. U can bypass it by this: https://github.com/rex2630/codeswholesale-for-woocommerce/issues/3#issue-721421947 or this method: https://github.com/rex2630/codeswholesale-for-woocommerce/commit/a2b653c7606538788cc447b0884cb2b9c04d15eb#diff-dfff50d587cb5810b12f75b9acf5ca7337050d64ef51269325d3af74bebea345R62

toxicclowd commented 4 years ago

You said something last night about me needing bojjet plugin to get my site working, what is bojjet plugin?

scarecr0w12 commented 4 years ago

@rex2630 So over night it did a random import of 10k items again. No reason or anything i can figure as to why, literally no changes have been made by me.

rex2630 commented 4 years ago

You said something last night about me needing bojjet plugin to get my site working, what is bojjet plugin?

https://github.com/RenewedPlains/codeswholesale-woocommerce-patch¨ It's plugin that temp. fixes import, but it do have this plugin as dependency.

rex2630 commented 4 years ago

@rex2630 So over night it did a random import of 10k items again. No reason or anything i can figure as to why, literally no changes have been made by me.

Delete all cron events, did u updated to latest release btw?

scarecr0w12 commented 4 years ago

@rex2630 did that and cleared out about 10k transients too that looked related. Yes, using the current release.

scarecr0w12 commented 4 years ago

@rex2630 So im pretty sure the importing is coming from Line 95 of the "class-cw-cron-update-stock.php" based on my limited knowledge of PHP.

scarecr0w12 commented 4 years ago

Another error being logged by WooCommerce logging:

2020-10-28T00:44:31+00:00 CRITICAL Uncaught Error: Call to a member function getValue() on null in /home/gamingrepublic/public_html/wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/cw-extension-framework/src/Postback/RegisterHandlers.php:102
Stack trace:
#0 /home/gamingrepublic/public_html/wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/cw-extension-framework/src/Postback/RegisterHandlers.php(59): CodesWholesaleFramework\Postback\RegisterHandlers->getPrice(Object(CodesWholesale\Resource\StockAndPriceChange))
#1 /home/gamingrepublic/public_html/wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/sdk/src/CodesWholesale/Client.php(387): CodesWholesaleFramework\Postback\RegisterHandlers->CodesWholesaleFramework\Postback\{closure}(Array)
#2 /home/gamingrepublic/public_html/wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/cw-extension-framework/src/Postback/RegisterHandlers.php(44): CodesWholesale\Client->handle()
#3 /home/gamingrepublic/public_html/wp-content/ in /home/gamingrepublic/public_html/wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/cw-extension-framework/src/Postback/RegisterHandlers.php on line 102
toxicclowd commented 4 years ago

I tried out the bojjet plugin. it worked ok, I had some issues but I think it was mainly my fault. When I get a chance I want to take a look through the code for the bojjet plugin and compare to the code for your plugin and see if I can figure out why that one imports and this one doesn't. I haven't done any real programming in about 15 years and that was using VB6 lol, so don't hold your breath ill be much help, but its worth a shot.

rex2630 commented 4 years ago

So problem found, random import is caused by cron: "codeswholesale_update_stock_action". But it's not that random, i will work on that ASAP

rex2630 commented 4 years ago

https://github.com/rex2630/codeswholesale-for-woocommerce/commit/9c6a136a26fd7ee184a457c6569e5467cfbd2568

toxicclowd commented 4 years ago

So, using the latest release of the bonnet plugin along with the latest release of this plugin, I thought I was still having problems but I'm thinking it just takes a ridiculous amount of time to import and update. I say this because it will import about a thousand items, they will be blank. the plugin will say its stuck, but if you leave it go without force stopping it, it'll slowly fill in the categories, prices, descriptions, images, etc. because I checked the products toward the beginning and they were empty but if I let it go then a couple hours later some of them will be filled in with info. plus about 1000 more products got added. this is just in a matter of about 5-7 hours so I'm going to let it run for a day or two and see if it will do a complete import.

scarecr0w12 commented 4 years ago

@rex2630 Looks good so far, had a bunch of randoms coming in, then installed new code, and they stopped. So far so good.

@toxicclowd Thats correct, You'll end up with about 5,184 items in total that actually have information from what i've seen.

HavioFrance commented 3 years ago

hi i have same error : Server error: POST https://api.codeswholesale.com/v2/imports resulted in a 500 Internal Server Error response: {"status":500,"code":90001,"message":"An error has occurred. We'll fix it soon.","developerMessage":"An error has occurr (truncated...)

HavioFrance commented 3 years ago

what i need make ?

HavioFrance commented 3 years ago

can you help me please @rex2630

MadCatMining commented 1 year ago

Capture

Hey! I know this thread is pretty old now, but I can later share the diff's based on official plugin v.2.5.4, which fix the import of new products and updating the existing ones, without duplication. With latest Wordpress & php v7.4 it does not import the descriptions of a product, and only one picture (cover) of MEDIUM size.

But from what i can see - the renewal of access token is not being triggered, or there are some hidden errors. In database - the "refresh_token" does not appear even if there is an "access_token" is already available. "access_token" gets fetched only the first time after the row is being removed manually. when -it just sits there.

HavioFrance commented 1 year ago

When you think its Can be working ?

Le jeu. 19 janv. 2023, 13:16, MadCatMining @.***> a écrit :

[image: Capture] https://user-images.githubusercontent.com/17141973/213438796-350c3cae-eb03-482f-9d59-e769983283e2.PNG

Hey! I know this thread is pretty old now, but I can later share the diff's based on official plugin v.2.5.4, which fix the import of new products and updating the existing ones, without duplication. With latest Wordpress & php v7.4 it does not import the descriptions of a product, and only one picture (cover) of MEDIUM size.

But from what i can see - the renewal of access token is not being triggered, or there are some hidden errors. In database - the "refresh_token" does not appear even if there is an "access_token" is already available. "access_token" gets fetched only the first time after the row is being removed manually. when -it just sits there.

— Reply to this email directly, view it on GitHub https://github.com/rex2630/codeswholesale-for-woocommerce/issues/6#issuecomment-1396888014, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVFXPDGPZ6ZK5EV6JRSO6TLWTEWAZANCNFSM4S2FSCJQ . You are receiving this because you commented.Message ID: @.***>

MadCatMining commented 1 year ago

As i've described earlier - additional attention is required to access_token renewal.

For the moment import of products is working. Price update seems to be irrelevant as bulk code providers do not follow the rules of how additional products have to be added to the platform.

MadCatMining commented 1 year ago

I don't know, i'm not a professional coder :)

Just proposing some changes for the common cause

HavioFrance commented 1 year ago

Ok and also i need add m'y token because i have biggest community gamer crypto you think its Can work for validation payment (because its woocommerce settings)

Le jeu. 19 janv. 2023, 15:17, MadCatMining @.***> a écrit :

As i've described earlier - additional attention is required to access_token renewal.

For the moment import of products is working. Price update seems to be irrelevant as bulk code providers do not follow the rules of how additional products have to be added to the platform.

— Reply to this email directly, view it on GitHub https://github.com/rex2630/codeswholesale-for-woocommerce/issues/6#issuecomment-1397049288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVFXPDHR34BSFYVKQDRJKRDWTFEIVANCNFSM4S2FSCJQ . You are receiving this because you commented.Message ID: @.***>

MadCatMining commented 1 year ago

That's beyound my competence

ShomY071 commented 1 year ago

Hi guys, are you using this plugin? Is it works?

rex2630 commented 1 year ago

I've personally dropped using it with whole codeswholesale. Seems like they dont care too much about the customers

MadCatMining commented 1 year ago

Just for the info. If any one is interested - here is a repo for the operational (as much as it gets) codeswholesale woocommerce plugin:

https://github.com/MadCatMining/codeswholesale-woocommerce

It is based on v2.5.4. It works with Wordpress 6.1.1 (current as of 05.02.2023), and a max. PHP version 7.4.

There were literally few files updated behind the scene. If any one is interested - I can point which ones were exactly changed here in the comment.

But.. The CW site/api is also seams to be affected by not having any Dev. Bulk sellers either not adhering to the rules of how keys have to be added, or that function is broken as well. Current amount of keys per API is ~40430 products. Most of them are out of supply.

MadCatMining commented 1 year ago

Ok and also i need add m'y token because i have biggest community gamer crypto you think its Can work for validation payment (because its woocommerce settings) Le jeu. 19 janv. 2023, 15:17, MadCatMining @.> a écrit : As i've described earlier - additional attention is required to access_token renewal. For the moment import of products is working. Price update seems to be irrelevant as bulk code providers do not follow the rules of how additional products have to be added to the platform. — Reply to this email directly, view it on GitHub <#6 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVFXPDHR34BSFYVKQDRJKRDWTFEIVANCNFSM4S2FSCJQ . You are receiving this because you commented.Message ID: @.>

if you have an operational crypto payment gateway - it'll work same way as with fiat payments. Example: https://store.diminutivecoin.com Prices are set in EUR (same as CW has), but the payment page actually provides the info on how many coins are required to be sent to a particular wallet address).