PluginProbe
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms / 3.44.0
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms v3.44.0
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 3.44.0, at inc/class.compatibility.php

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