Posted by Eugene Krall
This post was originally in YouMoz, and was promoted to the main blog because it provides great value and interest to our community. The author's views are entirely his or her own and may not reflect the views of SEOmoz, Inc.
1. Using a Search Engine for Finding Faulty Sites
I was reading the article about “Broken Link Building” the other day when I realized that there might be a possible extension to the idea of helping webmasters with keeping theirs sites together. Since there is a lot of stuff that can go wrong with a website, I started probing possibilities. Here is what I came up with.
Definitely, there might be other problems with an internet site that might be noticed by an ordinary user. And in order to take a well-structured and organized approach, I had to find sites with a certain clear and present problem, and be able to find these sites in bulk.
While thinking about this, I was doing my usual everyday routine when suddenly a php error popped out on the site I was browsing at the time. You are no doubt have encountered something like that lots of times.
I knew for sure that I had seen such type of error A LOT. Only all of those times I was in an absolutely different frame of mind and had no idea how I could use it to my benefit.
The site was related to my own (that’s why I was browsing it in the first place), and of pretty decent quality and value, so it made perfect sense for me to ask a responsible person for a link from it. Only all of us know that you do not simply contact a person and ask them to link to you right away. You wouldn’t, would you?
From experience we all know that all our requests that generate little or no value to the requestee should better be based on relationships, even if they are established by one simple sentence which says “Hi man, it seems your PHP is getting out of control, you had better do something about it: <link to the page with a PHP problem>”.
OK, let me explain everything step by step.
Try more subtle approach, show them that you sent the message only because you felt that it would be appropriate to let them know about the problem, not because you wanted to use it to your benefit.
“By the way, I was thinking if there is any chance that you can link to my site. It seems your visitors might be interested in this sort of thing. Anyway, size it up for yourself and if you of the same opinion, kindly add the link and let me know”
But let me explain everything step by step.
2. PHP Notification Explained
A lot of you probably have quite perfunctory understanding of PHP. So do I. The beauty of it is that you do not have to be a programmer to help webmasters with their PHP problems. I will try to explain in short what you should know in order to be ready to write a PHP error message.
Let's assume that you already know that PHP is a server-side scripting language.
If something goes wrong and a php command/function can not be executed properly on a page loading in a browser, PHP engine throws up a notification on the page (like the one displayed on the picture above). Sometimes they are not displayed, though, if the webmaster has chosen the "not display notifications in browser" option in the PHP settings.
There are several major types of notifications, but all of them are uniform, which makes it possible for us to find them on Google. Let's take a look at a couple of examples:
Warning: include(../inc_header.php) [function.include]: failed to open stream: No such file or directory in /home/actualad/public_html/hotel_soaltee_crowne_plaza.php on line 21
Notice: Uninitialized string offset: 0 in /var/www/odkryjpolske.pl/op3/functions/functions.php on line 1952
Fatal error: Call to undefined function tweetmeme() in /home/content/40/8396940/html/blog/wp-content/themes/magilas/single.php on line 54
Deprecated: Function ereg_replace() is deprecated in /var/www/virtual/sleepingparis.com/htdocs/admin/filemappa.php on line 18
Strict Standards: Non-static method DB::connect() should not be called statically in C:\wwwAmauta\php\dosmanosperu\connection\gateway.inc.php on line 28
I was able to spot five types of error notifications and then made an attempt to figure out a way to find them on Google so that the results were as relevant as possible. After taking a closer look I figured out that the part "php on line" was present in all the types of notifications. The only other part that seemingly remained the same were the words "Warning/Notice/Fatal Error/Deprecated/Strict Standards"
3. Seek...
So, in order to get results containing pages with PHP error notifications, you should form queries:
- "warning:" [function." "php on line"
- "notice:" "php on line"
- "fatal error:" "php on line"
- "deprecated:" "php on line"
- "strict standards:" "php on line"
But that might not be enough. Instead of getting search results with actual error notifications on faulty pages, you might stumble on a discussion of that error on some forum, or even the official PHP site.
The solution is as follows: add some relevant keywords to your query (defining the type of site you want to deal with). Let's assume I have an online hotel reservation site and I want to get in touch with tour and hotel sites all over the world. I do the following:
- "warning:" [function." "php on line" intitle:tours
- "notice:" "php on line" intitle:tours
- "fatal error:" "php on line" intitle:tours
- "deprecated:" "php on line" intitle:tours
- "strict standards:" "php on line" intitle:tours
The result is more than satisfactory one. There are 1,380,000 results for the query "warning:" [function." "php on line" intitle:tours and even the last hundred results out of 1000 displayed on Google are at least 50% relevant to what I was searching for. I mean the pages displayed indeed have a php error notification on them and offer tour services.
But if you somehow feel that the results aren't relevant enough, you can always expand your search query by adding additional keywords.
There is also a more thorough way to go. You may further brake down the types of PHP errors by the contents of a notification.
Let's assume you have stumbled upon the warning notification which looks like:
Warning: include_once(language/mn.php) [function.include-once]: failed to open stream: No such file or directory in /hermes/waloraweb061/b490/pow.sndmn/htdocs/destination/index.php on line 34
It is the easiest one to solve since it clearly states that the file or directory are missing. So all you have to write to the webmaster is "check your files and their names carefully"
Let's find the constant value of the message and delete all the information which changes (like the names of the files and folders, paths to them, etc.). And do not forget to attach your keywords!
That's what we get after some tweaking.
"Warning:" "[function.include-once]: failed to open stream: No such file or directory in" "php on line" intitle:tours
The query produces 132 results, which is quite something to start with since you already have the solution to the problem in your pocket. Now all you have to do is send your message to the respective parties in the results and wait for them to reply!
4. ... and destroy!
Usually, if you direct the attention of webmaster to the problem with their site, they should know what to do about it since they have probably earned being called "webmasters". Still there are a considerable percentage of people who take care of their site to some extent without deep understanding of its mechanics. The site might have been created by a company for a client who does not know much in this sort of stuff. In this case, your ability to search for information on the Internet will enable you to warm up the hearts of mighty number of people who can add your link on their sites.
What I am talking about here is trying to get to the bottom of the problem before contacting the webmaster so that not only could you state the presence of it, but also could help with figuring things out. It's nice if you are into PHP and can crack any related problem without referring to World Wide Web.
If, however, you are not that sort of person, you might want to read some specialized PHP forums:
PHP Freaks
SitePoint PHP Forum
PHP Help
Codewalkers PHP-Related Forum
If the search comes up with a page which contains a following notification:
Warning: Cannot modify header information - headers already sent by (output started at /home/zungahto/public_html/includes/joomla.php:836) in /home/zungahto/public_html/includes/joomla.php on line 697
you have enough information to be able to find a solution. Let's try to perform the following search:
site:forums.phpfreaks.com "Warning: Cannot modify header information - headers already sent by"
site:sitepoint.com "Warning: Cannot modify header information - headers already sent by"
Google comes up with as many as 4,350 and 4,700 results for forums.phpfreaks.com and sitepoint.com respectively, which is one damn mighty pile to browse through. You might want to look through the top 10 and send the links to the discussions you deem appropriate in your message. Another way to go is just simply send the url of the forum so that the recipient could start a new thread for themselves to address their problem exclusively. Of course it's not an exhaustive solution, but it will give the webmaster something to lean on. If you want to go hardcore though, you can plug in one of your company's programmers to give advice to the recipient (only I think it should be one hell of a good site to go into such extremities for a link).
Finally, check out this list of common PHP error messages. If you want to proceed with the idea of searching for a specific sort of error, you might want to read this one and then continue on with the search.
Let's assume I have chosen to proceed with the "use of undefined constant" error. I have some sort of solution already, poor as it is. (It’s in the document provided above). So all you need to do is search for this sort of messages:
"Notice:" "Use of undefined constant" "php on line" intitle:tours
And heeeere we go! 59 results.
5. Checking the Activities of the Website
Further on, the fact that an error notification has been around long enough for a search engine to index it means that the site is getting seriously out of hand and might have been completely abandoned by the crew, so before sending a message insure in some way that the site is still in business. I do it by performing these steps:
- Enter the query consisting of the advanced “site” operator along with the domain of the site in question. (site:phperrorsite.com)
- Collapse the list of the Google Search Tools under the "Show Search Tools" link on the left column of Google search result page.
- In the time selection section choose the “past year” option
- The options “sort by relevance” and “sort by date” will appear; choose the latter.
- Now pay attention to the date in the first search result. The more recent it is, the better. This, along with the number of the documents in the search results pertaining to the domain, gives you an approximate idea of what is going on with the site.
Remember, this is far from precise and I would be glad to hear of any other ideas about how one can discover whether a site has been abandoned or not.
6. Taking a Deeper Look into the Problems of a Website
You may also want to check whether there are any other php errors of one sort or another by performing a respective search query modified by the “site” search operator:
site:phperrorsite.com "warning:" [function." "php on line"
The higher the number of the documents found, the higher the likelihood that the site owners/editors just do not give a rat’s ass about their website and won’t probably respond to your message of good intention.
Now you have ensured that the site is still kept a close watch on by finding out that there is only one document with a php error, which, in its turn, happens to be in some secluded corner of the site and might simply have been missed by the webmaster. There is no excuse for a php error notification right above the header on the main page of a site. I think twice before contacting sites of that sort. Like, how could they have missed that and even gave time for a search engine to index it!?
7. Composing a PHP error notification email
Well, I guess I have fed you all I had on the subject. Now for the pivotal point - email composing. I guess it's one of the most popular subjects among SEOmoz blog writers, so I do not want to write something that has been written thousands of times before me. Try to check out the most recent article on the subject (at the time of this writing).
Nevertheless, here is my way of doing business. I hope this example might be of use to someone.
Subject: <recipient's name>, I have spotted a problem with your site.
HI, <recipient's name>
I was browsing through your site phperrorsite.com out of professional curiosity (I maintain an online hotel reservation site myself) and came upon a page that was obviously getting out of hand:
<the url of the page with a PHP error>
I understand how tiresome it might be to keep everything in line, so I have attached a document with possible solution to this <type of problem as specified in the error notification, "use of undefined variable", etc> problem.
There are also quite a few discussion on the internet pertaining to this problem, check them out if you will:
<the link to a thread on PHP Freaks forum on the subject>
<the link to a thread on SitePoint PHP forum on the subject>
However, I would recommend you to start a new thread on one of the forums laying down all the details.
Please drop me a line at your convenience; I would like to know how things worked out for you.
Best of luck with your work!
<your name>
You could omit some of the stuff like specifying the urls of forum threads. To keep it simple, you could just mention the page with the error and ask them to get back to you. After the reply, you can move on to asking for a little favor. Hopefully, you will be granted one!
Hi again, <recipient's name>
I am glad my message was of use to you. I guess we, webmasters, should back each other up when we can. We could learn a lot from each other.
By the way, I got this idea that maybe my hotel reservation services might be of use to some of your visitors. Hotel reservation and tour services go along quite well, don't you think so?
Please check out my site yoursite.com and if you of the same opinion, kindly add a link to it where you think it would be most appropriate.
I hope I do not impose you. It's just that it's so hard to stay on surface these days, if you get my meaning.
Hope to have a word from you soon.
Rock On,
<your name>
Well, I guess that's about it. It might not be the best message ever conceived, but it worked fine for me.
A thing to remember: I guess it's not a good idea to ask for a link in the very first message - wait for a little while in order to establish some sort of connection with the webmaster, and when you feel that you get along quite well - make your pitch.
Remember, if you do not get link - you still get yourself a grateful person who might do you a favor of one sort or another later on. So, not time wasted.
I would be glad to hear any suggestions for improving my messages!
A Little Extra: Contacting sites with enabled directory browsing in Apache
I have been trying to make the point that you should be creative and try different approaches based on something that has been done before. Helping webmasters to keep their site neat and clean is the core here.
So let's take a look at another method you could use as a reason for contacting webmasters:
Looks familiar, doesn't it? If you spend eight hours a day on the Internet (as most of us do), it's something you have seen a lot of times. And you probably know that there is something wrong with the site when you stumble upon something like that. And "that" can be called "directory indexing/browsing enabled in Apache server".
There is a whole movement of hackers excited about finding sites webmaster of which were reckless enough not to disable this default feature of Apache server. Having this enabled constitutes a great security risk to your website since there are a lot of ways in which the sensitive data could be manipulated. It can be even a lot easier for someone to breach your site if you are one of those guys who has a document with password for all of your accounts. Believe me, there is a lot more of those than you can think.
Besides, it simply looks untidy to find such page in Google results.
How to find sites with enabled directory browsing
There is a system and structure to everything. If you look at a couple of pages like the one on the picture, you will realise that there are constant values which never change. Here is what I use for finding such pages:
intitle:index intitle:of port apache server
The query comes back with 100% relevant results. (OK, let's say 95% relevant results just to be on the safe side)
But we do not want to contact random sites, do we? Almost all of us involved in a specific kind of business and we want to find sites relevant to it.
Assuming that my own site is dedicated to online hotel reservation, I modify the query as specified below:
intitle:tours intitle:index intitle:of port apache server
I come up with lots of tour sites around the world who have some security issues.
Here is what you want to do further on
You contact the webmaster (or anybody else involved with the site) and tell them to disable building of directory index by opening the apache config file "httpd.conf" and removing the word "indexes" found in it. After that you can gradually shift to the "quid pro quo" part of the conversation.
Sign up for The Moz Top 10, a semimonthly mailer updating you on the top ten hottest pieces of SEO news, tips, and rad links uncovered by the Moz team. Think of it as your exclusive digest of stuff you don't have time to hunt down but want to read!