robotstxt-og/robotstxt-og.php
2026-08-10 14:03:36 +00:00

46 lines
1.4 KiB
PHP

<?php
/**
* Plugin Name: OpenGraph (by ROBOTSTXT)
* Plugin URI: https://git.robotstxt.es/ROBOTSTXT/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.0
* Requires at least: 4.9.8
* Requires PHP: 8.0
* Author: ROBOTSTXT
* Author URI: https://www.robotstxt.es/
* License: GPL v3 or later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: robotstxt-og
* Domain Path: /languages
* Network: true
* Gitea Plugin URI: ROBOTSTXT/robotstxt-og
* Contributors: javiercasares, robotstxt
*
* @package ROBOTSTXT_OG
* @version 1.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Define plugin constants.
define( 'ROBOTSTXT_OG_VERSION', '1.2.0' );
define( 'ROBOTSTXT_OG_PATH', plugin_dir_path( __FILE__ ) );
define( 'ROBOTSTXT_OG_URL', plugin_dir_url( __FILE__ ) );
define( 'ROBOTSTXT_OG_BASENAME', plugin_basename( __FILE__ ) );
// Initialize the updater system.
require_once ROBOTSTXT_OG_PATH . 'robotstxt-updater.php';
Robotstxt_Updater::init( __FILE__ );
// Load the main plugin class.
require_once ROBOTSTXT_OG_PATH . 'includes/class-robotstxt-og-image-fallback.php';
// Initialize the plugin.
add_action(
'plugins_loaded',
function () {
Robotstxt_OG_Image_Fallback::get_instance()->init();
}
);