If this is your first visit, check our documentation. To post, register or login.

Delete Spam Customers

Started by swguy on 11 Jun 2019, 12:01 PM · Views: 16,210

Results 41 to 48 of 48
13 Jan 2022, 9:07 PM
#41
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Delete Spam Customers

It never happened but I had a bad dream about it. You could have a customer from Zimbabwe who worked for Google and had a yandex.com email address!

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

22 May 2022, 5:03 PM
#42
ianhg avatar

ianhg

Zen Follower

Join Date:
Jul 2007
Posts:
345
Plugin Contributions:
3

Re: Delete Spam Customers

@swguy
I looked at your delete spam customers as you suggested.
I worked out if I add this it will remove customers who have not ordered, but I would prefer to not delete customers who have not ordered in the last month. Is there a way of amending this:

$queries[] = array(   'name' => 'Accounts with no purchase',    'string' => "SELECT customers_id FROM " . TABLE_CUSTOMERS . " WHERE customers_id NOT IN (SELECT customers_id FROM ".TABLE_ORDERS.")");

Assuming this is correct, as the plugin was originally yours do you want to amend it to include this or should I simply submit a revised plugin as Remove Customers who have not ordered?
Thanks for the guidance.

22 May 2022, 9:29 PM
#43
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Delete Spam Customers

ianhg:

Assuming this is correct, as the plugin was originally yours do you want to amend it to include this or should I simply submit a revised plugin as Remove Customers who have not ordered?
Thanks for the guidance.

Neither. I don't update it every time someone has a new idea for a query.

You said,

I would prefer to not delete customers who have not ordered in the last month.

Do you mean "delete customers who have never ordered if their accounts are more than a month old?"

If so, see the FAQ on my site has additional examples that might be useful. The last example will point you in the right direction.

Test your query in phpMyAdmin and see if it's satisfactory.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

23 Apr 2024, 3:30 PM
#44
firebug avatar

firebug

New Zenner

Join Date:
Mar 2011
Location:
Georgia
Posts:
26
Plugin Contributions:
0

Re: Delete Spam Customers

All of my fake accounts have letters in their postal code (YeHsaInklb). Can anyone suggest a query I can add to remove all accounts with letters in the postal code?

23 Apr 2024, 3:43 PM
#45
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Delete Spam Customers

use the Fake Google accounts query and change

entry_company = 'google'

to

entry_postcode = 'YeHsaInklb'

(and change the query name too.)

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

23 Apr 2024, 4:18 PM
#46
firebug avatar

firebug

New Zenner

Join Date:
Mar 2011
Location:
Georgia
Posts:
26
Plugin Contributions:
0

Re: Delete Spam Customers

swguy:

use the Fake Google accounts query and change

entry_company = 'google'

to

entry_postcode = 'YeHsaInklb'

(and change the query name too.)

I should have said all of my fake accounts contain all random letters in their post code but none are exactly the same. I need a query to find random letters in the postal code.

Would this work?

$queries[] = array(
'name' => 'Fake Post Code',
'string' => "SELECT customers_id FROM " . TABLE_ADDRESS_BOOK . " WHERE entry_postcode LIKE '%[^a-z]%'"
);

23 Apr 2024, 6:11 PM
#47
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Delete Spam Customers

You'll need to use regular expressions and the syntax is different for different versions of mysql. Use phpMyAdmin to figure out a syntax that works with your version.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

23 Apr 2024, 6:32 PM
#48
firebug avatar

firebug

New Zenner

Join Date:
Mar 2011
Location:
Georgia
Posts:
26
Plugin Contributions:
0

Re: Delete Spam Customers

swguy:

You'll need to use regular expressions and the syntax is different for different versions of mysql. Use phpMyAdmin to figure out a syntax that works with your version.

Thank you so much!
I added the following to code 26 times for each letter of the alphabet and it removed all the fake accounts that had a letter in the postal code.

$queries[] = array(
'name' => 'Fake Post Code',
'string' => "SELECT customers_id FROM " . TABLE_ADDRESS_BOOK . " WHERE entry_postcode LIKE 'a%'"
);