Changeset 3809580
- Timestamp:
- 11/18/2026 03:06:20 PM (12 days ago)
- Location:
- livada-seo-lite
- Files:
-
- 2 added
- 9 edited
-
assets/banner-1544x500.png (modified) ( previous)
-
assets/banner-772x250.png (modified) ( previous)
-
assets/icon-128x128.png (modified) ( previous)
-
assets/icon-256x256.png (modified) ( previous)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/img (added)
-
trunk/assets/img/menu-icon.svg (added)
-
trunk/includes/admin/class-admin.php (modified) (2 diffs)
-
trunk/includes/class-opengraph.php (modified) (2 diffs)
-
trunk/livada-seo-lite.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
livada-seo-lite/trunk/assets/css/admin.css
r3719638 r3809580 71 71 72 72 .livada-mv-pill.is-info { 73 background: #e ef1ff;74 color: # 2c3a9e;73 background: #e8f5f7; 74 color: #0c5566; 75 75 } 76 76 -
livada-seo-lite/trunk/includes/admin/class-admin.php
r3755306 r3809580 47 47 // ── Menu ────────────────────────────────────────────────────────────────── 48 48 49 /** 50 * Livada logo for the admin menu, as a data URI (WordPress sizes SVG menu 51 * icons to 20 px). Falls back to a dashicon if the file is missing. 52 */ 53 public static function menu_icon(): string { 54 $file = LIVADA_SEO_LITE_PATH . 'assets/img/menu-icon.svg'; 55 if ( ! is_readable( $file ) ) { 56 return 'dashicons-chart-area'; 57 } 58 $svg = (string) file_get_contents( $file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- local plugin file. 59 return '' === $svg ? 'dashicons-chart-area' : 'data:image/svg+xml;base64,' . base64_encode( $svg ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- data URI for the menu icon. 60 } 61 49 62 public static function register_menus(): void { 50 63 add_menu_page( … … 54 67 'livada-seo-lite', 55 68 [ self::class, 'render_page' ], 56 'dashicons-chart-area',69 self::menu_icon(), 57 70 80 58 71 ); -
livada-seo-lite/trunk/includes/class-opengraph.php
r3717730 r3809580 50 50 $url = self::get_url(); 51 51 $type = is_front_page() ? 'website' : 'article'; 52 $locale = get_locale();52 $locale = self::current_locale(); 53 53 $site_name = self::get_site_name(); 54 54 … … 395 395 396 396 /** 397 * Language of the page in Open Graph form (`en_GB`), read from what the 398 * page itself declares in `<html lang>`: WordPress's language, switched by 399 * a multilingual plugin on a translated page, or set by the theme. A bare 400 * language (`fr`) gets its usual region. Filter: `livada_seo_og_locale`. 401 * 402 * @return string 403 */ 404 public static function current_locale(): string { 405 $declared = ''; 406 if ( function_exists( 'get_language_attributes' ) && preg_match( '/\blang="([^"]+)"/i', get_language_attributes( 'html' ), $m ) ) { 407 $declared = $m[1]; 408 } 409 if ( '' === $declared ) { 410 $declared = function_exists( 'determine_locale' ) ? determine_locale() : get_locale(); 411 } 412 $locale = self::to_og_locale( $declared ); 413 if ( '' === $locale ) { 414 $locale = self::to_og_locale( function_exists( 'determine_locale' ) ? determine_locale() : get_locale() ); 415 } 416 return (string) apply_filters( 'livada_seo_og_locale', '' !== $locale ? $locale : get_locale() ); 417 } 418 419 /** 420 * `en-GB`, `en_gb`, `EN` → Open Graph `ll_CC`. A language without a 421 * region gets the region it is most often published with. Empty when the 422 * code is not a language (`x-default`). 423 * 424 * @param string $code 425 * @return string 426 */ 427 public static function to_og_locale( string $code ): string { 428 // language [_Script] [_Region]: zh-Hant-TW, sr-Latn, en-GB, es-419. 429 $parts = array_values( array_filter( explode( '_', trim( str_replace( '-', '_', $code ) ) ), 'strlen' ) ); 430 $lang = strtolower( (string) ( $parts[0] ?? '' ) ); 431 if ( ! preg_match( '/^[a-z]{2,3}$/', $lang ) || 'x' === $lang ) { 432 return ''; 433 } 434 foreach ( array_slice( $parts, 1 ) as $sub ) { 435 if ( preg_match( '/^[a-zA-Z]{2}$/', $sub ) ) { 436 return $lang . '_' . strtoupper( $sub ); 437 } 438 } 439 $regions = [ 440 'fr' => 'FR', 'en' => 'GB', 'de' => 'DE', 'es' => 'ES', 'it' => 'IT', 'nl' => 'NL', 441 'pt' => 'PT', 'ca' => 'ES', 'eu' => 'ES', 'gl' => 'ES', 'pl' => 'PL', 'ro' => 'RO', 442 'sv' => 'SE', 'da' => 'DK', 'nb' => 'NO', 'nn' => 'NO', 'no' => 'NO', 'fi' => 'FI', 443 'is' => 'IS', 'ja' => 'JP', 'ko' => 'KR', 'zh' => 'CN', 'ru' => 'RU', 'uk' => 'UA', 444 'el' => 'GR', 'cs' => 'CZ', 'sk' => 'SK', 'sl' => 'SI', 'hr' => 'HR', 'sr' => 'RS', 445 'bg' => 'BG', 'hu' => 'HU', 'et' => 'EE', 'lv' => 'LV', 'lt' => 'LT', 'tr' => 'TR', 446 'he' => 'IL', 'ar' => 'AR', 'fa' => 'IR', 'hi' => 'IN', 'th' => 'TH', 'vi' => 'VN', 447 'id' => 'ID', 'ms' => 'MY', 'af' => 'ZA', 'ga' => 'IE', 'cy' => 'GB', 'lb' => 'LU', 448 ]; 449 // No invented region ("ko_KO"): an unknown bare language gives nothing 450 // and the caller keeps its fallback. 451 return isset( $regions[ $lang ] ) ? $lang . '_' . $regions[ $lang ] : ''; 452 } 453 454 /** 397 455 * Echoes a single <meta> tag with proper escaping. 398 456 * -
livada-seo-lite/trunk/livada-seo-lite.php
r3791368 r3809580 4 4 * Plugin URI: https://livada.io/livada-seo 5 5 * Description: Free SEO plugin for campgrounds, hotels, B&Bs & restaurants: meta tags, XML sitemap, Schema.org (WebSite/Article/business), Open Graph, on-page analysis, robots.txt, breadcrumbs, redirects & 404 monitor, llms.txt (AEO), Migration Verify, optional AI suggestions (bring your own API key), and a Yoast/Rank Math/AIOSEO/SEOPress importer. Adds no JavaScript to your pages. 6 * Version: 1.1.1 06 * Version: 1.1.11 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 21 21 // ── Constants ───────────────────────────────────────────────────────────────── 22 22 23 define( 'LIVADA_SEO_LITE_VERSION', '1.1.1 0' );23 define( 'LIVADA_SEO_LITE_VERSION', '1.1.11' ); 24 24 define( 'LIVADA_SEO_LITE_PATH', plugin_dir_path( __FILE__ ) ); 25 25 define( 'LIVADA_SEO_LITE_URL', plugin_dir_url( __FILE__ ) ); -
livada-seo-lite/trunk/readme.txt
r3791368 r3809580 5 5 Tested up to: 7.1.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.1.1 07 Stable tag: 1.1.11 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 198 198 199 199 == Changelog == 200 201 = 1.1.11 = 202 * Changed: new Livada brand identity. The Livada "L" (in white, with its gold wave) is now the icon of the Livada SEO menu in the WordPress admin, and the Migration Verify information labels use the new Livada colours. 203 * Fixed: og:locale follows the language the page declares (an English page on a French site now says en_GB), not only the WordPress language. 200 204 201 205 = 1.1.10 = … … 285 289 == Upgrade Notice == 286 290 291 = 1.1.11 = 292 New Livada logo in the admin menu, and og:locale now follows the language of each page. 293 287 294 = 1.1.10 = 288 295 The business review rating is no longer published, as Google's review rules ask. Pattern redirects now build their target from what they capture: end a pattern with (.*)$ and add $1 to the target to keep the end of the address.
Note:
See TracChangeset
for help on using the changeset viewer.