PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.3.3
Gallery : FooGallery v3.3.3
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 days ago dates.php 2 days ago general.php 2 days ago index.php 2 days ago screen.php 2 days ago strings.php 2 days ago
general.php
68 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 /*
8 * Foo Functions - General
9 * A bunch of common and useful functions that don't fall into any specific category
10 *
11 * Author: Brad Vincent
12 * Author URI: http://fooplugins.com
13 * License: GPL2
14 */
15
16 if ( !function_exists( 'foo_check_php_version' ) ) {
17
18 /**
19 * Checks the version of PHP running on the server.
20 *
21 * @param string $plugin_title The title of the plugin that is doing the check.
22 * @param string $ver The minimum required version
23 *
24 * @throws Exception if the version does not meet minimum requirements
25 */
26 function foo_check_php_version($plugin_title, $ver) {
27 $php_version = phpversion();
28 if ( version_compare( $php_version, $ver ) < 0 ) {
29 /* translators: %s: Value inserted at runtime. */
30 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 ) ) );
31 }
32 }
33 }
34
35 if ( !function_exists( 'foo_check_wp_version' ) ) {
36
37 /**
38 * Checks the version of WordPress running on the server.
39 *
40 * @param string $plugin_title The title of the plugin that is doing the check.
41 * @param string $ver The minimum required version
42 *
43 * @throws Exception if the version does not meet minimum requirements
44 */
45 function foo_check_wp_version($plugin_title, $ver) {
46 global $wp_version;
47 if ( version_compare( $wp_version, $ver ) < 0 ) {
48 /* translators: %s: Value inserted at runtime. */
49 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 ) ) );
50 }
51 }
52 }
53
54 if ( !function_exists( 'foo_check_wp_version_at_least' ) ) {
55
56 /**
57 * @TODO
58 * @param $ver
59 *
60 * @return bool
61 */
62 function foo_check_wp_version_at_least($ver) {
63 global $wp_version;
64
65 return version_compare( $wp_version, $ver ) >= 0;
66 }
67 }
68