PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.1.36
Gallery : FooGallery v3.1.36
3.3.2 3.3.3 3.3.0 3.1.31 3.1.32 3.1.34 3.1.36 3.2.0 3.2.6 trunk 1.10.3 2.0.24 2.1.34 2.2.44 2.3.3 2.4.32 3.0.6 3.1.11 3.1.12 3.1.13 3.1.20 3.1.25 3.1.26 3.1.26.1 3.1.26.2
foogallery / includes / foopluginbase / functions / general.php
foogallery / includes / foopluginbase / functions Last commit date
arrays.php 2 months ago dates.php 2 months ago general.php 2 months ago index.php 2 months ago screen.php 2 months ago strings.php 2 months ago
general.php
61 lines
1 <?php
2 /*
3 * Foo Functions - General
4 * A bunch of common and useful functions that don't fall into any specific category
5 *
6 * Author: Brad Vincent
7 * Author URI: http://fooplugins.com
8 * License: GPL2
9 */
10
11 if ( !function_exists( 'foo_check_php_version' ) ) {
12
13 /**
14 * Checks the version of PHP running on the server.
15 *
16 * @param string $plugin_title The title of the plugin that is doing the check.
17 * @param string $ver The minimum required version
18 *
19 * @throws Exception if the version does not meet minimum requirements
20 */
21 function foo_check_php_version($plugin_title, $ver) {
22 $php_version = phpversion();
23 if ( version_compare( $php_version, $ver ) < 0 ) {
24 throw new Exception( sprintf( esc_html__( "%s requires at least version %s of PHP. You are running an older version (%s). Please update!", "foogallery" ), esc_html( $plugin_title ), esc_html( $ver ), esc_html( $php_version ) ) );
25 }
26 }
27 }
28
29 if ( !function_exists( 'foo_check_wp_version' ) ) {
30
31 /**
32 * Checks the version of WordPress running on the server.
33 *
34 * @param string $plugin_title The title of the plugin that is doing the check.
35 * @param string $ver The minimum required version
36 *
37 * @throws Exception if the version does not meet minimum requirements
38 */
39 function foo_check_wp_version($plugin_title, $ver) {
40 global $wp_version;
41 if ( version_compare( $wp_version, $ver ) < 0 ) {
42 throw new Exception( sprintf( esc_html__( "%s requires at least version %s of WordPress. You are running an older version (%s). Please update!", "foogallery" ), esc_html( $plugin_title ), esc_html( $ver ), esc_html( $wp_version ) ) );
43 }
44 }
45 }
46
47 if ( !function_exists( 'foo_check_wp_version_at_least' ) ) {
48
49 /**
50 * @TODO
51 * @param $ver
52 *
53 * @return bool
54 */
55 function foo_check_wp_version_at_least($ver) {
56 global $wp_version;
57
58 return version_compare( $wp_version, $ver ) >= 0;
59 }
60 }
61