_binary From abb9ac0e6a1db7433b98b9ad557caf5b3e648347 Mon Sep 17 00:00:00 2001
From: Gargi Sheguri <gargiegs@gmail.com>
Date: Fri, 15 Sep 2023 12:14:40 -0700
Subject: [PATCH] Adds new search factors for wiki bonus and num_slashes bonus
 (inspired by yandex)

---
 src/configs/Config.php                        |   10 +
 src/configs/PublicHelpPages.php               |    2 +
 src/controllers/SearchController.php          |    4 +-
 src/controllers/components/CrawlComponent.php |    1 +
 src/library/FeedDocumentBundle.php            |    2 +-
 src/library/IndexDocumentBundle.php           |   63 +-
 .../NetworkIterator.php                       |    2 +
 .../index_bundle_iterators/WordIterator.php   |    8 +
 src/library/media_jobs/FeedsUpdateJob.php     |    2 +-
 src/locale/ar/configure.ini                   |    2 +
 src/locale/bn/configure.ini                   |    2 +
 src/locale/de/configure.ini                   |    2 +
 src/locale/el_GR/configure.ini                |    2 +
 src/locale/en_US/configure.ini                |    2 +
 src/locale/es/configure.ini                   |    2 +
 src/locale/fa/configure.ini                   |    2 +
 src/locale/fr_FR/configure.ini                |    2 +
 src/locale/he/configure.ini                   |    2 +
 src/locale/hi/configure.ini                   |    2 +
 src/locale/id/configure.ini                   |    2 +
 src/locale/it/configure.ini                   |    2 +
 src/locale/ja/configure.ini                   |    2 +
 src/locale/kn/configure.ini                   |    2 +
 src/locale/ko/configure.ini                   |    2 +
 src/locale/nl/configure.ini                   |    2 +
 src/locale/pl/configure.ini                   |    2 +
 src/locale/pt/configure.ini                   |    2 +
 src/locale/ru/configure.ini                   |    2 +
 src/locale/te/configure.ini                   |    2 +
 src/locale/th/configure.ini                   |    2 +
 src/locale/tl/configure.ini                   |    2 +
 src/locale/tr/configure.ini                   |    2 +
 src/locale/vi_VN/configure.ini                |    2 +
 src/locale/zh_CN/configure.ini                |    2 +
 src/models/ProfileModel.php                   |   12 +-
 src/views/elements/PageoptionsElement.php     | 1002 +++++++++--------
 36 files changed, 638 insertions(+), 520 deletions(-)

diff --git a/src/configs/Config.php b/src/configs/Config.php
index 43fa4f4d4..e93d67e00 100755
--- a/src/configs/Config.php
+++ b/src/configs/Config.php
@@ -584,6 +584,16 @@ if (file_exists(WORK_DIRECTORY . PROFILE_FILE_NAME)) {
      *  to the overall score used for ranking
      */
     nsdefine('USER_RANK_BONUS', 5);
+    /**
+     *  Bonus to add to doc rank score if the url points to a wikipedia page
+     */
+    nsdefine('WIKI_BONUS', 0.5);
+    /**
+     *  Bonus to add to doc rank score based on the number of '/' present in
+     *  the url, based on the idea that the lesser the count, the closer the url is
+     *  to the root page
+     */
+    nsdefine('NUM_SLASHES_BONUS', 0.5);
     /**
      * If that many exist, the minimum number of results to get
      * and group before trying to compute the top x (say 10) results
diff --git a/src/configs/PublicHelpPages.php b/src/configs/PublicHelpPages.php
index 5618767a1..8a79c4c8f 100644
--- a/src/configs/PublicHelpPages.php
+++ b/src/configs/PublicHelpPages.php
@@ -43402,6 +43402,8 @@ END_HEAD_VARSThe score used to rank a page is computed as the document rank scor
 ; &#039;&#039;&#039;CLD Url Bonus&#039;&#039;&#039; : Bonus to add to doc rank score if the url is a company level domain.
 ; &#039;&#039;&#039;Host Url Bonus&#039;&#039;&#039; : Bonus to add to doc rank score if the url is a a hostname.
 ; &#039;&#039;&#039;User Rank  Bonus&#039;&#039;&#039; : User rank scores (created by making a classifier) for a document are normalized between 0 and 1, this is the weighting factor to multiply that basic score before adding it to the overall score used for ranking.
+; &#039;&#039;&#039;Wiki Bonus&#039;&#039;&#039; : Bonus to add to doc rank score if the url points to a wikipedia page.
+; &#039;&#039;&#039;Num Slashes Bonus&#039;&#039;&#039; : Bonus to add to doc rank score based on the number of '/' present in the url, based on the idea that the lesser the count, the closer the url is to the root page.
 
 
 EOD;
diff --git a/src/controllers/SearchController.php b/src/controllers/SearchController.php
index c400bea4c..415289f2e 100755
--- a/src/controllers/SearchController.php
+++ b/src/controllers/SearchController.php
@@ -339,6 +339,8 @@ class SearchController extends Controller implements CrawlConstants
             "proximity_bonus" => C\PROXIMITY_BONUS,
             "title_bonus" => C\TITLE_BONUS,
             "user_rank_bonus" => C\USER_RANK_BONUS,
+            "wiki_bonus" => C\WIKI_BONUS,
+            "num_slashes_bonus" => C\NUM_SLASHES_BONUS,
             ] as $factor => $default) {
             if (isset($_REQUEST[$factor])) {
                 $ranking_factors[strtoupper($factor)] =
@@ -1711,7 +1713,7 @@ EOD;
                         $mark_prefix = L\crawlHash($word);
                         if (stristr($mark_prefix, $word) !== false) {
                             $mark_prefix = preg_replace(
-                            "/\b$word.{0,3}?\b/i", '', $mark_prefix);
+                                "/\b$word.{0,3}?\b/i", '', $mark_prefix);
                         }
                         $text = preg_replace(
                             "/\b$word.{0,3}?\b/i", $mark_prefix.'$0', $text);
diff --git a/src/controllers/components/CrawlComponent.php b/src/controllers/components/CrawlComponent.php
index e4729008e..32b9740a3 100644
--- a/src/controllers/components/CrawlComponent.php
+++ b/src/controllers/components/CrawlComponent.php
@@ -1705,6 +1705,7 @@ class CrawlComponent extends Component implements CrawlConstants
             'TITLE_BONUS' => 5, 'PATH_KEYWORD_BONUS' => 3,
             'PROXIMITY_BONUS' => 20,
             'CLD_URL_BONUS' => 2, 'HOST_URL_BONUS' => 0.5,
+            'WIKI_BONUS' => 0.5, 'NUM_SLASHES_BONUS' => 0.5,
             'MIN_RESULTS_TO_GROUP' => C\MIN_RESULTS_TO_GROUP,
             'USER_RANK_BONUS' => 5];
         $change = false;
diff --git a/src/library/FeedDocumentBundle.php b/src/library/FeedDocumentBundle.php
index d199f2377..bf4a6d3f1 100644
--- a/src/library/FeedDocumentBundle.php
+++ b/src/library/FeedDocumentBundle.php
@@ -329,7 +329,7 @@ class FeedDocumentBundle extends IndexDocumentBundle
     {
         $raw_guid = unbase64Hash($site[self::HASH]);
         $doc_id = crawlHash($site[self::URL], true) .
-            $raw_guid . "f" . substr(crawlHash(
+            $raw_guid . chr(24) . substr(crawlHash(
             UrlParser::getHost($site[self::URL]) . "/", true), 1);
         return $doc_id;
     }
diff --git a/src/library/IndexDocumentBundle.php b/src/library/IndexDocumentBundle.php
index 11e90cf3c..1adc8abbd 100644
--- a/src/library/IndexDocumentBundle.php
+++ b/src/library/IndexDocumentBundle.php
@@ -985,18 +985,18 @@ class IndexDocumentBundle implements CrawlConstants
         if (isset($site[self::TYPE]) && $site[self::TYPE] == "link") {
             $doc_id = $site[self::HTTP_CODE];
         } else {
-            $letter_code = 'b';
+            $letter_code = chr(0);
             $main_type = (!empty($site[self::TYPE])) ?
                 substr($site[self::TYPE], 0, 4) : "binary";
             if (!empty($site[self::IS_VIDEO])) {
-                $letter_code = 'v';
+                $letter_code = chr(64);
             } else if ($main_type == "text" ) {
-                $letter_code = 't';
+                $letter_code = chr(56);
             } else if ($main_type == "imag") {
-                $letter_code = 'p';
+                $letter_code = chr(48);
             }
             $hash = $site[self::HASH];
-            if ($letter_code == "t" && !empty($site[self::TITLE])) {
+            if ($letter_code == chr(56) && !empty($site[self::TITLE])) {
                 $trim_title = trim($site[self::TITLE]);
                 $hash = substr(crawlHash($trim_title, true), 0, 4) .
                     substr($hash, 4);
@@ -1008,6 +1008,23 @@ class IndexDocumentBundle implements CrawlConstants
                 "https://www.$cld/", "http://$cld/", "http://www.$cld/"])) {
                 $letter_code = chr(ord($letter_code) + 128);
             }
+            if (strpos($cld, "wikipedia") !== false) {
+                $letter_code = chr(ord($letter_code) + 4);
+            }
+            $num_slashes = substr_count(substr($site[self::URL], strlen($host)), '/');
+            /*
+             * Discount any trailing slashes in the URL.
+             */
+            if ($num_slashes > 0 && substr($site[self::URL], -1) == '/') {
+                $num_slashes--;
+            }
+            if ($num_slashes >= 2 && $num_slashes < 5) {
+                $letter_code = chr(ord($letter_code) + 1);
+            }  else if ($num_slashes >=5  && $num_slashes < 7){
+                $letter_code = chr(ord($letter_code) + 2);
+            } else if ($num_slashes >=7) {
+                $letter_code = chr(ord($letter_code) + 3);
+            }
             $doc_id = crawlHash($site_url, true) . $hash .
                 $letter_code . substr(crawlHash($host . "/", true), 1);
         }
@@ -1145,6 +1162,22 @@ class IndexDocumentBundle implements CrawlConstants
     {
         return (ord($key[self::DOCID_PART_LEN << 1] ?? '\0') & 128) > 0;
     }
+    /**
+     * Checks if a doc_id $key is that of a Wikipedia page.
+     * @param string $key to check if Wikipedia page or not
+     */
+    public static function isAWikipediaPage($key)
+    {
+        return (ord($key[self::DOCID_PART_LEN << 1] ?? '\0') & 4) > 0;
+    }
+    /**
+     * Finds number of '/' in the url after the hostname represented by doc_id $key.
+     * @param string $key to find '/' count
+     */
+    public static function findNumSlashes($key)
+    {
+        return (ord($key[self::DOCID_PART_LEN << 1] ?? '\0') & 3);
+    }
     /**
      * Checks if a doc_id corresponds to a particular large scale type among
      * external_link, internal_link, link (union of previous two),
@@ -1158,15 +1191,15 @@ class IndexDocumentBundle implements CrawlConstants
     public static function isType($key, $types)
     {
         $type_map = [
-            "b" => "binary",
-            "d" => "old_doc",
-            "e" => "external_link",
-            "f" => "feed",
-            "i" => "internal_link",
-            "l" => "old_link",
-            "p" => "image",
-            "t" => "text",
-            "v" => "video",
+            0 => "binary",
+            8 => "old_doc",
+            16 => "external_link",
+            24 => "feed",
+            32 => "internal_link",
+            40 => "old_link",
+            48 => "image",
+            56 => "text",
+            64 => "video",
         ];
         if (is_string($types)) {
             $types = [$types];
@@ -1178,7 +1211,7 @@ class IndexDocumentBundle implements CrawlConstants
             $types = array_merge($types, ["binary", "feed", "image",
                 "old_doc", "text", "video"]);
         }
-        $key_type = chr(ord($key[self::DOCID_PART_LEN << 1] ?? 0) & 127);
+        $key_type = ord($key[self::DOCID_PART_LEN << 1] ?? 0) & 120;
         return in_array($type_map[$key_type] ?? "old_link", $types);
     }
     /**
diff --git a/src/library/index_bundle_iterators/NetworkIterator.php b/src/library/index_bundle_iterators/NetworkIterator.php
index 842114639..640cd1fa4 100644
--- a/src/library/index_bundle_iterators/NetworkIterator.php
+++ b/src/library/index_bundle_iterators/NetworkIterator.php
@@ -150,6 +150,8 @@ class NetworkIterator extends IndexBundleIterator
             "proximity_bonus" => C\PROXIMITY_BONUS,
             "title_bonus" => C\TITLE_BONUS,
             "user_rank_bonus" => C\USER_RANK_BONUS,
+            "wiki_bonus" => C\WIKI_BONUS,
+            "num_slashes_bonus" => C\NUM_SLASHES_BONUS,
             ] as $factor => $default) {
             $this->base_query .= "&$factor=" . ($ranking_factors[$factor] ??
                 $default);
diff --git a/src/library/index_bundle_iterators/WordIterator.php b/src/library/index_bundle_iterators/WordIterator.php
index f3bee8444..c410f36dc 100644
--- a/src/library/index_bundle_iterators/WordIterator.php
+++ b/src/library/index_bundle_iterators/WordIterator.php
@@ -249,6 +249,8 @@ class WordIterator extends IndexBundleIterator
             "HOST_KEYWORD_BONUS" => C\HOST_KEYWORD_BONUS,
             "PATH_KEYWORD_BONUS" => C\PATH_KEYWORD_BONUS,
             "TITLE_BONUS" => C\TITLE_BONUS,
+            "WIKI_BONUS" => C\WIKI_BONUS,
+            "NUM_SLASHES_BONUS" => C\NUM_SLASHES_BONUS,
             ] as $factor => $default) {
             $this->ranking_factors[$factor] = $ranking_factors[$factor] ??
                 $default;
@@ -551,6 +553,12 @@ class WordIterator extends IndexBundleIterator
                         $this->ranking_factors["CLD_URL_BONUS"] :
                         $this->ranking_factors["HOST_URL_BONUS"];
                 }
+                if(L\IndexDocumentBundle::isAWikipediaPage($doc_key)) {
+                    $posting[self::DOC_RANK] += $this->ranking_factors["WIKI_BONUS"];
+                }
+                $posting[self::DOC_RANK] +=
+                    $this->ranking_factors["NUM_SLASHES_BONUS"] /
+                    (L\IndexDocumentBundle::findNumSlashes($doc_key) + 1);
             }
             list($preface_positions, $num_description_scores) =
                 array_values(array_shift($doc_info));
diff --git a/src/library/media_jobs/FeedsUpdateJob.php b/src/library/media_jobs/FeedsUpdateJob.php
index 58a15a7d7..dd0ab8761 100644
--- a/src/library/media_jobs/FeedsUpdateJob.php
+++ b/src/library/media_jobs/FeedsUpdateJob.php
@@ -739,7 +739,7 @@ class FeedsUpdateJob extends MediaJob
             $source_counts[$source_name]++;
             $raw_guid = L\unbase64Hash($item["GUID"]);
             $doc_id = L\crawlHash($item['LINK'], true) . $raw_guid .
-                "f" . substr(L\crawlHash(UrlParser::getHost($item['LINK']) .
+                chr(24) . substr(L\crawlHash(UrlParser::getHost($item['LINK']) .
                 "/", true), 1);
             $seen_url_count += 1;
             $summary = [];
diff --git a/src/locale/ar/configure.ini b/src/locale/ar/configure.ini
index 96aacbd9f..87cffdadf 100755
--- a/src/locale/ar/configure.ini
+++ b/src/locale/ar/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "مكافأة القرب :"
 pageoptions_element_cld_url_bonus = "مكافأة رابط نطاق الشركة :"
 pageoptions_element_host_url_bonus = "مكافأة عنوان المضيف :"
 pageoptions_element_user_rank_bonus = "مكافأة رتبة المستخدم:"
+pageoptions_element_num_slashes_bonus = "مكافأة لعدد الخطوط المائلة للأمام :"
+pageoptions_element_wiki_bonus = "مكافأة ويكيبيديا :"
 pageoptions_element_results_grouping_options = "تجميع نتائج البحث"
 pageoptions_element_min_results_to_group = "نتائج الحد الأدنى للمجموعة:"
 pageoptions_element_test_page = "صفحة اختبار"
diff --git a/src/locale/bn/configure.ini b/src/locale/bn/configure.ini
index 860efca36..f12f4aeaf 100755
--- a/src/locale/bn/configure.ini
+++ b/src/locale/bn/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "প্রক্সিমিটি বো
 pageoptions_element_cld_url_bonus = "কোম্পানির ডোমেন ইউআরএল বোনাস:"
 pageoptions_element_host_url_bonus = "হোস্ট ইউআরএল বোনাস:"
 pageoptions_element_user_rank_bonus = "ব্যবহারকারী র্যাঙ্ক বোনাস:"
+pageoptions_element_num_slashes_bonus = "স্ল্যাশ বোনাসের সংখ্যা:"
+pageoptions_element_wiki_bonus = "উইকি বোনাস:"
 pageoptions_element_results_grouping_options = "অনুসন্ধান ফলাফল জোট"
 pageoptions_element_min_results_to_group = "সর্বনিম্ন ফলাফল গ্রুপ:"
 pageoptions_element_test_page = "পরীক্ষা পৃষ্ঠা"
diff --git a/src/locale/de/configure.ini b/src/locale/de/configure.ini
index 78b9bb385..f8a06d9fe 100755
--- a/src/locale/de/configure.ini
+++ b/src/locale/de/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Proximity-Bonus:"
 pageoptions_element_cld_url_bonus = "Firmen-Domain-URL-Bonus:"
 pageoptions_element_host_url_bonus = "Host-URL-Prämie:"
 pageoptions_element_user_rank_bonus = "Benutzerrangbonus :"
+pageoptions_element_num_slashes_bonus = "Anzahl der Schrägstriche Bonus:"
+pageoptions_element_wiki_bonus = "Wiki-Bonus:"
 pageoptions_element_results_grouping_options = "Suchergebnisse Gruppierung"
 pageoptions_element_min_results_to_group = "Minimale Ergebnisse Gruppe:"
 pageoptions_element_test_page = "Test Seite"
diff --git a/src/locale/el_GR/configure.ini b/src/locale/el_GR/configure.ini
index f5f145232..5b8ffd2a0 100644
--- a/src/locale/el_GR/configure.ini
+++ b/src/locale/el_GR/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Μπόνους Εγγύτητας :"
 pageoptions_element_cld_url_bonus = "Μπόνους Διεύθυνσης URL Τομέα Εταιρείας :"
 pageoptions_element_host_url_bonus = "Μπόνους URL Υποδοχής :"
 pageoptions_element_user_rank_bonus = "Μπόνους Κατάταξης Χρήστη :"
+pageoptions_element_num_slashes_bonus = "Μπόνους αριθμός κάθετου:"
+pageoptions_element_wiki_bonus = "Μπόνους Wiki:"
 pageoptions_element_results_grouping_options = "Ομαδοποίηση αποτελεσμάτων αναζήτησης"
 pageoptions_element_min_results_to_group = "Ελάχιστα αποτελέσματα στην ομάδα:"
 pageoptions_element_test_page = "Δοκιμαστική σελίδα"
diff --git a/src/locale/en_US/configure.ini b/src/locale/en_US/configure.ini
index d36c23f0e..53e6ca064 100644
--- a/src/locale/en_US/configure.ini
+++ b/src/locale/en_US/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Proximity Bonus:"
 pageoptions_element_cld_url_bonus = "Company Domain Url Bonus:"
 pageoptions_element_host_url_bonus = "Host Url Bonus:"
 pageoptions_element_user_rank_bonus = "User Rank Bonus:"
+pageoptions_element_num_slashes_bonus = "Num Slashes Bonus:"
+pageoptions_element_wiki_bonus = "Wiki Bonus:"
 pageoptions_element_results_grouping_options = "Search Results Grouping"
 pageoptions_element_min_results_to_group = "Minimum Results to Group:"
 pageoptions_element_test_page = "Test Page"
diff --git a/src/locale/es/configure.ini b/src/locale/es/configure.ini
index e4268d63a..42805b0c2 100755
--- a/src/locale/es/configure.ini
+++ b/src/locale/es/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Bonificación de proximidad:"
 pageoptions_element_cld_url_bonus = "Bonificación de Url de Dominio de Empresa:"
 pageoptions_element_host_url_bonus = "Bonificación de URL de Host:"
 pageoptions_element_user_rank_bonus = "Bonificación de Rango de Usuario :"
+pageoptions_element_num_slashes_bonus = "Bonificación por número de barras diagonales:"
+pageoptions_element_wiki_bonus = "Bonificación para Wiki:"
 pageoptions_element_results_grouping_options = "Resultados De La B&uacute;squeda De La Agrupaci&oacute;n"
 pageoptions_element_min_results_to_group = "Resultados m&iacute;nimos para el Grupo:"
 pageoptions_element_test_page = "P&aacute;gina De Prueba"
diff --git a/src/locale/fa/configure.ini b/src/locale/fa/configure.ini
index e43d216cc..f4b80e443 100755
--- a/src/locale/fa/configure.ini
+++ b/src/locale/fa/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "پاداش نزدیکی:"
 pageoptions_element_cld_url_bonus = "پاداش دامنه شرکت :"
 pageoptions_element_host_url_bonus = "پاداش نشانی وب میزبان :"
 pageoptions_element_user_rank_bonus = "پاداش رتبه کاربر:"
+pageoptions_element_num_slashes_bonus = "پاداش تعداد اسلش :"
+pageoptions_element_wiki_bonus = "پاداش ویکی :"
 pageoptions_element_results_grouping_options = "دسته&zwnj;بندی نتایج جستجو"
 pageoptions_element_min_results_to_group = "حداقل تعداد هر دسته:"
 pageoptions_element_test_page = "تست صفحه"
diff --git a/src/locale/fr_FR/configure.ini b/src/locale/fr_FR/configure.ini
index b2318a5e0..8dc5d68ce 100755
--- a/src/locale/fr_FR/configure.ini
+++ b/src/locale/fr_FR/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Bonus de proximité:"
 pageoptions_element_cld_url_bonus = "Bonus d&#039;URL de domaine d&#039;entreprise:"
 pageoptions_element_host_url_bonus = "Bonus d&#039;URL d&#039;hôte:"
 pageoptions_element_user_rank_bonus = "Bonus de classement utilisateur:"
+pageoptions_element_num_slashes_bonus = "Bonus de nombre de barres obliques:"
+pageoptions_element_wiki_bonus = "Bonus Wiki:"
 pageoptions_element_results_grouping_options = "R&eacute;sultats de la recherche groupement"
 pageoptions_element_min_results_to_group = "Minimum de r&eacute;sultats &agrave; un groupe:"
 pageoptions_element_test_page = "Page de test"
diff --git a/src/locale/he/configure.ini b/src/locale/he/configure.ini
index 70460c234..3f93d99ef 100755
--- a/src/locale/he/configure.ini
+++ b/src/locale/he/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "בונוס קרבה:"
 pageoptions_element_cld_url_bonus = "בונוס כתובת אתר של תחום החברה :"
 pageoptions_element_host_url_bonus = "בונוס כתובת אתר מארח :"
 pageoptions_element_user_rank_bonus = "בונוס דירוג משתמש:"
+pageoptions_element_num_slashes_bonus = "מספר / בונוס :"
+pageoptions_element_wiki_bonus = "בונוס ויקי :"
 pageoptions_element_results_grouping_options = "תוצאות חיפוש קיבוץ"
 pageoptions_element_min_results_to_group = "מינימום תוצאות הקבוצה:"
 pageoptions_element_test_page = "דף בדיקה"
diff --git a/src/locale/hi/configure.ini b/src/locale/hi/configure.ini
index 9eab4ea77..9f3ad3a35 100755
--- a/src/locale/hi/configure.ini
+++ b/src/locale/hi/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "निकटता बोनस:"
 pageoptions_element_cld_url_bonus = "कंपनी डोमेन यूआरएल बोनस:"
 pageoptions_element_host_url_bonus = "होस्ट यूआरएल बोनस:"
 pageoptions_element_user_rank_bonus = "उपयोगकर्ता रैंक बोनस:"
+pageoptions_element_num_slashes_bonus = "स्लैश की संख्या बोनस:"
+pageoptions_element_wiki_bonus = "विकी बोनस:"
 pageoptions_element_results_grouping_options = "खोज परिणाम समूहीकरण"
 pageoptions_element_min_results_to_group = "न्यूनतम परिणाम समूह के लिए:"
 pageoptions_element_test_page = "परीक्षण पृष्ठ"
diff --git a/src/locale/id/configure.ini b/src/locale/id/configure.ini
index ef6e2c1c1..619dbba0e 100755
--- a/src/locale/id/configure.ini
+++ b/src/locale/id/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Bonus Kedekatan:"
 pageoptions_element_cld_url_bonus = "Bonus Url Domain Perusahaan:"
 pageoptions_element_host_url_bonus = "Bonus URL Tuan Rumah:"
 pageoptions_element_user_rank_bonus = "Bonus Peringkat Pengguna :"
+pageoptions_element_num_slashes_bonus = "Bonus untuk Bilangan Slash:"
+pageoptions_element_wiki_bonus = "Bonus untuk Wiki:"
 pageoptions_element_results_grouping_options = "Hasil Pencarian Pengelompokan"
 pageoptions_element_min_results_to_group = "Minimal Hasil untuk Kelompok:"
 pageoptions_element_test_page = "Uji Halaman"
diff --git a/src/locale/it/configure.ini b/src/locale/it/configure.ini
index f1b5e03fe..093144e6e 100755
--- a/src/locale/it/configure.ini
+++ b/src/locale/it/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Bonus di prossimità:"
 pageoptions_element_cld_url_bonus = "Bonus Url dominio azienda:"
 pageoptions_element_host_url_bonus = "Bonus Url host:"
 pageoptions_element_user_rank_bonus = "Bonus classifica utente:"
+pageoptions_element_num_slashes_bonus = "Bonus per numero di /:"
+pageoptions_element_wiki_bonus = "Bonus per Wiki:"
 pageoptions_element_results_grouping_options = "Raggruppa risultati di ricerca"
 pageoptions_element_min_results_to_group = "Minimo risultati da raggruppare:"
 pageoptions_element_test_page = "Pagina Di Prova"
diff --git a/src/locale/ja/configure.ini b/src/locale/ja/configure.ini
index 6a86257c0..e0159a109 100755
--- a/src/locale/ja/configure.ini
+++ b/src/locale/ja/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "近接ボーナス:"
 pageoptions_element_cld_url_bonus = "企業ドメインUrlボーナス:"
 pageoptions_element_host_url_bonus = "ホストUrlボーナス:"
 pageoptions_element_user_rank_bonus = "ユーザーランクボーナス:"
+pageoptions_element_num_slashes_bonus = "スラッシュボーナスの数:"
+pageoptions_element_wiki_bonus = "Wiki のボーナス:"
 pageoptions_element_results_grouping_options = "検索結果の分類"
 pageoptions_element_min_results_to_group = "最低限の結果をグループ"
 pageoptions_element_test_page = "テストページ"
diff --git a/src/locale/kn/configure.ini b/src/locale/kn/configure.ini
index 0903bf0b6..cc6acb14d 100755
--- a/src/locale/kn/configure.ini
+++ b/src/locale/kn/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "ಸಾಮೀಪ್ಯ ಬೋನಸ್:"
 pageoptions_element_cld_url_bonus = "ಕಂಪನಿ ಡೊಮೇನ್ ಯುಆರ್ಎಲ್ ಬೋನಸ್:"
 pageoptions_element_host_url_bonus = "ಹೋಸ್ಟ್ ಯುಆರ್ಎಲ್ ಬೋನಸ್:"
 pageoptions_element_user_rank_bonus = "ಬಳಕೆದಾರ ಶ್ರೇಣಿಯ ಬೋನಸ್:"
+pageoptions_element_num_slashes_bonus = "ಸ್ಲಾಶ್‌ಗಳ ಬೋನಸ್‌ಗಳ ಸಂಖ್ಯೆ:"
+pageoptions_element_wiki_bonus = "ವಿಕಿ ಬೋನಸ್:"
 pageoptions_element_results_grouping_options = "ಹುಡುಕಾಟ ಫಲಿತಾಂಶಗಳು ಗುಂಪು"
 pageoptions_element_min_results_to_group = "ಕನಿಷ್ಠ ಫಲಿತಾಂಶಗಳು ಗುಂಪು:"
 pageoptions_element_test_page = "ಟೆಸ್ಟ್ ಪುಟ"
diff --git a/src/locale/ko/configure.ini b/src/locale/ko/configure.ini
index 224a5f2eb..9310d680c 100755
--- a/src/locale/ko/configure.ini
+++ b/src/locale/ko/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "근접 보너스:"
 pageoptions_element_cld_url_bonus = "회사 도메인 주소 보너스:"
 pageoptions_element_host_url_bonus = "호스트 주소 보너스:"
 pageoptions_element_user_rank_bonus = "사용자 순위 보너스:"
+pageoptions_element_num_slashes_bonus = "슬래시 보너스 수:"
+pageoptions_element_wiki_bonus = "위키 보너스:"
 pageoptions_element_results_grouping_options = "검색 결과 그룹"
 pageoptions_element_min_results_to_group = "최소 결과하는 그룹:"
 pageoptions_element_test_page = "테스트 페이지"
diff --git a/src/locale/nl/configure.ini b/src/locale/nl/configure.ini
index 726cf70d6..d16b4ec5e 100644
--- a/src/locale/nl/configure.ini
+++ b/src/locale/nl/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Proximity Bonus :"
 pageoptions_element_cld_url_bonus = "Bedrijfsdomein Url-Bonus :"
 pageoptions_element_host_url_bonus = "Host Url Bonus :"
 pageoptions_element_user_rank_bonus = "User Rank Bonus :"
+pageoptions_element_num_slashes_bonus = "Num Slashes Bonus:"
+pageoptions_element_wiki_bonus = "Wiki Bonus:"
 pageoptions_element_results_grouping_options = "Zoekresultaten Groepering"
 pageoptions_element_min_results_to_group = "Minimum Resultaten Groep:"
 pageoptions_element_test_page = "testpagina"
diff --git a/src/locale/pl/configure.ini b/src/locale/pl/configure.ini
index 03030925c..507e5652f 100755
--- a/src/locale/pl/configure.ini
+++ b/src/locale/pl/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Premia Zbliżeniowa :"
 pageoptions_element_cld_url_bonus = "Bonus URL Domeny Firmowej :"
 pageoptions_element_host_url_bonus = "Bonus URL Hosta:"
 pageoptions_element_user_rank_bonus = "Bonus Rangi Użytkownika:"
+pageoptions_element_num_slashes_bonus = "Premia za liczbę /:"
+pageoptions_element_wiki_bonus = "Bonus dla Wiki:"
 pageoptions_element_results_grouping_options = "Wyniki Wyszukiwania Grupowanie"
 pageoptions_element_min_results_to_group = "Minimalne wyniki w grupie:"
 pageoptions_element_test_page = "Strona Testowa "
diff --git a/src/locale/pt/configure.ini b/src/locale/pt/configure.ini
index ff1b81560..61f27f235 100755
--- a/src/locale/pt/configure.ini
+++ b/src/locale/pt/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Bônus De Proximidade :"
 pageoptions_element_cld_url_bonus = "Bônus De Url De Domínio Da Empresa:"
 pageoptions_element_host_url_bonus = "Bônus De URL Do Host :"
 pageoptions_element_user_rank_bonus = "Bônus De Classificação Do Usuário :"
+pageoptions_element_num_slashes_bonus = "Bônus para o número de /:"
+pageoptions_element_wiki_bonus = "Bônus para Wiki:"
 pageoptions_element_results_grouping_options = "Resultados Da Pesquisa De Agrupamento"
 pageoptions_element_min_results_to_group = "Resultados m&iacute;nimos para o Grupo:"
 pageoptions_element_test_page = "P&aacute;gina De Teste"
diff --git a/src/locale/ru/configure.ini b/src/locale/ru/configure.ini
index 66d4415b5..8443d8a68 100755
--- a/src/locale/ru/configure.ini
+++ b/src/locale/ru/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Бонус за близость:"
 pageoptions_element_cld_url_bonus = "Бонусный URL-адрес домена компании:"
 pageoptions_element_host_url_bonus = "Бонусный URL-адрес хоста:"
 pageoptions_element_user_rank_bonus = "Бонус за ранг пользователя:"
+pageoptions_element_num_slashes_bonus = "Бонус за количество слэшей:"
+pageoptions_element_wiki_bonus = "Бонус для Вики:"
 pageoptions_element_results_grouping_options = "Результаты Поиска Группировка"
 pageoptions_element_min_results_to_group = "Минимальные результаты в группе:"
 pageoptions_element_test_page = "Тестовая Страница "
diff --git a/src/locale/te/configure.ini b/src/locale/te/configure.ini
index 86bb0f100..84953f35a 100644
--- a/src/locale/te/configure.ini
+++ b/src/locale/te/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "సామీప్య బోనస్:"
 pageoptions_element_cld_url_bonus = "కంపెనీ డొమైన్ యూఆర్ఎల్ బోనస్:"
 pageoptions_element_host_url_bonus = "హోస్ట్ యూఆర్ఎల్ బోనస్:"
 pageoptions_element_user_rank_bonus = "వాడుకరి రాంక్ బోనస్:"
+pageoptions_element_num_slashes_bonus = "ఫార్వర్డ్ స్లాష్‌ల బోనస్ సంఖ్య:"
+pageoptions_element_wiki_bonus = "బోనస్ వికీ:"
 pageoptions_element_results_grouping_options = "శోధన ఫలితాలు చోట"
 pageoptions_element_min_results_to_group = "కనీస ఫలితాలు గుంపు:"
 pageoptions_element_test_page = "టెస్ట్ పేజీ"
diff --git a/src/locale/th/configure.ini b/src/locale/th/configure.ini
index e10073b77..24a9dc889 100755
--- a/src/locale/th/configure.ini
+++ b/src/locale/th/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "โบนัสความใกล้
 pageoptions_element_cld_url_bonus = "โบนัสโดเมนบริษัท:"
 pageoptions_element_host_url_bonus = "โบนัสโฮสต์:"
 pageoptions_element_user_rank_bonus = "โบนัสอันดับผู้ใช้:"
+pageoptions_element_num_slashes_bonus = "โบนัสสำหรับจำนวนสแลช:"
+pageoptions_element_wiki_bonus = "โบนัสสำหรับวิกิ:"
 pageoptions_element_results_grouping_options = "ผลการค้นหาการจัดกลุ่ม"
 pageoptions_element_min_results_to_group = "อย่างน้อยผลให้กลุ่ม:"
 pageoptions_element_test_page = "ทดสอบหน้า"
diff --git a/src/locale/tl/configure.ini b/src/locale/tl/configure.ini
index 6d8a8f8f4..eb82752f3 100644
--- a/src/locale/tl/configure.ini
+++ b/src/locale/tl/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Malapit Na Bonus:"
 pageoptions_element_cld_url_bonus = "Bonus Ng Url Ng Domain Ng Kumpanya:"
 pageoptions_element_host_url_bonus = "Host Url Bonus:"
 pageoptions_element_user_rank_bonus = "Bonus Sa Ranggo Ng Gumagamit:"
+pageoptions_element_num_slashes_bonus = "Bonus para sa Bilang ng mga Slash:"
+pageoptions_element_wiki_bonus = "Bonus para sa Wiki:"
 pageoptions_element_results_grouping_options = "Mga Resulta Ng Paghahanap Ng Pagpapangkat"
 pageoptions_element_min_results_to_group = "Minimum na mga Resulta sa Grupo:"
 pageoptions_element_test_page = "Pahina Ng Pagsubok"
diff --git a/src/locale/tr/configure.ini b/src/locale/tr/configure.ini
index ab1599ced..05d47e490 100755
--- a/src/locale/tr/configure.ini
+++ b/src/locale/tr/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Yakınlık Bonusu :"
 pageoptions_element_cld_url_bonus = "Şirket Alan Adı Url Bonusu :"
 pageoptions_element_host_url_bonus = "Ana Bilgisayar Url Bonusu :"
 pageoptions_element_user_rank_bonus = "Kullanıcı Sıralaması Bonusu :"
+pageoptions_element_num_slashes_bonus = "Eğik Çizgi Sayısı için Bonus:"
+pageoptions_element_wiki_bonus = "Wiki için Bonus:"
 pageoptions_element_results_grouping_options = "Arama Sonu&ccedil;ları Gruplandırma"
 pageoptions_element_min_results_to_group = "Minimum Sonu&ccedil;lar Grup i&ccedil;in:"
 pageoptions_element_test_page = "Test Sayfası"
diff --git a/src/locale/vi_VN/configure.ini b/src/locale/vi_VN/configure.ini
index 15fd30696..59b5c5f17 100755
--- a/src/locale/vi_VN/configure.ini
+++ b/src/locale/vi_VN/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "Gần Thưởng:"
 pageoptions_element_cld_url_bonus = "Công Ty Miền Url Thưởng:"
 pageoptions_element_host_url_bonus = "Chủ Url Thưởng:"
 pageoptions_element_user_rank_bonus = "Sử Dụng Cấp Bậc Tiền Thưởng:"
+pageoptions_element_num_slashes_bonus = "Phần thưởng cho số lần chém:"
+pageoptions_element_wiki_bonus = "Phần thưởng cho Wiki:"
 pageoptions_element_results_grouping_options = "Kết Quả Tìm Kiếm Nhóm"
 pageoptions_element_min_results_to_group = "Kết Quả tối thiểu để Nhóm:"
 pageoptions_element_test_page = "Kiểm Tra Trang"
diff --git a/src/locale/zh_CN/configure.ini b/src/locale/zh_CN/configure.ini
index 086a14d90..11540d466 100755
--- a/src/locale/zh_CN/configure.ini
+++ b/src/locale/zh_CN/configure.ini
@@ -1460,6 +1460,8 @@ pageoptions_element_proximity_bonus = "接近奖励:"
 pageoptions_element_cld_url_bonus = "公司域名Url奖金:"
 pageoptions_element_host_url_bonus = "主机Url奖金:"
 pageoptions_element_user_rank_bonus = "用户等级奖金:"
+pageoptions_element_num_slashes_bonus = "斜线奖励数量:"
+pageoptions_element_wiki_bonus = "维基奖励:"
 pageoptions_element_results_grouping_options = "搜索结果的分组"
 pageoptions_element_min_results_to_group = "最低结果，小组："
 pageoptions_element_test_page = "测试页"
diff --git a/src/models/ProfileModel.php b/src/models/ProfileModel.php
index 226c9b0ca..8a52a3455 100755
--- a/src/models/ProfileModel.php
+++ b/src/models/ProfileModel.php
@@ -61,7 +61,7 @@ class ProfileModel extends Model
         'LOGO_LARGE', 'MAIL_PASSWORD',  'MAIL_SECURITY',
         'MAIL_SENDER', 'MAIL_SERVER', 'MAIL_SERVERPORT', 'MAIL_USERNAME',
         'MIN_RESULTS_TO_GROUP',  'MONETIZATION_TYPE', 'MORE_RESULT',
-        'MEDIA_MODE', 'NAME_SERVER', 'PATH_KEYWORD_BONUS',
+        'MEDIA_MODE', 'NAME_SERVER', 'NUM_SLASHES_BONUS', 'PATH_KEYWORD_BONUS',
         'PRIVATE_DB_NAME', 'PRIVATE_DB_HOST', 'PRIVATE_DBMS',
         'PRIVATE_DB_PASSWORD', 'PRIVATE_DB_USER', 'PROXY_SERVERS',
         'PROXIMITY_BONUS', 'RECOVERY_MODE', 'REGISTRATION_TYPE', 'RESULT_SCORE',
@@ -71,8 +71,8 @@ class ProfileModel extends Model
         'SIMILAR_LINK', 'SUBSEARCH_LINK', 'TITLE_BONUS', 'TIMEZONE',
         'TOPBAR_COLOR', 'TOP_ADSCRIPT','TOR_PROXY', 'USE_FILECACHE',
         'USE_MAIL_PHP', 'USE_PROXY', 'USER_AGENT_SHORT', 'USER_RANK_BONUS',
-        'WEB_URI', 'WEB_ACCESS', 'WORD_CLOUD', 'WORD_SUGGEST'
-        ];
+        'WEB_URI', 'WEB_ACCESS', 'WIKI_BONUS', 'WORD_CLOUD', 'WORD_SUGGEST'
+    ];
     /**
      * Profile fields which are stored in wiki or in a flat file
      * @var array
@@ -339,12 +339,12 @@ class ProfileModel extends Model
             "RECOMMENDATION_ITEM_EMBEDDING" => "CREATE TABLE
                 RECOMMENDATION_ITEM_EMBEDDING (ID $integer NOT NULL,
                 ITEM_TYPE $integer NOT NULL, VECTOR VARCHAR(" .
-                    32 * C\EMBEDDING_VECTOR_SIZE . "), PARENT_ID $integer,
+                32 * C\EMBEDDING_VECTOR_SIZE . "), PARENT_ID $integer,
                 PRIMARY KEY(ID, ITEM_TYPE))",
             "RECOMMENDATION_TERM_EMBEDDING" => "CREATE TABLE
                 RECOMMENDATION_TERM_EMBEDDING (ID VARCHAR(16) NOT NULL,
                 ITEM_TYPE $integer NOT NULL, VECTOR VARCHAR(" .
-                    32 * C\EMBEDDING_VECTOR_SIZE . "),
+                32 * C\EMBEDDING_VECTOR_SIZE . "),
                 PRIMARY KEY(ID, ITEM_TYPE))",
             "SCRAPER" =>
                 "CREATE TABLE SCRAPER (ID $serial PRIMARY KEY
@@ -491,7 +491,7 @@ class ProfileModel extends Model
      *     to factory settings or not
      */
     public function updateProfile($directory, $new_profile_data,
-        $old_profile_data, $reset = false)
+                                  $old_profile_data, $reset = false)
     {
         $n = [];
         $n[] = <<<EOT
diff --git a/src/views/elements/PageoptionsElement.php b/src/views/elements/PageoptionsElement.php
index b7eb7a488..fe25f5843 100644
--- a/src/views/elements/PageoptionsElement.php
+++ b/src/views/elements/PageoptionsElement.php
@@ -52,163 +52,163 @@ class PageOptionsElement extends Element
     public function render($data)
     { ?>
         <div class="current-activity">
-        <form id="pageoptionsForm" method="post" enctype='multipart/form-data'>
-        <ul class='tab-menu-list'>
-        <li><script>
-            document.write('<a href="javascript:switchTab(' +
-                "'crawltimetab', 'searchtimetab', 'testoptionstab'" + ');" ' +
-                "id='crawltimetabitem' " +
-                'class="<?=$data['crawl_time_active'] ?>"><?=
-                tl('pageoptions_element_crawl_time')?></a>');
-            </script>
-            <noscript>
-            <a href="#crawltimetab"
-                id='crawltimetabitem'><?=
-                tl('pageoptions_element_crawl_time')?></a>
-            </noscript>
-        </li>
-        <li><script>
-            document.write('<a href="javascript:switchTab(' +
-                "'searchtimetab', 'crawltimetab','testoptionstab'" + ');" ' +
-                "id='searchtimetabitem' " +
-                'class="<?=$data['search_time_active'] ?>"><?=
-                tl('pageoptions_element_search_time')?></a>');
-            </script>
-            <noscript>
-            <a href="#searchtimetab" id='searchtimetabitem'><?=
-                tl('pageoptions_element_search_time')?></a>
-            </noscript>
-        </li>
-        <li><script>
-            document.write('<a href="javascript:switchTab(' +
-                "'testoptionstab', 'crawltimetab', 'searchtimetab'" + ');" ' +
-                "id='testoptionstabitem' " +
-                'class="<?=$data['test_options_active'] ?>"><?=
-                tl('pageoptions_element_test_options') ?></a>');
-            </script>
-            <noscript>
-            <a href="#testoptionstab" id='testoptionstabitem' ><?=
-                tl('pageoptions_element_test_options') ?></a>
-            </noscript>
-        </li>
-        </ul>
-        <div class='tab-menu-content'>
-        <input type="hidden" name="c" value="admin" >
-        <input type="hidden" name="posted" value="posted" >
-        <input id='option-type' type="hidden"  name="option_type" value="<?=
-            $data['option_type'] ?>" >
-        <input type="hidden" name="<?= C\CSRF_TOKEN ?>" value="<?=
-            $data[C\CSRF_TOKEN] ?>" >
-        <input type="hidden" name="a" value="pageOptions" >
-        <?php
-        $this->renderCrawlTimeTab($data); ?>
-        <noscript>
-        <div class="center slight-pad">
-        <button class="button-box" type="submit"><?=
-        tl('pageoptions_element_save_options')?></button>
-        </div>
-        </noscript>
-        <?php
-        $this->renderSearchTimeTab($data); ?>
-        <noscript>
-        <div class="center slight-pad">
-        <button class="button-box" type="submit"><?=
-        tl('pageoptions_element_save_options')?></button>
-        </div>
-        </noscript>
-        <?php
-        $this->renderTestTab($data); ?>
-        <div class="center slight-pad">
-            <script>
-            document.write('<button class="button-box" id="page-button" '+
-                'type="submit"><?php if ($data['test_options_active'] == "") {
-                    e(tl('pageoptions_element_save_options'));
-                } else {
-                    e(tl('pageoptions_element_run_tests'));
-                }
-                ?></button>');
-            </script>
-            <noscript>
-            <button class="button-box" type="submit"><?=
-            tl('pageoptions_element_run_tests')?></button>
-            </noscript>
-        </div>
-        </div>
-        </form>
-        <?php
-        foreach ($data['INDEXING_PLUGINS'] as
-            $plugin => $plugin_data) {
-            $class_name = C\NS_PLUGINS . $plugin."Plugin";
-            if ($plugin_data['configure']) { ?>
-                <div class="indexing-plugin-lightbox" id="plugin-<?=$plugin?>" >
-                <div class="light-content">
-                <?= $this->view->helper("close")->render(
-                    "javascript:setDisplay('plugin-$plugin', false);");?>
-                <?php
-                    $plugin_object = new $class_name();
-                    $plugin_object->configureView($data);
-                ?>
+            <form id="pageoptionsForm" method="post" enctype='multipart/form-data'>
+                <ul class='tab-menu-list'>
+                    <li><script>
+                            document.write('<a href="javascript:switchTab(' +
+                                "'crawltimetab', 'searchtimetab', 'testoptionstab'" + ');" ' +
+                                "id='crawltimetabitem' " +
+                                'class="<?=$data['crawl_time_active'] ?>"><?=
+                                    tl('pageoptions_element_crawl_time')?></a>');
+                        </script>
+                        <noscript>
+                            <a href="#crawltimetab"
+                               id='crawltimetabitem'><?=
+                                tl('pageoptions_element_crawl_time')?></a>
+                        </noscript>
+                    </li>
+                    <li><script>
+                            document.write('<a href="javascript:switchTab(' +
+                                "'searchtimetab', 'crawltimetab','testoptionstab'" + ');" ' +
+                                "id='searchtimetabitem' " +
+                                'class="<?=$data['search_time_active'] ?>"><?=
+                                    tl('pageoptions_element_search_time')?></a>');
+                        </script>
+                        <noscript>
+                            <a href="#searchtimetab" id='searchtimetabitem'><?=
+                                tl('pageoptions_element_search_time')?></a>
+                        </noscript>
+                    </li>
+                    <li><script>
+                            document.write('<a href="javascript:switchTab(' +
+                                "'testoptionstab', 'crawltimetab', 'searchtimetab'" + ');" ' +
+                                "id='testoptionstabitem' " +
+                                'class="<?=$data['test_options_active'] ?>"><?=
+                                    tl('pageoptions_element_test_options') ?></a>');
+                        </script>
+                        <noscript>
+                            <a href="#testoptionstab" id='testoptionstabitem' ><?=
+                                tl('pageoptions_element_test_options') ?></a>
+                        </noscript>
+                    </li>
+                </ul>
+                <div class='tab-menu-content'>
+                    <input type="hidden" name="c" value="admin" >
+                    <input type="hidden" name="posted" value="posted" >
+                    <input id='option-type' type="hidden"  name="option_type" value="<?=
+                    $data['option_type'] ?>" >
+                    <input type="hidden" name="<?= C\CSRF_TOKEN ?>" value="<?=
+                    $data[C\CSRF_TOKEN] ?>" >
+                    <input type="hidden" name="a" value="pageOptions" >
+                    <?php
+                    $this->renderCrawlTimeTab($data); ?>
+                    <noscript>
+                        <div class="center slight-pad">
+                            <button class="button-box" type="submit"><?=
+                                tl('pageoptions_element_save_options')?></button>
+                        </div>
+                    </noscript>
+                    <?php
+                    $this->renderSearchTimeTab($data); ?>
+                    <noscript>
+                        <div class="center slight-pad">
+                            <button class="button-box" type="submit"><?=
+                                tl('pageoptions_element_save_options')?></button>
+                        </div>
+                    </noscript>
+                    <?php
+                    $this->renderTestTab($data); ?>
+                    <div class="center slight-pad">
+                        <script>
+                            document.write('<button class="button-box" id="page-button" '+
+                                'type="submit"><?php if ($data['test_options_active'] == "") {
+                                    e(tl('pageoptions_element_save_options'));
+                                } else {
+                                    e(tl('pageoptions_element_run_tests'));
+                                }
+                                    ?></button>');
+                        </script>
+                        <noscript>
+                            <button class="button-box" type="submit"><?=
+                                tl('pageoptions_element_run_tests')?></button>
+                        </noscript>
+                    </div>
                 </div>
-                </div><?php
+            </form>
+            <?php
+            foreach ($data['INDEXING_PLUGINS'] as
+                     $plugin => $plugin_data) {
+                $class_name = C\NS_PLUGINS . $plugin."Plugin";
+                if ($plugin_data['configure']) { ?>
+                <div class="indexing-plugin-lightbox" id="plugin-<?=$plugin?>" >
+                    <div class="light-content">
+                        <?= $this->view->helper("close")->render(
+                            "javascript:setDisplay('plugin-$plugin', false);");?>
+                        <?php
+                        $plugin_object = new $class_name();
+                        $plugin_object->configureView($data);
+                        ?>
+                    </div>
+                    </div><?php
+                }
             }
-        }
-        $this->renderTestResults($data);
-        ?>
+            $this->renderTestResults($data);
+            ?>
         </div>
         <script>
-        function switchTab(newtab, oldtab, oldtab2)
-        {
-            setDisplay(newtab, true);
-            setDisplay(oldtab, false);
-            setDisplay(oldtab2, false);
-            ntab = elt(newtab + "item");
-            if (ntab) {
-                ntab.className = 'active';
-            }
-            otab = elt(oldtab + "item");
-            if (otab) {
-                otab.className = '';
-            }
-            otab2 = elt(oldtab2 + "item");
-            if (otab2) {
-                otab2.className = '';
+            function switchTab(newtab, oldtab, oldtab2)
+            {
+                setDisplay(newtab, true);
+                setDisplay(oldtab, false);
+                setDisplay(oldtab2, false);
+                ntab = elt(newtab + "item");
+                if (ntab) {
+                    ntab.className = 'active';
+                }
+                otab = elt(oldtab + "item");
+                if (otab) {
+                    otab.className = '';
+                }
+                otab2 = elt(oldtab2 + "item");
+                if (otab2) {
+                    otab2.className = '';
+                }
+                ctype = elt('option-type');
+                if (ctype) {
+                    ctype.value = (newtab == 'crawltimetab')
+                        ? 'crawl_time' : ((newtab == 'searchtimetab') ?
+                            'search_time' : 'test_options' );
+                    if (ctype.value == 'test_options') {
+                        elt('page-button').innerHTML =
+                            '<?= tl('pageoptions_element_run_tests') ?>';
+                        elt('page-button').style.display = 'inline';
+                        elt('test-results').style.display = 'block';
+                        switchTestMethod();
+                    } else {
+                        elt('page-button').innerHTML =
+                            '<?= tl('pageoptions_element_save_options') ?>';
+                        elt('page-button').style.display = 'inline';
+                        elt('test-results').style.display = 'none';
+                    }
+                }
             }
-            ctype = elt('option-type');
-            if (ctype) {
-                ctype.value = (newtab == 'crawltimetab')
-                    ? 'crawl_time' : ((newtab == 'searchtimetab') ?
-                    'search_time' : 'test_options' );
-                if (ctype.value == 'test_options') {
-                    elt('page-button').innerHTML =
-                        '<?= tl('pageoptions_element_run_tests') ?>';
-                    elt('page-button').style.display = 'inline';
-                    elt('test-results').style.display = 'block';
-                    switchTestMethod();
+            function switchTestMethod()
+            {
+                method = elt('test-method').value;
+                elt('test-uri').style.display = 'none';
+                elt('test-file-upload').style.display = 'none';
+                elt('test-direct-input').style.display = 'none';
+                if (method == 'uri' || method == 'file-upload' ||
+                    method == 'direct-input') {
+                    elt("test-" + method).style.display = 'block';
+                }
+                if (elt('option-type').value == 'test_options' && (
+                    method == 'file-upload' || method == -1)) {
+                    elt('page-button').style.display = 'none';
                 } else {
-                    elt('page-button').innerHTML =
-                        '<?= tl('pageoptions_element_save_options') ?>';
                     elt('page-button').style.display = 'inline';
-                    elt('test-results').style.display = 'none';
                 }
             }
-        }
-        function switchTestMethod()
-        {
-            method = elt('test-method').value;
-            elt('test-uri').style.display = 'none';
-            elt('test-file-upload').style.display = 'none';
-            elt('test-direct-input').style.display = 'none';
-            if (method == 'uri' || method == 'file-upload' ||
-                method == 'direct-input') {
-                    elt("test-" + method).style.display = 'block';
-            }
-            if (elt('option-type').value == 'test_options' && (
-                method == 'file-upload' || method == -1)) {
-                elt('page-button').style.display = 'none';
-            } else {
-                elt('page-button').style.display = 'inline';
-            }
-        }
         </script>
         <?php
     }
@@ -221,96 +221,96 @@ class PageOptionsElement extends Element
     { ?>
         <div id='crawltimetab'>
         <div class="top-margin"><label for="load-options"><b><?=
-            tl('pageoptions_element_load_options')?></b></label><?php
+                    tl('pageoptions_element_load_options')?></b></label><?php
             $this->view->helper("options")->render("load-options","load_option",
                 $data['available_options'], $data['options_default'], true);
-        ?></div>
+            ?></div>
         <div class="top-margin">[<a href="<?=
             htmlentities(B\controllerUrl('admin', true)) .
             C\CSRF_TOKEN . "=" . $data[C\CSRF_TOKEN] .
             "&amp;a=manageCrawls&amp;arg=options" ?>"><?=
-            tl('pageoptions_element_crawl_options')
-            ?></a>]</div>
+                tl('pageoptions_element_crawl_options')
+                ?></a>]</div>
         <div class="top-margin"><b><label for="page-range-request"><?=
-            tl('pageoptions_element_page_range')?></label></b>
+                    tl('pageoptions_element_page_range')?></label></b>
             <?php $this->view->helper("options")->render("page-range-request",
-            "page_range_request", $data['SIZE_VALUES'], $data['PAGE_SIZE']);
+                "page_range_request", $data['SIZE_VALUES'], $data['PAGE_SIZE']);
             e("&nbsp;" . $this->view->helper("helpbutton")->render(
-                "Page Byte Ranges", $data[C\CSRF_TOKEN])); ?></div>
+                    "Page Byte Ranges", $data[C\CSRF_TOKEN])); ?></div>
         <div class="top-margin"><label for="summarizer"><b><?=
-            tl('pageoptions_element_summarizer') ?></b></label><?php
-                $this->view->helper("options")->render("summarizer",
+                    tl('pageoptions_element_summarizer') ?></b></label><?php
+            $this->view->helper("options")->render("summarizer",
                 "summarizer_option", $data['available_summarizers'],
                 $data['summarizer_option']);
             e("&nbsp;" . $this->view->helper("helpbutton")->render(
-                "Kinds of Summarizers", $data[C\CSRF_TOKEN]));
+                    "Kinds of Summarizers", $data[C\CSRF_TOKEN]));
             ?>
         </div>
         <div class="top-margin"><b><label for="max-description-len"><?=
-            tl('pageoptions_element_max_description')?></label></b>
+                    tl('pageoptions_element_max_description')?></label></b>
             <?php $this->view->helper("options")->render("max-description-len",
-            "max_description_len", $data['LEN_VALUES'], $data['MAX_LEN']);
+                "max_description_len", $data['LEN_VALUES'], $data['MAX_LEN']);
             e("&nbsp;" . $this->view->helper("helpbutton")->render(
-                "Summary Length", $data[C\CSRF_TOKEN]));?></div>
+                    "Summary Length", $data[C\CSRF_TOKEN]));?></div>
         <div class="top-margin"><b><label for="max-links-to-extract"><?=
-            tl('pageoptions_element_max_links_to_extract')?></label></b>
+                    tl('pageoptions_element_max_links_to_extract')?></label></b>
             <?php $this->view->helper("options")->render("max-links-to-extract",
-            "max_links_to_extract", $data['MAX_LINKS_VALUES'],
-            $data['MAX_LINKS_TO_EXTRACT']);
+                "max_links_to_extract", $data['MAX_LINKS_VALUES'],
+                $data['MAX_LINKS_TO_EXTRACT']);
             e("&nbsp;" . $this->view->helper("helpbutton")->render(
-                "Max Links", $data[C\CSRF_TOKEN]));?></div>
+                    "Max Links", $data[C\CSRF_TOKEN]));?></div>
         <div class="top-margin"><b><label for="cache-pages"><?=
-            tl('pageoptions_element_cache_pages')?>
-            </label></b><input
-            id='cache-pages' type="checkbox" name="cache_pages"
-            value="true"
-            <?php if (!empty($data['CACHE_PAGES'])) {
-                e("checked='checked'");
-             }?>
+                    tl('pageoptions_element_cache_pages')?>
+                </label></b><input
+                id='cache-pages' type="checkbox" name="cache_pages"
+                value="true"
+                <?php if (!empty($data['CACHE_PAGES'])) {
+                    e("checked='checked'");
+                }?>
             >
         </div>
         <div class="top-margin"><b><label for="page-recrawl-frequency"><?=
-            tl('pageoptions_element_allow_recrawl') ?></label></b>
+                    tl('pageoptions_element_allow_recrawl') ?></label></b>
             <?php $this->view->helper("options")->render(
                 "page-recrawl-frequency",
                 "page_recrawl_frequency", $data['RECRAWL_FREQS'],
                 $data['PAGE_RECRAWL_FREQUENCY']);
             ?></div>
         <div class="top-margin"><b><?=
-            tl('pageoptions_element_file_types')?></b>
-       </div>
-       <table class="file-types-all"><tr>
-       <?php $cnt = 0;
-             $num_types_per_column = ceil(count($data['INDEXED_FILE_TYPES'])/3);
-             foreach ($data['INDEXED_FILE_TYPES'] as $filetype => $checked) {
-                 if ($cnt % $num_types_per_column == 0) {
-                    ?><td><table class="file-types-table" ><?php
-                 }
-       ?>
-            <tr><td><label for="filetype-<?= $filetype ?>-id"><?=$filetype ?>
-            </label></td><td><input type="checkbox" <?= $checked ?>
-                name="filetype[<?=$filetype ?>]"
-                id="filetype-<?= $filetype ?>-id"
-                value="true" ></td>
-            </tr>
-       <?php
-                $cnt++;
-                if ($cnt % $num_types_per_column == 0) {
-                    ?></table></td><?php
-                }
-            }?>
-        <?php
+                tl('pageoptions_element_file_types')?></b>
+        </div>
+        <table class="file-types-all"><tr>
+                <?php $cnt = 0;
+                $num_types_per_column = ceil(count($data['INDEXED_FILE_TYPES'])/3);
+                foreach ($data['INDEXED_FILE_TYPES'] as $filetype => $checked) {
+                    if ($cnt % $num_types_per_column == 0) {
+                        ?><td><table class="file-types-table" ><?php
+                    }
+                    ?>
+                    <tr><td><label for="filetype-<?= $filetype ?>-id"><?=$filetype ?>
+                            </label></td><td><input type="checkbox" <?= $checked ?>
+                                                    name="filetype[<?=$filetype ?>]"
+                                                    id="filetype-<?= $filetype ?>-id"
+                                                    value="true" ></td>
+                    </tr>
+                    <?php
+                    $cnt++;
+                    if ($cnt % $num_types_per_column == 0) {
+                        ?></table></td><?php
+                    }
+                }?>
+            <?php
             if ($cnt % $num_types_per_column != 0) {
-                ?></table></td><?php
-            }
+            ?></table></td><?php
+        }
         ?>
         </tr></table>
         <div class="top-margin"><b><?=
-            tl('pageoptions_element_classifiers_rankers') ?></b> <?=
+                tl('pageoptions_element_classifiers_rankers') ?></b> <?=
             $this->view->helper("helpbutton")->render(
                 "Using a Classifier or Ranker", $data[C\CSRF_TOKEN]) ?>
-       </div>
-       <?php if (!empty($data['CLASSIFIERS'])) {
+        </div>
+        <?php if (!empty($data['CLASSIFIERS'])) {
             $data['TABLE_TITLE'] = "";
             $data['ACTIVITY'] = 'pageOptions';
             $data['VIEW'] = $this->view;
@@ -321,88 +321,88 @@ class PageOptionsElement extends Element
             $data['NO_ADD_TOGGLE'] = true;
             ?>
             <table class="classifiers-table" >
-            <tr><td class="no-border" colspan="3"><?php $this->view->helper(
-                "pagingtable")->render($data);?></td></tr>
-            <tr><td></td>
-                <th><?=tl('pageoptions_element_use_classify') ?></th>
-                <th><?=tl('pageoptions_element_use_rank') ?></th>
-            </tr>
-            <?php
-            foreach ($data['CLASSIFIERS'] as $label => $class_checked) {
-                if (isset($data['RANKERS'][$label])) {
-                    $rank_checked = $data['RANKERS'][$label];
-                } else {
-                    $rank_checked = "";
+                <tr><td class="no-border" colspan="3"><?php $this->view->helper(
+                            "pagingtable")->render($data);?></td></tr>
+                <tr><td></td>
+                    <th><?=tl('pageoptions_element_use_classify') ?></th>
+                    <th><?=tl('pageoptions_element_use_rank') ?></th>
+                </tr>
+                <?php
+                foreach ($data['CLASSIFIERS'] as $label => $class_checked) {
+                    if (isset($data['RANKERS'][$label])) {
+                        $rank_checked = $data['RANKERS'][$label];
+                    } else {
+                        $rank_checked = "";
+                    }
+                    ?>
+                    <tr><td><?=$label
+                            ?></td><td class="check"><input type="checkbox"
+                                <?= $class_checked ?>
+                                                            aria-label="classifier-<?= $label ?>"
+                                                            name="classifier[<?=$label ?>]"
+                                                            id="classifier-<?= $label ?>-id" value="true" ></td>
+                        <td class="check"><input type="checkbox"
+                                <?= $rank_checked ?>
+                                                 aria-label="ranker-<?= $label ?>"
+                                                 name="ranker[<?= $label ?>]"
+                                                 id="ranker-<?= $label ?>-id" value="true" ></td>
+                    </tr>
+                    <?php
                 }
                 ?>
-                <tr><td><?=$label
-                    ?></td><td class="check"><input type="checkbox"
-                    <?= $class_checked ?>
-                    aria-label="classifier-<?= $label ?>"
-                    name="classifier[<?=$label ?>]"
-                    id="classifier-<?= $label ?>-id" value="true" ></td>
-                    <td class="check"><input type="checkbox"
-                    <?= $rank_checked ?>
-                    aria-label="ranker-<?= $label ?>"
-                    name="ranker[<?= $label ?>]"
-                    id="ranker-<?= $label ?>-id" value="true" ></td>
-                </tr>
-            <?php
-            }
-            ?>
             </table>
-        <?php
+            <?php
         } else {
             e("<p class='red'>".
                 tl('pageoptions_element_no_classifiers').'</p>');
         } ?>
         <div class="top-margin"><b><?=
-            tl("pageoptions_element_indexing_plugins")?></b> <?=
+                tl("pageoptions_element_indexing_plugins")?></b> <?=
             $this->view->helper("helpbutton")->render(
                 "Indexing Plugins", $data[C\CSRF_TOKEN]) ?></div>
         <?php if (isset($data['INDEXING_PLUGINS']) &&
             count($data['INDEXING_PLUGINS']) > 0) { ?>
             <table class="indexing-plugin-table">
                 <tr><th><?= tl('pageoptions_element_plugin') ?></th>
-                <th><?= tl('pageoptions_element_plugin_include') ?></th></tr>
+                    <th><?= tl('pageoptions_element_plugin_include') ?></th></tr>
                 <?php
                 $k = 0;
                 foreach ($data['INDEXING_PLUGINS'] as
-                    $plugin => $plugin_data) {
+                         $plugin => $plugin_data) {
                     if ($plugin == "") { continue; }
+                    ?>
+                    <tr><td><label for="<?= $plugin. "Plugin" ?>"><?=
+                                $plugin. "Plugin" ?></label></td>
+                        <td class="check"><input type="checkbox"
+                                                 name="INDEXING_PLUGINS[<?= $k ?>]"
+                                                 id="<?= $plugin. "Plugin" ?>"
+                                                 value = "<?= $plugin ?>"
+                                <?= $plugin_data['checked'] ?>
+                            ><?php
+                            if ($plugin_data['configure']) { ?>
+                                [<a href="javascript:setDisplay('plugin-<?=
+                                $plugin ?>', true);" ><?=
+                                    tl('pageoptions_element_configure')
+                                    ?></a>]<?php
+                            }
+                            ?></td></tr>
+                    <?php
+                    $k++;
+                }
                 ?>
-                <tr><td><label for="<?= $plugin. "Plugin" ?>"><?=
-                    $plugin. "Plugin" ?></label></td>
-                <td class="check"><input type="checkbox"
-                    name="INDEXING_PLUGINS[<?= $k ?>]"
-                    id="<?= $plugin. "Plugin" ?>"
-                    value = "<?= $plugin ?>"
-                    <?= $plugin_data['checked'] ?>
-                    ><?php
-                    if ($plugin_data['configure']) { ?>
-                        [<a href="javascript:setDisplay('plugin-<?=
-                            $plugin ?>', true);" ><?=
-                            tl('pageoptions_element_configure')
-                        ?></a>]<?php
-                    }
-                ?></td></tr>
-            <?php
-                $k++;
-            }
-            ?>
             </table>
-        <?php
+            <?php
         } else {
             e("<p class='red'>".
                 tl('pageoptions_element_no_compatible_plugins')."</p>");
         } ?>
         <div class="top-margin"><label for="page-rules"><b><?=
-            tl('pageoptions_element_page_rules')?></b></label> <?=
+                    tl('pageoptions_element_page_rules')?></b></label> <?=
             $this->view->helper("helpbutton")->render(
                 "Page Rules", $data[C\CSRF_TOKEN]) ?>
         </div>
         <textarea class="short-text-area" id="page-rules"
-            name="page_rules" ><?=$data['page_rules'] ?></textarea>
+                  name="page_rules" ><?=$data['page_rules'] ?></textarea>
         </div><?php
     }
     /**
@@ -414,165 +414,175 @@ class PageOptionsElement extends Element
     { ?>
         <div id='searchtimetab'>
         <h2><?= tl('pageoptions_element_search_page')?>
-        <?= $this->view->helper("helpbutton")->render(
-            "Search Results Page Elements", $data[C\CSRF_TOKEN]) ?></h2>
+            <?= $this->view->helper("helpbutton")->render(
+                "Search Results Page Elements", $data[C\CSRF_TOKEN]) ?></h2>
         <table class="search-page-all"><tr><td>
-        <table class="search-page-table">
-        <tr>
-        <td><label for="wd-suggest"><?=
-            tl('pageoptions_element_wd_suggest') ?></label></td>
-            <td><input id='wd-suggest' type="checkbox"
-            name="WORD_SUGGEST" value="true"
-            <?php if (isset($data['WORD_SUGGEST']) &&
-                $data['WORD_SUGGEST']) {
-                e("checked='checked'");}?>
-            ></td></tr>
-        <tr><td><label for="subsearch-link"><?=
-            tl('pageoptions_element_subsearch_link')?></label></td><td>
-            <input id='subsearch-link'
-            type="checkbox" name="SUBSEARCH_LINK" value="true"
-            <?php if (isset($data['SUBSEARCH_LINK']) &&
-                $data['SUBSEARCH_LINK']){
-                e("checked='checked'");}?>
-            ></td>
-        </tr>
-        <tr><td><label for="signin-link"><?=
-            tl('pageoptions_element_signin_link') ?></label></td><td>
-            <input id='signin-link' type="checkbox"
-            name="SIGNIN_LINK" value="true"
-            <?php if (isset($data['SIGNIN_LINK']) &&
-                $data['SIGNIN_LINK']){ e("checked='checked'");}?>
-            >
-        </td></tr>
-        <tr><td><label for="continuous-scroll"><?=
-            tl('pageoptions_element_continuous_scroll') ?></label></td>
-        <td><input id='continuous-scroll' type="checkbox"
-            name="DEFAULT_CONTINUOUS_SCROLL" value="true"
-            <?php if (isset($data['DEFAULT_CONTINUOUS_SCROLL'])
-                && $data['DEFAULT_CONTINUOUS_SCROLL']){
-                e("checked='checked'");}?>
-            ></td>
-        </tr>
-        <tr><td><label for="serp-favicons"><?=
-            tl('pageoptions_element_serp_favicons') ?></label></td>
-        <td><input id='serp-favicons' type="checkbox"
-            name="SERP_FAVICONS" value="true"
-            <?php if (isset($data['SERP_FAVICONS'])
-                && $data['SERP_FAVICONS']){
-                e("checked='checked'");}?>
-            ></td>
-        </tr>
-        <tr>
-        <td><label for="more-result"><?=
-            tl('pageoptions_element_more_result') ?></label></td>
-            <td><input id='more-result' type="checkbox"
-            name="MORE_RESULT" value="true"
-            <?php if (isset($data['MORE_RESULT']) &&
-                $data['MORE_RESULT']) {
-                e("checked='checked'");}?>
-            ></td></tr>
-        </table></td>
-        <td><table class="search-page-table">
-        <tr>
-        <td><label for="wd-cloud"><?=
-            tl('pageoptions_element_wd_cloud') ?></label></td>
-            <td><input id='wd-cloud' type="checkbox"
-            name="WORD_CLOUD" value="true"
-            <?php if (isset($data['WORD_CLOUD']) &&
-                $data['WORD_CLOUD']) {
-                e("checked='checked'");}?>
-            ></td></tr>
-        <tr><td><label for="cache-link"><?=
-            tl('pageoptions_element_cache_link') ?></label>
-        </td><td><input id='cache-link' type="checkbox"
-            name="CACHE_LINK" value="true"
-            <?php if (isset($data['CACHE_LINK']) && $data['CACHE_LINK']){
-                e("checked='checked'");}?>
-            ></td></tr>
-        <tr><td><label for="similar-link"><?=
-            tl('pageoptions_element_similar_link') ?></label></td>
-        <td><input id='similar-link'
-            type="checkbox" name="SIMILAR_LINK" value="true"
-            <?php if (isset($data['SIMILAR_LINK']) &&
-                $data['SIMILAR_LINK']){
-                e("checked='checked'");}?>
-            ></td>
-        </tr>
-        <tr><td><label for="in-link"><?=
-            tl('pageoptions_element_in_link') ?></label></td>
-        <td><input id='in-link' type="checkbox"
-            name="IN_LINK" value="true"
-            <?php if (isset($data['IN_LINK']) && $data['IN_LINK']){
-                e("checked='checked'");}?>
-            ></td></tr>
-        <tr><td><label for="ip-link"><?=
-            tl('pageoptions_element_ip_link') ?></label></td>
-        <td><input id='ip-link' type="checkbox"
-            name="IP_LINK" value="true"
-            <?php if (isset($data['IP_LINK']) && $data['IP_LINK']){
-                e("checked='checked'");}?>
-            ></td>
-        </tr>
-        <tr><td><label for="result-score"><?=
-            tl('pageoptions_element_result_score') ?></label></td>
-        <td><input id='result-score' type="checkbox"
-            name="RESULT_SCORE" value="true"
-            <?php if (isset($data['RESULT_SCORE']) && $data['RESULT_SCORE']){
-                e("checked='checked'");}?>
-            ></td>
-        </tr>
-        </table></td>
-        </tr></table>
+                    <table class="search-page-table">
+                        <tr>
+                            <td><label for="wd-suggest"><?=
+                                    tl('pageoptions_element_wd_suggest') ?></label></td>
+                            <td><input id='wd-suggest' type="checkbox"
+                                       name="WORD_SUGGEST" value="true"
+                                    <?php if (isset($data['WORD_SUGGEST']) &&
+                                        $data['WORD_SUGGEST']) {
+                                        e("checked='checked'");}?>
+                                ></td></tr>
+                        <tr><td><label for="subsearch-link"><?=
+                                    tl('pageoptions_element_subsearch_link')?></label></td><td>
+                                <input id='subsearch-link'
+                                       type="checkbox" name="SUBSEARCH_LINK" value="true"
+                                    <?php if (isset($data['SUBSEARCH_LINK']) &&
+                                        $data['SUBSEARCH_LINK']){
+                                        e("checked='checked'");}?>
+                                ></td>
+                        </tr>
+                        <tr><td><label for="signin-link"><?=
+                                    tl('pageoptions_element_signin_link') ?></label></td><td>
+                                <input id='signin-link' type="checkbox"
+                                       name="SIGNIN_LINK" value="true"
+                                    <?php if (isset($data['SIGNIN_LINK']) &&
+                                        $data['SIGNIN_LINK']){ e("checked='checked'");}?>
+                                >
+                            </td></tr>
+                        <tr><td><label for="continuous-scroll"><?=
+                                    tl('pageoptions_element_continuous_scroll') ?></label></td>
+                            <td><input id='continuous-scroll' type="checkbox"
+                                       name="DEFAULT_CONTINUOUS_SCROLL" value="true"
+                                    <?php if (isset($data['DEFAULT_CONTINUOUS_SCROLL'])
+                                        && $data['DEFAULT_CONTINUOUS_SCROLL']){
+                                        e("checked='checked'");}?>
+                                ></td>
+                        </tr>
+                        <tr><td><label for="serp-favicons"><?=
+                                    tl('pageoptions_element_serp_favicons') ?></label></td>
+                            <td><input id='serp-favicons' type="checkbox"
+                                       name="SERP_FAVICONS" value="true"
+                                    <?php if (isset($data['SERP_FAVICONS'])
+                                        && $data['SERP_FAVICONS']){
+                                        e("checked='checked'");}?>
+                                ></td>
+                        </tr>
+                        <tr>
+                            <td><label for="more-result"><?=
+                                    tl('pageoptions_element_more_result') ?></label></td>
+                            <td><input id='more-result' type="checkbox"
+                                       name="MORE_RESULT" value="true"
+                                    <?php if (isset($data['MORE_RESULT']) &&
+                                        $data['MORE_RESULT']) {
+                                        e("checked='checked'");}?>
+                                ></td></tr>
+                    </table></td>
+                <td><table class="search-page-table">
+                        <tr>
+                            <td><label for="wd-cloud"><?=
+                                    tl('pageoptions_element_wd_cloud') ?></label></td>
+                            <td><input id='wd-cloud' type="checkbox"
+                                       name="WORD_CLOUD" value="true"
+                                    <?php if (isset($data['WORD_CLOUD']) &&
+                                        $data['WORD_CLOUD']) {
+                                        e("checked='checked'");}?>
+                                ></td></tr>
+                        <tr><td><label for="cache-link"><?=
+                                    tl('pageoptions_element_cache_link') ?></label>
+                            </td><td><input id='cache-link' type="checkbox"
+                                            name="CACHE_LINK" value="true"
+                                    <?php if (isset($data['CACHE_LINK']) && $data['CACHE_LINK']){
+                                        e("checked='checked'");}?>
+                                ></td></tr>
+                        <tr><td><label for="similar-link"><?=
+                                    tl('pageoptions_element_similar_link') ?></label></td>
+                            <td><input id='similar-link'
+                                       type="checkbox" name="SIMILAR_LINK" value="true"
+                                    <?php if (isset($data['SIMILAR_LINK']) &&
+                                        $data['SIMILAR_LINK']){
+                                        e("checked='checked'");}?>
+                                ></td>
+                        </tr>
+                        <tr><td><label for="in-link"><?=
+                                    tl('pageoptions_element_in_link') ?></label></td>
+                            <td><input id='in-link' type="checkbox"
+                                       name="IN_LINK" value="true"
+                                    <?php if (isset($data['IN_LINK']) && $data['IN_LINK']){
+                                        e("checked='checked'");}?>
+                                ></td></tr>
+                        <tr><td><label for="ip-link"><?=
+                                    tl('pageoptions_element_ip_link') ?></label></td>
+                            <td><input id='ip-link' type="checkbox"
+                                       name="IP_LINK" value="true"
+                                    <?php if (isset($data['IP_LINK']) && $data['IP_LINK']){
+                                        e("checked='checked'");}?>
+                                ></td>
+                        </tr>
+                        <tr><td><label for="result-score"><?=
+                                    tl('pageoptions_element_result_score') ?></label></td>
+                            <td><input id='result-score' type="checkbox"
+                                       name="RESULT_SCORE" value="true"
+                                    <?php if (isset($data['RESULT_SCORE']) && $data['RESULT_SCORE']){
+                                        e("checked='checked'");}?>
+                                ></td>
+                        </tr>
+                    </table></td>
+            </tr></table>
         <h2><?= tl('pageoptions_element_ranking_factors')?>
         <?= $this->view->helper("helpbutton")->render(
             "Page Ranking Factors", $data[C\CSRF_TOKEN]) ?></h2>
         <table class="bonus-table" >
-        <tr><th><label for="host-keyword-bonus"><?=
-            tl('pageoptions_element_host_keyword_bonus') ?></label></th><td>
-            <input type="text" id="host-keyword-bonus" class="very-narrow-field"
-                maxlength="<?= C\NUM_FIELD_LEN ?>" name="HOST_KEYWORD_BONUS"
-                value="<?= $data['HOST_KEYWORD_BONUS']  ?>" ></td></tr>
-        <tr><th><label for="title-bonus"><?=
-            tl('pageoptions_element_title_bonus') ?></label></th><td>
-            <input type="text" id="title-bonus" class="very-narrow-field"
-                maxlength="<?= C\NUM_FIELD_LEN ?>" name="TITLE_BONUS"
-                value="<?= $data['TITLE_BONUS']  ?>" ></td></tr>
-        <tr><th><label for="path-keyword-bonus"><?=
-            tl('pageoptions_element_path_keyword_bonus') ?></label></th><td>
-            <input type="text" id="path-keyword-bonus" class="very-narrow-field"
-                maxlength="<?= C\NUM_FIELD_LEN ?>" name="PATH_KEYWORD_BONUS"
-                value="<?= $data['PATH_KEYWORD_BONUS']  ?>" ></td></tr>
-        <tr><th><label for="proximity-bonus"><?=
-            tl('pageoptions_element_proximity_bonus')?></label></th><td>
-            <input type="text" id="proximity-bonus" class="very-narrow-field"
-                maxlength="<?= C\NUM_FIELD_LEN ?>" name="PROXIMITY_BONUS"
-                value="<?= $data['PROXIMITY_BONUS'] ?>" ></td></tr>
-        <tr><th><label for="cld-url-bonus"><?=
-            tl('pageoptions_element_cld_url_bonus')?></label></th><td>
-            <input type="text" id="cld-url-bonus" class="very-narrow-field"
-                maxlength="<?= C\NUM_FIELD_LEN ?>" name="CLD_URL_BONUS"
-                value="<?= $data['CLD_URL_BONUS'] ?>" ></td></tr>
-        <tr><th><label for="host-url-bonus"><?=
-            tl('pageoptions_element_host_url_bonus')?></label></th><td>
-            <input type="text" id="host-url-bonus" class="very-narrow-field"
-                maxlength="<?= C\NUM_FIELD_LEN ?>" name="HOST_URL_BONUS"
-                value="<?= $data['HOST_URL_BONUS'] ?>" ></td></tr>
-        <tr><th><label for="user-rank-bonus"><?=
-            tl('pageoptions_element_user_rank_bonus')?></label></th><td>
-            <input type="text" id="user-rank-bonus" class="very-narrow-field"
-                maxlength="<?= C\NUM_FIELD_LEN ?>" name="USER_RANK_BONUS"
-                value="<?= $data['USER_RANK_BONUS'] ?>" ></td></tr>
+            <tr><th><label for="host-keyword-bonus"><?=
+                        tl('pageoptions_element_host_keyword_bonus') ?></label></th><td>
+                    <input type="text" id="host-keyword-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="HOST_KEYWORD_BONUS"
+                           value="<?= $data['HOST_KEYWORD_BONUS']  ?>" ></td></tr>
+            <tr><th><label for="title-bonus"><?=
+                        tl('pageoptions_element_title_bonus') ?></label></th><td>
+                    <input type="text" id="title-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="TITLE_BONUS"
+                           value="<?= $data['TITLE_BONUS']  ?>" ></td></tr>
+            <tr><th><label for="path-keyword-bonus"><?=
+                        tl('pageoptions_element_path_keyword_bonus') ?></label></th><td>
+                    <input type="text" id="path-keyword-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="PATH_KEYWORD_BONUS"
+                           value="<?= $data['PATH_KEYWORD_BONUS']  ?>" ></td></tr>
+            <tr><th><label for="proximity-bonus"><?=
+                        tl('pageoptions_element_proximity_bonus')?></label></th><td>
+                    <input type="text" id="proximity-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="PROXIMITY_BONUS"
+                           value="<?= $data['PROXIMITY_BONUS'] ?>" ></td></tr>
+            <tr><th><label for="cld-url-bonus"><?=
+                        tl('pageoptions_element_cld_url_bonus')?></label></th><td>
+                    <input type="text" id="cld-url-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="CLD_URL_BONUS"
+                           value="<?= $data['CLD_URL_BONUS'] ?>" ></td></tr>
+            <tr><th><label for="host-url-bonus"><?=
+                        tl('pageoptions_element_host_url_bonus')?></label></th><td>
+                    <input type="text" id="host-url-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="HOST_URL_BONUS"
+                           value="<?= $data['HOST_URL_BONUS'] ?>" ></td></tr>
+            <tr><th><label for="user-rank-bonus"><?=
+                        tl('pageoptions_element_user_rank_bonus')?></label></th><td>
+                    <input type="text" id="user-rank-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="USER_RANK_BONUS"
+                           value="<?= $data['USER_RANK_BONUS'] ?>" ></td></tr>
+            <tr><th><label for="wiki-bonus"><?=
+                        tl('pageoptions_element_wiki_bonus')?></label></th><td>
+                    <input type="text" id="wiki-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="WIKI_BONUS"
+                           value="<?= $data['WIKI_BONUS'] ?>" ></td></tr>
+            <tr><th><label for="num-slashes-bonus"><?=
+                        tl('pageoptions_element_num_slashes_bonus')?></label></th><td>
+                    <input type="text" id="num-slashes-bonus" class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="NUM_SLASHES_BONUS"
+                           value="<?= $data['NUM_SLASHES_BONUS'] ?>" ></td></tr>
         </table>
         <h2><?= tl('pageoptions_element_results_grouping_options') ?>
-        <?= $this->view->helper("helpbutton")->render(
-            "Page Grouping Options", $data[C\CSRF_TOKEN]) ?></h2>
+            <?= $this->view->helper("helpbutton")->render(
+                "Page Grouping Options", $data[C\CSRF_TOKEN]) ?></h2>
         <table class="weights-table" >
-        <tr><th><label for="min-results-to-group"><?=
-            tl('pageoptions_element_min_results_to_group')?></label></th><td>
-            <input type="text" id="min-results-to-group"
-                class="very-narrow-field"
-                maxlength="<?= C\NUM_FIELD_LEN ?>" name="MIN_RESULTS_TO_GROUP"
-                value="<?= $data['MIN_RESULTS_TO_GROUP'] ?>" ></td></tr>
+            <tr><th><label for="min-results-to-group"><?=
+                        tl('pageoptions_element_min_results_to_group')?></label></th><td>
+                    <input type="text" id="min-results-to-group"
+                           class="very-narrow-field"
+                           maxlength="<?= C\NUM_FIELD_LEN ?>" name="MIN_RESULTS_TO_GROUP"
+                           value="<?= $data['MIN_RESULTS_TO_GROUP'] ?>" ></td></tr>
         </table>
         </div><?php
     }
@@ -584,48 +594,48 @@ class PageOptionsElement extends Element
     private function renderTestTab($data)
     { ?>
         <div id='testoptionstab'>
-        <h2><?= tl('pageoptions_element_test_page') ?>
-        <?= $this->view->helper("helpbutton")->render(
-            "Test Indexing a Page", $data[C\CSRF_TOKEN]) ?></h2>
-        <div class="top-margin">
-            <?php
-            $label = $data["test_methods"][array_key_first(
-                $data["test_methods"])];
-            $this->view->helper("options")->render("test-method",
-            "test_method", $data["test_methods"],
-            $data["test_method"], "switchTestMethod()", [
-                "aria-label" => $label]);
-            ?>
-        </div>
-        <div id='test-uri'>
-            <div class="top-margin"><b><label for="test-url"><?=
-                tl('pageoptions_element_uri')?></label></b>
-                <input id='test-url' name='test_uri' value='<?=
-                $data["test_uri"]; ?>' >
+            <h2><?= tl('pageoptions_element_test_page') ?>
+                <?= $this->view->helper("helpbutton")->render(
+                    "Test Indexing a Page", $data[C\CSRF_TOKEN]) ?></h2>
+            <div class="top-margin">
+                <?php
+                $label = $data["test_methods"][array_key_first(
+                    $data["test_methods"])];
+                $this->view->helper("options")->render("test-method",
+                    "test_method", $data["test_methods"],
+                    $data["test_method"], "switchTestMethod()", [
+                        "aria-label" => $label]);
+                ?>
             </div>
-        </div>
-        <div id='test-file-upload'>
-            <div id="test-file" class="media-upload-box"
+            <div id='test-uri'>
+                <div class="top-margin"><b><label for="test-url"><?=
+                            tl('pageoptions_element_uri')?></label></b>
+                    <input id='test-url' name='test_uri' value='<?=
+                    $data["test_uri"]; ?>' >
+                </div>
+            </div>
+            <div id='test-file-upload'>
+                <div id="test-file" class="media-upload-box"
                 >&nbsp;</div><?php
-            $this->view->helper("fileupload")->render(
-                'test-file', 'test_file_upload', 'test-file-uploader',
-                min(L\metricToInt(ini_get('upload_max_filesize')),
-                L\metricToInt(ini_get('post_max_size'))), 'text',
-                null, true);
-            ?>
-        </div>
-        <div id='test-direct-input'>
-            <div class="top-margin"><b><label for="page-type"><?=
-                tl('pageoptions_element_page_type')?></label></b>
-                <?php
-                $types = $data['MIME_TYPES'];
-                $this->view->helper("options")->render("page-type",
-                "page_type", array_combine($types, $types),
-                $data["page_type"]);
-                ?></div>
-            <textarea class="tall-text-area" id="testpage"
-                name="TESTPAGE" ><?=$data['TESTPAGE'] ?></textarea>
-        </div>
+                $this->view->helper("fileupload")->render(
+                    'test-file', 'test_file_upload', 'test-file-uploader',
+                    min(L\metricToInt(ini_get('upload_max_filesize')),
+                        L\metricToInt(ini_get('post_max_size'))), 'text',
+                    null, true);
+                ?>
+            </div>
+            <div id='test-direct-input'>
+                <div class="top-margin"><b><label for="page-type"><?=
+                            tl('pageoptions_element_page_type')?></label></b>
+                    <?php
+                    $types = $data['MIME_TYPES'];
+                    $this->view->helper("options")->render("page-type",
+                        "page_type", array_combine($types, $types),
+                        $data["page_type"]);
+                    ?></div>
+                <textarea class="tall-text-area" id="testpage"
+                          name="TESTPAGE" ><?=$data['TESTPAGE'] ?></textarea>
+            </div>
         </div>
         <?php
     }
@@ -640,61 +650,61 @@ class PageOptionsElement extends Element
         ?>
         <div id="test-results">
         <?php if (!empty($data['test_options_active']) &&
-            !empty($data["AFTER_PAGE_PROCESS"])) { ?>
-            <h2><?=tl('pageoptions_element_test_results')?></h2>
-            <?php
-            if (!empty($_REQUEST['TESTPAGE']) &&
-                strlen($_REQUEST['TESTPAGE']) > $data["PAGE_RANGE_REQUEST"]) {
-                e("<h3 class='red'>".tl('pageoptions_element_page_truncated',
-                strlen($_REQUEST['TESTPAGE']), $data["PAGE_RANGE_REQUEST"]).
+        !empty($data["AFTER_PAGE_PROCESS"])) { ?>
+        <h2><?=tl('pageoptions_element_test_results')?></h2>
+        <?php
+        if (!empty($_REQUEST['TESTPAGE']) &&
+            strlen($_REQUEST['TESTPAGE']) > $data["PAGE_RANGE_REQUEST"]) {
+            e("<h3 class='red'>".tl('pageoptions_element_page_truncated',
+                    strlen($_REQUEST['TESTPAGE']), $data["PAGE_RANGE_REQUEST"]).
                 "</h3>");
-            }
-            if (isset($data["AFTER_PAGE_PROCESS"])) {
-                e("<h3>".tl('pageoptions_element_after_process')."</h3>");
-                e("<pre>\n{$data['AFTER_PAGE_PROCESS']}\n</pre>");
-            }
-            if (isset($data["AFTER_RULE_PROCESS"])) {
-                e("<h3>".tl('pageoptions_element_after_rules')."</h3>");
-                e("<pre>\n{$data['AFTER_RULE_PROCESS']}\n</pre>");
-            }
-            if (isset($data["EXTRACTED_WORDS"])) {
-                e("<h3>".tl('pageoptions_element_extracted_words')."</h3>");
-                e("<pre>\n{$data['EXTRACTED_WORDS']}\n</pre>");
-            }
-            if (isset($data["QUESTIONS_TRIPLET"])) {
-                e("<h3>" . tl('pageoptions_element_extracted_questions') .
-                    "</h3>");
-                e("<pre>\n{$data['QUESTIONS_TRIPLET']}\n</pre>");
-            }
-            if (isset($data["EXTRACTED_META_WORDS"])) {
-                e("<h3>" . tl('pageoptions_element_extracted_metas') . "</h3>");
-                e("<pre>\n{$data['EXTRACTED_META_WORDS']}\n</pre>");
-            }
-            if (isset($data["PROCESS_TIMES"])) {
-                e("<h3>".tl('pageoptions_element_page_process_times')."</h3>");
-                $timing_translations = [
-                    'PAGE_PROCESS' =>
-                        tl('pageoptions_element_page_process_time'),
-                    'RULE_PROCESS' =>
-                        tl('pageoptions_element_rule_process_time'),
-                    'CANONICALIZE' => tl('pageoptions_element_canon_time'),
-                    'TERM_POSITIONS_SENTENCE_TAGGING' =>
-                        tl('pageoptions_element_term_pos_sentence_tag_time'),
-                    'QUESTION_ANSWER_EXTRACT' =>
-                        tl('pageoptions_element_qa_time'),
-                    'TOTAL' => tl('pageoptions_element_total_time'),
-                    ];
-                e("<table>");
-                foreach ($timing_translations as $timing => $translation) {
-                    if (!empty($data["PROCESS_TIMES"][$timing])) {
-                        e("<tr><th class='align-opposite'>$translation".
-                            "</th><td>" . tl('pageoptions_element_time_seconds',
+        }
+        if (isset($data["AFTER_PAGE_PROCESS"])) {
+            e("<h3>".tl('pageoptions_element_after_process')."</h3>");
+            e("<pre>\n{$data['AFTER_PAGE_PROCESS']}\n</pre>");
+        }
+        if (isset($data["AFTER_RULE_PROCESS"])) {
+            e("<h3>".tl('pageoptions_element_after_rules')."</h3>");
+            e("<pre>\n{$data['AFTER_RULE_PROCESS']}\n</pre>");
+        }
+        if (isset($data["EXTRACTED_WORDS"])) {
+            e("<h3>".tl('pageoptions_element_extracted_words')."</h3>");
+            e("<pre>\n{$data['EXTRACTED_WORDS']}\n</pre>");
+        }
+        if (isset($data["QUESTIONS_TRIPLET"])) {
+            e("<h3>" . tl('pageoptions_element_extracted_questions') .
+                "</h3>");
+            e("<pre>\n{$data['QUESTIONS_TRIPLET']}\n</pre>");
+        }
+        if (isset($data["EXTRACTED_META_WORDS"])) {
+            e("<h3>" . tl('pageoptions_element_extracted_metas') . "</h3>");
+            e("<pre>\n{$data['EXTRACTED_META_WORDS']}\n</pre>");
+        }
+        if (isset($data["PROCESS_TIMES"])) {
+            e("<h3>".tl('pageoptions_element_page_process_times')."</h3>");
+            $timing_translations = [
+                'PAGE_PROCESS' =>
+                    tl('pageoptions_element_page_process_time'),
+                'RULE_PROCESS' =>
+                    tl('pageoptions_element_rule_process_time'),
+                'CANONICALIZE' => tl('pageoptions_element_canon_time'),
+                'TERM_POSITIONS_SENTENCE_TAGGING' =>
+                    tl('pageoptions_element_term_pos_sentence_tag_time'),
+                'QUESTION_ANSWER_EXTRACT' =>
+                    tl('pageoptions_element_qa_time'),
+                'TOTAL' => tl('pageoptions_element_total_time'),
+            ];
+            e("<table>");
+            foreach ($timing_translations as $timing => $translation) {
+                if (!empty($data["PROCESS_TIMES"][$timing])) {
+                    e("<tr><th class='align-opposite'>$translation".
+                        "</th><td>" . tl('pageoptions_element_time_seconds',
                             $data["PROCESS_TIMES"][$timing]) . "</td></tr>");
-                    }
                 }
-                e("<table>");
             }
-        } ?>
+            e("<table>");
+        }
+    } ?>
         </div><?php
     }
 }
-- 
2.42.0

