aaron13100 / 404solution

404 Solution
https://ajexperience.com/wealthpsychology/404-solution/
4 stars 2 forks source link

Empty Trashcan Button #21

Closed Europalso closed 6 years ago

Europalso commented 6 years ago

What I Expected To Happen

Being a typical user, I expected 404 captured URLs to be deleted when doublechecked for deletion in tools, instead of move to trashcan.

What Happened Instead

So, I ended up with a huge trashcan (almost 100000 lines). Just imagine that when trying to enter into it to search for a way to empty it, the server timeouts and I get a beautiful "503 unavailable"

Steps to Reproduce the Bug

Debug Lines

It would be a tremendous help, to add a button to empty the trashcan for cases like mine, when entering the trashcan is not possible.

Thank you in advance for considering this, and thank you for an excellent plugin!!

aaron13100 commented 6 years ago

Hey Europalos. I'll see what I can do to try to fix this. Unfortunately the "Empty Trash" button is on the "Trash" view that doesn't work for you. In the "Captured URLs" view is the "Rows per page" setting set to something small, like 50? If not maybe that would help... thanks

aaron13100 commented 6 years ago

Oh, also can you tell me what the debug log says? There should be an error message there. You can see it by going to Options -> Advanced Settings -> View the debug log.

thanks

Europalso commented 6 years ago

Hi Aaron,

Thanks for replying and letting me know.

It would be great if you can incorporate a “full empty trash can” button in the tools page.

I guess you would also truncate the relative sql table to minimize its size.

Awaiting for your new functionality then.

Best regards,

Christos Papantonakis

Chief Information Officer

Web and Social Media Officer

Europalso commented 6 years ago

2017-11-13 11:32:49 (ERROR): No ID(s) found in GET or POST data for edit request., PHP version: 5.5.38, WP ver: 4.8.3, Plugin ver: 2.3.0, Referrer: https://www.europalso.gr/wp-admin/options-general.php?page=abj404_solution&subpage=abj404_captured, Trace: #0 /usr/www/users/europj/wp-content/plugins/404-solution/includes/View.php(565): ABJ_404_Solution_Logging->errorMessage('No ID(s) found ...')

1 /usr/www/users/europj/wp-content/plugins/404-solution/includes/View.php(106): ABJ_404_Solution_View->echoAdminEditRedirectPage()

2 /usr/www/users/europj/wp-content/plugins/404-solution/includes/View.php(72): ABJ_404_Solution_View->echoChosenAdminTab('editRedirect', '', '')

3 [internal function]: ABJ_404_Solution_View::handleMainAdminPageActionAndDisplay('')

4 /usr/www/users/europj/wp-includes/class-wp-hook.php(298): call_user_func_array('ABJ_404_Solutio...', Array)

5 /usr/www/users/europj/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)

6 /usr/www/users/europj/wp-includes/plugin.php(453): WP_Hook->do_action(Array)

7 /usr/www/users/europj/wp-admin/admin.php(222): do_action('settings_page_a...')

8 /usr/www/users/europj/wp-admin/options-general.php(10): require_once('/usr/www/users/...')

9 {main}

Christos Papantonakis

Chief Information Officer

Web and Social Media Officer

aaron13100 commented 6 years ago

I'll have to spend some time trying to reproduce this. In the meantime, if you're bored, the error message and what you're describing don't really make sense to me. Does the error happen while trying to edit a redirect? I thought the issue was with emptying the trash? Can you delete the debug log, do the one thing that causes the issue, then send or attach the entire debug log? thanks

aaron13100 commented 6 years ago

Europalso, I created 130,000 redirects that are in the trash on my test site and it still works fine for me. So I would need the bug to be recreated and the complete debug log to be able to move forward on this.

aaron13100 commented 6 years ago

thanks

Europalso commented 6 years ago

Dear Aaron,

I really don't want to be a smart ass or anything, but I tried again and it timeouts. An "Empty trashcan" button would be a miracle.

If for any reason you do not wish to have such a button in your application, please give me instructions about the MySQL tables you use in website's database, so that I will be able to delete lines and then truncate these tables.

Thank in advance for your time and consideration.

Best Regards,

Christos

aaron13100 commented 6 years ago

Christos I can see that you're frustrated, but I don't have enough information to be able to help you. Since I do have an "empty trash" button when I use the plugin, I'll need a lot of information from you to be able to solve the problem. What I would need is for you to

1) delete the log file (Options -> Advanced Settings -> Delete the Debug File) 2) Go to the Trash page that times out, where you have the issue. 3) View the log file (Options -> Advanced Settings -> View the log file) 4) Send me the entire file contents here.

Without that it will be impossible for me to help....

-Aaron

Europalso commented 6 years ago

Aaron,

I followed your exact instructions, and after getting error 500, I tried to see the debug file, but I get a message "(the file does not exist.)" so I have nothing to send you.

Instead I send you two screen captures, so that you can see which trashcan has the problem, and the timeout I get when trying to enter it. aaron_prob1 aaron_prob2

I still believe that you should replicate the "Empty Trash Can" button inside "Options" or "Tools" tab too. But then again, who am I and what do I know?

I am waiting for your response at your earliest convenience, hoping for a solution to the problem.

Thanks again for your time and consideration.

aaron13100 commented 6 years ago

Christos, probably the "(the file does not exist.)" message was because the server was still doing something and the error didn't have a chance to happen yet. If you look at the debug file now, without deleting it first, it'll probably be there. Please send me the whole thing...

If it's still not there then please click around the plugin pages a bit, doing whatever it is you had done before to create the error message, then send me the entire file...

Are you open to letting me login to your site as an admin to debug the issue?

thanks

-Aaron

Europalso commented 6 years ago

Hello again,

Monday 20 NOV 2017 12:30 local time

Log file is:

2017-11-18 11:01:29 (INFO): deleteOldRedirectsCron. Old captured URLs removed: 0, Old automatic redirects removed: 0, Old manual redirects removed: 0, Old log lines removed: 5000, Duplicate rows deleted: 2302 2017-11-19 10:58:56 (INFO): deleteOldRedirectsCron. Old captured URLs removed: 0, Old automatic redirects removed: 0, Old manual redirects removed: 0, Old log lines removed: 3000, Duplicate rows deleted: 1109

As you can see you there is no info about any trouble.

You are more than welcome to login as admin to the site. But it is an active website with pages that clients access online and enter order details, so we must choose a low usage hour for your debugging, because all my attempts to get inside the trashcan page, create huge delays to the website even after the 500 ot 503 errors. I guess some time around midnight local time would be ideal.

Also give me your email that is not linked to this repository, because I think it would be better to continue our communication there, than here in plain sight.

BR

Christos

Europalso commented 6 years ago

Can you please confirm the following

SELECT * FROM eur_abj404_redirects WHERE disabled = 1

gives me the trash can records ?

and

SELECT * FROM eur_abj404_redirects WHERE disabled = 0

gives me the captured 404 urls ?

The above mentioned table is this one:

aaron_prob3

aaron13100 commented 6 years ago

Christos,

I released version 2.3.2 of the plugin. Please upgrade! You should be able to activate it now. Please turn off debug mode in the options as I forgot to do that earlier. (Options -> Advanced Settings -> Debug logging)

Does the Captured 404 URLs page will work now? Does it take 5 to 10 minutes to load?

thanks

-Aaron

aaron13100 commented 6 years ago

Christos,

Version 2.4.0 should fix all of the previous issues. Let me know if that's the case or not.

thanks

Europalso commented 6 years ago

Hello again Aaron,

First let me thank you for all your efforts.

After installing 2.4.0 of course the plugin is activated and everything is lightning fast, and I am also able to enter into the “Captured 404 URLs/Trash” page. BUT, when I press the “Empty Trash” button I get an empty page and nothing happens.

As you know I can delete these lines from the relevant SQL table, but I leave them there in case you need to see this behavior in person.

Let me know.

Best Regards,

Christos

From: Aaron [mailto:notifications@github.com] Sent: Sunday, November 26, 2017 10:21 PM To: aaron13100/404solution 404solution@noreply.github.com Cc: Europalso cpapantonakis@europalso.gr; Author author@noreply.github.com Subject: Re: [aaron13100/404solution] Empty Trashcan Button (#21)

Christos,

Version 2.4.0 should fix all of the previous issues. Let me know if that's the case or not.

thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aaron13100/404solution/issues/21#issuecomment-347035435 , or mute the thread https://github.com/notifications/unsubscribe-auth/AgEhwMPTjNgY_dAiZMwNF_JnfnDHMkEpks5s6cgWgaJpZM4Qb0G9 . https://github.com/notifications/beacon/AgEhwDqpijTmDdfmYyQJU0i_AqQ0pWvdks5s6cgWgaJpZM4Qb0G9.gif

aaron13100 commented 6 years ago

Hey Christos,

I'm glad the pages are loading faster for you!

Thanks for saving the data for me. Is there an error in the debug log file after trying the "empty trash" button?

Thanks...

On Nov 27, 2017 5:50 AM, "Europalso" notifications@github.com wrote:

Hello again Aaron,

First let me thank you for all your efforts.

After installing 2.4.0 of course the plugin is activated and everything is lightning fast, and I am also able to enter into the “Captured 404 URLs/Trash” page. BUT, when I press the “Empty Trash” button I get an empty page and nothing happens.

As you know I can delete these lines from the relevant SQL table, but I leave them there in case you need to see this behavior in person.

Let me know.

Best Regards,

Christos

Europalso commented 6 years ago

With debug logging off nothing registers.

With debug logging on I have the following lines:

2017-11-27 12:52:38 (DEBUG): Displaying sub page: abj404_options 2017-11-27 12:52:49 (DEBUG): Ignoring user agent (process ok): Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/) for URL: /en/node 2017-11-27 12:52:49 (DEBUG): Processing 404 for URL: /en/node?page=3,6,1,0 | Redirect: {"id":0} | is_single(): | is_page(): | is_feed(): | is_trackback(): | is_preview(): | options: auto_redirects: 1, auto_score: 90, auto_cats: 1, auto_tags: 1, dest404page: 0|0, HTTP_USER_AGENT: Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/), REMOTE_ADDR: 144.76.29.162, REQUEST_URI: /en/node?page=3,6,1,0 2017-11-27 12:52:49 (DEBUG): No posts or pages matching slug: node 2017-11-27 12:52:49 (DEBUG): Logging redirect. Referer: | Current user: | From: /en/node?page=3,6,1,0 to: 404, Reason: gave up. , Ignore msg(s): User agent (process ok): mj12bot 2017-11-27 12:52:52 (DEBUG): Processing request for action: (none) 2017-11-27 12:52:52 (DEBUG): Displaying sub page: abj404_captured 2017-11-27 12:52:55 (DEBUG): Processing request for action: (none) 2017-11-27 12:52:55 (DEBUG): Displaying sub page: abj404_captured 2017-11-27 12:52:58 (DEBUG): Processing request for action: (none) 2017-11-27 12:52:58 (DEBUG): Displaying sub page: abj404_captured 2017-11-27 12:52:58 (DEBUG): Ignoring user agent (process ok): Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/) for URL: /en/node 2017-11-27 12:52:58 (DEBUG): Processing 404 for URL: /en/node?page=3,6,10,28 | Redirect: {"id":0} | is_single(): | is_page(): | is_feed(): | is_trackback(): | is_preview(): | options: auto_redirects: 1, auto_score: 90, auto_cats: 1, auto_tags: 1, dest404page: 0|0, HTTP_USER_AGENT: Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/), REMOTE_ADDR: 144.76.29.162, REQUEST_URI: /en/node?page=3,6,10,28 2017-11-27 12:52:58 (DEBUG): No posts or pages matching slug: node 2017-11-27 12:52:59 (DEBUG): Logging redirect. Referer: | Current user: | From: /en/node?page=3,6,10,28 to: 404, Reason: gave up. , Ignore msg(s): User agent (process ok): mj12bot 2017-11-27 12:53:00 (DEBUG): Processing request for action: (none) 2017-11-27 12:53:00 (DEBUG): Displaying sub page: abj404_captured 2017-11-27 12:53:06 (DEBUG): Ignoring user agent (process ok): Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/) for URL: /en/node 2017-11-27 12:53:06 (DEBUG): Processing 404 for URL: /en/node?page=3,6,2,6 | Redirect: {"id":0} | is_single(): | is_page(): | is_feed(): | is_trackback(): | is_preview(): | options: auto_redirects: 1, auto_score: 90, auto_cats: 1, auto_tags: 1, dest404page: 0|0, HTTP_USER_AGENT: Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/), REMOTE_ADDR: 144.76.29.162, REQUEST_URI: /en/node?page=3,6,2,6 2017-11-27 12:53:06 (DEBUG): No posts or pages matching slug: node 2017-11-27 12:53:06 (DEBUG): Logging redirect. Referer: | Current user: | From: /en/node?page=3,6,2,6 to: 404, Reason: gave up. , Ignore msg(s): User agent (process ok): mj12bot 2017-11-27 12:53:20 (DEBUG): Ignoring user agent (process ok): Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/) for URL: /en/node 2017-11-27 12:53:20 (DEBUG): Processing 404 for URL: /en/node?page=3,6,4,12 | Redirect: {"id":0} | is_single(): | is_page(): | is_feed(): | is_trackback(): | is_preview(): | options: auto_redirects: 1, auto_score: 90, auto_cats: 1, auto_tags: 1, dest404page: 0|0, HTTP_USER_AGENT: Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/), REMOTE_ADDR: 144.76.29.162, REQUEST_URI: /en/node?page=3,6,4,12 2017-11-27 12:53:20 (DEBUG): No posts or pages matching slug: node 2017-11-27 12:53:21 (DEBUG): Logging redirect. Referer: | Current user: | From: /en/node?page=3,6,4,12 to: 404, Reason: gave up. , Ignore msg(s): User agent (process ok): mj12bot 2017-11-27 12:53:21 (DEBUG): Processing request for action: emptyCapturedTrash 2017-11-27 12:53:27 (DEBUG): Ignoring user agent (process ok): Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/) for URL: /en/node 2017-11-27 12:53:28 (DEBUG): Processing 404 for URL: /en/node?page=3,6,4,13 | Redirect: {"id":0} | is_single(): | is_page(): | is_feed(): | is_trackback(): | is_preview(): | options: auto_redirects: 1, auto_score: 90, auto_cats: 1, auto_tags: 1, dest404page: 0|0, HTTP_USER_AGENT: Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/), REMOTE_ADDR: 144.76.29.162, REQUEST_URI: /en/node?page=3,6,4,13 2017-11-27 12:53:28 (DEBUG): No posts or pages matching slug: node 2017-11-27 12:53:28 (DEBUG): Logging redirect. Referer: | Current user: | From: /en/node?page=3,6,4,13 to: 404, Reason: gave up. , Ignore msg(s): User agent (process ok): mj12bot 2017-11-27 12:53:42 (DEBUG): Ignoring user agent (process ok): Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/) for URL: /en/node 2017-11-27 12:53:42 (DEBUG): Processing 404 for URL: /en/node?page=3,6,4,18 | Redirect: {"id":0} | is_single(): | is_page(): | is_feed(): | is_trackback(): | is_preview(): | options: auto_redirects: 1, auto_score: 90, auto_cats: 1, auto_tags: 1, dest404page: 0|0, HTTP_USER_AGENT: Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/), REMOTE_ADDR: 144.76.29.162, REQUEST_URI: /en/node?page=3,6,4,18 2017-11-27 12:53:42 (DEBUG): No posts or pages matching slug: node 2017-11-27 12:53:42 (DEBUG): Logging redirect. Referer: | Current user: | From: /en/node?page=3,6,4,18 to: 404, Reason: gave up. , Ignore msg(s): User agent (process ok): mj12bot 2017-11-27 12:53:56 (DEBUG): Processing request for action: (none) 2017-11-27 12:53:56 (DEBUG): Displaying sub page: abj404_debugfile

aaron13100 commented 6 years ago

Hm ok. I'm going out today so I'll have to take a look at this later tonight. Probably I'll have to add more debug messages in to see what's happening. I'll get back to you. thanks

Europalso commented 6 years ago

OK

I just stopped this annoying mj12bot using my robots.txt so your debug will be free of all this trash.

BR

aaron13100 commented 6 years ago

Christos, version 2.4.1 should work. Let me know...

thanks

Europalso commented 6 years ago

Aaron,

2.4.1 works like a charm!!!!

Kudos!!!!

Europalso commented 6 years ago

I also optimized "_redirects" table, no need for it to be some MBytes in size.

In "_logsv2" table what do you propose me to do regarding deletion of unnecessary lines?

Europalso commented 6 years ago

I was also trying to see the functionality of your "Logs" tab. It is a nice case in my site, since it has over 92300 lines.

I think it is a good idea to add some sort of selection and mass selection tool along with a "delete selected" button.

Just my 2c

aaron13100 commented 6 years ago

Good idea. I'll add an "optimize table ..." after emptying the trash.

About the logs. I don't understand. So you want to delete specific lines from the log manually instead of having the oldest ones deleted automatically? I guess I don't understand the end goal.

cheers

Europalso commented 6 years ago

Regarding logs... scenario (real one).

A bad bot created lots of unwanted trash traffic. You "killed it" (in robots.txt) and you have thousands of log lines related to that bot's IP to clear before clearing older potentially useful logs regarding real traffic.

But it is not a pressing issue... just an idea.

Europalso commented 6 years ago

Captured 404 URLs/Captured URLs, sort by Hits is broken.

aaron13100 commented 6 years ago

About logs. Okay. If you can delete lines from it though, then it's not a log, it's just a list. I would suggest changing the "Maximum log disk usage" to 1 MB, going to the "Tools" tab and running the Maintenance (all the way at the bottom), then changing the "Maximum log disk usage" back to what you want.

Thanks for letting me know about sorting by hits! I'll have a look at it.