robotstxt-hello/robotstxt-hello.php
2026-08-24 11:54:39 +00:00

54 lines
1.6 KiB
PHP

<?php
/**
* Plugin Name: Hello (by ROBOTSTXT)
* Plugin URI: https://www.robotstxt.software/plugins/robotstxt-hello/
* Update URI: https://www.robotstxt.software/plugins/robotstxt-hello/
* Description: Adds a Hello admin page for demonstration purposes.
* Version: 1.2.6
* Requires at least: 4.0
* Requires PHP: 7.0
* Network: true
* Security: robotstxt@robotstxt.es
* Author: ROBOTSTXT
* Author URI: https://www.robotstxt.software/
* Text Domain: robotstxt-hello
* Domain Path: /languages
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
*
* @package ROBOTSTXT_Hello
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( version_compare( PHP_VERSION, '7.0', '<' ) ) {
add_action( 'admin_notices', 'robotstxt_hello_render_php_version_notice' );
return;
}
/**
* Renders the admin notice shown when the PHP version is too old.
*
* Defined in the main file because the plugin class itself uses PHP 7.0+
* syntax and must not be loaded on older versions.
*
* @since 1.2.6
*
* @return void
*/
function robotstxt_hello_render_php_version_notice() {
printf(
'<div class="notice notice-error"><p>%s</p></div>',
esc_html__( 'Hello (by ROBOTSTXT) requires PHP 7.0 or newer. The plugin stays inactive until PHP is updated.', 'robotstxt-hello' )
);
}
define( 'ROBOTSTXT_HELLO_VERSION', '1.2.6' );
define( 'ROBOTSTXT_HELLO_FILE', __FILE__ );
require_once __DIR__ . '/includes/class-robotstxt-hello-plugin.php';
( new Robotstxt_Hello_Plugin() )->register();