-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgnetwork.php
More file actions
75 lines (61 loc) · 2.18 KB
/
gnetwork.php
File metadata and controls
75 lines (61 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php defined( 'ABSPATH' ) || die( header( 'HTTP/1.0 403 Forbidden' ) );
/*
Plugin Name: gNetwork
Plugin URI: https://geminorum.ir/wordpress/gnetwork
Update URI: https://github.com/geminorum/gnetwork
Description: Network Helper
Version: 3.18.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Author: geminorum
Author URI: https://geminorum.ir/
Network: true
Text Domain: gnetwork
Domain Path: /languages
RepoGitHub: geminorum/gnetwork
GitHub Plugin URI: https://github.com/geminorum/gnetwork
Release Asset: true
Requires WP: 5.9.0
Requires at least: 5.9.0
Requires PHP: 7.4
Tested up to: 6.9
*/
define( 'GNETWORK_VERSION', '3.18.0' );
define( 'GNETWORK_MIN_PHP', '7.2' );
define( 'GNETWORK_DIR', plugin_dir_path( __FILE__ ) );
define( 'GNETWORK_URL', plugin_dir_url( __FILE__ ) );
define( 'GNETWORK_FILE', basename( GNETWORK_DIR ) . '/' . basename( __FILE__ ) );
if ( is_readable( WP_CONTENT_DIR . '/gnetwork-custom.php' ) ) {
require_once WP_CONTENT_DIR . '/gnetwork-custom.php';
}
if ( version_compare( GNETWORK_MIN_PHP, PHP_VERSION, '>=' ) ) {
if ( is_admin() ) {
echo '<div class="notice notice-warning notice-alt is-dismissible"><p dir="ltr">';
printf( '<b>gNetwork</b> requires PHP %s or higher. Please contact your hosting provider to update your site.', GNETWORK_MIN_PHP ); // WPCS: XSS ok.
echo '</p></div>';
}
return false;
} else if ( file_exists( GNETWORK_DIR . 'assets/vendor/autoload.php' ) ) {
require_once GNETWORK_DIR . 'assets/vendor/autoload.php';
function gNetwork() {
return \geminorum\gNetwork\Plugin::instance(
GNETWORK_DIR,
GNETWORK_URL,
GNETWORK_FILE,
GNETWORK_VERSION
);
}
gNetwork();
} else {
$gnetwork_notice = static function () {
echo '<div class="notice notice-warning notice-alt is-dismissible"><p dir="ltr">';
printf( '<b>gNetwork</b> is not installed correctly. go grab the latest package <a href="%s" target="_blank">here</a>.', 'https://github.com/geminorum/gnetwork/releases/latest' );
echo '</p></div>';
};
if ( ! is_multisite() ) {
add_action( 'admin_notices', $gnetwork_notice );
} else if ( is_network_admin() ) {
add_action( 'network_admin_notices', $gnetwork_notice );
}
unset( $gnetwork_notice );
}