PluginProbe
WPVulnerability / 4.3.0
WPVulnerability v4.3.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 4.3.0, at wpvulnerability.php

163 lines 5.1 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/
5 * Description: Receive information about possible vulnerabilities in your WordPress from WordPress Vulnerability Database API.
6 * Requires at least: 4.7
7 * Requires PHP: 5.6
8 * Version: 4.3.0
9 * Author: Javier Casares
10 * Author URI: https://www.javiercasares.com/
11 * License: GPL-2.0-or-later
12 * License URI: https://spdx.org/licenses/GPL-2.0-or-later.html
13 * Text Domain: wpvulnerability
14 * Domain Path: /languages
15 *
16 * @package WPVulnerability
17 *
18 * @version 2.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', '4.3.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 * Backward compatibility for wp_doing_cron().
117 *
118 * wp_doing_cron() was introduced in WordPress 4.8. This plugin supports
119 * versions as old as WordPress 4.7, so define the function when it does not
120 * exist in core.
121 *
122 * @since 4.1.1
123 */
124 if ( ! function_exists( 'wp_doing_cron' ) ) {
125 /**
126 * Determines whether the current request is a WordPress cron request.
127 *
128 * Mirrors the core wp_doing_cron() function available since 4.8.0.
129 *
130 * @since 4.1.1
131 *
132 * @return bool Whether the current request is a WordPress cron request.
133 */
134 function wp_doing_cron() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
135 return apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
136 }
137 }
138
139 /*
140 * Only load if it's admin / super admin.
141 */
142 if (
143 ( ! is_multisite() && is_admin() ) ||
144 ( is_multisite() && ( is_network_admin() || is_main_site() ) ) ||
145 ( defined( 'WP_CLI' ) && WP_CLI ) ||
146 wp_doing_cron()
147 ) {
148
149 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-run.php';
150 register_activation_hook( WPVULNERABILITY_PLUGIN_FILE, 'wpvulnerability_activation' );
151 register_deactivation_hook( WPVULNERABILITY_PLUGIN_FILE, 'wpvulnerability_deactivation' );
152 register_uninstall_hook( WPVULNERABILITY_PLUGIN_FILE, 'wpvulnerability_uninstall' );
153 add_action( 'init', 'wpvulnerability_plugin_init' );
154 }
155
156 /*
157 * The plugin really needs this.
158 *
159 * @since 3.1.0
160 */
161 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-schedule.php';
162 require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-api.php';
163