Index: src/gm/classes/GMSEOBoost.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/gm/classes/GMSEOBoost.php	(revision cde4c9dd67fb8c26ff7d837983ac1264d65f9ad7)
+++ src/gm/classes/GMSEOBoost.php	(date 1522353173000)
@@ -1034,117 +1034,137 @@
 	}
 	
 	
-	public function repair($p_type = 'all')
+	public function repair($p_type = 'all', $p_id = 0)
 	{
 		if($p_type == 'all' || $p_type == 'products')
 		{
-			$t_get_languages_ids = xtc_db_query("SELECT languages_id
+			if(!empty($p_id))
+			{
+				$t_get_empty_keywords_ids = xtc_db_query("SELECT products_id
+													FROM " . TABLE_PRODUCTS_DESCRIPTION . "
+													WHERE
+													(gm_url_keywords = '' OR LENGTH(gm_url_keywords) >= 255)
+													AND products_id = '" . $p_id . "'
+													", 'db_link', false);
+				
+				$t_get_double_keywords_ids = xtc_db_query("select count(gm_url_keywords) as count from `products_description` group by gm_url_keywords,language_id HAVING count > 1",
+				                                          'db_link', false);
+			}
+			if(empty($p_id) || xtc_db_num_rows($t_get_empty_keywords_ids) > 0 || xtc_db_num_rows($t_get_double_keywords_ids) > 0)
+			{
+				
+				$t_get_languages_ids = xtc_db_query("SELECT languages_id
 													FROM " . TABLE_LANGUAGES . "", 'db_link', false);
-			while($t_result_array = xtc_db_fetch_array($t_get_languages_ids))
-			{
-				$c_languages_id = (int)$t_result_array['languages_id'];
-				
-				$t_get_empty_keywords = xtc_db_query("SELECT
+				while($t_result_array = xtc_db_fetch_array($t_get_languages_ids))
+				{
+					$c_languages_id = (int)$t_result_array['languages_id'];
+					
+					$t_get_empty_keywords = xtc_db_query("SELECT
 															products_id,
 															products_name
 														FROM " . TABLE_PRODUCTS_DESCRIPTION . "
 														WHERE
 															(gm_url_keywords = '' OR LENGTH(gm_url_keywords) >= 255)
 															AND language_id = '" . $c_languages_id . "'", 'db_link',
-				                                     false);
-				while($t_product_array = xtc_db_fetch_array($t_get_empty_keywords))
-				{
-					$c_cleaned_name = $this->clean_keyword($t_product_array['products_name']);
-					if(strlen_wrapper($c_cleaned_name . '-' . $t_product_array['products_id']) >= 255)
-					{
-						$c_cleaned_name = substr_wrapper($c_cleaned_name, 0, 100);
-					}
-					
-					if($c_cleaned_name != '')
-					{
-						$t_update = xtc_db_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . "
+					                                     false);
+					while($t_product_array = xtc_db_fetch_array($t_get_empty_keywords))
+					{
+						$c_cleaned_name = $this->clean_keyword($t_product_array['products_name']);
+						if(strlen_wrapper($c_cleaned_name . '-' . $t_product_array['products_id']) >= 255)
+						{
+							$c_cleaned_name = substr_wrapper($c_cleaned_name, 0, 100);
+						}
+						
+						if($c_cleaned_name != '')
+						{
+							$t_update = xtc_db_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . "
 													SET gm_url_keywords = '" . $c_cleaned_name . "'
 													WHERE
 														products_id = '" . (int)$t_product_array['products_id'] . "'
 														AND language_id = '" . $c_languages_id . "'", 'db_link', false);
-					}
-					else
-					{
-						$t_update = xtc_db_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . "
+						}
+						else
+						{
+							$t_update = xtc_db_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . "
 													SET gm_url_keywords = 'product-"
-						                         . (int)$t_product_array['products_id'] . "'
+							                         . (int)$t_product_array['products_id'] . "'
 													WHERE
 														products_id = '" . (int)$t_product_array['products_id'] . "'
 														AND language_id = '" . $c_languages_id . "'", 'db_link', false);
-					}
-				}
-				
-				$t_found_double_keywords = true;
-				
-				while($t_found_double_keywords)
-				{
-					$t_products_array = array();
-					$t_found          = false;
-					
-					$t_get_double_keywords = xtc_db_query("SELECT DISTINCT
+						}
+					}
+					
+					$t_found_double_keywords = true;
+					
+					while($t_found_double_keywords)
+					{
+						$t_products_array = [];
+						$t_found          = false;
+						
+						$t_get_double_keywords = xtc_db_query("SELECT DISTINCT
 																a.products_id,
 																a.gm_url_keywords
 															FROM " . TABLE_PRODUCTS_DESCRIPTION . " a
 															LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " AS b ON ("
-					                                      . $this->v_binary_string . "a.gm_url_keywords = "
-					                                      . $this->v_binary_string . "b.gm_url_keywords)
+						                                      . $this->v_binary_string . "a.gm_url_keywords = "
+						                                      . $this->v_binary_string . "b.gm_url_keywords)
 															WHERE
 																a.products_id != b.products_id
 																AND a.language_id = '" . $c_languages_id . "'
 																AND b.language_id = '" . $c_languages_id . "'
 															ORDER BY a.products_id", 'db_link', false);
-					
-					while($t_result_array = xtc_db_fetch_array($t_get_double_keywords))
-					{
-						$t_found                                          = true;
-						$t_products_array[$t_result_array['products_id']] = $t_result_array['gm_url_keywords'];
-					}
-					
-					if(!$t_found)
-					{
-						$t_found_double_keywords = false;
-					}
-					else
-					{
-						$t_cleared_keywords_array = array();
-						
-						foreach($t_products_array AS $t_products_id => $t_gm_url_keywords)
-						{
-							$t_keys_array = array();
-							$t_keys_array = array_keys($t_products_array, $t_gm_url_keywords);
-							
-							for($i = 1; $i < count($t_keys_array); $i++)
-							{
-								if(!in_array($t_gm_url_keywords, $t_cleared_keywords_array))
-								{
-									$t_new_url_keyword = preg_replace('/(.+?)(-[0-9]+)$/', "$1", $t_gm_url_keywords);
-									$c_new_url_keyword = ((isset($GLOBALS["___mysqli_ston"])
-									                       && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"],
-									                                                                                             $t_new_url_keyword) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",
-									                                                                                                                                   E_USER_ERROR)) ? "" : ""));
-									
-									$t_sql_products_id = $t_keys_array[$i];
-									if($c_new_url_keyword . '-' . $t_keys_array[$i] == $t_gm_url_keywords)
-									{
-										$t_sql_products_id = $t_keys_array[0];
-									}
-									
-									$t_update = xtc_db_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . "
+						
+						while($t_result_array = xtc_db_fetch_array($t_get_double_keywords))
+						{
+							$t_found                                          = true;
+							$t_products_array[$t_result_array['products_id']] = $t_result_array['gm_url_keywords'];
+						}
+						
+						if(!$t_found)
+						{
+							$t_found_double_keywords = false;
+						}
+						else
+						{
+							$t_cleared_keywords_array = [];
+							
+							foreach($t_products_array AS $t_products_id => $t_gm_url_keywords)
+							{
+								$t_keys_array = [];
+								$t_keys_array = array_keys($t_products_array, $t_gm_url_keywords);
+								
+								for($i = 1; $i < count($t_keys_array); $i++)
+								{
+									if(!in_array($t_gm_url_keywords, $t_cleared_keywords_array))
+									{
+										$t_new_url_keyword = preg_replace('/(.+?)(-[0-9]+)$/', "$1",
+										                                  $t_gm_url_keywords);
+										$c_new_url_keyword = ((isset($GLOBALS["___mysqli_ston"])
+										                       && is_object($GLOBALS["___mysqli_ston"]))
+											? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $t_new_url_keyword)
+											: ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",
+											                  E_USER_ERROR))
+												? ""
+												: ""));
+										
+										$t_sql_products_id = $t_keys_array[$i];
+										if($c_new_url_keyword . '-' . $t_keys_array[$i] == $t_gm_url_keywords)
+										{
+											$t_sql_products_id = $t_keys_array[0];
+										}
+										
+										$t_update = xtc_db_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . "
 																SET gm_url_keywords = '" . $c_new_url_keyword . "-"
-									                         . (int)$t_sql_products_id . "'
+										                         . (int)$t_sql_products_id . "'
 																WHERE
 																	products_id = '" . (int)$t_sql_products_id . "'
 																	AND language_id = '" . $c_languages_id . "'",
-									                         'db_link', false);
-								}
-							}
-							
-							$t_cleared_keywords_array[] = $t_gm_url_keywords;
+										                         'db_link', false);
+									}
+								}
+								
+								$t_cleared_keywords_array[] = $t_gm_url_keywords;
+							}
 						}
 					}
 				}
Index: src/GXMainComponents/Services/Core/Product/ProductWriteService.inc.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/GXMainComponents/Services/Core/Product/ProductWriteService.inc.php	(revision cde4c9dd67fb8c26ff7d837983ac1264d65f9ad7)
+++ src/GXMainComponents/Services/Core/Product/ProductWriteService.inc.php	(date 1522352940000)
@@ -124,7 +124,7 @@
 		$this->productRepo->store($product);
 		
 		// set url keywords
-		$this->urlKeywordsRepairer->repair('products');
+		$this->urlKeywordsRepairer->repair('products',$product->getProductId());
 
 		return $this;
 	}
Index: src/GXMainComponents/Shared/Interfaces/UrlKeywordsRepairerInterface.inc.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/GXMainComponents/Shared/Interfaces/UrlKeywordsRepairerInterface.inc.php	(revision cde4c9dd67fb8c26ff7d837983ac1264d65f9ad7)
+++ src/GXMainComponents/Shared/Interfaces/UrlKeywordsRepairerInterface.inc.php	(date 1522353308000)
@@ -21,7 +21,9 @@
 	/**
 	 * @param string $type all|products|categories|contents
 	 *
+	 * @param int $p_id
+	 *
 	 * @return null
 	 */
-	public function repair($type = 'all');
+	public function repair($type = 'all', $p_id = 0);
 }
\ No newline at end of file
