Bugs » AutoAdd problems and some errors in the log for v20090603

added on Jun 11, 2009 by jim
PHP Warning: array_reverse() [<a href='function.array-reverse'>function.array-reverse</a>]: The argument
should be an array in /public_html/linkex/index.php on line 2227
PHP Notice: Undefined offset: -1 in /public_html/linkex/index.php on line 4242
PHP Notice: Undefined variable: h in /public_html/linkex/index.php on line 5473

I commented out those lines thinking maybe those are the problem but am still having problems with AutoAdd stopping and
just sitting there if it gets a linkex URL. If it's not it goes on to the next link but as soon as it reaches a linkex
one it never ends. The php process will run and run for minutes and I finally have to kill it. It doesn't matter what
link it is, I've tried many and killed the process each time.

Also, when I hit "edit" for a link and then try to "verify now" it will do the same and I have to
kill the process after a while.

I'm going to try to go back to a old version that worked and see if it is me or the script.
added on Jun 11, 2009 by jim
I made a copy of the data folder as a backup just in case and ONLY changed the index.php to v20090302 and I am now
happily autoadding just like before.

I can't remember if this was the first time I have autoadded using the new 0603 script or not but I think it was. So I
guess I will just stick with the old version for now.

The old version still stops sometimes, just like it did before, but not EVERY time. And I can just start over from that
link that it stopped on and then it continues just fine. Just like it used to work.

And yes I have seen it take a while to get a response back from the other server, but not as long as the new version,
and every time. Plus on the old version I didn't have to kill it when it got stuck, it would go away in a short time.

And why does it take so long to get to [OK] sometimes anyway? All it has to do is load the linkex response page again,
that should take no time at all, it's a small page and should reply quickly since it just needs to load my link page to
check.

I'm getting really tired of this autoadd response [ ] WTF?? It doesn't add the link and if I go to the site my link is
not there, but at least the script should report something. What happened? What did it do? Why is it blank?

The "ID Domain" column should be longer, it's nice to copy/paste off of the list so I can open the site and
see what's going on while still autoadding.

You really need to break this script up into a lot of parts so that when you mod one thing it doesn't mess up the
others.

Plus, it would make it easier for people like me to possibly figure it out and fix things.
added on Jun 11, 2009 by jim
I spent some time researching this on php sites, I fixed up the old script, it may work on the new one too, but here's
what you should be doing, it seems to be working good so far....

Near your "fsockopen" call for autoadd right after fputs( $fp, $header );

stream_set_blocking($fp, TRUE);
stream_set_timeout($fp, 40);
$infox = stream_get_meta_data($fp);

while ((!feof($fp)) && (!$infox['timed_out'])) {
// $buffer .= fgets($fp, 50);
$buffer .= fread($fp, 50);
$infox = stream_get_meta_data($fp);
ob_flush;
flush();
}

I am using fread because I think it will handle the EOF signal better and the "50" doesn't really hurt
anything and keeps it looping even if there are less than "1024" like it was set before (just to make sure it
times out).

Please put this in for the next release, it really does work better. This is where it is getting stuck, I tracked it
down adding a bunch of prints and a lot of time.

BTW: The fsockopen will only timeout on the header from what I read, but check that value, it might not be what you
think it is, I set it permanently to 20 seconds just to make sure.

added on Jun 11, 2009 by jim
One more thing, I noticed that a lot of the links that said [ OK ] were from a 2006 version of linkex and there were no
links at all on these people's page and no notices of where the links might be.

I think it's a old leftover install they forgot about and aren't using anymore.

It's important to fix autoadd to handle recp links properly ASAP so the new versions can get out there and then we can
start checking for links as soon as you autoadd someone. Doing this blind doesn't help and if I check these now I will
suspend 50% or more of my links and a lot of those are just on another page, or another site (ABC links).

Linkex could possibly look on the main linkex page for links to other pages that the guy put there to tell people where
their links will show up. Try that before you give up and say that the link check is not valid. That might work for
older linkex scripts too.

added on Jun 11, 2009 by jim
One more problem, found a site that redirects over and over in a endless loop, you should have a counter in there to
stop that after so many tries.
added on Jun 13, 2009 by jim
These are not needed, it seems to be working without them..

ob_flush;
flush();

And... I added some stuff to autoadd so it can tell you more of what's going on, here's what I have so far....

I added a new log called "autoaddfixable.log" that will contain URLs that didn't accept for things like
"Title too long" and things like that so you could go in manually later and submit or something.


function fixablelog( $theurl, $str ) { // {{{
$file = 'autoaddfixable.log';
$log = sprintf( "[%s] %s %s\n", date( 'Y-m-d H:i:s' ), $theurl, $str );
$fp = fopen( BASEDIR . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . $file, 'a'
);
flock( $fp, LOCK_EX );
fwrite( $fp, $log );
fclose( $fp );
} // }}}




Here's the part you have to add in for the error reports, it's not pretty but it seems to work so far...


if ( strpos( $res, 'please make sure the linkback is correct' ) !== false ) {
$l->delete();
return 'Error: The script could not find the linkback';
} else if ( strpos( $res, 'link added' ) !== false ) {
$l->notes .= "Autoadded:\nDate:".date( 'Y-m-d H:i:s' )."\nScript: LinkEX\n\n";
$l->updateIPs();
$l->save();
return true;
} else if ( strpos( $res, 'is allready in the database' ) !== false ) {
return 'Allready listed at the site';
} else if ( strpos( $res, 'allready have' ) !== false ) {
return 'Site already has one of your submitted links';
} else {
$l->delete();
if ( strpos( $res, 'require a min' ) !== false ) {
return 'This site requires a higher PR';
} else if ( strpos( $res, 'index exchanges' ) !== false ) {
return 'Only index exchanges allowed';
} else if ( strpos( $res, 'querystrings allowed' ) !== false ) {
return 'No querystrings allowed';
} else if ( strpos( $res, 'same domain' ) !== false ) {
return 'The submitted URLs must be on the same domain';
} else if ( strpos( $res, 'different domains' ) !== false ) {
return 'The submitted URLs must be on different domains';
} else if ( strpos( $res, 'title is too long' ) !== false ) {
autoadd::fixablelog( $con{'URL'}, "Title is too long" );
return 'Title is too long';
} else if ( strpos( $res, 'tion is too long' ) !== false ) {
autoadd::fixablelog( $con{'URL'}, "Description is too long" );
return 'Description is too long';
} else if ( strpos( $res, 'verify backlink' ) !== false ) {
autoadd::fixablelog( $con{'URL'}, "They cannot find the backlink" );
return 'They cannot find the backlink';
} else if ( strpos( $res, 'the links found' ) !== false ) {
return 'None of the links found could be accepted for some reason';
} else if ( strpos( $res, 'anchor text' ) !== false ) {
return 'The anchor text of the backlink did not match their requirement';
} else return 'No recognizable response given, not saving this site';
}



Add reply

This thread has been inactive for more than 14 days, so it has been locked.

Feel free to create a new thread with your questions.