PluginProbe
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms / trunk
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms vtrunk
3.53.0 3.52.0 3.51.0 3.50.0 3.45.0 3.38.0 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.40.0 3.40.1 3.41.0 3.42.0 3.43.0 3.44.0 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 All 177 releases
simple-tags / inc / class.compatibility.php

class.compatibility.php in Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms trunk, at inc/class.compatibility.php

53 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_trigger_error -- Legacy TaxoPress file: keep behavior unchanged while documenting existing PHPCS exceptions.
4
5 class SimpleTags_Compatibility
6 {
7 /**
8 * admin_init hook callback
9 *
10 * @since 0.1
11 */
12 public static function admin_init()
13 {
14 // Not on ajax
15 if (defined('DOING_AJAX') && DOING_AJAX) {
16 return;
17 }
18
19 // Check activation
20 if (! current_user_can('activate_plugins')) {
21 return;
22 }
23
24 trigger_error(sprintf(esc_html__('TaxoPress requires PHP version %s or greater to be activated.'), esc_html(STAGS_MIN_PHP_VERSION)));
25
26 // Deactive self
27 deactivate_plugins(plugin_basename(STAGS_DIR . '/simple-tags.php'));
28
29 unset($_GET['activate']);
30
31 add_action('admin_notices', array( __CLASS__, 'admin_notices' ));
32 }
33
34 /**
35 * Notify the user about the incompatibility issue.
36 */
37 public static function admin_notices()
38 {
39 echo '<div class="notice error is-dismissible taxopress-notice">';
40 $data = get_plugin_data(TAXOPRESS_FILE);
41
42 echo '<p><strong>' . esc_html__('Warning:', 'simple-tags') . '</strong> '
43 . sprintf(
44 esc_html__('The active plugin %s is not compatible with your PHP version.', 'simple-tags') . '</p><p>',
45 '&laquo;' . esc_html($data['Name']) . ' ' . esc_html($data['Version']) . '&raquo;'
46 )
47 . sprintf(esc_html__('%s is the minimum version required for this plugin.', 'simple-tags'), 'PHP 7.2.5 ')
48 . '</p>';
49
50 echo '</div>';
51 }
52 }
53