| @@ -29,9 +29,8 @@ | ||
| 29 | 29 | add_action('wp_head', [self::class, 'outputSEOMetaTags'], 1); |
| 30 | 30 | add_filter('document_title', [self::class, 'filterDocumentTitle'], 10); |
| 31 | 31 | } |
| 32 | 32 | } catch (\Exception $e) { |
| 33 | - error_log('Yatra SEO Manager init Error: ' . $e->getMessage()); | |
| 34 | 33 | } |
| 35 | 34 | } |
| 36 | 35 | |
| 37 | 36 | /** |
| @@ -48,10 +47,9 @@ | ||
| 48 | 47 | $seoService = SEOService::forPage($pageType, $pageObject); |
| 49 | 48 | $seoService->generateMetaTags(); |
| 50 | 49 | } |
| 51 | 50 | } catch (\Exception $e) { |
| 52 | - error_log('Yatra SEO Manager outputSEOMetaTags Error: ' . $e->getMessage()); | |
| 53 | - | |
| 51 | + | |
| 54 | 52 | // Fail silently to avoid breaking page rendering |
| 55 | 53 | } |
| 56 | 54 | } |
| 57 | 55 | |
| @@ -93,10 +91,9 @@ | ||
| 93 | 91 | } |
| 94 | 92 | |
| 95 | 93 | return $title; |
| 96 | 94 | } catch (\Exception $e) { |
| 97 | - error_log('Yatra SEO Manager filterDocumentTitle Error: ' . $e->getMessage()); | |
| 98 | - | |
| 95 | + | |
| 99 | 96 | // Return original title on error |
| 100 | 97 | return $title; |
| 101 | 98 | } |
| 102 | 99 | } |
| @@ -141,9 +138,8 @@ | ||
| 141 | 138 | } |
| 142 | 139 | |
| 143 | 140 | return ''; |
| 144 | 141 | } catch (\Exception $e) { |
| 145 | - error_log('Yatra SEO Manager getCurrentPageType Error: ' . $e->getMessage()); | |
| 146 | 142 | return ''; |
| 147 | 143 | } |
| 148 | 144 | } |
| 149 | 145 | |
| @@ -168,9 +164,8 @@ | ||
| 168 | 164 | } |
| 169 | 165 | |
| 170 | 166 | return null; |
| 171 | 167 | } catch (\Exception $e) { |
| 172 | - error_log('Yatra SEO Manager getCurrentPageObject Error: ' . $e->getMessage()); | |
| 173 | 168 | return null; |
| 174 | 169 | } |
| 175 | 170 | } |
| 176 | 171 | |
| @@ -198,9 +193,8 @@ | ||
| 198 | 193 | $isArchivePage = (strpos($current_path, $pattern1) !== false || $current_path === $pattern2); |
| 199 | 194 | |
| 200 | 195 | return $isArchivePage && !self::isSingleTripPage(); |
| 201 | 196 | } catch (\Exception $e) { |
| 202 | - error_log('Yatra SEO Manager isTripArchivePage Error: ' . $e->getMessage()); | |
| 203 | 197 | return false; |
| 204 | 198 | } |
| 205 | 199 | } |
| 206 | 200 | |
| @@ -228,9 +222,8 @@ | ||
| 228 | 222 | if (self::matchesTaxonomyListingRoot('category')) { |
| 229 | 223 | return SEOService::PAGE_TYPE_CATEGORY_LISTING; |
| 230 | 224 | } |
| 231 | 225 | } catch (\Exception $e) { |
| 232 | - error_log('Yatra SEOManager getTaxonomyListingPageType Error: ' . $e->getMessage()); | |
| 233 | 226 | } |
| 234 | 227 | |
| 235 | 228 | return ''; |
| 236 | 229 | } |
| @@ -240,11 +233,11 @@ | ||
| 240 | 233 | */ |
| 241 | 234 | private static function matchesTaxonomyListingRoot(string $type): bool |
| 242 | 235 | { |
| 243 | 236 | $bases = [ |
| 244 | - 'destination' => SettingsService::getString('destination_base', 'destination'), | |
| 245 | - 'activity' => SettingsService::getString('activity_base', 'activity'), | |
| 246 | - 'category' => SettingsService::getString('trip_category_base', 'trip-category'), | |
| 237 | + 'destination' => SettingsService::getDestinationBase(), | |
| 238 | + 'activity' => SettingsService::getActivityBase(), | |
| 239 | + 'category' => SettingsService::getTripCategoryBase(), | |
| 247 | 240 | ]; |
| 248 | 241 | $legacyKeys = [ |
| 249 | 242 | 'destination' => 'yatra_destination_slug', |
| 250 | 243 | 'activity' => 'yatra_activity_slug', |