PluginProbe
WPVulnerability / 5.0.0
WPVulnerability v5.0.0
5.1.6 5.1.2 5.1.1 5.0.1 5.0.0 trunk 0.1 0.2 1.0 1.0.1 1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 All 57 releases
wpvulnerability / wpvulnerability.php

wpvulnerability.php in WPVulnerability 5.0.0, at wpvulnerability.php

139 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: WPVulnerability
4 * Plugin URI: https://www.wpvulnerability.com/plugin/
5 * Description: Receive information about possible vulnerabilities in your WordPress from WordPress Vulnerability Database API.
6 * Requires at least: 5.6
7 * Requires PHP: 7.0
8 * Version: 5.0.0
9 * Author: ROBOTSTXT
10 * Author URI: https://www.robotstxt.es/
11 * License: GPL-3.0-or-later
12 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13 * Text Domain: wpvulnerability
14 * Domain Path: /languages
15 *
16 * @package WPVulnerability
17 *
18 * @version 5.0.0
19 */
20
21 defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
22
23 /**
24 * Set some constants that I can change in future versions.
25 */
26 define( 'WPVULNERABILITY_PLUGIN_VERSION', '5.0.0' );
27 define( 'WPVULNERABILITY_API_HOST', 'https://www.wpvulnerability.net/' );
28
29 /**
30 * Set some useful constants.
31 */
32 define( 'WPVULNERABILITY_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
33 define( 'WPVULNERABILITY_PLUGIN_FILE', __FILE__ );
34 define( 'WPVULNERABILITY_PLUGIN_BASE', plugin_basename( __FILE__ ) );
35 define( 'WPVULNERABILITY_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
36
37 // Handle front-end email opt-out requests early.
38 if ( isset( $_GET['wpvulnerability_disable_email'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
39 // Load pluggable functions so wp_verify_nonce() is available.
40 if ( ! function_exists( 'wp_verify_nonce' ) ) {
41 require_once ABSPATH . WPINC . '/pluggable.php';
42 }
43
44 if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) {
45 if ( ! function_exists( 'wp_cookie_constants' ) ) {
46 require_once ABSPATH . WPINC . '/default-constants.php';
47 }
48
49 if ( function_exists( 'wp_cookie_constants' ) ) {
50 wp_cookie_constants();
51 }
52 }
53
54 if ( ! function_exists( 'wpvulnerability_normalize_notify_settings' ) ) {
55 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-general.php';
56 }
57
58 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-notifications.php';
59
60 if ( function_exists( 'wpvulnerability_disable_notifications_via_url' ) ) {
61 wpvulnerability_disable_notifications_via_url();
62 }
63 }
64
65 /**
66 * Initialize the plugin.
67 *
68 * @since 2.0.0
69 *
70 * @return void
71 */
72 function wpvulnerability_plugin_init() {
73 wpvulnerability_initialize_plugin_data();
74
75 /*
76 * Global functions, where the magic happens.
77 *
78 * @since 2.0.0
79 */
80 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-general.php';
81
82 /*
83 * The admin panel for the configuration.
84 *
85 * @since 2.0.0
86 */
87 if ( is_multisite() && ( is_network_admin() || ( wp_doing_ajax() && is_admin() ) ) ) {
88 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-adminms.php';
89 } elseif ( ! is_multisite() && is_admin() ) {
90 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-admin.php';
91 }
92
93 /*
94 * The functions to work with the data.
95 *
96 * @since 2.0.0
97 */
98 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-core.php';
99 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-plugins.php';
100 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-themes.php';
101 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-software.php';
102
103 /*
104 * All the plugin really does.
105 *
106 * @since 2.0.0
107 */
108 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-process.php';
109 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-notifications.php';
110 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-sitehealth.php';
111 require_once WPVULNERABILITY_PLUGIN_PATH . '/class-wpvulnerability-cli.php';
112 require_once WPVULNERABILITY_PLUGIN_PATH . '/class-wpvulnerability-config-cli.php';
113 }
114
115 /*
116 * Only load if it's admin / super admin.
117 */
118 if (
119 ( ! is_multisite() && is_admin() ) ||
120 ( is_multisite() && ( is_network_admin() || is_main_site() ) ) ||
121 ( defined( 'WP_CLI' ) && WP_CLI ) || // @phpstan-ignore booleanAnd.rightAlwaysFalse (WP_CLI is false in bootstrap but true at runtime)
122 wp_doing_cron()
123 ) {
124
125 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-run.php';
126 register_activation_hook( WPVULNERABILITY_PLUGIN_FILE, 'wpvulnerability_activation' );
127 register_deactivation_hook( WPVULNERABILITY_PLUGIN_FILE, 'wpvulnerability_deactivation' );
128 register_uninstall_hook( WPVULNERABILITY_PLUGIN_FILE, 'wpvulnerability_uninstall' );
129 add_action( 'init', 'wpvulnerability_plugin_init' );
130 }
131
132 /*
133 * The plugin really needs this.
134 *
135 * @since 3.1.0
136 */
137 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-schedule.php';
138 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-api.php';
139