Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

[Plugin] Error_Jump

(Page 1 of 3)
> >
Quote Reply
[Plugin] Error_Jump
Ok...I had a request for this, so I thought I would make it Smile Basically, what this plugin does, is check the URL that it is supposed to be linking to, and if it is not a 200 report returned, then it will display the GT error, and update the database with link_Status set to the error code that was returned.

Future improvments;

Email admin upon bad link...
A bit more error handling...
Anything people want to suggest Tongue

This release is free, but any upgrades are going to be $20 for the Plugin (as Ian is doing with the Editors plugin).

Well, the plugin is attached to this post...

Enjoy Smile


Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

If on a busy server, this could quite rapidly slow it down! You may want to see how much of an impact it has on your site, before making it perminatly live!

Last edited by:

Andy: Jun 18, 2002, 8:23 AM
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
The Error_Jump.pm file is really where all your code should go rather than in the cgi script itself.
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
I think you should attach a big warning to this thread that on a very busy site this plugin could bring your server to it's knees.

- wil
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
Hi Andy,



Does this plugin create a template for the error code?

This is an interesting plugin and could be extremely useful. I do think that emailing the admin is a great idea.

Customized error messages would be a great idea as well. I always enjoy the errors where they include a joke of some kind. Much better than a stuffy message.

Thanks and nice work!
Quote Reply
Re: [Wil] [Plugin] Error_Jump In reply to
Paul...you are correct...but I like to be different Tongue

Wil...also true.

Brian. I like the idea of customized messages. Maybe I could add the different messages as user options, and then you can just edit them by clicking 'edit' on the plugin once its installed Smile

Wel..I better get back to work Crazy

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
I was making that comment not to crizitize your code (and well done for reusing internal GT library), but to underline that any script that potentially makes expensive calls like this can be very testing to a server. And users on shared hosting plans should really check their traffic/load and maybe consult with their sysadmin before they get booted.

Cheers

- wil
Quote Reply
Re: [Wil] [Plugin] Error_Jump In reply to
Yup..I didn't take it the wrong way..don't worry ;) Its a bit like my Count_Impressions plugin..as that can take a LOT of system resources Tongue

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
Well, the customized error message stuff has been done now...and I'm just exploring the sending email stuff. Look smore complex than I first thought...but I'll definatly try to add it Wink If you are interested in this plugin..please email me, and I'll give you details on how to purchase the pro version.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
You can remove init_user() seeing as you don't seem to be using $USER anywhere.

Also if you don't pass in an ID it looks like it would give an internal server error or something weird would happen as you never do anything if $id is undefined.

You also use:

my $table = $DB->table ('Links');

....twice.

Oh one major booboo is your update will update _all_ columns as you don't specify a condition to meet.

my $result = $table->update ( { Link_Status => "$code_returned" } ) or die $GT::SQL::error;

Last edited by:

Paul: Jun 18, 2002, 9:23 AM
Quote Reply
Re: [Paul] [Plugin] Error_Jump In reply to
Yeah..I knew about the ID thing...that was one of the features I was hoping people will upgrade for Tongue The sad fact is, as discussed many times...people DON'T pay for the plugins if you don't give them a reason to Wink

As for the other problems..I'll look into them.

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Jun 18, 2002, 9:29 AM
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
>>
Yeah..I knew about the ID thing...that was one of the features I was hoping people will upgrade for
<<

Forgive me for saying so but you don't purposely leave errors in the code so people will pay for an upgrade...if you want to do it that way you should leave out features, not add in errors :)
Quote Reply
Re: [Paul] [Plugin] Error_Jump In reply to
Yeah..suppose your right. It just annoys me that people ALWAYs take advantage of Plugins...out of my 3 plugins so far..I havn't had one cent!

Anyway..back to the plugin at hand...

This part is really getting on my nerves.

# now connect to the URL..to see what we get...
my $sock = GT::Socket->open({
'host' => $url,
'port' => 80,
'timeout' => 5,
'max_down'=> 15
});

$sock->write( "GET / HTTP/1.0\n\n" );

my $returned = $sock->gulpread(-1);

If the domain name is invalid, then I get an error from write(). If I add a die before it (after });), when there is a domain with a dud URL, then it kills the script. How do GT make it so that they get a 404 error reported, and it doesnt make the script keel over and die? Crazy

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
Why not just change:

$sock->write( "GET / HTTP/1.0\n\n" );

to:

Code:
if (defined $sock) {
$sock->write( "GET / HTTP/1.0\n\n" );
}
else {
...
}

Last edited by:

Paul: Jun 18, 2002, 11:31 AM
Quote Reply
Re: [Paul] [Plugin] Error_Jump In reply to
I really feel that plugin developers shouldn't release any trial or whatever version of their plugin with purposely throw in errors, since this mite screw ppl's sites! If you really looking forward get pay for developing please just leave a description and demo of plugin and purchase informations! Ian started this type of method, i think it's generally lame, scripts full of errors!
Quote Reply
Re: [silky] [Plugin] Error_Jump In reply to
"Ian started this type of method, i think it's generally lame, scripts full of errors!"

This is an absolutely an uncalled for statement. If it wasn't for Paul, Ian, Pugdog, Andy and Yogi there would be little if any plugins even available for you to critique!

I very rarely download preview plugins or early versions due to the human factor. You know, the one where mistakes are made! And normally in later versions these mistakes are corrected. So, to bypass all the unwanted issues I go for the later, full PAID FOR releases!

I would suggest making an effort to understand the human factor and being a little bit more understanding. It will pay off quite well for you in the long run! Cool
Quote Reply
Re: [silky] [Plugin] Error_Jump In reply to
>>
If you really looking forward get pay for developing please just leave a description and demo of plugin and purchase informations!
<<

Unfortunately that doesn't work otherwise it would be the preferred method of requesting payments. Sadly many people choose not to follow the payment link (yet still use the plugin) which it quite irritating for developers and does (in my case anyway) deter me from wanting to make further plugins. I don't wish to rant, this isn't the point of my reply but in my opinion that is just seriously taking advantage of developers time and efforts.

Developers may not be staff members or professional programmers but if they go to the effort of writing a plugin for public use, which requires payment, then it is only common courtesy to make the payment, even if you can gain access to the plugin in advance.

As I personally didn't want to stop writing plugins then I decided to add code to my plugins to expire the plugin if payment wasn't made within x days. This essentially worked as a trial period and stopped my plugin being used for free without permission. This seemed to work well with MyLinks.

I'm still considering whether to have my plugins removed from the admin download for Links SQL/GForum....due to a few reasons really.

Last edited by:

Paul: Jun 18, 2002, 5:28 PM
Quote Reply
Re: [Paul] [Plugin] Error_Jump In reply to
This is a very unfortunate situation stimulated by the words of one person Paul.

Know that there are people that appreciate your efforts and look towards you amoung others to bring forward plugins that are insiteful, unique and useful. Removing them from the download area would be a loss as it has been with Ian removing his.

Hopefully Alex, Jack and the GT team will put together some changes that will enhance your offering and allow people that are buyers (not just talkers) to use the service.

Please do not let one person that has 67 posts which include asking for assitance (most you helped this person with), asking for free this or that, and whining effect your decision. This person does not dictate the actual perception of those of us that use the forum.

Thanks for being a very large supporter of a very large portion of the userbase here on GTs' forum.

Smile

Last edited by:

Teambldr: Jun 18, 2002, 5:50 PM
Quote Reply
Re: [Teambldr] [Plugin] Error_Jump In reply to
You are missing my point, i do support to pay the developers for their plugins, but i just dun like the case when Ian and Andy purposely leave in errors in the scripts then ask users to buy their errorless scripts! The other better option would be to just setup a demo of their true script for users to checkout then send users to purchase it! I also support the fact that developers should leave out their pay plugins from the GT admin area and setup a little area in their site where users can directly purchase it from them and receive supports there, like the way Ian is doing with his pay plugins, setup a forum for the pay customers! In case of Paul, i think he meant by removing from admin area, and move back to his site so users can obtain from him? So it don't limit users from buying it. It's sad for Brian because i guess he never like paying for them, that y he dun want Paul to move back his plugins! LOL!

Last edited by:

silky: Jun 18, 2002, 6:04 PM
Quote Reply
Re: [Paul] [Plugin] Error_Jump In reply to
In Reply To:
>>
If you really looking forward get pay for developing please just leave a description and demo of plugin and purchase informations!
<<

Unfortunately that doesn't work otherwise it would be the preferred method of requesting payments. Sadly many people choose not to follow the payment link (yet still use the plugin) which it quite irritating for developers and does (in my case anyway) deter me from wanting to make further plugins. I don't wish to rant, this isn't the point of my reply but in my opinion that is just seriously taking advantage of developers time and efforts.

Developers may not be staff members or professional programmers but if they go to the effort of writing a plugin for public use, which requires payment, then it is only common courtesy to make the payment, even if you can gain access to the plugin in advance.

As I personally didn't want to stop writing plugins then I decided to add code to my plugins to expire the plugin if payment wasn't made within x days. This essentially worked as a trial period and stopped my plugin being used for free without permission. This seemed to work well with MyLinks.

I'm still considering whether to have my plugins removed from the admin download for Links SQL/GForum....due to a few reasons really.
Yeah Paul that's right i mention that take off the plugins from download area and only provide users a demo hosted form ur own site, that'll let them checkout the full features of ur plugin, so if they feel that they like it, they'll have to buy it! Just like GT, show a demo, then show purchase info!
Quote Reply
Re: [silky] [Plugin] Error_Jump In reply to
Silky, That is your name right? Because I see no name or business name, or websites represented, or anything that states you are even a web developer.



Please understand that your comments mean absolutely NOTHING to me. Your actions causing useful, productive programmers grief does have an adverse effect on BUYERS.



But of course, you wouldn't know this. Unsure
Quote Reply
Re: [silky] [Plugin] Error_Jump In reply to
>>>Ian started this type of method, i think it's generally lame, scripts full of errors! <<<

Where/what made you come to this conclusion? Ian is just releasing his scripts with lesser features than the Paid version...hes not putting bugs in it Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
Argh..this getting annoying now! For some reason $code_returned has a value at the blue code, but when it gets to the red stuff, it seems to have just dissapeared! Can anyone see why? Its almost like its dissapearing into the net-blackhole Crazy

Code:
# now connect to the URL..to see what we get...
my $sock = GT::Socket->open({
'host' => $url,
'port' => 80,
'timeout' => 5,
'max_down'=> 15
});

if (defined $sock) {

$sock->write( "GET / HTTP/1.0\n\n" );

my $returned = $sock->gulpread(-1);

my @sliced = split(/\s/, $returned);
my $code_returned = $sliced[1];
print $code_returned;

} else {

my $code_returned = "404";

}

####
print $code_returned;
####

# if we didnt get a value, then we must have been called after a deade site...
#so give it a 404 value!
if (!$code_returned) {
#####
print "changing code_retyurned";
#####
my $code_returned = "404";
}

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
The black-hole is called 'scope' of a variable. If you use my for a variable within a block, then the variable will only be visible inside the block.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] [Plugin] Error_Jump In reply to
How would you get out of it though? I never really even touched local/my variables until playing with Links SQL Plugins (yeah, I know..it was a bad habiy).

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [Plugin] Error_Jump In reply to
Just declare it before (i.e. outside of) the if statement.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
> >