PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / requirement.php

requirement.php in Depicter — Popup & Slider Builder 1.9.2, at app/requirement.php

49 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Handle checking requirements.
4 *
5 * @package Depicter
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 if ( ! function_exists( 'depicter_requirements_satisfied' ) ) {
13
14 /**
15 * Whether required php version is available or not.
16 *
17 * @param string $name Project name.
18 * @param string $min Minimum PHP version.
19 *
20 * @return bool
21 */
22 function depicter_requirements_satisfied( $name, $min ) {
23
24 if ( version_compare( PHP_VERSION, $min, '>=' ) ) {
25 return true;
26 }
27
28 add_action(
29 'admin_notices',
30 function () use ( $name, $min ) {
31 $message = __( '%1$s plugin requires PHP version %2$s but current version is %3$s. Please contact your host provider and ask them to upgrade PHP version.', 'depicter' );
32 ?>
33 <div class="notice notice-error">
34 <p><?php echo wp_kses( sprintf(
35 $message,
36 '<strong>' . $name . '</strong>',
37 '<strong>' . $min . '</strong>',
38 '<strong>' . PHP_VERSION . '</strong>'
39 ), ['strong' => [] ] ); ?></p>
40 </div>
41 <?php
42 }
43 );
44
45 // An incompatible version is already loaded.
46 return false;
47 }
48 }
49