aaron13100 / 404solution

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

Empty Trash buttons dosn't work #23

Closed VA3DBJ closed 5 years ago

VA3DBJ commented 6 years ago

The Empty Trash buttons on the Captured 404 URL's and the page Redirects pages do not work. It states that it has deleted all the items, but the items are still there, when you refresh the page.

aaron13100 commented 6 years ago

Hi VA3DBJ,

Let's figure out what's going on.

Please click the empty trash button and then have a look at the debug log (Settings -> 404 Solution -> Options -> Advanced Settings Etc -> View the debug log).

Perhaps there will be an error message there. If so then please paste the error message here for me.

If not then please turn on "Debug logging" within the plugin (Settings -> 404 Solution -> Options -> Advanced Settings Etc -> Debug logging [checkbox]). Then click the empty trash button and paste the last part of the debug log here. When it works the debug log looks something like this.

2018-06-23 14:11:00 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-23 14:11:06 UTC (DEBUG): Processing request for action: emptyCapturedTrash 2018-06-23 14:11:06 UTC (DEBUG): doEmptyTrash deleted 4 rows total. (abj404_captured) 2018-06-23 14:11:06 UTC (DEBUG): Displaying sub page: abj404_captured

Let me know how it goes.

thanks

VA3DBJ commented 6 years ago

2018-06-24 00:12:07 UTC (DEBUG): Displaying sub page: abj404_options 2018-06-24 00:12:10 UTC (DEBUG): Processing request for action: (none) 2018-06-24 00:12:10 UTC (DEBUG): Displaying sub page: abj404_redirects 2018-06-24 00:12:14 UTC (DEBUG): Processing request for action: (none) 2018-06-24 00:12:14 UTC (DEBUG): Displaying sub page: abj404_redirects 2018-06-24 00:12:16 UTC (DEBUG): Processing request for action: emptyRedirectTrash 2018-06-24 00:12:16 UTC (DEBUG): doEmptyTrash deleted 0 rows total. (abj404_redirects) 2018-06-24 00:12:16 UTC (DEBUG): Displaying sub page: abj404_redirects 2018-06-24 00:12:18 UTC (DEBUG): Processing request for action: (none) 2018-06-24 00:12:18 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-24 00:12:18 UTC (DEBUG): Processing request for action: (none) 2018-06-24 00:12:18 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-24 00:12:20 UTC (DEBUG): Processing request for action: (none) 2018-06-24 00:12:20 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-24 00:12:22 UTC (DEBUG): Processing request for action: emptyCapturedTrash 2018-06-24 00:12:22 UTC (DEBUG): doEmptyTrash deleted 0 rows total. (abj404_captured) 2018-06-24 00:12:22 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-24 00:12:26 UTC (DEBUG): Processing request for action: (none) 2018-06-24 00:12:26 UTC (DEBUG): Displaying sub page: abj404_options 2018-06-24 00:12:32 UTC (DEBUG): Processing request for action: (none) 2018-06-24 00:12:32 UTC (DEBUG): Displaying sub page: abj404_debugfile

capture1 capture2

All (35) | Manual Redirects (25) | Automatic Redirects (10) | Trash (1) Captured URLs (11) | Ignored 404s (0) | Organize Later (0) | Trash (348)

aaron13100 commented 6 years ago

We should make sure autocommit is turned on and look at the SQL that's being used in to query and to empty the trash.

We can add/edit some lines to the plugin to do this. If you want I can remote into your machine to do it for you when it's convenient for you.

I will edit PluginLogic.php and add these lines $abj404logging->debugMessage("empty trash query: " . $query); $result = ABJ_404_Solution_DataAccess::queryAndGetResults("commit"); $result = ABJ_404_Solution_DataAccess::queryAndGetResults("show variables like 'autocommit'"); $abj404logging->debugMessage("autocommit value: " . json_encode($result)); around line 920 after the line that starts with "$abj404logging->debugMessage("doEmptyTrash deleted "[...]

Then I would edit DataAccess.php around line 396 right after "$results = $this->queryAndGetResults($query);" and add this line $abj404logging->debugMessage("query trash query: " . $query);

then I would have a look at the results in the debug log. Let me know what you want to do. If you want me to remote in then you can email me at aaron@wealth-psychology.com. If you want to make the edits yourself then let me know how it goes. If you don't want either of those then let me know and I'll try to think of a way to incorporate this extra debug information into the normal plugin.

aaron13100 commented 6 years ago

"Remoting into your machine" with TeamViewer means you can watch as I test the changes. Otherwise access to your site would work as well, but it would be unmonitored in that case.

VA3DBJ commented 6 years ago

I added the lines and here is the resulting log:

2018-06-29 00:46:14 UTC (DEBUG): Displaying sub page: abj404_options 2018-06-29 00:46:17 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:17 UTC (DEBUG): Displaying sub page: abj404_options 2018-06-29 00:46:23 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:23 UTC (DEBUG): Displaying sub page: abj404_redirects 2018-06-29 00:46:23 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status in (1, 2, 6)) and disabled = 0 order by url ASC limit 0, 25 2018-06-29 00:46:25 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:25 UTC (DEBUG): Displaying sub page: abj404_redirects 2018-06-29 00:46:25 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status in (1, 2, 6)) and disabled = 1 order by url ASC limit 0, 25 2018-06-29 00:46:31 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:31 UTC (DEBUG): Displaying sub page: abj404_redirects 2018-06-29 00:46:31 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status in (1, 2, 6)) and disabled = 1 order by url ASC limit 0, 25 2018-06-29 00:46:33 UTC (DEBUG): Processing request for action: emptyRedirectTrash 2018-06-29 00:46:33 UTC (DEBUG): doEmptyTrash deleted 0 rows total. (abj404_redirects) 2018-06-29 00:46:33 UTC (DEBUG): empty trash query: delete FROM wp799_abj404_redirects where disabled = 1 and status = 2 2018-06-29 00:46:33 UTC (DEBUG): autocommit value: {"rows":[{"Variable_name":"autocommit","Value":"ON"}],"last_error":"","last_result":[{"Variable_name":"autocommit","Value":"ON"}],"rows_affected":0,"insert_id":0} 2018-06-29 00:46:33 UTC (DEBUG): Displaying sub page: abj404_redirects 2018-06-29 00:46:33 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status in (1, 2, 6)) and disabled = 1 order by url ASC limit 0, 25 2018-06-29 00:46:39 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:39 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-29 00:46:39 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status = 3) and disabled = 0 order by url ASC limit 0, 25 2018-06-29 00:46:42 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:42 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-29 00:46:42 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status in (3, 4, 5) ) and disabled = 1 order by url ASC limit 0, 25 2018-06-29 00:46:47 UTC (DEBUG): Processing request for action: emptyCapturedTrash 2018-06-29 00:46:47 UTC (DEBUG): doEmptyTrash deleted 0 rows total. (abj404_captured) 2018-06-29 00:46:47 UTC (DEBUG): empty trash query: delete FROM wp799_abj404_redirects where disabled = 1 and status = 3 2018-06-29 00:46:47 UTC (DEBUG): autocommit value: {"rows":[{"Variable_name":"autocommit","Value":"ON"}],"last_error":"","last_result":[{"Variable_name":"autocommit","Value":"ON"}],"rows_affected":0,"insert_id":0} 2018-06-29 00:46:47 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-29 00:46:47 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status in (3, 4, 5) ) and disabled = 1 order by url ASC limit 0, 25 2018-06-29 00:46:47 UTC (DEBUG): Processing request for action: emptyCapturedTrash 2018-06-29 00:46:47 UTC (DEBUG): doEmptyTrash deleted 0 rows total. (abj404_captured) 2018-06-29 00:46:47 UTC (DEBUG): empty trash query: delete FROM wp799_abj404_redirects where disabled = 1 and status = 3 2018-06-29 00:46:47 UTC (DEBUG): autocommit value: {"rows":[{"Variable_name":"autocommit","Value":"ON"}],"last_error":"","last_result":[{"Variable_name":"autocommit","Value":"ON"}],"rows_affected":0,"insert_id":0} 2018-06-29 00:46:47 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-29 00:46:47 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status in (3, 4, 5) ) and disabled = 1 order by url ASC limit 0, 25 2018-06-29 00:46:50 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:50 UTC (DEBUG): Displaying sub page: abj404_redirects 2018-06-29 00:46:50 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status in (1, 2, 6)) and disabled = 0 order by url ASC limit 0, 25 2018-06-29 00:46:53 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:53 UTC (DEBUG): Displaying sub page: abj404_captured 2018-06-29 00:46:53 UTC (DEBUG): query trash query: select wp799_abj404_redirects.id, wp799_abj404_redirects.url, wp799_abj404_redirects.status, wp799_abj404_redirects.type, wp799_abj404_redirects.final_dest, wp799_abj404_redirects.code, wp799_abj404_redirects.timestamp, wp799_posts.id as wp_post_id, null as logshits, null as logsid, null as last_used, wp799_posts.post_type as wp_post_type from wp799_abj404_redirects LEFT OUTER JOIN wp799_posts on wp799_abj404_redirects.final_dest = wp799_posts.id where 1 and (status = 3) and disabled = 0 order by url ASC limit 0, 25 2018-06-29 00:46:56 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:46:56 UTC (DEBUG): Displaying sub page: abj404_options 2018-06-29 00:47:02 UTC (DEBUG): Processing request for action: (none) 2018-06-29 00:47:02 UTC (DEBUG): Displaying sub page: abj404_debugfile

aaron13100 commented 6 years ago

Please try version 2.9.2 and let me know how it goes.