Resource icon

Unclutter - Get Inactive Website Status 0.2

No permission to download

Mark

Administrator
Staff member
Mark submitted a new resource:

Unclutter - Get Inactive Website Status - shows dead websites for easier maintenance

What does it do?
This plugin will display the website response code on the manage inactive members page of the admin panel. If a website is dead, unregistered, unhosted etc you can investigate and remove.

How do I use it?
Go to your manage inactive members page of your admin panel, and you will see a status column along with the header response from your members websites.

Installation:
Upload zip file via your admin panel plugin manager.
Read more about this resource...
 

Karl

Member
on checking the sites that are inactive on my site I have had a couple of dead sites that still show as a status 200/ok .
 

Mark

Administrator
Staff member
could you post the URL's of the dead sites so I can see what they return?
 

Mark

Administrator
Staff member
Got the pm with the URL thanks, that URL is actually active and returns 200. Even though the domain expired, the domain is now parked and is serving content. There is no way for this plugin to know if it's a legit page or a parked page.
 

Karl

Member
Ahh that makes sense thanks.

On one my sites when I run the validate links function in the directory script it picks up if a site is parked does this mean that some parked domains have a different return or would they have been picked up another way?
 

Mark

Administrator
Staff member
Most likely they are returning a different status, it depends on how the parked page is setup
 

mwhite21

New Member
Neat idea but I have 3 problems.
  1. It takes AGES (about 3-4 minutes for the page to load now)
  2. Each new page takes more time to load.
  3. If I click delete on a dead site, it returns me to the old page without "status". With 21 pages full of active sites, is there no way to filter just the inactive ones?
This tool is VERY helpful but at the same time it is a bit more time consuming than if I was to manually check each link =P
 

Mark

Administrator
Staff member
hmm I was pretty sure this checked only inactive sites already, given the name of the plugin. It is slow while doing the checks, but if its only checking sites with inactive status then it should only be checking a handful of sites and the speed should be tolerable. I'll need to double check and ensure its only checking inactive, sounds like on your list its not.

that said, the plugin can use some improvements and optimizations, there are more elegant ways (Ajax) to handle these checks.
 

mwhite21

New Member
hmm I was pretty sure this checked only inactive sites already, given the name of the plugin. It is slow while doing the checks, but if its only checking sites with inactive status then it should only be checking a handful of sites and the speed should be tolerable. I'll need to double check and ensure its only checking inactive, sounds like on your list its not.

that said, the plugin can use some improvements and optimizations, there are more elegant ways (Ajax) to handle these checks.
My apology for the lack of reply. I didn't get hit with a notification so I just stumbled back on this.

It's searching all sites & listing them. I have 13 pages of sites & it's listing all 13. Some show ok. Some show errors (which are the sites I need to clean up!). It's a GREAT feature. Sounds like it's just a bit outdated. The addition of an ajax check WOULD be pretty nice though =)
 

Basti

Administrator
Staff member
First off, please do us a favor. We will later update this plugin also with this when next VL is released. This is to fix a few errors.

1) In the file sources/admin/inactive.php
Code:
    eval (PluginManager::getPluginManager ()->pluginHooks ('admin_manage_build_page'));
That hook is use by another file already. Please change it to this
Code:
    eval (PluginManager::getPluginManager ()->pluginHooks ('admin_manage_inactive_build_page'));

2) Next up in the same file
Code:
$num_list = 20;
On a new blank line below it, add
Code:
    $extra_heading = '';
3) Next up still same file
Code:
      $blacklist_extra = '';
Again, below on blank line, add
Code:
$extra = '';

4) Then go into the Unclutter plugin folder and change the filename admin_manage_build_page.php to admin_manage_inactive_build_page.php
Then open this file, and replace all content with this
Code:
$ch = curl_init($url);
if (!$ch) {
    die("Couldn't initialize a cURL handle");
}
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);

$c = curl_exec($ch);

$http_codes = parse_ini_file("./plugins/Unclutter/check.ini");

$http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$http_status_text = ($http_status_code > 0) ? $http_codes[curl_getinfo($ch, CURLINFO_HTTP_CODE)] : 'Failed';

$extra .= "<td align=\"center\">{$http_status_code} | {$http_status_text}</td>";
Few changes in this file.
- First off, added a connect timeout, so no url will get called longer than 2 seconds ( usually dead sites ). Would say even 1 second is enough, but for now 2
That is what cause the huge loading time if you have many unreachable members.
It never called each and every member, but only the 20 on current page, but due there being no timeout for unreachable domains, it hanged quite badly.
- Then theres an error ( php notice ) when the curl can not connect ( usually not found domains ). We now return status text "Failed", as generally a status code of zero doesn't exist. Zero can have multiple reason, thus i call it failed.
- And lastly the $extra needed an dot before the equal sign, so that variable can be reused by other plugins


This should improove loading time by quite a bit, next up would be like Mark mentioned Ajax calls so any extra loading time doesn't influence the VL script.
And maybe also use multi curl processing to reduce the servers cpu load also.


Once we made the core changes, the plugin will get these also. Thats why you need to do it manually for now.
 
Last edited:

Basti

Administrator
Staff member
The plugin here is not updated, still a old version. Pls delete plugin and then upload the attached one.
Ill poke Mark to replace it here.

Should fix your issue
 

Attachments

Basti

Administrator
Staff member
And does that also happen when you remove the plugin?
VL 1.4 ?
Something in the error_log ?

If only with plugin, can you try to open the plugin file admin_manage_inactive_member_loop.php
find
Code:
$http_status_text = ($http_status_code > 0) ? $http_codes[curl_getinfo($ch, CURLINFO_HTTP_CODE)] : 'Failed';
Place below
Code:
curl_close($ch);
Lets try closing the connection as soon as possible and not rely on auto close
 
Top