XH 1.6: Linkchecker overhaul

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6: Linkchecker overhaul

Post by cmb » Fri Jul 19, 2013 12:11 am

Hi Holger,

thanks for testing. :)
Holger wrote:But I've noticed that redirected pages are now reported to check by the user.
For example say you have a sub-navigation with a list of internal links in a newsbox.
The links are redirected to pages like "Impressum"...
Indeed, I have not thought about the redirection of internal links. However, there should be a general improvement regarding redirects. It seems to me that it's not a bad idea to hint that there's a redirection (for instance, see the change from cmsimple-xh.com to cmsimple-xh.org), but the redirects should be followed and checked anyway.

Before elaborating on this variant further, it would be good to know, if the performance is good for many internal links (I suppose that external links are checked faster, but internal links take longer). So it would be nice to have some more real-world tests; I encourage everyone to download the plugin and compare it with the built-in link check, and to report the results.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6: Linkchecker overhaul

Post by cmb » Fri Jul 19, 2013 11:43 pm

I have added the following of redirections to the link checker draft. It is configurable whether any redirects should be reported as hints or simply suppressed. Furthermore I have added appropriate background colors for the errors resp. hints.

Please download and test the plugin and give feedback: http://3-magi.net/downloads/Linkcheck_XH.zip. The plugin works with CMSimple_XH 1.5.7 (and probably older versions and with CMSimple 4), so you don't need to download and set up a snapshot of CMSimple_XH 1.6.

Thanks in advance for helping improving CMSimple_XH.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6: Linkchecker overhaul

Post by cmb » Thu Aug 15, 2013 8:08 pm

Any test results?
Christoph M. Becker – Plugins for CMSimple_XH

bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: XH 1.6: Linkchecker overhaul

Post by bca » Fri Aug 16, 2013 9:16 am

Could not get it to work in 1.5.7.
Froze the whole site and had to delete the plugin to unfreeze it!!
B

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6: Linkchecker overhaul

Post by cmb » Fri Aug 16, 2013 10:27 am

Thanks for testing. :)

What did you mean with "Froze the whole site"? Did you always get a blank browser window, or did the request actually hang (i.e. never return)? Have you enabled debug mode?
Christoph M. Becker – Plugins for CMSimple_XH

bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: XH 1.6: Linkchecker overhaul

Post by bca » Fri Aug 16, 2013 11:29 am

I installed the plugin.
Logged in and selected Linkchecker in dropdown menu.
Screen opened which just said Linkchecker with three menu options.
Waited but nothing happened.
Clicked on menu option Main Settings(?) the left hand one.
The site then stopped and couldn't access any pages. Page eventually came up which said that there was an error in the script and the site froze. I deleted linkchecker using ftp and a few minutes later the site came up again.

in the interests of progress i just enabled debug, reinstalled linkchecker and tried again. Same result and debug no error messages referring to Linkchecker

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6: Linkchecker overhaul

Post by cmb » Fri Aug 16, 2013 12:14 pm

bca wrote:Clicked on menu option Main Settings(?) the left hand one.
Yes, that's the way it's meant to work (for testing purposes).
bca wrote:The site then stopped and couldn't access any pages. Page eventually came up which said that there was an error in the script and the site froze. I deleted linkchecker using ftp and a few minutes later the site came up again.

in the interests of progress i just enabled debug, reinstalled linkchecker and tried again. Same result and debug no error messages referring to Linkchecker
I guess an Apache worker process/thread did still hang in the background, so the server refused further requests. I'll review the code later today, and try to improve the timeout handling.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6: Linkchecker overhaul

Post by cmb » Sun Aug 18, 2013 2:56 pm

I investigated some more about the issue, and now I'm not sure, if the behavior was caused by a timeout, or rather a congestion of the server and possibly a preventive mitigation thereof. As it's now the LinkChecker opens a HTTP connection for every unique link simultenously, what might easily be regarded as a (D)DOS attack by the server.

RFC2616 states that a client should not maintain more than 2 connections with any server or proxy (modern browsers seem to use some more, though). Heeding this advice would increase the complexity of the LinkCheck quite considerably, or otherwise substantially slow it down (what is likely to bring back timeout issues or at least unresponsiveness of the check).

However, to make at least some progress, I have modified the latest version of Linkcheck_XH to use the curl_multi_* functions (these are less error prone than the manual way and restrict the simultenaous connections to at most 10). The new version requires PHP 5 and the "curl" extension to be installed (a small system check is included). Please download, test it and provide feedback. (even if it's just that you can't test it, because one or both of the requirements fail)

A completely different strategy might also be considered. Basically this is employed by the Broken Link Checker Wordpress Plugin. The idea is to run the checks in the background one by one while one's logged in as admin; all broken links are gathered and can be viewed later, when all checks are finished.
Last edited by cmb on Sun Aug 18, 2013 3:54 pm, edited 1 time in total.
Reason: PS: fixed download link
Christoph M. Becker – Plugins for CMSimple_XH

oldnema
Posts: 265
Joined: Wed Jan 21, 2009 5:15 pm
Location: Czech Republic
Contact:

Re: XH 1.6: Linkchecker overhaul

Post by oldnema » Sun Aug 18, 2013 3:43 pm

Download link does not exist
Nobody knows how much time he has left ...
http://oldnema.compsys.cz/en/?Demo_templates

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6: Linkchecker overhaul

Post by cmb » Sun Aug 18, 2013 3:54 pm

Sorry, Josef, I've forgotten the file extension (.zip). It's fixed now.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply