PluginProbe
Version Info – Server Health Monitor, PHP & MySQL Version Display, Environment Indicators / trunk
Version Info – Server Health Monitor, PHP & MySQL Version Display, Environment Indicators vtrunk
2.1.0 2.0.3 2.0.2 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 2.0.0 2.0.1
version-info / version-info.php

version-info.php in Version Info – Server Health Monitor, PHP & MySQL Version Display, Environment Indicators trunk, at version-info.php

92 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Version Info
5 * Plugin URI: https://versioninfoplugin.com
6 * Description: Show current WordPress, PHP, Web Server, and MySQL versions optionally in the admin footer, WP-Admin bar, or dashboard widget.
7 * Author: Gaucho Plugins
8 * Author URI: https://gauchoplugins.com
9 * Version: 2.1.0
10 * License: GPLv3
11 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
12 * Text Domain: version-info
13 * Requires PHP: 5.6
14 * Requires at least: 4.7
15 * Tested up to: 7.1
16 *
17 * @package Version_Info
18 *
19 */
20 if ( !defined( 'ABSPATH' ) ) {
21 exit;
22 }
23 if ( function_exists( 'vi_fs' ) ) {
24 vi_fs()->set_basename( false, __FILE__ );
25 } else {
26 // @phpstan-ignore booleanNot.alwaysTrue (Standard Freemius SDK init snippet — the redundant guard ships as-is for merge-safety across Freemius products.)
27 if ( !function_exists( 'vi_fs' ) ) {
28 /**
29 * Returns the Freemius SDK instance, initializing it on first call.
30 */
31 function vi_fs() {
32 global $vi_fs;
33 if ( !isset( $vi_fs ) ) {
34 // Activate multisite network integration.
35 if ( !defined( 'WP_FS__PRODUCT_24628_MULTISITE' ) ) {
36 define( 'WP_FS__PRODUCT_24628_MULTISITE', true );
37 }
38 // Include Freemius SDK.
39 require_once __DIR__ . '/vendor/freemius/start.php';
40 $vi_fs = fs_dynamic_init( array(
41 'id' => '24628',
42 'slug' => 'version-info',
43 'type' => 'plugin',
44 'public_key' => 'pk_0aab3921d653db1046b13586d75f7',
45 'is_premium' => false,
46 'premium_suffix' => 'PRO',
47 'has_addons' => false,
48 'has_paid_plans' => true,
49 'is_org_compliant' => true,
50 'menu' => array(
51 'slug' => 'version-info',
52 'parent' => array(
53 'slug' => 'options-general.php',
54 ),
55 ),
56 'is_live' => true,
57 ) );
58 }
59 return $vi_fs;
60 }
61
62 vi_fs();
63 vi_fs()->add_filter( 'pricing/show_annual_in_monthly', '__return_false' );
64 vi_fs()->add_filter( 'plugin_icon', function () {
65 return __DIR__ . '/assets/plugin-icon.png';
66 } );
67 do_action( 'vi_fs_loaded' );
68 }
69 // Keep in lockstep with the plugin header Version above (was stale at 2.0.1 through 2.0.3).
70 define( 'VERSION_INFO_VERSION', '2.1.0' );
71 define( 'VERSION_INFO_FILE', __FILE__ );
72 define( 'VERSION_INFO_DIR', plugin_dir_path( __FILE__ ) );
73 spl_autoload_register( function ( $class_name ) {
74 $prefix = 'GauchoPlugins\\VersionInfo\\';
75 // Replaces str_starts_with() (PHP 8.0+) for PHP 5.6 compatibility.
76 if ( 0 !== strpos( $class_name, $prefix ) ) {
77 return;
78 }
79 $relative = substr( $class_name, strlen( $prefix ) );
80 $pro_prefix = 'Pro\\';
81 if ( 0 === strpos( $relative, $pro_prefix ) ) {
82 $relative = substr( $relative, strlen( $pro_prefix ) );
83 $file = VERSION_INFO_DIR . 'includes/pro/' . str_replace( '\\', '/', $relative ) . '.php';
84 } else {
85 $file = VERSION_INFO_DIR . 'includes/' . str_replace( '\\', '/', $relative ) . '.php';
86 }
87 if ( file_exists( $file ) ) {
88 require_once $file;
89 }
90 } );
91 ( new GauchoPlugins\VersionInfo\Plugin() )->init();
92 }