From 9cd3bb6cb2debc34154da34aa6401dce60b884e3 Mon Sep 17 00:00:00 2001 From: Javier Casares Date: Mon, 24 Aug 2026 12:20:42 +0000 Subject: [PATCH] v1.2.2 --- changelog.txt | 24 +++++++++++ .../class-robotstxt-og-manager-notice.php | 40 ++++++++++++------ languages/robotstxt-og-ca.mo | Bin 17816 -> 17816 bytes languages/robotstxt-og-ca.po | 2 +- languages/robotstxt-og-es_ES.mo | Bin 17847 -> 17847 bytes languages/robotstxt-og-es_ES.po | 2 +- languages/robotstxt-og.pot | 2 +- readme.txt | 25 +++++------ robotstxt-og.php | 6 +-- uninstall.php | 2 +- update.json | 27 ------------ 11 files changed, 69 insertions(+), 61 deletions(-) delete mode 100644 update.json diff --git a/changelog.txt b/changelog.txt index 2eeae6c..5ebdeeb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,29 @@ == Changelog == += 1.2.2 = + +_Release date: 2026-08-24_ + +**Changed** + +* Manager (by ROBOTSTXT) detection now uses the ecosystem presence constant ROBOTSTXT_MANAGER_NOTICED (Manager 1.6.2+); for older Manager versions it falls back to a plugin-list scan. Same behaviour, faster and path-independent detection. +* Removed the leftover robotstxt-updater.php PHPCS exclusion rule (the file was removed in 1.2.1). + +**Compatibility** + +* WordPress: 4.9.8 - 7.1 +* PHP: 8.0 - 8.5 +* WP-CLI: 2.x + +**Tests** + +* PHP Coding Standards: 3.13.6 +* WordPress Coding Standards: 3.4.1 +* PHPStan: level 9 (2.2.9) +* PHPUnit: 9.6.36 (257 tests) +* Composer dev dependencies updated: PHPStan 2.2.9, Mockery 1.6.15, WordPress hook stubs (wp-hooks/wordpress-core) 1.13.0 +* Plugin Check (PCP): not run (no WP-CLI in build environment) + = 1.2.1 = _Release date: 2026-08-17_ diff --git a/includes/class-robotstxt-og-manager-notice.php b/includes/class-robotstxt-og-manager-notice.php index f1469db..81008fd 100644 --- a/includes/class-robotstxt-og-manager-notice.php +++ b/includes/class-robotstxt-og-manager-notice.php @@ -25,14 +25,6 @@ if ( ! defined( 'ABSPATH' ) ) { */ class Robotstxt_OG_Manager_Notice { - /** - * Basename of the Manager (by ROBOTSTXT) plugin. - * - * @since 1.2.1 - * @var string - */ - const MANAGER_BASENAME = 'robotstxt-manager/robotstxt-manager.php'; - /** * Query argument used to dismiss the notice. * @@ -66,14 +58,38 @@ class Robotstxt_OG_Manager_Notice { const MANAGER_URL = 'https://www.robotstxt.software/plugins/robotstxt-manager/'; /** - * Whether the Manager (by ROBOTSTXT) plugin is installed and active. + * Returns whether Manager (by ROBOTSTXT) is installed and active. * - * @since 1.2.1 + * Uses the ecosystem presence constant (Manager 1.6.2+) and falls back + * to a plugin-list scan for older Manager versions. * - * @return bool True if the Manager plugin is active. + * @since 1.2.1 Introduced as a basename is_plugin_active() check. + * @since 1.2.2 Constant check first; plugin-list scan only as fallback. + * + * @return bool True when Manager is present and activated. */ public static function is_manager_active(): bool { - return is_plugin_active( self::MANAGER_BASENAME ); + if ( defined( 'ROBOTSTXT_MANAGER_NOTICED' ) && ROBOTSTXT_MANAGER_NOTICED ) { + return true; + } + + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + foreach ( get_plugins() as $file => $data ) { + $slug = dirname( $file ); + + if ( '.' === $slug ) { + $slug = basename( $file, '.php' ); + } + + if ( 'robotstxt-manager' === $slug ) { + return is_plugin_active( $file ); + } + } + + return false; } /** diff --git a/languages/robotstxt-og-ca.mo b/languages/robotstxt-og-ca.mo index e62111499ed8fc2507081616e15502256900439a..83f069f34d8748c04bd93500c5b96ec59ec689ae 100644 GIT binary patch delta 16 YcmbQy%{Zf*al8AdH?_b delta 16 YcmbQy%{Zf*al4c>n+a diff --git a/languages/robotstxt-og-ca.po b/languages/robotstxt-og-ca.po index 9474158..260746e 100644 --- a/languages/robotstxt-og-ca.po +++ b/languages/robotstxt-og-ca.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: OpenGraph (by ROBOTSTXT) 1.2.1\n" +"Project-Id-Version: OpenGraph (by ROBOTSTXT) 1.2.2\n" "Report-Msgid-Bugs-To: https://git.robotstxt.es/ROBOTSTXT/robotstxt-og/" "issues\n" "POT-Creation-Date: 2026-03-28\n" diff --git a/languages/robotstxt-og-es_ES.mo b/languages/robotstxt-og-es_ES.mo index 6749e60a3697e446bb9aabb024fb170aefe21f9c..4ce0d7d03f76baa1c7848a41b4bea546783a1adf 100644 GIT binary patch delta 16 Xcmdnq&A7dral\n" "Language-Team: LANGUAGE \n" diff --git a/readme.txt b/readme.txt index 4ae5b02..ebabe65 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: robotstxt, javiercasares Tags: opengraph, open graph, twitter card, social media, seo Requires at least: 4.9.8 Tested up to: 7.1 -Stable tag: 1.2.1 +Stable tag: 1.2.2 Requires PHP: 8.0 -Version: 1.2.1 +Version: 1.2.2 License: GPL-3.0-or-later License URI: https://www.gnu.org/licenses/gpl-3.0.txt @@ -180,6 +180,14 @@ Yes. The plugin hooks into `wp_head` for direct tag injection and filters Yoast/ == Changelog == += 1.2.2 = + +_Release date: 2026-08-24_ + +* Changed: Manager (by ROBOTSTXT) detection now uses the ecosystem presence constant `ROBOTSTXT_MANAGER_NOTICED` (Manager 1.6.2+); for older Manager versions it falls back to the plugin-list scan. +* Changed: Tested up to WordPress 7.1 (requires 4.9.8, re-verified); PHP 8.0 – 8.5 (re-verified). +* Dev: Composer dev dependencies updated (PHPStan 2.2.9, Mockery 1.6.15, WordPress hook stubs 1.13.0). + = 1.2.1 = _Release date: 2026-08-17_ @@ -203,19 +211,6 @@ _Release date: 2026-08-10_ * Changed: Minimum supported WordPress lowered from 6.8 to 4.9.8 (verified by WP-Compat). * Changed: Minimum supported PHP lowered from 8.2 to 8.0 (verified by the PHPCompatibility scan). -= 1.1.0 = - -_Release date: 2026-03-28_ - -* Fixed: Fatal `TypeError` in `handle_thumbnail_change()` when `deleted_post_meta` passes an array of meta IDs as the first argument. -* Security: Added SSRF protection — outbound HEAD requests now block private and reserved IP ranges. -* Security: Replaced deprecated `FILTER_SANITIZE_SPECIAL_CHARS` with `FILTER_SANITIZE_FULL_SPECIAL_CHARS`. -* Added: GDPR Privacy API — custom OG title and description are included in WordPress personal data export and erase. -* Changed: Settings page and REST API now require `edit_others_posts`, allowing editors to manage OG settings. -* Changed: Minimum supported WordPress version raised to 6.8. -* Changed: Added `Network: true` header confirming Multisite compatibility. -* Added: PHPUnit test suite (Brain\Monkey) covering SSRF protection, format detection, and cache clearing. - = Previous versions = If you want to see the full changelog, visit the [changelog](https://www.robotstxt.software/plugins/robotstxt-og/) page. diff --git a/robotstxt-og.php b/robotstxt-og.php index f5f28a0..5bd9037 100644 --- a/robotstxt-og.php +++ b/robotstxt-og.php @@ -3,7 +3,7 @@ * Plugin Name: OpenGraph (by ROBOTSTXT) * Plugin URI: https://www.robotstxt.software/plugins/robotstxt-og/ * Description: Intelligent Open Graph image fallback for social media crawlers. Automatically detects and serves compatible image formats (JPEG/PNG) when modern formats (AVIF/WebP) are used as featured images. - * Version: 1.2.1 + * Version: 1.2.2 * Requires at least: 4.9.8 * Requires PHP: 8.0 * Author: ROBOTSTXT @@ -17,7 +17,7 @@ * Contributors: robotstxt, javiercasares * * @package ROBOTSTXT_OG - * @version 1.2.1 + * @version 1.2.2 */ if ( ! defined( 'ABSPATH' ) ) { @@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) { } // Define plugin constants. -define( 'ROBOTSTXT_OG_VERSION', '1.2.1' ); +define( 'ROBOTSTXT_OG_VERSION', '1.2.2' ); define( 'ROBOTSTXT_OG_PATH', plugin_dir_path( __FILE__ ) ); define( 'ROBOTSTXT_OG_URL', plugin_dir_url( __FILE__ ) ); define( 'ROBOTSTXT_OG_BASENAME', plugin_basename( __FILE__ ) ); diff --git a/uninstall.php b/uninstall.php index f6fd537..ff7e8a8 100644 --- a/uninstall.php +++ b/uninstall.php @@ -5,7 +5,7 @@ * Fired when the plugin is uninstalled. * * @package ROBOTSTXT_OG - * @version 1.2.1 + * @version 1.2.2 */ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { diff --git a/update.json b/update.json deleted file mode 100644 index 669e791..0000000 --- a/update.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "OpenGraph (by ROBOTSTXT)", - "slug": "robotstxt-og", - "version": "1.2.1", - "download_url": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-og/releases/download/1.2.1/robotstxt-og-1.2.1.zip", - "requires": "4.9.8", - "requires_php": "8.0", - "tested": "7.0", - "last_updated": "2026-08-10", - "author": "ROBOTSTXT", - "author_profile": "https://www.robotstxt.es/", - "homepage": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-og", - "description": "Intelligent Open Graph meta tags with automatic image fallback from AVIF/WebP to JPEG/PNG for social media crawlers. Outputs a complete set of og:* and twitter:* meta tags, detects incompatible image formats, and resolves JPEG/PNG alternatives via HTTP HEAD requests.", - "changelog": "", - "sections": { - "description": "

Social media crawlers — Facebook, Twitter/X, LinkedIn, WhatsApp — do not support modern image formats such as AVIF and WebP. When a post’s featured image uses one of these formats, the platform shows a broken or missing image preview.

OpenGraph (by ROBOTSTXT) outputs a complete set of Open Graph and Twitter Card meta tags and solves this automatically. It detects whether each post’s featured image is in a supported format and, when needed, resolves and caches a compatible JPEG or PNG alternative.

  • Full og:* and twitter:* meta tag output
  • Automatic AVIF/WebP/GIF/BMP/SVG/TIFF detection with JPEG/PNG fallback
  • Per-post OG title and description overrides via post editor meta box
  • Global fallback image URL and homepage-specific image URL
  • Yoast SEO and RankMath integration (no duplicate tags)
  • Postmeta caching with automatic invalidation
  • Admin panel with Settings, Tools, and Diagnostics tabs
  • WP-CLI commands and REST API endpoints
  • Multisite compatible
", - "changelog": "" - }, - "banners": { - "low": "", - "high": "" - }, - "icons": { - "1x": "", - "2x": "" - } -}