Deprecated: Creation of dynamic property CF\WordPress\DataStore::$logger is deprecated in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php on line 23

Deprecated: Creation of dynamic property CF\WordPress\Proxy::$pluginAPI is deprecated in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/Proxy.php on line 31

Deprecated: Creation of dynamic property SyntaxHighlighter::$brush_names is deprecated in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/syntaxhighlighter/syntaxhighlighter.php on line 248

Deprecated: Creation of dynamic property SyntaxHighlighter::$specialchars is deprecated in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/syntaxhighlighter/syntaxhighlighter.php on line 326
המכללה | חשיבותן של הודעות שגיאה
Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

חשיבותן של הודעות שגיאה

אחד השינויים המהותיים שעשיתי במעבר הנוכחי, היה לעדכן את הקטגוריות שלי. עד עתה היו לי מעל ל 60 קטגוריות ואילו לאחר תהליך צימצום אינטנסיבי נותרתי עם כ 9 קטגוריות ראשיות וכל שאר הקטגוריות הומרו לתגיות.

כאשר עליתי עם השרת החדש הייתי יחסית מבסוט (ושאנן) מתוך מחשבה שהכל עובד. מה ששכחתי היה העובדה שקישורים חיצוניים עדיין לא התעדכנו ומפנים אל הקטגוריות הישנות. אם במקור, הקטגוריות שלי ישבו תחת /category/ הרי שכתגיות הן יושבות תחת /tag/ ולכן, בכל פעם שמשתמש ניסה לגשת אל עמוד קטגוריה שהומרה הוא קיבל הודעת שגיאה במקום את הקישור המתאים.

הודעת שגיאה, צילום מסך מג\'ימיילמאז שהעלתי את ערכת העיצוב החדשה לאתר, אני מקבל הודעות מוזרות אל הדוא"ל שלי שמספרות לי על משתמשים שניסו להגיע לאנשהו וקיבלו עמוד שגיאה. בגלל שהשידרוג הזה עירב גם שידרוג של מסד הנתונים, וגם שידרוג של וורדפרס הנחתי שמדובר במנגנון פנימי חדש של וורדפרס שאני לא מכיר.
רק המבט על הפרצוף של רן, כשהראתי לו את הודעות השגיאה, גרם לי להתחיל לחפש את המקור האמיתי של הודעות הדואר הללו.

מסתבר, שמילו, הבחור שעיצב את הערכה, הכניס אל תוך עמוד ה 404 פונקציה ששולחת הודעה על שגיאה לבעל הבלוג. כך, בכל מקרה שבו משתמש מקבל עמוד 404 אני מקבל דוא"ל שאומר שיש שגיאה. אני חייב להודות, שבימים הראשונים, בהם שיפצתי את הערכה זה די שיגע אותי, כל תמונה חסרה הניבה הודעות שגיאה ואני מצאתי את עצמי מוחק מאות הודעות ביום. אבל עכשיו, כשהכל כבר מוכן, רובן המכריע של הודעות השגיאה הוא רלוונטי ומפרט תקלות אמיתיות שדורשות טיפול.

< ?php
$adminemail = get_bloginfo('admin_email'); 
$website = get_bloginfo('url'); 
$websitename = get_bloginfo('url');
  if (!isset($_SERVER['HTTP_REFERER'])) 
	   echo "אין לי מושג איך הגעת לכאן אבל הדף הזה לא קיים";  
  elseif (isset($_SERVER['HTTP_REFERER'])) 
	{
   	$failuremess = "A user tried to go to $website" .$_SERVER['REQUEST_URI']." and received a 404 (page not found) error. ";
	$failuremess .= "It wasn't their fault, so try fixing it. They came from ".$_SERVER['HTTP_REFERER'];
	mail($adminemail, "Bad Link To ".$_SERVER['REQUEST_URI'],
        $failuremess, "From: $websitename "); #email you about problem
    } 
?> 

שורות 2-4 לוקחות את הפרטים של האדמין מתוך הבלוג, משפט התנאי שבשורה 5 בודק אם המשתמש הגיע מהפניה כלשהי או שזו כתובת שהוא הקליד בעצמו. אם הוא הקליד את הכתובת – הוא מקבל את הודעת ה"אין לי מושג" אך אם יש הפונקציה מרכיבה הודעת דוא"ל ומשגרת אותה אל האדמין.

הודעות השגיאה הללו הניבו לא מעט מידע חיוני עבורי. פתאום קיבלתי מעין רשימה של מקומות המפנים אלי או לחילופין, מושכים תוכן מתוך האתר שלי. זה היווה תזכורת לעובדה שפעם הייתה לי ספריה תחת http://n2b.org/images ועכשיו היא כבר לא זמינה כי הדומיין לא מפנה אל ספריית השורש. זאת כמובן בנוסף לעובדה שגם ההשלכות של המרת הקטגוריות לתגיות התבטאו בהודעת שגיאה.

Redirect pluginהפיתרון הגיע בצורה של תוסף בשם Redirection שיודע לבצע הפניות ישירות בצורה גורפת. כך למשל, יכולתי להחליף את כל ההפניות מצורה n2b.org/images לצורה images.n2b.org. גם ההעברה מקטגוריות לתגים זכתה (חלקית בינתיים) לטיפול מתאים וכך ניתן היה להפוך הפניות שהפנו בעבר אל /category/ כך שיפנו אל /tag/ בהצלחה.
אחת המעלות של התוסף היא העובדה שהוא מציע מערכת לוגים העוקבת אחר הודעות השגיאה המתקבלות, כאשר כל הודעת שגיאה ניתן להפוך בקלות להפניה חדשה כאשר עבור ההפניות שהוגדרו מתקבל דיווח לגבי כמות הפעמים בהן הופעלו.

בסופו של דבר, השילוב של מנגנון ההתראה בתוך עמוד ה 404, בשילוב עם תוסף ההפניות, מאפשר לקבל מידע מדוייק על כל אותה תעבורה "שהולכת לאיבוד" בגלל גולש שהגיע מבחוץ למקום הלא נכון ובגלל זה עזב. במשך מספיק זמן פעילות ניתן יהיה לתקן את מירב הקישורים השבורים.
מעלה נוספת של התוסף היא שניתן להגדיר את ההפניות כהפניות מסוג 301 – כלומר – הועבר תמידית. במקרה שכזה, מנועי חיפוש שינסו לאנדקס את הקישורים הישנים, יקבלו הודעה שהקישור עודכן באופן תמידי ויתקנו את הרישומים אצלם. עם הזמן, גם הקישורים התקולים החיצוניים יעלמו.

הודעת שגיאה, גרפיטי

קרדיט: Andreas Solberg

לדרג את הפוסט
0

Comments

4 תגובות על “חשיבותן של הודעות שגיאה”

  1. תמונת פרופיל של דרור
    דרור

    לא ידעתי על קיומן של הפניות 301 והשימוש בהן עבור מנועי חיפוש. תודה על המידע. ד"א, האם לא נכון יותר להגיד שהקישורים ה"תקולים" ממנועי החיפוש *בלבד* ייעלמו? שהרי קישורים רגילים מאתרים אחרים יישארו בעינם ללא התערבות.

  2. תמונת פרופיל של ~ניצן~

    הכוונה היא כמובן ללינקים התקולים ממנועי החיפוש, באתרי תוכן הלינקים מן הסתם יתעדכנו אך ורק אם מישהו יעדכן אותם ידנית.

  3. תמונת פרופיל של שימי

    פיצ'ר מעניין ומועיל, הייתי מוסיף אותו אם היה לי בלוג עצמאי (אני בנתיים תקוע עם וורדפרס.קום)

  4. תמונת פרופיל של רמי

    גם אני משתמש בתוסף Redirection של הג'ירפה העירונית. מאוד שימוש.

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *


Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home/nitzan_n2b/n2b.org/wordpress/wp-content/plugins/cloudflare/src/WordPress/HTTP2ServerPush.php on line 79