Version Description
Download this release
Release Info
Developer | miguelxavierpenha |
Plugin | VaultPress |
Version | 2.2.0-beta |
Comparing to | |
See all releases |
Code changes from version 2.1.4 to 2.2.0-beta
- CHANGELOG.md +295 -0
- class.vaultpress-cli.php +6 -1
- class.vaultpress-hotfixes.php +0 -679
- composer.json +44 -8
- cron-tasks.php +1 -1
- readme.txt +9 -43
- uninstall.php +13 -13
- vaultpress.php +3 -10
- vendor/autoload.php +1 -1
- vendor/autoload_packages.php +5 -198
- vendor/automattic/jetpack-logo/composer.json +22 -4
- vendor/automattic/jetpack-logo/src/class-logo.php +2 -1
- vendor/composer/ClassLoader.php +142 -15
- vendor/composer/InstalledVersions.php +337 -0
- vendor/composer/autoload_classmap.php +6 -0
- vendor/composer/autoload_psr4.php +0 -3
- vendor/composer/autoload_real.php +7 -16
- vendor/composer/autoload_static.php +10 -25
- vendor/composer/installed.json +102 -490
- vendor/composer/installed.php +41 -0
- vendor/composer/jetpack_autoload_classmap.php +33 -0
- vendor/jetpack-autoloader/class-autoloader-handler.php +147 -0
- vendor/jetpack-autoloader/class-autoloader-locator.php +90 -0
- vendor/jetpack-autoloader/class-autoloader.php +90 -0
- vendor/jetpack-autoloader/class-container.php +150 -0
- vendor/jetpack-autoloader/class-hook-manager.php +76 -0
- vendor/jetpack-autoloader/class-latest-autoloader-guard.php +86 -0
- vendor/jetpack-autoloader/class-manifest-reader.php +99 -0
- vendor/jetpack-autoloader/class-path-processor.php +194 -0
- vendor/jetpack-autoloader/class-php-autoloader.php +90 -0
- vendor/jetpack-autoloader/class-plugin-locator.php +153 -0
- vendor/jetpack-autoloader/class-plugins-handler.php +164 -0
- vendor/jetpack-autoloader/class-shutdown-handler.php +92 -0
- vendor/jetpack-autoloader/class-version-loader.php +164 -0
- vendor/jetpack-autoloader/class-version-selector.php +69 -0
CHANGELOG.md
ADDED
@@ -0,0 +1,295 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Changelog
|
2 |
+
|
3 |
+
All notable changes to this project will be documented in this file.
|
4 |
+
|
5 |
+
## 2.2.0-beta - 2021-10-07
|
6 |
+
### Changed
|
7 |
+
- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills).
|
8 |
+
- Updated package dependencies.
|
9 |
+
|
10 |
+
### Removed
|
11 |
+
- VaultPress: Remove obsolete hotfixes
|
12 |
+
|
13 |
+
### Fixed
|
14 |
+
- General: avoid PHP notices when using recent versions of PHP.
|
15 |
+
|
16 |
+
## 2.1.4 - 2020-08-07
|
17 |
+
### Bug fixes
|
18 |
+
- General: Revert autoloader version to prior 1.7.0 version, to resolve an intermittent issue during the upgrade process for some users.
|
19 |
+
|
20 |
+
## 2.1.3 - 2020-08-06
|
21 |
+
### Compatibility
|
22 |
+
- General: Handle new user meta actions.
|
23 |
+
- General: Implement the spread operator for our IXR class methods to match WordPress Core behavior in 5.5.
|
24 |
+
- General: Update some miscellaneous dependencies.
|
25 |
+
|
26 |
+
## 2.1.0 - 2019-12-10
|
27 |
+
### Compatibility
|
28 |
+
- General: the VaultPress plugin now requires PHP 5.6, just like WordPress.
|
29 |
+
- General: avoid using PHP short array syntax to load plugin files.
|
30 |
+
|
31 |
+
## 2.1.0 - 2019-12-09
|
32 |
+
### Compatibility
|
33 |
+
- General: avoid PHP deprecation notices when using a newer version of the Jetpack plugin.
|
34 |
+
- Admin Page: do not display a dashboard link if not registered.
|
35 |
+
- Admin Page: update reset settings card wording.
|
36 |
+
- Connect button: update link to current VaultPress page.
|
37 |
+
- Notices: only display notices in specific locations.
|
38 |
+
- Notices: update wording for the VaultPress connection notice
|
39 |
+
|
40 |
+
## 2.0.1 - 2019-07-12
|
41 |
+
### Bug fixes
|
42 |
+
- Security Scanner: ensure the Security Scanner can be triggered at all times.
|
43 |
+
|
44 |
+
## 2.0 - 2019-07-09
|
45 |
+
### Enhancements
|
46 |
+
- Dashboard: redesign the main VaultPress dashboard.
|
47 |
+
|
48 |
+
### Compatibility
|
49 |
+
- General: VaultPress now requires PHP 5.3.2, and will display a notice if your site uses an older version of PHP.
|
50 |
+
|
51 |
+
## 1.9.10 - 2019-04-04
|
52 |
+
### Bug fixes
|
53 |
+
- Fix a PHP fatal error caused by passing an object to the current() function.
|
54 |
+
|
55 |
+
## 1.9.9 - 2019-03-28
|
56 |
+
|
57 |
+
- PHP 7.2.0 compatibility fix.
|
58 |
+
- Adding button to delete all VaultPress settings
|
59 |
+
|
60 |
+
## 1.9.8 - 2019-02-07
|
61 |
+
|
62 |
+
- Limit the size of _vp_ai_ping_% entries when a site gets disconnected from VaultPress.com
|
63 |
+
|
64 |
+
## 1.9.7 - 2018-12-11
|
65 |
+
|
66 |
+
- Update firewall IP detection rules to autodetect various reverse proxy setups
|
67 |
+
|
68 |
+
## 1.9.6 - 2018-08-17
|
69 |
+
|
70 |
+
- Limit _vp_ai_ping_% entries to improve stability when a site gets disconnected from VaultPress.com
|
71 |
+
|
72 |
+
## 1.9.5 - 2018-02-02
|
73 |
+
|
74 |
+
- Removing activation notice
|
75 |
+
|
76 |
+
## 1.9.4 - 2017-11-15
|
77 |
+
|
78 |
+
- Error handling improvements in the scanner
|
79 |
+
|
80 |
+
## 1.9.3 - 2017-11-09
|
81 |
+
|
82 |
+
- Compatibility update
|
83 |
+
- Send a better user-agent string to VaultPress servers
|
84 |
+
|
85 |
+
## 1.9.2 - 2017-07-06
|
86 |
+
|
87 |
+
- Compatibility update
|
88 |
+
|
89 |
+
## 1.9.1 - 2017-06-29
|
90 |
+
|
91 |
+
- Security improvement: use hash_equals to compare signatures
|
92 |
+
|
93 |
+
## 1.9.0 - 2017-06-05
|
94 |
+
|
95 |
+
- Bugfix: Check return value from openssl_verify()
|
96 |
+
|
97 |
+
## 1.8.9 - 2017-05-08
|
98 |
+
|
99 |
+
- Remove outdated free trial link
|
100 |
+
|
101 |
+
## 1.8.7 - 2017-03-06
|
102 |
+
|
103 |
+
- Security fix for https://wpvulndb.com/vulnerabilities/8745
|
104 |
+
|
105 |
+
## 1.8.6 - 2016-01-26
|
106 |
+
|
107 |
+
- Compatibility updates
|
108 |
+
- Security hotfixes
|
109 |
+
- Improved performance for security scanner
|
110 |
+
- Misc small bugfixes
|
111 |
+
|
112 |
+
## 1.8.5 - 2016-08-07
|
113 |
+
|
114 |
+
- Delete plugin option when plugin is deleted via admin area.
|
115 |
+
- Fix horizontal scroll bar on the fresh installation settings page at high resolutions.
|
116 |
+
|
117 |
+
## 1.8.4 - 2016-07-21
|
118 |
+
|
119 |
+
- Compatibility updates for Jetpack 4.1
|
120 |
+
|
121 |
+
## 1.8.3 - 2016-05-26
|
122 |
+
|
123 |
+
- Security: Hotfix for certain versions of Jetpack
|
124 |
+
|
125 |
+
## 1.8.2 - 2016-05-11
|
126 |
+
|
127 |
+
- Workaround for some versions of mod_security.
|
128 |
+
|
129 |
+
## 1.8.1 - 2016-03-29
|
130 |
+
|
131 |
+
- Improved support for WooCommerce live backups.
|
132 |
+
- Bugfix: Avoid cloning the 'vaultpress' option between Multisite instances.
|
133 |
+
|
134 |
+
## 1.8.0 - 2016-03-07
|
135 |
+
|
136 |
+
- Add support for an upcoming ability to have the Jetpack plugin manage registering the VaultPress plugin and entering the required API key. Gone will be the days of needing to copy/paste it!
|
137 |
+
|
138 |
+
## 1.7.9 - 2016-02-24
|
139 |
+
|
140 |
+
- PHP 7 support. Drop support for PHP 4 and versions of WordPress older than 3.2.
|
141 |
+
- Silence PHP errors when attempting to change the execution time limit when PHP is running in safe mode.
|
142 |
+
- Prevent database update pings from being stored when not connected to a paid VaultPress account.
|
143 |
+
|
144 |
+
## 1.7.8 - 2015-10-15
|
145 |
+
|
146 |
+
- Security: Hotfix for Akismet < 3.1.5.
|
147 |
+
|
148 |
+
## 1.7.7 - 2015-09-15
|
149 |
+
|
150 |
+
- Security: Add a new security hotfix.
|
151 |
+
|
152 |
+
## 1.7.6 - 2015-08-14
|
153 |
+
|
154 |
+
- Improved support for multisite installs with custom domains
|
155 |
+
- Improved live-backup support for WooCommerce
|
156 |
+
- Tested against WordPress 4.3
|
157 |
+
|
158 |
+
## 1.7.5 - 2015-06-11
|
159 |
+
|
160 |
+
- Security: Add a new security hotfix.
|
161 |
+
|
162 |
+
## 1.7.4 - 2015-04-28
|
163 |
+
|
164 |
+
- Bugfix: Don't allow openssl signing unless the public key exists.
|
165 |
+
|
166 |
+
## 1.7.3 - 2015-04-27
|
167 |
+
|
168 |
+
- Security: Add a new security hotfix.
|
169 |
+
|
170 |
+
## 1.7.2 - 2015-04-20
|
171 |
+
|
172 |
+
- Hotfix: Protect against a core security issue.
|
173 |
+
- Bugfix: Don't allow direct access to plugin files
|
174 |
+
- Bugfix: Ensure that the firewall rule option is not autoloaded.
|
175 |
+
- Bugfix: More careful path tidy-up when inspecting directory contents. Fixes an edge case where some sites were having backup problems.
|
176 |
+
|
177 |
+
## 1.7.1 - 2015-03-25
|
178 |
+
|
179 |
+
- Added support for openssl signing.
|
180 |
+
|
181 |
+
## 1.7.0 - 2015-01-09
|
182 |
+
|
183 |
+
- Added an option to disable calls to php_uname, as some hosts don't allow them.
|
184 |
+
|
185 |
+
## 1.6.9 - 2014-12-24
|
186 |
+
|
187 |
+
- Tested against WordPress 4.1
|
188 |
+
|
189 |
+
## 1.6.8 - 2014-12-12
|
190 |
+
|
191 |
+
- Bugfix: Fall back on HTTP when updating firewall via HTTPS fails. Still warn the user about the security implications.
|
192 |
+
|
193 |
+
## 1.6.7 - 2014-12-01
|
194 |
+
|
195 |
+
- Security: More efficient format for internal firewall IPs.
|
196 |
+
|
197 |
+
## 1.6.6 - 2014-11-14
|
198 |
+
|
199 |
+
- Security: Fetch service IP updates via HTTPS.
|
200 |
+
- Feature: Don't send backup notifications while mass-deleting spam.
|
201 |
+
|
202 |
+
## 1.6.5 - 2014-09-04
|
203 |
+
|
204 |
+
- Security: Hotfix for the Slider Revolution plugin.
|
205 |
+
|
206 |
+
## 1.6.4 - 2014-09-03
|
207 |
+
|
208 |
+
- Bumping the "Tested up to" tag to 4.0
|
209 |
+
|
210 |
+
## 1.6.3 - 2014-07-30
|
211 |
+
|
212 |
+
- Bugfix: Make sure existing empty key and secret options are always strings. This fixes an error when run with HHVM.
|
213 |
+
- Bugfix: Detect if the plugin has been installed on localhost and show an error.
|
214 |
+
- CSS Fix: Stop the "Register" button from bouncing around when clicked.
|
215 |
+
|
216 |
+
## 1.6.2 - 2014-07-10
|
217 |
+
|
218 |
+
- Feature: Instantly register for a VaultPress trial via Jetpack.
|
219 |
+
- Bugfix: Make sure the key and secret options are always strings. This fixes an error when run with HHVM.
|
220 |
+
|
221 |
+
## 1.6.1 - 2014-07-01
|
222 |
+
|
223 |
+
- Security: Add a new security hotfix.
|
224 |
+
|
225 |
+
## 1.6 - 2014-06-27
|
226 |
+
|
227 |
+
- Bugfix: Better handling for Multisite table prefixes.
|
228 |
+
- Bugfix: Do not use the deprecated wpdb::escape() method.
|
229 |
+
|
230 |
+
## 1.5.9 - 2014-06-16
|
231 |
+
|
232 |
+
- Feature: If available, use command line md5sum and sha1sum to get checksums for large files.
|
233 |
+
|
234 |
+
## 1.5.8 - 2014-06-03
|
235 |
+
|
236 |
+
- Security: Add a new security hotfix.
|
237 |
+
|
238 |
+
## 1.5.7 - 2014-04-11
|
239 |
+
|
240 |
+
- Bugfix: Avoid PHP 5.4 warnings due to invalid constructor names.
|
241 |
+
- Security: Add a new security hotfix.
|
242 |
+
|
243 |
+
## 1.5.6 - 2014-04-01
|
244 |
+
|
245 |
+
- Bugfix: Avoid PHP 5.4 warnings.
|
246 |
+
- Bugfix: Some servers with restrictive security filters make database restores fail.
|
247 |
+
- Feature: Add a new restore method to VaultPress_Database.
|
248 |
+
|
249 |
+
## 1.5.2 - 2013-12-26
|
250 |
+
|
251 |
+
- Bugfix: Adding less greedy patterns for cache directories.
|
252 |
+
|
253 |
+
## 1.5.1 - 2013-12-16
|
254 |
+
|
255 |
+
- Feature: Adding file exclusion patterns to avoid backing up cache and backup directories.
|
256 |
+
|
257 |
+
## 1.5 - 2013-12-11
|
258 |
+
|
259 |
+
- Bugfix: Don't show admin notices on the about page.
|
260 |
+
|
261 |
+
## 1.4.9 - 2013-10-10
|
262 |
+
|
263 |
+
- Bugfix: Clean up PHP5 strict warnings.
|
264 |
+
|
265 |
+
## 1.4.8 - 2013-07-15
|
266 |
+
|
267 |
+
- Feature: Include styles and images with the plugin instead of loading them externally.
|
268 |
+
|
269 |
+
## 1.4.7 - 2013-07-02
|
270 |
+
|
271 |
+
- Bugfix: Some servers have SSL configuration problems, which breaks the plugin when SSL verification is enforced.
|
272 |
+
|
273 |
+
## 1.4.6 - 2013-06-26
|
274 |
+
|
275 |
+
- Bugfix: PHP 5.4 notices
|
276 |
+
- Feature: Add the possibility to ignore frequent updates on some postmeta keys.
|
277 |
+
|
278 |
+
## 1.3.9 - 2013-06-26
|
279 |
+
|
280 |
+
- Feature: Request decoding (base64/rot13)
|
281 |
+
- Feature: Response encoding (base64/rot13)
|
282 |
+
|
283 |
+
## 1.3.8 - 2013-06-26
|
284 |
+
|
285 |
+
- Bugfix: Validate IPv4-mapped IPv6 addresses in the internal firewall.
|
286 |
+
- Bugfix: Fix hooks not being properly added under certain circumstances.
|
287 |
+
|
288 |
+
## 1.3.7 - 2013-06-26
|
289 |
+
|
290 |
+
- Bugfix: Protect against infinite loop due to a PHP bug.
|
291 |
+
- Bugfix: Encode remote ping requests.
|
292 |
+
|
293 |
+
## 1.0 - 2013-06-25
|
294 |
+
|
295 |
+
- First public release!
|
class.vaultpress-cli.php
CHANGED
@@ -1,4 +1,9 @@
|
|
1 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
WP_CLI::add_command( 'vaultpress', 'VaultPress_CLI' );
|
4 |
|
1 |
+
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
|
2 |
+
/**
|
3 |
+
* WP CLI commands for vaultpress.
|
4 |
+
*
|
5 |
+
* @package automattic/vaultpress
|
6 |
+
*/
|
7 |
|
8 |
WP_CLI::add_command( 'vaultpress', 'VaultPress_CLI' );
|
9 |
|
class.vaultpress-hotfixes.php
CHANGED
@@ -6,123 +6,16 @@ class VaultPress_Hotfixes {
|
|
6 |
function __construct() {
|
7 |
global $wp_version;
|
8 |
|
9 |
-
if ( version_compare( $wp_version, '3.0.2', '<' ) )
|
10 |
-
add_filter( 'query', array( $this, 'r16625' ) );
|
11 |
-
|
12 |
-
if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST && version_compare( $wp_version, '4.3.1', '<' ) )
|
13 |
-
add_action( 'xmlrpc_call', array( $this, 'filter_xmlrpc_methods' ) );
|
14 |
-
|
15 |
-
if ( version_compare( $wp_version, '3.3.2', '<' ) ) {
|
16 |
-
add_filter( 'pre_kses', array( $this, 'r17172_wp_kses' ), 1, 3 );
|
17 |
-
add_filter( 'clean_url', array( $this, 'r17172_esc_url' ), 1, 3 );
|
18 |
-
}
|
19 |
-
|
20 |
-
if ( version_compare( $wp_version, '3.1.3', '<' ) ) {
|
21 |
-
add_filter( 'sanitize_file_name', array( $this, 'r17990' ) );
|
22 |
-
|
23 |
-
if ( ! empty( $_POST ) ) {
|
24 |
-
$this->r17994( $_POST );
|
25 |
-
}
|
26 |
-
// Protect add_meta, update_meta used by the XML-RPC API.
|
27 |
-
add_filter( 'wp_xmlrpc_server_class', 'r17994_xmlrpc_server' );
|
28 |
-
|
29 |
-
// clean post_mime_type and guid (r17994)
|
30 |
-
add_filter( 'pre_post_mime_type', array( $this, 'r17994_sanitize_mime_type' ) );
|
31 |
-
add_filter( 'post_mime_type', array( $this, 'r17994_sanitize_mime_type' ) );
|
32 |
-
add_filter( 'pre_post_guid', 'esc_url_raw' );
|
33 |
-
add_filter( 'post_guid', 'esc_url' );
|
34 |
-
}
|
35 |
-
|
36 |
-
if ( version_compare( $wp_version, '3.1.4', '<' ) ) {
|
37 |
-
add_filter( 'wp_insert_post_data', array( $this, 'r18368' ), 1, 2 );
|
38 |
-
|
39 |
-
// Add click jacking protection
|
40 |
-
// login_init does not exist before 17826.
|
41 |
-
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login';
|
42 |
-
add_action( 'login_form_' . $action, array( $this, 'r17826_send_frame_options_header' ), 10, 0 );
|
43 |
-
add_action( 'admin_init', array( $this, 'r17826_send_frame_options_header' ), 10, 0 );
|
44 |
-
|
45 |
-
add_filter( 'sanitize_option_WPLANG', array( $this, 'r18346_sanitize_lang_on_save' ) );
|
46 |
-
add_filter( 'sanitize_option_new_admin_email', array( $this, 'r18346_sanitize_admin_email_on_save' ) );
|
47 |
-
}
|
48 |
add_filter( 'option_new_admin_email', array( $this, 'r18346_sanitize_admin_email' ) );
|
49 |
|
50 |
-
if ( version_compare( $wp_version, '3.3.2', '<' ) ) {
|
51 |
-
remove_filter( 'comment_text', 'make_clickable' );
|
52 |
-
add_filter( 'comment_text', array( $this, 'r20493_make_clickable' ), 9 );
|
53 |
-
|
54 |
-
add_filter( 'comment_post_redirect', array( $this, 'r20486_comment_post_redirect' ) );
|
55 |
-
}
|
56 |
-
|
57 |
-
// WooThemes < 3.8.3, foxypress, asset-manager, wordpress-member-private-conversation.
|
58 |
-
$end_execution = false;
|
59 |
-
if ( isset( $_SERVER['SCRIPT_FILENAME'] ) )
|
60 |
-
foreach ( array( 'preview-shortcode-external.php', 'uploadify.php', 'doupload.php', 'cef-upload.php', 'upload.php' ) as $vulnerable_script ) {
|
61 |
-
if ( $vulnerable_script == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
|
62 |
-
switch ( $vulnerable_script ) {
|
63 |
-
case 'upload.php':
|
64 |
-
$pma_config_file = realpath( dirname( $_SERVER['SCRIPT_FILENAME'] ) . DIRECTORY_SEPARATOR . 'paam-config-ajax.php' );
|
65 |
-
if ( false === $pma_config_file || ! in_array( $pma_config_file, get_included_files() ) ) {
|
66 |
-
break;
|
67 |
-
}
|
68 |
-
default:
|
69 |
-
$end_execution = true;
|
70 |
-
break 2;
|
71 |
-
}
|
72 |
-
}
|
73 |
-
}
|
74 |
-
if ( $end_execution )
|
75 |
-
die( 'Disabled for security reasons' );
|
76 |
-
|
77 |
-
if ( version_compare( $wp_version, '3.3.2', '>') && version_compare( $wp_version, '3.4.1', '<' ) ) {
|
78 |
-
add_filter( 'map_meta_cap', array( $this, 'r21138_xmlrpc_edit_posts' ), 10, 4 );
|
79 |
-
add_action( 'map_meta_cap', array( $this, 'r21152_unfiltered_html' ), 10, 4 );
|
80 |
-
}
|
81 |
-
|
82 |
-
// https://core.trac.wordpress.org/changeset/21083
|
83 |
-
if ( version_compare( $wp_version, '3.3', '>=') && version_compare( $wp_version, '3.3.3', '<' ) )
|
84 |
-
add_filter( 'editable_slug', 'esc_textarea' );
|
85 |
-
|
86 |
-
if ( version_compare( $wp_version, '4.1', '>=' ) && version_compare( $wp_version, '4.1.2', '<' ) )
|
87 |
-
add_filter( 'wp_check_filetype_and_ext', array( $this, 'wp_check_filetype_and_ext' ), 20, 4 );
|
88 |
-
|
89 |
-
if ( version_compare( $wp_version, '4.2', '<=' ) )
|
90 |
-
add_filter( 'preprocess_comment', array( $this, 'filter_long_comment_xss' ), 10, 1 );
|
91 |
-
|
92 |
add_filter( 'get_pagenum_link', array( $this, 'get_pagenum_link' ) );
|
93 |
|
94 |
-
add_filter( 'jetpack_xmlrpc_methods', array( $this, 'disable_jetpack_xmlrpc_methods_293' ), 20, 3 );
|
95 |
-
add_filter( 'xmlrpc_methods', array( $this, 'disable_xmlrpc_methods_293' ), 20 );
|
96 |
-
|
97 |
// Protect All-in-one SEO from non-authorized users making changes, and script injection attacks.
|
98 |
add_action( 'wp_ajax_aioseop_ajax_save_meta', array( $this, 'protect_aioseo_ajax' ), 1 );
|
99 |
|
100 |
-
// Protect The MailPoet plugin (wysija-newsletters) from remote file upload. Affects versions <= 2.6.6
|
101 |
-
add_action( 'admin_init', array( $this , 'protect_wysija_newsletters_verify_capability' ), 1 );
|
102 |
-
|
103 |
-
// Protect the Revolution Slider plugin (revslider) from local file inclusion. Affects versions < 4.2
|
104 |
-
add_action( 'init', array( $this , 'protect_revslider_lfi' ), 1 );
|
105 |
-
|
106 |
// Protect WooCommerce from object injection via PayPal IPN notifications. Affects 2.0.20 -> 2.3.10
|
107 |
add_action( 'init', array( $this , 'protect_woocommerce_paypal_object_injection' ), 1 );
|
108 |
|
109 |
-
// Protect Jetpack from comments-based XSS attack
|
110 |
-
add_action( 'plugins_loaded', array( $this, 'protect_jetpack_402_from_oembed_xss' ), 1 );
|
111 |
-
|
112 |
-
if ( version_compare( $wp_version, '3.1', '>=') && version_compare( $wp_version, '4.3', '<=' ) ) {
|
113 |
-
if ( is_admin() ) {
|
114 |
-
add_filter( 'user_email', array( $this, 'patch_user_email' ), 10 , 3 );
|
115 |
-
}
|
116 |
-
|
117 |
-
remove_shortcode( 'wp_caption' );
|
118 |
-
remove_shortcode( 'caption' );
|
119 |
-
add_shortcode( 'wp_caption', array( $this, 'filtered_caption_shortcode' ) );
|
120 |
-
add_shortcode( 'caption', array( $this, 'filtered_caption_shortcode' ) );
|
121 |
-
}
|
122 |
-
|
123 |
-
// Protect Akismet < 3.1.5 from stored XSS in admin page
|
124 |
-
add_filter( 'init', array( $this, 'protect_akismet_comment_xss' ), 50 );
|
125 |
-
|
126 |
if ( version_compare( $wp_version, '4.7.1', '<=' ) ) {
|
127 |
// Protect WordPress 4.4 - 4.7.1 against WP REST type abuse
|
128 |
if ( version_compare( $wp_version, '4.4', '>=' ) ) {
|
@@ -159,216 +52,14 @@ class VaultPress_Hotfixes {
|
|
159 |
return( wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) );
|
160 |
}
|
161 |
|
162 |
-
function protect_jetpack_402_from_oembed_xss() {
|
163 |
-
if ( $this->needs_jetpack_402_fix() ) {
|
164 |
-
add_filter( 'jetpack_comments_allow_oembed', array( $this, 'disable_jetpack_oembed' ) );
|
165 |
-
}
|
166 |
-
}
|
167 |
-
|
168 |
-
function needs_jetpack_402_fix() {
|
169 |
-
if ( ! defined( 'JETPACK__VERSION' ) ) {
|
170 |
-
return false;
|
171 |
-
}
|
172 |
-
|
173 |
-
if ( version_compare( JETPACK__VERSION, '2.0.7', '<' ) ) {
|
174 |
-
return true;
|
175 |
-
}
|
176 |
-
|
177 |
-
if ( version_compare( JETPACK__VERSION, '4.0.2', '>' ) ) {
|
178 |
-
return false;
|
179 |
-
}
|
180 |
-
|
181 |
-
$secure_jetpacks = array(
|
182 |
-
'2.1' => '2.1.5',
|
183 |
-
'2.2' => '2.2.8',
|
184 |
-
'2.3' => '2.3.8',
|
185 |
-
'2.4' => '2.4.5',
|
186 |
-
'2.5' => '2.5.3',
|
187 |
-
'2.6' => '2.6.4',
|
188 |
-
'2.7' => '2.7.3',
|
189 |
-
'2.8' => '2.8.3',
|
190 |
-
'2.9' => '2.9.4',
|
191 |
-
'3.0' => '3.0.4',
|
192 |
-
'3.1' => '3.1.3',
|
193 |
-
'3.2' => '3.2.3',
|
194 |
-
'3.3' => '3.3.4',
|
195 |
-
'3.4' => '3.4.4',
|
196 |
-
'3.5' => '3.5.4',
|
197 |
-
'3.6' => '3.6.2',
|
198 |
-
'3.7' => '3.7.3',
|
199 |
-
'3.8' => '3.8.3',
|
200 |
-
'3.9' => '3.9.7',
|
201 |
-
'4.0' => '4.0.3',
|
202 |
-
);
|
203 |
-
|
204 |
-
$parts = explode( '.', JETPACK__VERSION, 3 );
|
205 |
-
if ( count( $parts ) < 2 ) {
|
206 |
-
// no/not enough periods in the version;
|
207 |
-
return false;
|
208 |
-
}
|
209 |
-
|
210 |
-
// pull out the first two components, cast to int to get rid of weird 'beta2' junk
|
211 |
-
$int_parts = array();
|
212 |
-
$int_parts[0] = intval( $parts[0] );
|
213 |
-
$int_parts[1] = intval( $parts[1] );
|
214 |
-
|
215 |
-
// and find the secure version for this branch
|
216 |
-
$branch = sprintf( '%d.%d', $int_parts[0], $int_parts[1] );
|
217 |
-
if ( ! isset( $secure_jetpacks[ $branch ] ) ) {
|
218 |
-
return false;
|
219 |
-
}
|
220 |
-
return version_compare( JETPACK__VERSION, $secure_jetpacks[ $branch ], '<' );
|
221 |
-
}
|
222 |
-
|
223 |
function disable_jetpack_oembed( $enabled ) {
|
224 |
return false;
|
225 |
}
|
226 |
|
227 |
-
function filter_long_comment_xss( $commentdata ) {
|
228 |
-
if ( strlen( $commentdata['comment_content'] ) > 65500 )
|
229 |
-
wp_die( 'Comment too long', 'Invalid comment' );
|
230 |
-
|
231 |
-
return $commentdata;
|
232 |
-
}
|
233 |
-
|
234 |
-
function wp_check_filetype_and_ext( $filetype, $file, $filename, $mimes ) {
|
235 |
-
if ( empty( $mimes ) )
|
236 |
-
$mimes = get_allowed_mime_types();
|
237 |
-
$type = false;
|
238 |
-
$ext = false;
|
239 |
-
foreach ( $mimes as $ext_preg => $mime_match ) {
|
240 |
-
$ext_preg = '!\.(' . $ext_preg . ')$!i';
|
241 |
-
if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
|
242 |
-
$type = $mime_match;
|
243 |
-
$ext = $ext_matches[1];
|
244 |
-
break;
|
245 |
-
}
|
246 |
-
}
|
247 |
-
$filetype['ext'] = $ext;
|
248 |
-
$filetype['type'] = $type;
|
249 |
-
return $filetype;
|
250 |
-
}
|
251 |
-
|
252 |
-
function disable_jetpack_xmlrpc_methods_293( $jetpack_methods, $core_methods, $user = false ) {
|
253 |
-
if ( $this->needs_jetpack_293_fix() && !$user )
|
254 |
-
unset( $jetpack_methods['jetpack.jsonAPI'], $jetpack_methods['jetpack.verifyAction'] );
|
255 |
-
return $jetpack_methods;
|
256 |
-
}
|
257 |
-
|
258 |
-
function disable_xmlrpc_methods_293( $core_methods ) {
|
259 |
-
if ( $this->needs_jetpack_293_fix() )
|
260 |
-
unset( $core_methods['jetpack.verifyAction'] );
|
261 |
-
return $core_methods;
|
262 |
-
}
|
263 |
-
|
264 |
-
function needs_jetpack_293_fix() {
|
265 |
-
if ( ! defined( 'JETPACK__VERSION' ) )
|
266 |
-
return false;
|
267 |
-
$secure_jetpacks = array(
|
268 |
-
'1.9' => '1.9.3',
|
269 |
-
'2.0' => '2.0.5',
|
270 |
-
'2.1' => '2.1.3',
|
271 |
-
'2.2' => '2.2.6',
|
272 |
-
'2.3' => '2.3.6',
|
273 |
-
'2.4' => '2.4.3',
|
274 |
-
'2.5' => '2.5.1',
|
275 |
-
'2.6' => '2.6.2',
|
276 |
-
'2.7' => '2.7.1',
|
277 |
-
'2.8' => '2.8.1',
|
278 |
-
'2.9' => '2.9.3',
|
279 |
-
);
|
280 |
-
$float_version = (string) floatval( JETPACK__VERSION );
|
281 |
-
if ( ! isset( $secure_jetpacks[ $float_version ] ) )
|
282 |
-
return false;
|
283 |
-
return version_compare( JETPACK__VERSION, $secure_jetpacks[ $float_version ], '<' );
|
284 |
-
}
|
285 |
-
|
286 |
-
function r21138_xmlrpc_edit_posts( $caps, $cap, $user_id, $args ) {
|
287 |
-
if ( ! isset( $args[0] ) || isset( $args[1] ) && $args[1] === 'hotfixed' )
|
288 |
-
return $caps;
|
289 |
-
foreach ( get_post_types( array(), 'objects' ) as $post_type_object ) {
|
290 |
-
if ( $cap === $post_type_object->cap->edit_posts )
|
291 |
-
return map_meta_cap( $post_type_object->cap->edit_post, $user_id, $args[0], 'hotfixed' );
|
292 |
-
}
|
293 |
-
return $caps;
|
294 |
-
}
|
295 |
-
|
296 |
-
function r21152_unfiltered_html( $caps, $cap, $user_id, $args ) {
|
297 |
-
if ( $cap !== 'unfiltered_html' )
|
298 |
-
return $caps;
|
299 |
-
if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML )
|
300 |
-
return $caps;
|
301 |
-
$key = array_search( 'do_not_allow', $caps );
|
302 |
-
if ( false !== $key )
|
303 |
-
return $caps;
|
304 |
-
if ( is_multisite() && ! is_super_admin( $user_id ) )
|
305 |
-
$caps[$key] = 'do_not_allow';
|
306 |
-
return $caps;
|
307 |
-
}
|
308 |
-
|
309 |
function get_pagenum_link( $url ) {
|
310 |
return esc_url_raw( $url );
|
311 |
}
|
312 |
|
313 |
-
function r20486_comment_post_redirect( $location ) {
|
314 |
-
$location = wp_sanitize_redirect( $location );
|
315 |
-
$location = wp_validate_redirect( $location, admin_url() );
|
316 |
-
|
317 |
-
return $location;
|
318 |
-
}
|
319 |
-
|
320 |
-
function r20493_make_clickable( $text ) {
|
321 |
-
$r = '';
|
322 |
-
$textarr = preg_split( '/(<[^<>]+>)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // split out HTML tags
|
323 |
-
foreach ( $textarr as $piece ) {
|
324 |
-
if ( empty( $piece ) || ( $piece[0] == '<' && ! preg_match('|^<\s*[\w]{1,20}+://|', $piece) ) ) {
|
325 |
-
$r .= $piece;
|
326 |
-
continue;
|
327 |
-
}
|
328 |
-
|
329 |
-
// Long strings might contain expensive edge cases ...
|
330 |
-
if ( 10000 < strlen( $piece ) ) {
|
331 |
-
// ... break it up
|
332 |
-
foreach ( $this->r20493_split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
|
333 |
-
if ( 2101 < strlen( $chunk ) ) {
|
334 |
-
$r .= $chunk; // Too big, no whitespace: bail.
|
335 |
-
} else {
|
336 |
-
$r .= $this->r20493_make_clickable( $chunk );
|
337 |
-
}
|
338 |
-
}
|
339 |
-
} else {
|
340 |
-
$ret = " $piece "; // Pad with whitespace to simplify the regexes
|
341 |
-
|
342 |
-
$url_clickable = '~
|
343 |
-
([\\s(<.,;:!?]) # 1: Leading whitespace, or punctuation
|
344 |
-
( # 2: URL
|
345 |
-
[\\w]{1,20}+:// # Scheme and hier-part prefix
|
346 |
-
(?=\S{1,2000}\s) # Limit to URLs less than about 2000 characters long
|
347 |
-
[\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]*+ # Non-punctuation URL character
|
348 |
-
(?: # Unroll the Loop: Only allow puctuation URL character if followed by a non-punctuation URL character
|
349 |
-
[\'.,;:!?)] # Punctuation URL character
|
350 |
-
[\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]++ # Non-punctuation URL character
|
351 |
-
)*
|
352 |
-
)
|
353 |
-
(\)?) # 3: Trailing closing parenthesis (for parethesis balancing post processing)
|
354 |
-
~xS'; // The regex is a non-anchored pattern and does not have a single fixed starting character.
|
355 |
-
// Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
|
356 |
-
|
357 |
-
$ret = preg_replace_callback( $url_clickable, array( $this, 'r20493_make_url_clickable_cb') , $ret );
|
358 |
-
|
359 |
-
$ret = preg_replace_callback( '#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret );
|
360 |
-
$ret = preg_replace_callback( '#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret );
|
361 |
-
|
362 |
-
$ret = substr( $ret, 1, -1 ); // Remove our whitespace padding.
|
363 |
-
$r .= $ret;
|
364 |
-
}
|
365 |
-
}
|
366 |
-
|
367 |
-
// Cleanup of accidental links within links
|
368 |
-
$r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
|
369 |
-
return $r;
|
370 |
-
}
|
371 |
-
|
372 |
function r20493_make_url_clickable_cb($matches) {
|
373 |
$url = $matches[2];
|
374 |
|
@@ -421,280 +112,10 @@ class VaultPress_Hotfixes {
|
|
421 |
return $chunks;
|
422 |
}
|
423 |
|
424 |
-
function r16625( $query ) {
|
425 |
-
// Hotfixes: http://core.trac.wordpress.org/changeset/16625
|
426 |
-
|
427 |
-
// Punt as fast as possible if this isn't an UPDATE
|
428 |
-
if ( substr( $query, 0, 6 ) != "UPDATE" )
|
429 |
-
return $query;
|
430 |
-
global $wpdb;
|
431 |
-
|
432 |
-
// Determine what the prefix of the bad query would look like and punt if this query doesn't match
|
433 |
-
$badstring = "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '";
|
434 |
-
if ( substr( $query, 0, strlen( $badstring ) ) != $badstring )
|
435 |
-
return $query;
|
436 |
-
|
437 |
-
// Pull the post_id which is the last thing in the origin query, after a space, no quotes
|
438 |
-
$query_parts = explode( " ", $query );
|
439 |
-
$post_id = array_pop( $query_parts );
|
440 |
-
|
441 |
-
// Chop off the beginning and end of the original query to get our unsanitized $tb_ping
|
442 |
-
$tb_ping = substr(
|
443 |
-
$query,
|
444 |
-
strlen( $badstring ),
|
445 |
-
(
|
446 |
-
strlen( $query ) - (
|
447 |
-
strlen( $badstring ) + strlen( sprintf( "', '')) WHERE ID = %d", $post_id ) )
|
448 |
-
)
|
449 |
-
)
|
450 |
-
);
|
451 |
-
|
452 |
-
// Return the fixed query
|
453 |
-
return $wpdb->prepare( "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $tb_ping, $post_id );
|
454 |
-
}
|
455 |
-
|
456 |
-
function filter_xmlrpc_methods( $xmlrpc_method ) {
|
457 |
-
// Hotfixes: http://core.trac.wordpress.org/changeset/16803
|
458 |
-
global $wp_xmlrpc_server;
|
459 |
-
// Pretend that we are an xmlrpc method, freshly called
|
460 |
-
$args = $wp_xmlrpc_server->message->params;
|
461 |
-
$error_code = 401;
|
462 |
-
switch( $xmlrpc_method ) {
|
463 |
-
case 'metaWeblog.newPost':
|
464 |
-
$content_struct = $args[3];
|
465 |
-
$publish = isset( $args[4] ) ? $args[4] : 0;
|
466 |
-
if ( !empty( $content_struct['post_type'] ) ) {
|
467 |
-
if ( $content_struct['post_type'] == 'page' ) {
|
468 |
-
if ( $publish || 'publish' == $content_struct['page_status'] )
|
469 |
-
$cap = 'publish_pages';
|
470 |
-
else
|
471 |
-
$cap = 'edit_pages';
|
472 |
-
$error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
|
473 |
-
} elseif ( $content_struct['post_type'] == 'post' ) {
|
474 |
-
if ( $publish || 'publish' == $content_struct['post_status'] )
|
475 |
-
$cap = 'publish_posts';
|
476 |
-
else
|
477 |
-
$cap = 'edit_posts';
|
478 |
-
$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
|
479 |
-
} else {
|
480 |
-
$error_message = __( 'Invalid post type.' );
|
481 |
-
}
|
482 |
-
} else {
|
483 |
-
if ( $publish || 'publish' == $content_struct['post_status'] )
|
484 |
-
$cap = 'publish_posts';
|
485 |
-
else
|
486 |
-
$cap = 'edit_posts';
|
487 |
-
$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
|
488 |
-
}
|
489 |
-
if ( current_user_can( $cap ) )
|
490 |
-
return true;
|
491 |
-
break;
|
492 |
-
case 'metaWeblog.editPost':
|
493 |
-
$post_ID = (int) $args[0];
|
494 |
-
$content_struct = $args[3];
|
495 |
-
$publish = $args[4] || ( isset( $content_struct['post_status'] ) && in_array( $content_struct['post_status'], array( 'publish', 'private' ) ) );
|
496 |
-
$cap = ( $publish ) ? 'publish_posts' : 'edit_posts';
|
497 |
-
$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
|
498 |
-
if ( !empty( $content_struct['post_type'] ) ) {
|
499 |
-
if ( $content_struct['post_type'] == 'page' ) {
|
500 |
-
$error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
|
501 |
-
} elseif ( $content_struct['post_type'] == 'post' ) {
|
502 |
-
$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
|
503 |
-
} else {
|
504 |
-
$error_message = __( 'Invalid post type.' );
|
505 |
-
}
|
506 |
-
}
|
507 |
-
if ( current_user_can( $cap ) )
|
508 |
-
return true;
|
509 |
-
break;
|
510 |
-
case 'mt.publishPost':
|
511 |
-
$post_ID = (int) $args[0];
|
512 |
-
if ( current_user_can( 'publish_posts' ) && current_user_can( 'edit_post', $post_ID ) )
|
513 |
-
return true;
|
514 |
-
$error_message = __( 'Sorry, you cannot edit this post.' );
|
515 |
-
break;
|
516 |
-
case 'blogger.deletePost':
|
517 |
-
$post_ID = (int) $args[1];
|
518 |
-
if ( current_user_can( 'delete_post', $post_ID ) )
|
519 |
-
return true;
|
520 |
-
$error_message = __( 'Sorry, you do not have the right to delete this post.' );
|
521 |
-
break;
|
522 |
-
case 'wp.getPageStatusList':
|
523 |
-
if ( current_user_can( 'edit_pages' ) )
|
524 |
-
return true;
|
525 |
-
$error_code = 403;
|
526 |
-
$error_message = __( 'You are not allowed access to details about this site.' );
|
527 |
-
break;
|
528 |
-
case 'wp.deleteComment':
|
529 |
-
case 'wp.editComment':
|
530 |
-
$comment_ID = (int) $args[3];
|
531 |
-
if ( !$comment = get_comment( $comment_ID ) )
|
532 |
-
return true; // This will be handled in the calling function explicitly
|
533 |
-
if ( current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
534 |
-
return true;
|
535 |
-
$error_code = 403;
|
536 |
-
$error_message = __( 'You are not allowed to moderate comments on this site.' );
|
537 |
-
break;
|
538 |
-
default:
|
539 |
-
return true;
|
540 |
-
}
|
541 |
-
// If we are here then this was a handlable xmlrpc call and the capability checks above all failed
|
542 |
-
// ( otherwise they would have returned to the do_action from the switch statement above ) so it's
|
543 |
-
// time to exit with whatever error we've determined is the problem (thus short circuiting the
|
544 |
-
// original XMLRPC method call, and enforcing the above capability checks -- with an ax. We'll
|
545 |
-
// mimic the behavior from the end of IXR_Server::serve()
|
546 |
-
$r = new IXR_Error( $error_code, $error_message );
|
547 |
-
$resultxml = $r->getXml();
|
548 |
-
$xml = <<<EOD
|
549 |
-
<methodResponse>
|
550 |
-
<params>
|
551 |
-
<param>
|
552 |
-
<value>
|
553 |
-
$resultxml
|
554 |
-
</value>
|
555 |
-
</param>
|
556 |
-
</params>
|
557 |
-
</methodResponse>
|
558 |
-
EOD;
|
559 |
-
$wp_xmlrpc_server->output( $xml );
|
560 |
-
// For good measure...
|
561 |
-
die();
|
562 |
-
}
|
563 |
-
|
564 |
-
function r17172_esc_url( $url, $original_url, $_context ) {
|
565 |
-
$url = $original_url;
|
566 |
-
|
567 |
-
if ( '' == $url )
|
568 |
-
return $url;
|
569 |
-
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
|
570 |
-
$strip = array('%0d', '%0a', '%0D', '%0A');
|
571 |
-
$url = _deep_replace($strip, $url);
|
572 |
-
$url = str_replace(';//', '://', $url);
|
573 |
-
/* If the URL doesn't appear to contain a scheme, we
|
574 |
-
* presume it needs http:// appended (unless a relative
|
575 |
-
* link starting with /, # or ? or a php file).
|
576 |
-
*/
|
577 |
-
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
|
578 |
-
! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
|
579 |
-
$url = 'http://' . $url;
|
580 |
-
|
581 |
-
// Replace ampersands and single quotes only when displaying.
|
582 |
-
if ( 'display' == $_context ) {
|
583 |
-
$url = wp_kses_normalize_entities( $url );
|
584 |
-
$url = str_replace( '&', '&', $url );
|
585 |
-
$url = str_replace( "'", ''', $url );
|
586 |
-
}
|
587 |
-
|
588 |
-
$protocols = array ('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');
|
589 |
-
if ( VaultPress_kses::wp_kses_bad_protocol( $url, $protocols ) != $url )
|
590 |
-
return '';
|
591 |
-
return $url;
|
592 |
-
}
|
593 |
-
|
594 |
-
// http://core.trac.wordpress.org/changeset/17172
|
595 |
-
// http://core.trac.wordpress.org/changeset/20541
|
596 |
-
function r17172_wp_kses( $string, $html, $protocols ) {
|
597 |
-
return VaultPress_kses::wp_kses( $string, $html, $protocols );
|
598 |
-
}
|
599 |
-
|
600 |
-
// http://core.trac.wordpress.org/changeset/17990
|
601 |
-
function r17990( $filename ) {
|
602 |
-
$parts = explode('.', $filename);
|
603 |
-
$filename = array_shift($parts);
|
604 |
-
$extension = array_pop($parts);
|
605 |
-
$mimes = get_allowed_mime_types();
|
606 |
-
|
607 |
-
// Loop over any intermediate extensions. Munge them with a trailing underscore if they are a 2 - 5 character
|
608 |
-
// long alpha string not in the extension whitelist.
|
609 |
-
foreach ( (array) $parts as $part) {
|
610 |
-
$filename .= '.' . $part;
|
611 |
-
|
612 |
-
if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) {
|
613 |
-
$allowed = false;
|
614 |
-
foreach ( $mimes as $ext_preg => $mime_match ) {
|
615 |
-
$ext_preg = '!^(' . $ext_preg . ')$!i';
|
616 |
-
if ( preg_match( $ext_preg, $part ) ) {
|
617 |
-
$allowed = true;
|
618 |
-
break;
|
619 |
-
}
|
620 |
-
}
|
621 |
-
if ( !$allowed )
|
622 |
-
$filename .= '_';
|
623 |
-
}
|
624 |
-
}
|
625 |
-
$filename .= '.' . $extension;
|
626 |
-
return $filename;
|
627 |
-
}
|
628 |
-
|
629 |
-
/*
|
630 |
-
* Hotfixes: http://core.trac.wordpress.org/changeset/18368
|
631 |
-
*/
|
632 |
-
function r18368( $post, $raw_post ) {
|
633 |
-
if ( isset( $post['filter'] ) || isset ( $raw_post['filter'] ) ) {
|
634 |
-
unset( $post['filter'], $raw_post['filter'] ); // to ensure the post is properly sanitized
|
635 |
-
$post = sanitize_post($post, 'db');
|
636 |
-
}
|
637 |
-
if ( empty( $post['ID'] ) )
|
638 |
-
unset( $post['ID'] ); // sanitize_post
|
639 |
-
unset( $post['filter'] ); // sanitize_post
|
640 |
-
return $post;
|
641 |
-
}
|
642 |
-
|
643 |
-
/**
|
644 |
-
* Protect WordPress internal metadata.
|
645 |
-
*
|
646 |
-
* The post data is passed as a parameter to (unit) test this method.
|
647 |
-
* @param $post_data|array the $_POST array.
|
648 |
-
*/
|
649 |
-
function r17994( &$post_data ) {
|
650 |
-
// Protect admin-ajax add_meta
|
651 |
-
$metakeyselect = isset( $post_data['metakeyselect'] ) ? stripslashes( trim( $post_data['metakeyselect'] ) ) : '';
|
652 |
-
$metakeyinput = isset( $post_data['metakeyinput'] ) ? stripslashes( trim( $post_data['metakeyinput'] ) ) : '';
|
653 |
-
|
654 |
-
if ( ( $metakeyselect && '_' == $metakeyselect[0] ) || ( $metakeyinput && '_' == $metakeyinput[0] ) ) {
|
655 |
-
unset( $_POST['metakeyselect'], $_POST['metakeyinput'] );
|
656 |
-
}
|
657 |
-
|
658 |
-
// Protect admin-ajax update_meta
|
659 |
-
if ( isset( $post_data['meta'] ) ) {
|
660 |
-
foreach ( (array)$post_data['meta'] as $mid => $value ) {
|
661 |
-
$key = stripslashes( $post_data['meta'][$mid]['key'] );
|
662 |
-
if ( $key && '_' == $key[0] )
|
663 |
-
unset( $post_data['meta'][$mid] );
|
664 |
-
}
|
665 |
-
}
|
666 |
-
}
|
667 |
-
|
668 |
-
function r17994_sanitize_mime_type( $mime_type ) {
|
669 |
-
$sani_mime_type = preg_replace( '/[^\-*.a-zA-Z0-9\/+]/', '', $mime_type );
|
670 |
-
return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
|
671 |
-
}
|
672 |
-
|
673 |
-
function r17826_send_frame_options_header() {
|
674 |
-
@header( 'X-Frame-Options: SAMEORIGIN' );
|
675 |
-
}
|
676 |
-
|
677 |
-
function r18346_sanitize_admin_email_on_save($value) {
|
678 |
-
$value = sanitize_email( $value );
|
679 |
-
if ( !is_email( $value ) ) {
|
680 |
-
$value = get_option( 'new_admin_email' ); // Resets option to stored value in the case of failed sanitization
|
681 |
-
if ( function_exists( 'add_settings_error' ) )
|
682 |
-
add_settings_error( 'new_admin_email', 'invalid_admin_email', __( 'The email address entered did not appear to be a valid email address. Please enter a valid email address.' ) );
|
683 |
-
}
|
684 |
-
return $value;
|
685 |
-
}
|
686 |
-
|
687 |
function r18346_sanitize_admin_email( $value ) {
|
688 |
return sanitize_email( $value ); // Is it enough ?
|
689 |
}
|
690 |
|
691 |
-
function r18346_sanitize_lang_on_save( $value ) {
|
692 |
-
$value = $this->r18346_sanitize_lang( $value ); // sanitize the new value.
|
693 |
-
if ( empty( $value ) )
|
694 |
-
$value = get_option( 'WPLANG' );
|
695 |
-
return $value;
|
696 |
-
}
|
697 |
-
|
698 |
function r18346_sanitize_lang( $value ) {
|
699 |
$allowed = apply_filters( 'available_languages', get_available_languages() ); // add a filter to unit test
|
700 |
if ( !empty( $value ) && !in_array( $value, $allowed ) )
|
@@ -723,61 +144,6 @@ EOD;
|
|
723 |
$_POST['new_meta'] = strip_tags( $_POST['new_meta'] );
|
724 |
}
|
725 |
|
726 |
-
// Protect The MailPoet plugin (wysija-newsletters) from remote file upload. Affects versions <= 2.6.6
|
727 |
-
function protect_wysija_newsletters_verify_capability() {
|
728 |
-
if ( !class_exists( 'WYSIJA_object' ) )
|
729 |
-
return true;
|
730 |
-
if ( version_compare( WYSIJA::get_version(), '2.6.7', '>=' ) )
|
731 |
-
return true;
|
732 |
-
if ( !defined( 'DOING_AJAX' ) && !defined( 'WYSIJA_ITF' ) )
|
733 |
-
return true;
|
734 |
-
if( isset( $_REQUEST['page'] ) && substr( $_REQUEST['page'] ,0 ,7 ) == 'wysija_' ){
|
735 |
-
|
736 |
-
switch( $_REQUEST['page'] ){
|
737 |
-
case 'wysija_campaigns':
|
738 |
-
$role_needed = 'wysija_newsletters';
|
739 |
-
break;
|
740 |
-
case 'wysija_subscribers':
|
741 |
-
$role_needed = 'wysija_subscribers';
|
742 |
-
break;
|
743 |
-
case 'wysija_config':
|
744 |
-
$role_needed = 'wysija_config';
|
745 |
-
break;
|
746 |
-
case 'wysija_statistics':
|
747 |
-
$role_needed = 'wysija_stats_dashboard';
|
748 |
-
break;
|
749 |
-
default:
|
750 |
-
$role_needed = 'switch_themes';
|
751 |
-
}
|
752 |
-
|
753 |
-
if( current_user_can( $role_needed ) ){
|
754 |
-
return true;
|
755 |
-
} else{
|
756 |
-
die( 'You are not allowed here.' );
|
757 |
-
}
|
758 |
-
|
759 |
-
}else{
|
760 |
-
// this is not a wysija interface/action we can let it pass
|
761 |
-
return true;
|
762 |
-
}
|
763 |
-
}
|
764 |
-
|
765 |
-
// Protect the Revolution Slider plugin (revslider) from local file inclusion. Affects versions < 4.2
|
766 |
-
function protect_revslider_lfi() {
|
767 |
-
if ( isset( $_GET['action'] ) && 'revslider_show_image' == $_GET['action'] ) {
|
768 |
-
$img = '';
|
769 |
-
if ( isset( $_GET['img'] ) )
|
770 |
-
$img = $_GET['img'];
|
771 |
-
if ( is_numeric( $img ) )
|
772 |
-
return;
|
773 |
-
$validate = validate_file( $img );
|
774 |
-
if ( 0 !== $validate )
|
775 |
-
die( 'invalid file' );
|
776 |
-
if ( !file_exists( $img ) )
|
777 |
-
die( 'file does not exist' );
|
778 |
-
}
|
779 |
-
}
|
780 |
-
|
781 |
// Protect WooCommerce 2.0.20 - 2.3.10 from PayPal IPN object injection attack.
|
782 |
function protect_woocommerce_paypal_object_injection() {
|
783 |
global $woocommerce;
|
@@ -797,51 +163,6 @@ EOD;
|
|
797 |
}
|
798 |
}
|
799 |
}
|
800 |
-
|
801 |
-
// Protect WordPress 3.1.0 -> WordPress 4.3.0 from code injection via user email
|
802 |
-
function patch_user_email( $value, $user_id, $context ) {
|
803 |
-
if ( 'display' === $context && class_exists( 'WP_Users_List_Table' ) ) {
|
804 |
-
return esc_attr( $value );
|
805 |
-
}
|
806 |
-
|
807 |
-
return $value;
|
808 |
-
}
|
809 |
-
|
810 |
-
// Protect WordPress < 4.3.1 from evil tags inside caption shortcodes
|
811 |
-
function filtered_caption_shortcode( $attr, $content = null ) {
|
812 |
-
if ( isset( $attr['caption'] ) && strpos( $attr['caption'], '<' ) !== false ) {
|
813 |
-
$attr['caption'] = wp_kses( $attr['caption'], 'post' );
|
814 |
-
}
|
815 |
-
|
816 |
-
return img_caption_shortcode( $attr, $content );
|
817 |
-
}
|
818 |
-
|
819 |
-
// Protect Akismet < 3.1.5 from stored XSS in admin page
|
820 |
-
function protect_akismet_comment_xss() {
|
821 |
-
remove_filter( 'comment_text', array( 'Akismet_Admin', 'text_add_link_class' ) );
|
822 |
-
}
|
823 |
-
}
|
824 |
-
|
825 |
-
global $wp_version;
|
826 |
-
$needs_class_fix = version_compare( $wp_version, '3.1', '>=') && version_compare( $wp_version, '3.1.3', '<' );
|
827 |
-
if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST && $needs_class_fix ) {
|
828 |
-
include_once( ABSPATH . WPINC . '/class-IXR.php' );
|
829 |
-
include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php' );
|
830 |
-
|
831 |
-
class VaultPress_XMLRPC_Server_r17994 extends wp_xmlrpc_server {
|
832 |
-
function set_custom_fields( $post_id, $fields ) {
|
833 |
-
foreach( $fields as $k => $meta ) {
|
834 |
-
$key = stripslashes( trim( $meta['key'] ) );
|
835 |
-
if ( $key && '_' == $key[0] )
|
836 |
-
unset( $fields[$k] );
|
837 |
-
}
|
838 |
-
parent::set_custom_fields( $post_id, $fields );
|
839 |
-
}
|
840 |
-
}
|
841 |
-
|
842 |
-
function r17994_xmlrpc_server() {
|
843 |
-
return 'VaultPress_XMLRPC_Server_r17994';
|
844 |
-
}
|
845 |
}
|
846 |
|
847 |
class VaultPress_kses {
|
6 |
function __construct() {
|
7 |
global $wp_version;
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
add_filter( 'option_new_admin_email', array( $this, 'r18346_sanitize_admin_email' ) );
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
add_filter( 'get_pagenum_link', array( $this, 'get_pagenum_link' ) );
|
12 |
|
|
|
|
|
|
|
13 |
// Protect All-in-one SEO from non-authorized users making changes, and script injection attacks.
|
14 |
add_action( 'wp_ajax_aioseop_ajax_save_meta', array( $this, 'protect_aioseo_ajax' ), 1 );
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
// Protect WooCommerce from object injection via PayPal IPN notifications. Affects 2.0.20 -> 2.3.10
|
17 |
add_action( 'init', array( $this , 'protect_woocommerce_paypal_object_injection' ), 1 );
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
if ( version_compare( $wp_version, '4.7.1', '<=' ) ) {
|
20 |
// Protect WordPress 4.4 - 4.7.1 against WP REST type abuse
|
21 |
if ( version_compare( $wp_version, '4.4', '>=' ) ) {
|
52 |
return( wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) );
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
function disable_jetpack_oembed( $enabled ) {
|
56 |
return false;
|
57 |
}
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
function get_pagenum_link( $url ) {
|
60 |
return esc_url_raw( $url );
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
function r20493_make_url_clickable_cb($matches) {
|
64 |
$url = $matches[2];
|
65 |
|
112 |
return $chunks;
|
113 |
}
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
function r18346_sanitize_admin_email( $value ) {
|
116 |
return sanitize_email( $value ); // Is it enough ?
|
117 |
}
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
function r18346_sanitize_lang( $value ) {
|
120 |
$allowed = apply_filters( 'available_languages', get_available_languages() ); // add a filter to unit test
|
121 |
if ( !empty( $value ) && !in_array( $value, $allowed ) )
|
144 |
$_POST['new_meta'] = strip_tags( $_POST['new_meta'] );
|
145 |
}
|
146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
// Protect WooCommerce 2.0.20 - 2.3.10 from PayPal IPN object injection attack.
|
148 |
function protect_woocommerce_paypal_object_injection() {
|
149 |
global $woocommerce;
|
163 |
}
|
164 |
}
|
165 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
}
|
167 |
|
168 |
class VaultPress_kses {
|
composer.json
CHANGED
@@ -5,19 +5,55 @@
|
|
5 |
"type": "wordpress-plugin",
|
6 |
"license": "GPL-2.0-or-later",
|
7 |
"support": {
|
8 |
-
"issues": "https://github.com/Automattic/
|
9 |
},
|
10 |
"require": {
|
11 |
-
"automattic/jetpack-logo": "1.
|
12 |
-
"automattic/jetpack-autoloader": "
|
13 |
},
|
14 |
"require-dev": {
|
15 |
-
"
|
|
|
16 |
},
|
17 |
"scripts": {
|
18 |
-
"
|
19 |
-
|
20 |
-
|
21 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
}
|
5 |
"type": "wordpress-plugin",
|
6 |
"license": "GPL-2.0-or-later",
|
7 |
"support": {
|
8 |
+
"issues": "https://github.com/Automattic/jetpack/issues"
|
9 |
},
|
10 |
"require": {
|
11 |
+
"automattic/jetpack-logo": "^1.5",
|
12 |
+
"automattic/jetpack-autoloader": "^2.10"
|
13 |
},
|
14 |
"require-dev": {
|
15 |
+
"yoast/phpunit-polyfills": "1.0.2",
|
16 |
+
"automattic/jetpack-changelogger": "^2.0"
|
17 |
},
|
18 |
"scripts": {
|
19 |
+
"phpunit": [
|
20 |
+
"./vendor/phpunit/phpunit/phpunit --colors=always"
|
21 |
+
],
|
22 |
+
"test-coverage": [
|
23 |
+
"@composer install",
|
24 |
+
"phpdbg -d memory_limit=2048M -d max_execution_time=900 -qrr ./vendor/bin/phpunit --coverage-clover \"$COVERAGE_DIR/clover.xml\""
|
25 |
+
],
|
26 |
+
"test-php": [
|
27 |
+
"@composer install",
|
28 |
+
"@composer phpunit"
|
29 |
+
],
|
30 |
+
"build-development": [
|
31 |
+
"Composer\\Config::disableProcessTimeout",
|
32 |
+
"@clean",
|
33 |
+
"@composer install"
|
34 |
+
],
|
35 |
+
"build-production": [
|
36 |
+
"Composer\\Config::disableProcessTimeout",
|
37 |
+
"@clean",
|
38 |
+
"@putenv COMPOSER_MIRROR_PATH_REPOS=1",
|
39 |
+
"@composer install -o --no-dev --classmap-authoritative --prefer-dist"
|
40 |
+
],
|
41 |
+
"clean": [
|
42 |
+
"rm -rf vendor/"
|
43 |
+
]
|
44 |
+
},
|
45 |
+
"repositories": [],
|
46 |
+
"minimum-stability": "dev",
|
47 |
+
"prefer-stable": true,
|
48 |
+
"config": {
|
49 |
+
"autoloader-suffix": "9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta"
|
50 |
+
},
|
51 |
+
"extra": {
|
52 |
+
"mirror-repo": "Automattic/vaultpress",
|
53 |
+
"release-branch-prefix": "vaultpress",
|
54 |
+
"version-constants": {
|
55 |
+
"VAULTPRESS__VERSION": "vaultpress.php"
|
56 |
+
},
|
57 |
+
"wp-plugin-slug": "vaultpress"
|
58 |
}
|
59 |
}
|
cron-tasks.php
CHANGED
@@ -11,8 +11,8 @@ function apply_filters_ref_array($tag, $args) {
|
|
11 |
|
12 |
// Do 'all' actions first
|
13 |
if ( isset($wp_filter['all']) ) {
|
14 |
-
$wp_current_filter[] = $tag;
|
15 |
$all_args = func_get_args();
|
|
|
16 |
_wp_call_all_hook($all_args);
|
17 |
}
|
18 |
|
11 |
|
12 |
// Do 'all' actions first
|
13 |
if ( isset($wp_filter['all']) ) {
|
|
|
14 |
$all_args = func_get_args();
|
15 |
+
$wp_current_filter[] = $tag;
|
16 |
_wp_call_all_hook($all_args);
|
17 |
}
|
18 |
|
readme.txt
CHANGED
@@ -48,51 +48,17 @@ A VaultPress subscription is for a single WordPress site. You can purchase addit
|
|
48 |
Yes, VaultPress supports Multisite installs. Each site will require its own subscription.
|
49 |
|
50 |
== Changelog ==
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
|
|
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
** Opcache Conflict **
|
57 |
-
|
58 |
-
* General: Revert autoloader version to prior 1.7.0 version, to resolve an intermittent issue during the upgrade process for some users.
|
59 |
-
|
60 |
-
= 2.1.3 =
|
61 |
-
|
62 |
-
* Release date: August 6, 2020
|
63 |
-
|
64 |
-
** Compatibility **
|
65 |
-
|
66 |
-
* General: Handle new user meta actions.
|
67 |
-
* General: Implement the spread operator for our IXR class methods to match WordPress Core behavior in 5.5.
|
68 |
-
* General: Update some miscellaneous dependencies.
|
69 |
-
|
70 |
-
= 2.1.2 =
|
71 |
-
|
72 |
-
* Release date: Not publicly released, all changes shipped in subsequent version instead.
|
73 |
-
|
74 |
-
= 2.1.1 =
|
75 |
-
|
76 |
-
* Release date: December 10, 2019
|
77 |
-
|
78 |
-
**Compatibility**
|
79 |
-
|
80 |
-
* General: the VaultPress plugin now requires PHP 5.6, just like WordPress.
|
81 |
-
* General: avoid using PHP short array syntax to load plugin files.
|
82 |
-
|
83 |
-
= 2.1 =
|
84 |
-
|
85 |
-
* Release date: December 9, 2019
|
86 |
-
|
87 |
-
**Compatibility**
|
88 |
-
|
89 |
-
* General: avoid PHP deprecation notices when using a newer version of the Jetpack plugin.
|
90 |
-
* Admin Page: do not display a dashboard link if not registered.
|
91 |
-
* Admin Page: update reset settings card wording.
|
92 |
-
* Connect button: update link to current VaultPress page.
|
93 |
-
* Notices: only display notices in specific locations.
|
94 |
-
* Notices: update wording for the VaultPress connection notice
|
95 |
|
96 |
--------
|
97 |
|
98 |
-
[See the previous changelogs here](https://
|
48 |
Yes, VaultPress supports Multisite installs. Each site will require its own subscription.
|
49 |
|
50 |
== Changelog ==
|
51 |
+
### 2.2.0-beta - 2021-10-07
|
52 |
+
#### Changed
|
53 |
+
- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills).
|
54 |
+
- Updated package dependencies.
|
55 |
|
56 |
+
#### Removed
|
57 |
+
- VaultPress: Remove obsolete hotfixes
|
58 |
|
59 |
+
#### Fixed
|
60 |
+
- General: avoid PHP notices when using recent versions of PHP.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
--------
|
63 |
|
64 |
+
[See the previous changelogs here](https://github.com/Automattic/jetpack/blob/master/projects/plugins/vaultpress/CHANGELOG.md#changelog)
|
uninstall.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* This file runs if someone clicks the delete link next to a deactivated
|
4 |
-
* copy of the VaultPress plugin from within the WordPress admin area.
|
5 |
-
*
|
6 |
-
* @see https://developer.wordpress.org/plugins/the-basics/uninstall-methods/
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
10 |
-
exit();
|
11 |
-
}
|
12 |
-
|
13 |
-
delete_option( 'vaultpress' );
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file runs if someone clicks the delete link next to a deactivated
|
4 |
+
* copy of the VaultPress plugin from within the WordPress admin area.
|
5 |
+
*
|
6 |
+
* @see https://developer.wordpress.org/plugins/the-basics/uninstall-methods/
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
10 |
+
exit();
|
11 |
+
}
|
12 |
+
|
13 |
+
delete_option( 'vaultpress' );
|
vaultpress.php
CHANGED
@@ -3,21 +3,21 @@
|
|
3 |
* Plugin Name: VaultPress
|
4 |
* Plugin URI: http://vaultpress.com/?utm_source=plugin-uri&utm_medium=plugin-description&utm_campaign=1.0
|
5 |
* Description: Protect your content, themes, plugins, and settings with <strong>realtime backup</strong> and <strong>automated security scanning</strong> from <a href="http://vaultpress.com/?utm_source=wp-admin&utm_medium=plugin-description&utm_campaign=1.0" rel="nofollow">VaultPress</a>. Activate, enter your registration key, and never worry again. <a href="http://vaultpress.com/help/?utm_source=wp-admin&utm_medium=plugin-description&utm_campaign=1.0" rel="nofollow">Need some help?</a>
|
6 |
-
* Version: 2.
|
7 |
* Author: Automattic
|
8 |
* Author URI: http://vaultpress.com/?utm_source=author-uri&utm_medium=plugin-description&utm_campaign=1.0
|
9 |
* License: GPL2+
|
10 |
* Text Domain: vaultpress
|
11 |
* Domain Path: /languages/
|
12 |
*
|
13 |
-
* @package
|
14 |
*/
|
15 |
|
16 |
// don't call the file directly.
|
17 |
defined( 'ABSPATH' ) || die();
|
18 |
|
19 |
define( 'VAULTPRESS__MINIMUM_PHP_VERSION', '5.6' );
|
20 |
-
define( 'VAULTPRESS__VERSION', '2.
|
21 |
define( 'VAULTPRESS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
22 |
|
23 |
/**
|
@@ -3046,13 +3046,6 @@ $vaultpress = VaultPress::init();
|
|
3046 |
|
3047 |
if ( isset( $_GET['vaultpress'] ) && $_GET['vaultpress'] ) {
|
3048 |
if ( !function_exists( 'wp_magic_quotes' ) ) {
|
3049 |
-
// If already slashed, strip.
|
3050 |
-
if ( get_magic_quotes_gpc() ) {
|
3051 |
-
$_GET = stripslashes_deep( $_GET );
|
3052 |
-
$_POST = stripslashes_deep( $_POST );
|
3053 |
-
$_COOKIE = stripslashes_deep( $_COOKIE );
|
3054 |
-
}
|
3055 |
-
|
3056 |
// Escape with wpdb.
|
3057 |
$_GET = add_magic_quotes( $_GET );
|
3058 |
$_POST = add_magic_quotes( $_POST );
|
3 |
* Plugin Name: VaultPress
|
4 |
* Plugin URI: http://vaultpress.com/?utm_source=plugin-uri&utm_medium=plugin-description&utm_campaign=1.0
|
5 |
* Description: Protect your content, themes, plugins, and settings with <strong>realtime backup</strong> and <strong>automated security scanning</strong> from <a href="http://vaultpress.com/?utm_source=wp-admin&utm_medium=plugin-description&utm_campaign=1.0" rel="nofollow">VaultPress</a>. Activate, enter your registration key, and never worry again. <a href="http://vaultpress.com/help/?utm_source=wp-admin&utm_medium=plugin-description&utm_campaign=1.0" rel="nofollow">Need some help?</a>
|
6 |
+
* Version: 2.2.0-beta
|
7 |
* Author: Automattic
|
8 |
* Author URI: http://vaultpress.com/?utm_source=author-uri&utm_medium=plugin-description&utm_campaign=1.0
|
9 |
* License: GPL2+
|
10 |
* Text Domain: vaultpress
|
11 |
* Domain Path: /languages/
|
12 |
*
|
13 |
+
* @package automattic/vaultpress
|
14 |
*/
|
15 |
|
16 |
// don't call the file directly.
|
17 |
defined( 'ABSPATH' ) || die();
|
18 |
|
19 |
define( 'VAULTPRESS__MINIMUM_PHP_VERSION', '5.6' );
|
20 |
+
define( 'VAULTPRESS__VERSION', '2.2.0-beta' );
|
21 |
define( 'VAULTPRESS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
22 |
|
23 |
/**
|
3046 |
|
3047 |
if ( isset( $_GET['vaultpress'] ) && $_GET['vaultpress'] ) {
|
3048 |
if ( !function_exists( 'wp_magic_quotes' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3049 |
// Escape with wpdb.
|
3050 |
$_GET = add_magic_quotes( $_GET );
|
3051 |
$_POST = add_magic_quotes( $_POST );
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta::getLoader();
|
vendor/autoload_packages.php
CHANGED
@@ -1,206 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* This file
|
4 |
-
*
|
5 |
-
* From your plugin include this file with:
|
6 |
-
* require_once . plugin_dir_path( __FILE__ ) . '/vendor/autoload_packages.php';
|
7 |
*
|
8 |
* @package automattic/jetpack-autoloader
|
9 |
*/
|
10 |
|
11 |
-
|
12 |
-
// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_namespaceFound
|
13 |
-
// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_ns_cFound
|
14 |
-
|
15 |
-
namespace Automattic\Jetpack\Autoloader;
|
16 |
-
|
17 |
-
if ( ! function_exists( __NAMESPACE__ . '\enqueue_package_class' ) ) {
|
18 |
-
global $jetpack_packages_classes;
|
19 |
-
|
20 |
-
if ( ! is_array( $jetpack_packages_classes ) ) {
|
21 |
-
$jetpack_packages_classes = array();
|
22 |
-
}
|
23 |
-
/**
|
24 |
-
* Adds the version of a package to the $jetpack_packages global array so that
|
25 |
-
* the autoloader is able to find it.
|
26 |
-
*
|
27 |
-
* @param string $class_name Name of the class that you want to autoload.
|
28 |
-
* @param string $version Version of the class.
|
29 |
-
* @param string $path Absolute path to the class so that we can load it.
|
30 |
-
*/
|
31 |
-
function enqueue_package_class( $class_name, $version, $path ) {
|
32 |
-
global $jetpack_packages_classes;
|
33 |
-
|
34 |
-
if ( ! isset( $jetpack_packages_classes[ $class_name ] ) ) {
|
35 |
-
$jetpack_packages_classes[ $class_name ] = array(
|
36 |
-
'version' => $version,
|
37 |
-
'path' => $path,
|
38 |
-
);
|
39 |
-
|
40 |
-
return;
|
41 |
-
}
|
42 |
-
// If we have a @dev version set always use that one!
|
43 |
-
if ( 'dev-' === substr( $jetpack_packages_classes[ $class_name ]['version'], 0, 4 ) ) {
|
44 |
-
return;
|
45 |
-
}
|
46 |
-
|
47 |
-
// Always favour the @dev version. Since that version is the same as bleeding edge.
|
48 |
-
// We need to make sure that we don't do this in production!
|
49 |
-
if ( 'dev-' === substr( $version, 0, 4 ) ) {
|
50 |
-
$jetpack_packages_classes[ $class_name ] = array(
|
51 |
-
'version' => $version,
|
52 |
-
'path' => $path,
|
53 |
-
);
|
54 |
-
|
55 |
-
return;
|
56 |
-
}
|
57 |
-
// Set the latest version!
|
58 |
-
if ( version_compare( $jetpack_packages_classes[ $class_name ]['version'], $version, '<' ) ) {
|
59 |
-
$jetpack_packages_classes[ $class_name ] = array(
|
60 |
-
'version' => $version,
|
61 |
-
'path' => $path,
|
62 |
-
);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
if ( ! function_exists( __NAMESPACE__ . '\enqueue_package_file' ) ) {
|
68 |
-
global $jetpack_packages_files;
|
69 |
-
|
70 |
-
if ( ! is_array( $jetpack_packages_files ) ) {
|
71 |
-
$jetpack_packages_files = array();
|
72 |
-
}
|
73 |
-
/**
|
74 |
-
* Adds the version of a package file to the $jetpack_packages_files global array so that
|
75 |
-
* we can load the most recent version after 'plugins_loaded'.
|
76 |
-
*
|
77 |
-
* @param string $file_identifier Unique id to file assigned by composer based on package name and filename.
|
78 |
-
* @param string $version Version of the file.
|
79 |
-
* @param string $path Absolute path to the file so that we can load it.
|
80 |
-
*/
|
81 |
-
function enqueue_package_file( $file_identifier, $version, $path ) {
|
82 |
-
global $jetpack_packages_files;
|
83 |
-
|
84 |
-
if ( ! isset( $jetpack_packages_files[ $file_identifier ] ) ) {
|
85 |
-
$jetpack_packages_files[ $file_identifier ] = array(
|
86 |
-
'version' => $version,
|
87 |
-
'path' => $path,
|
88 |
-
);
|
89 |
-
|
90 |
-
return;
|
91 |
-
}
|
92 |
-
// If we have a @dev version set always use that one!
|
93 |
-
if ( 'dev-' === substr( $jetpack_packages_files[ $file_identifier ]['version'], 0, 4 ) ) {
|
94 |
-
return;
|
95 |
-
}
|
96 |
-
|
97 |
-
// Always favour the @dev version. Since that version is the same as bleeding edge.
|
98 |
-
// We need to make sure that we don't do this in production!
|
99 |
-
if ( 'dev-' === substr( $version, 0, 4 ) ) {
|
100 |
-
$jetpack_packages_files[ $file_identifier ] = array(
|
101 |
-
'version' => $version,
|
102 |
-
'path' => $path,
|
103 |
-
);
|
104 |
-
|
105 |
-
return;
|
106 |
-
}
|
107 |
-
// Set the latest version!
|
108 |
-
if ( version_compare( $jetpack_packages_files[ $file_identifier ]['version'], $version, '<' ) ) {
|
109 |
-
$jetpack_packages_files[ $file_identifier ] = array(
|
110 |
-
'version' => $version,
|
111 |
-
'path' => $path,
|
112 |
-
);
|
113 |
-
}
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
if ( ! function_exists( __NAMESPACE__ . '\file_loader' ) ) {
|
118 |
-
/**
|
119 |
-
* Include latest version of all enqueued files. Should be called after all plugins are loaded.
|
120 |
-
*/
|
121 |
-
function file_loader() {
|
122 |
-
global $jetpack_packages_files;
|
123 |
-
foreach ( $jetpack_packages_files as $file_identifier => $file_data ) {
|
124 |
-
if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) {
|
125 |
-
require $file_data['path'];
|
126 |
-
|
127 |
-
$GLOBALS['__composer_autoload_files'][ $file_identifier ] = true;
|
128 |
-
}
|
129 |
-
}
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
if ( ! function_exists( __NAMESPACE__ . '\autoloader' ) ) {
|
134 |
-
/**
|
135 |
-
* Used for autoloading jetpack packages.
|
136 |
-
*
|
137 |
-
* @param string $class_name Class Name to load.
|
138 |
-
*/
|
139 |
-
function autoloader( $class_name ) {
|
140 |
-
global $jetpack_packages_classes;
|
141 |
-
|
142 |
-
if ( isset( $jetpack_packages_classes[ $class_name ] ) ) {
|
143 |
-
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
144 |
-
// TODO ideally we shouldn't skip any of these, see: https://github.com/Automattic/jetpack/pull/12646.
|
145 |
-
$ignore = in_array(
|
146 |
-
$class_name,
|
147 |
-
array(
|
148 |
-
'Automattic\Jetpack\Connection\Manager',
|
149 |
-
'Jetpack_Options',
|
150 |
-
),
|
151 |
-
true
|
152 |
-
);
|
153 |
-
|
154 |
-
if ( ! $ignore && function_exists( 'did_action' ) && ! did_action( 'plugins_loaded' ) ) {
|
155 |
-
_doing_it_wrong(
|
156 |
-
esc_html( $class_name ),
|
157 |
-
sprintf(
|
158 |
-
/* translators: %s Name of a PHP Class */
|
159 |
-
esc_html__( 'Not all plugins have loaded yet but we requested the class %s', 'jetpack' ),
|
160 |
-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
161 |
-
$class_name
|
162 |
-
),
|
163 |
-
esc_html( $jetpack_packages_classes[ $class_name ]['version'] )
|
164 |
-
);
|
165 |
-
}
|
166 |
-
}
|
167 |
-
|
168 |
-
require_once $jetpack_packages_classes[ $class_name ]['path'];
|
169 |
-
|
170 |
-
return true;
|
171 |
-
}
|
172 |
-
|
173 |
-
return false;
|
174 |
-
}
|
175 |
-
|
176 |
-
// Add the jetpack autoloader.
|
177 |
-
spl_autoload_register( __NAMESPACE__ . '\autoloader' );
|
178 |
-
}
|
179 |
-
/**
|
180 |
-
* Prepare all the classes for autoloading.
|
181 |
-
*/
|
182 |
-
function enqueue_packages_dad950db79c73a765361c7b7c609843f() {
|
183 |
-
$class_map = require_once dirname( __FILE__ ) . '/composer/autoload_classmap_package.php';
|
184 |
-
foreach ( $class_map as $class_name => $class_info ) {
|
185 |
-
enqueue_package_class( $class_name, $class_info['version'], $class_info['path'] );
|
186 |
-
}
|
187 |
-
|
188 |
-
$autoload_file = __DIR__ . '/composer/autoload_files_package.php';
|
189 |
-
|
190 |
-
$includeFiles = file_exists( $autoload_file )
|
191 |
-
? require $autoload_file
|
192 |
-
: array();
|
193 |
|
194 |
-
|
195 |
-
enqueue_package_file( $fileIdentifier, $file_data[ 'version' ], $file_data[ 'path' ] );
|
196 |
-
}
|
197 |
|
198 |
-
|
199 |
-
|
200 |
-
// Priority -10 to load files as early as possible in case plugins try to use them during `plugins_loaded`.
|
201 |
-
add_action( 'plugins_loaded', __NAMESPACE__ . '\file_loader', 0, -10 );
|
202 |
-
} elseif( ! function_exists( 'did_action' ) || did_action( 'plugins_loaded' ) ) {
|
203 |
-
file_loader(); // Either WordPress is not loaded or plugin is doing it wrong. Either way we'll load the files so nothing breaks.
|
204 |
-
}
|
205 |
-
}
|
206 |
-
enqueue_packages_dad950db79c73a765361c7b7c609843f();
|
1 |
<?php
|
2 |
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
|
|
|
|
|
|
4 |
*
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
// phpcs:ignore
|
|
|
|
|
11 |
|
12 |
+
require_once __DIR__ . '/jetpack-autoloader/class-autoloader.php';
|
13 |
+
Autoloader::init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/automattic/jetpack-logo/composer.json
CHANGED
@@ -5,8 +5,8 @@
|
|
5 |
"license": "GPL-2.0-or-later",
|
6 |
"require": {},
|
7 |
"require-dev": {
|
8 |
-
"
|
9 |
-
"
|
10 |
},
|
11 |
"autoload": {
|
12 |
"classmap": [
|
@@ -15,10 +15,28 @@
|
|
15 |
},
|
16 |
"scripts": {
|
17 |
"phpunit": [
|
18 |
-
"@composer install",
|
19 |
"./vendor/phpunit/phpunit/phpunit --colors=always"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
]
|
21 |
},
|
|
|
22 |
"minimum-stability": "dev",
|
23 |
-
"prefer-stable": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
5 |
"license": "GPL-2.0-or-later",
|
6 |
"require": {},
|
7 |
"require-dev": {
|
8 |
+
"yoast/phpunit-polyfills": "1.0.2",
|
9 |
+
"automattic/jetpack-changelogger": "^2.0"
|
10 |
},
|
11 |
"autoload": {
|
12 |
"classmap": [
|
15 |
},
|
16 |
"scripts": {
|
17 |
"phpunit": [
|
|
|
18 |
"./vendor/phpunit/phpunit/phpunit --colors=always"
|
19 |
+
],
|
20 |
+
"test-coverage": [
|
21 |
+
"@composer update",
|
22 |
+
"phpdbg -d memory_limit=2048M -d max_execution_time=900 -qrr ./vendor/bin/phpunit --coverage-clover \"$COVERAGE_DIR/clover.xml\""
|
23 |
+
],
|
24 |
+
"test-php": [
|
25 |
+
"@composer update",
|
26 |
+
"@composer phpunit"
|
27 |
]
|
28 |
},
|
29 |
+
"repositories": [],
|
30 |
"minimum-stability": "dev",
|
31 |
+
"prefer-stable": true,
|
32 |
+
"extra": {
|
33 |
+
"autotagger": true,
|
34 |
+
"mirror-repo": "Automattic/jetpack-logo",
|
35 |
+
"changelogger": {
|
36 |
+
"link-template": "https://github.com/Automattic/jetpack-logo/compare/v${old}...v${new}"
|
37 |
+
},
|
38 |
+
"branch-alias": {
|
39 |
+
"dev-master": "1.5.x-dev"
|
40 |
+
}
|
41 |
+
}
|
42 |
}
|
vendor/automattic/jetpack-logo/src/class-logo.php
CHANGED
@@ -45,7 +45,8 @@ class Logo {
|
|
45 |
/**
|
46 |
* Return string containing the Jetpack logo.
|
47 |
*
|
48 |
-
* @since
|
|
|
49 |
*
|
50 |
* @param bool $logotype Should we use the full logotype (logo + text). Default to false.
|
51 |
*
|
45 |
/**
|
46 |
* Return string containing the Jetpack logo.
|
47 |
*
|
48 |
+
* @since 1.1.4
|
49 |
+
* @since-jetpack 7.5.0
|
50 |
*
|
51 |
* @param bool $logotype Should we use the full logotype (logo + text). Default to false.
|
52 |
*
|
vendor/composer/ClassLoader.php
CHANGED
@@ -37,57 +37,130 @@ namespace Composer\Autoload;
|
|
37 |
*
|
38 |
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
-
* @see
|
41 |
-
* @see
|
42 |
*/
|
43 |
class ClassLoader
|
44 |
{
|
|
|
|
|
|
|
45 |
// PSR-4
|
|
|
|
|
|
|
|
|
46 |
private $prefixLengthsPsr4 = array();
|
|
|
|
|
|
|
|
|
47 |
private $prefixDirsPsr4 = array();
|
|
|
|
|
|
|
|
|
48 |
private $fallbackDirsPsr4 = array();
|
49 |
|
50 |
// PSR-0
|
|
|
|
|
|
|
|
|
51 |
private $prefixesPsr0 = array();
|
|
|
|
|
|
|
|
|
52 |
private $fallbackDirsPsr0 = array();
|
53 |
|
|
|
54 |
private $useIncludePath = false;
|
|
|
|
|
|
|
|
|
|
|
55 |
private $classMap = array();
|
|
|
|
|
56 |
private $classMapAuthoritative = false;
|
|
|
|
|
|
|
|
|
|
|
57 |
private $missingClasses = array();
|
|
|
|
|
58 |
private $apcuPrefix;
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
public function getPrefixes()
|
61 |
{
|
62 |
if (!empty($this->prefixesPsr0)) {
|
63 |
-
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
64 |
}
|
65 |
|
66 |
return array();
|
67 |
}
|
68 |
|
|
|
|
|
|
|
|
|
69 |
public function getPrefixesPsr4()
|
70 |
{
|
71 |
return $this->prefixDirsPsr4;
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
74 |
public function getFallbackDirs()
|
75 |
{
|
76 |
return $this->fallbackDirsPsr0;
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
79 |
public function getFallbackDirsPsr4()
|
80 |
{
|
81 |
return $this->fallbackDirsPsr4;
|
82 |
}
|
83 |
|
|
|
|
|
|
|
|
|
84 |
public function getClassMap()
|
85 |
{
|
86 |
return $this->classMap;
|
87 |
}
|
88 |
|
89 |
/**
|
90 |
-
* @param
|
|
|
|
|
|
|
91 |
*/
|
92 |
public function addClassMap(array $classMap)
|
93 |
{
|
@@ -102,9 +175,11 @@ class ClassLoader
|
|
102 |
* Registers a set of PSR-0 directories for a given prefix, either
|
103 |
* appending or prepending to the ones previously set for this prefix.
|
104 |
*
|
105 |
-
* @param string
|
106 |
-
* @param
|
107 |
-
* @param bool
|
|
|
|
|
108 |
*/
|
109 |
public function add($prefix, $paths, $prepend = false)
|
110 |
{
|
@@ -147,11 +222,13 @@ class ClassLoader
|
|
147 |
* Registers a set of PSR-4 directories for a given namespace, either
|
148 |
* appending or prepending to the ones previously set for this namespace.
|
149 |
*
|
150 |
-
* @param string
|
151 |
-
* @param
|
152 |
-
* @param bool
|
153 |
*
|
154 |
* @throws \InvalidArgumentException
|
|
|
|
|
155 |
*/
|
156 |
public function addPsr4($prefix, $paths, $prepend = false)
|
157 |
{
|
@@ -195,8 +272,10 @@ class ClassLoader
|
|
195 |
* Registers a set of PSR-0 directories for a given prefix,
|
196 |
* replacing any others previously set for this prefix.
|
197 |
*
|
198 |
-
* @param string
|
199 |
-
* @param
|
|
|
|
|
200 |
*/
|
201 |
public function set($prefix, $paths)
|
202 |
{
|
@@ -211,10 +290,12 @@ class ClassLoader
|
|
211 |
* Registers a set of PSR-4 directories for a given namespace,
|
212 |
* replacing any others previously set for this namespace.
|
213 |
*
|
214 |
-
* @param string
|
215 |
-
* @param
|
216 |
*
|
217 |
* @throws \InvalidArgumentException
|
|
|
|
|
218 |
*/
|
219 |
public function setPsr4($prefix, $paths)
|
220 |
{
|
@@ -234,6 +315,8 @@ class ClassLoader
|
|
234 |
* Turns on searching the include path for class files.
|
235 |
*
|
236 |
* @param bool $useIncludePath
|
|
|
|
|
237 |
*/
|
238 |
public function setUseIncludePath($useIncludePath)
|
239 |
{
|
@@ -256,6 +339,8 @@ class ClassLoader
|
|
256 |
* that have not been registered with the class map.
|
257 |
*
|
258 |
* @param bool $classMapAuthoritative
|
|
|
|
|
259 |
*/
|
260 |
public function setClassMapAuthoritative($classMapAuthoritative)
|
261 |
{
|
@@ -276,6 +361,8 @@ class ClassLoader
|
|
276 |
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
277 |
*
|
278 |
* @param string|null $apcuPrefix
|
|
|
|
|
279 |
*/
|
280 |
public function setApcuPrefix($apcuPrefix)
|
281 |
{
|
@@ -296,25 +383,44 @@ class ClassLoader
|
|
296 |
* Registers this instance as an autoloader.
|
297 |
*
|
298 |
* @param bool $prepend Whether to prepend the autoloader or not
|
|
|
|
|
299 |
*/
|
300 |
public function register($prepend = false)
|
301 |
{
|
302 |
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
}
|
304 |
|
305 |
/**
|
306 |
* Unregisters this instance as an autoloader.
|
|
|
|
|
307 |
*/
|
308 |
public function unregister()
|
309 |
{
|
310 |
spl_autoload_unregister(array($this, 'loadClass'));
|
|
|
|
|
|
|
|
|
311 |
}
|
312 |
|
313 |
/**
|
314 |
* Loads the given class or interface.
|
315 |
*
|
316 |
* @param string $class The name of the class
|
317 |
-
* @return
|
318 |
*/
|
319 |
public function loadClass($class)
|
320 |
{
|
@@ -323,6 +429,8 @@ class ClassLoader
|
|
323 |
|
324 |
return true;
|
325 |
}
|
|
|
|
|
326 |
}
|
327 |
|
328 |
/**
|
@@ -367,6 +475,21 @@ class ClassLoader
|
|
367 |
return $file;
|
368 |
}
|
369 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
private function findFileWithExtension($class, $ext)
|
371 |
{
|
372 |
// PSR-4 lookup
|
@@ -438,6 +561,10 @@ class ClassLoader
|
|
438 |
* Scope isolated include.
|
439 |
*
|
440 |
* Prevents access to $this/self from included files.
|
|
|
|
|
|
|
|
|
441 |
*/
|
442 |
function includeFile($file)
|
443 |
{
|
37 |
*
|
38 |
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
+
* @see https://www.php-fig.org/psr/psr-0/
|
41 |
+
* @see https://www.php-fig.org/psr/psr-4/
|
42 |
*/
|
43 |
class ClassLoader
|
44 |
{
|
45 |
+
/** @var ?string */
|
46 |
+
private $vendorDir;
|
47 |
+
|
48 |
// PSR-4
|
49 |
+
/**
|
50 |
+
* @var array[]
|
51 |
+
* @psalm-var array<string, array<string, int>>
|
52 |
+
*/
|
53 |
private $prefixLengthsPsr4 = array();
|
54 |
+
/**
|
55 |
+
* @var array[]
|
56 |
+
* @psalm-var array<string, array<int, string>>
|
57 |
+
*/
|
58 |
private $prefixDirsPsr4 = array();
|
59 |
+
/**
|
60 |
+
* @var array[]
|
61 |
+
* @psalm-var array<string, string>
|
62 |
+
*/
|
63 |
private $fallbackDirsPsr4 = array();
|
64 |
|
65 |
// PSR-0
|
66 |
+
/**
|
67 |
+
* @var array[]
|
68 |
+
* @psalm-var array<string, array<string, string[]>>
|
69 |
+
*/
|
70 |
private $prefixesPsr0 = array();
|
71 |
+
/**
|
72 |
+
* @var array[]
|
73 |
+
* @psalm-var array<string, string>
|
74 |
+
*/
|
75 |
private $fallbackDirsPsr0 = array();
|
76 |
|
77 |
+
/** @var bool */
|
78 |
private $useIncludePath = false;
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @var string[]
|
82 |
+
* @psalm-var array<string, string>
|
83 |
+
*/
|
84 |
private $classMap = array();
|
85 |
+
|
86 |
+
/** @var bool */
|
87 |
private $classMapAuthoritative = false;
|
88 |
+
|
89 |
+
/**
|
90 |
+
* @var bool[]
|
91 |
+
* @psalm-var array<string, bool>
|
92 |
+
*/
|
93 |
private $missingClasses = array();
|
94 |
+
|
95 |
+
/** @var ?string */
|
96 |
private $apcuPrefix;
|
97 |
|
98 |
+
/**
|
99 |
+
* @var self[]
|
100 |
+
*/
|
101 |
+
private static $registeredLoaders = array();
|
102 |
+
|
103 |
+
/**
|
104 |
+
* @param ?string $vendorDir
|
105 |
+
*/
|
106 |
+
public function __construct($vendorDir = null)
|
107 |
+
{
|
108 |
+
$this->vendorDir = $vendorDir;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* @return string[]
|
113 |
+
*/
|
114 |
public function getPrefixes()
|
115 |
{
|
116 |
if (!empty($this->prefixesPsr0)) {
|
117 |
+
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
118 |
}
|
119 |
|
120 |
return array();
|
121 |
}
|
122 |
|
123 |
+
/**
|
124 |
+
* @return array[]
|
125 |
+
* @psalm-return array<string, array<int, string>>
|
126 |
+
*/
|
127 |
public function getPrefixesPsr4()
|
128 |
{
|
129 |
return $this->prefixDirsPsr4;
|
130 |
}
|
131 |
|
132 |
+
/**
|
133 |
+
* @return array[]
|
134 |
+
* @psalm-return array<string, string>
|
135 |
+
*/
|
136 |
public function getFallbackDirs()
|
137 |
{
|
138 |
return $this->fallbackDirsPsr0;
|
139 |
}
|
140 |
|
141 |
+
/**
|
142 |
+
* @return array[]
|
143 |
+
* @psalm-return array<string, string>
|
144 |
+
*/
|
145 |
public function getFallbackDirsPsr4()
|
146 |
{
|
147 |
return $this->fallbackDirsPsr4;
|
148 |
}
|
149 |
|
150 |
+
/**
|
151 |
+
* @return string[] Array of classname => path
|
152 |
+
* @psalm-var array<string, string>
|
153 |
+
*/
|
154 |
public function getClassMap()
|
155 |
{
|
156 |
return $this->classMap;
|
157 |
}
|
158 |
|
159 |
/**
|
160 |
+
* @param string[] $classMap Class to filename map
|
161 |
+
* @psalm-param array<string, string> $classMap
|
162 |
+
*
|
163 |
+
* @return void
|
164 |
*/
|
165 |
public function addClassMap(array $classMap)
|
166 |
{
|
175 |
* Registers a set of PSR-0 directories for a given prefix, either
|
176 |
* appending or prepending to the ones previously set for this prefix.
|
177 |
*
|
178 |
+
* @param string $prefix The prefix
|
179 |
+
* @param string[]|string $paths The PSR-0 root directories
|
180 |
+
* @param bool $prepend Whether to prepend the directories
|
181 |
+
*
|
182 |
+
* @return void
|
183 |
*/
|
184 |
public function add($prefix, $paths, $prepend = false)
|
185 |
{
|
222 |
* Registers a set of PSR-4 directories for a given namespace, either
|
223 |
* appending or prepending to the ones previously set for this namespace.
|
224 |
*
|
225 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
226 |
+
* @param string[]|string $paths The PSR-4 base directories
|
227 |
+
* @param bool $prepend Whether to prepend the directories
|
228 |
*
|
229 |
* @throws \InvalidArgumentException
|
230 |
+
*
|
231 |
+
* @return void
|
232 |
*/
|
233 |
public function addPsr4($prefix, $paths, $prepend = false)
|
234 |
{
|
272 |
* Registers a set of PSR-0 directories for a given prefix,
|
273 |
* replacing any others previously set for this prefix.
|
274 |
*
|
275 |
+
* @param string $prefix The prefix
|
276 |
+
* @param string[]|string $paths The PSR-0 base directories
|
277 |
+
*
|
278 |
+
* @return void
|
279 |
*/
|
280 |
public function set($prefix, $paths)
|
281 |
{
|
290 |
* Registers a set of PSR-4 directories for a given namespace,
|
291 |
* replacing any others previously set for this namespace.
|
292 |
*
|
293 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
294 |
+
* @param string[]|string $paths The PSR-4 base directories
|
295 |
*
|
296 |
* @throws \InvalidArgumentException
|
297 |
+
*
|
298 |
+
* @return void
|
299 |
*/
|
300 |
public function setPsr4($prefix, $paths)
|
301 |
{
|
315 |
* Turns on searching the include path for class files.
|
316 |
*
|
317 |
* @param bool $useIncludePath
|
318 |
+
*
|
319 |
+
* @return void
|
320 |
*/
|
321 |
public function setUseIncludePath($useIncludePath)
|
322 |
{
|
339 |
* that have not been registered with the class map.
|
340 |
*
|
341 |
* @param bool $classMapAuthoritative
|
342 |
+
*
|
343 |
+
* @return void
|
344 |
*/
|
345 |
public function setClassMapAuthoritative($classMapAuthoritative)
|
346 |
{
|
361 |
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
362 |
*
|
363 |
* @param string|null $apcuPrefix
|
364 |
+
*
|
365 |
+
* @return void
|
366 |
*/
|
367 |
public function setApcuPrefix($apcuPrefix)
|
368 |
{
|
383 |
* Registers this instance as an autoloader.
|
384 |
*
|
385 |
* @param bool $prepend Whether to prepend the autoloader or not
|
386 |
+
*
|
387 |
+
* @return void
|
388 |
*/
|
389 |
public function register($prepend = false)
|
390 |
{
|
391 |
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
392 |
+
|
393 |
+
if (null === $this->vendorDir) {
|
394 |
+
return;
|
395 |
+
}
|
396 |
+
|
397 |
+
if ($prepend) {
|
398 |
+
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
399 |
+
} else {
|
400 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
401 |
+
self::$registeredLoaders[$this->vendorDir] = $this;
|
402 |
+
}
|
403 |
}
|
404 |
|
405 |
/**
|
406 |
* Unregisters this instance as an autoloader.
|
407 |
+
*
|
408 |
+
* @return void
|
409 |
*/
|
410 |
public function unregister()
|
411 |
{
|
412 |
spl_autoload_unregister(array($this, 'loadClass'));
|
413 |
+
|
414 |
+
if (null !== $this->vendorDir) {
|
415 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
416 |
+
}
|
417 |
}
|
418 |
|
419 |
/**
|
420 |
* Loads the given class or interface.
|
421 |
*
|
422 |
* @param string $class The name of the class
|
423 |
+
* @return true|null True if loaded, null otherwise
|
424 |
*/
|
425 |
public function loadClass($class)
|
426 |
{
|
429 |
|
430 |
return true;
|
431 |
}
|
432 |
+
|
433 |
+
return null;
|
434 |
}
|
435 |
|
436 |
/**
|
475 |
return $file;
|
476 |
}
|
477 |
|
478 |
+
/**
|
479 |
+
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
480 |
+
*
|
481 |
+
* @return self[]
|
482 |
+
*/
|
483 |
+
public static function getRegisteredLoaders()
|
484 |
+
{
|
485 |
+
return self::$registeredLoaders;
|
486 |
+
}
|
487 |
+
|
488 |
+
/**
|
489 |
+
* @param string $class
|
490 |
+
* @param string $ext
|
491 |
+
* @return string|false
|
492 |
+
*/
|
493 |
private function findFileWithExtension($class, $ext)
|
494 |
{
|
495 |
// PSR-4 lookup
|
561 |
* Scope isolated include.
|
562 |
*
|
563 |
* Prevents access to $this/self from included files.
|
564 |
+
*
|
565 |
+
* @param string $file
|
566 |
+
* @return void
|
567 |
+
* @private
|
568 |
*/
|
569 |
function includeFile($file)
|
570 |
{
|
vendor/composer/InstalledVersions.php
ADDED
@@ -0,0 +1,337 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
|
13 |
+
namespace Composer;
|
14 |
+
|
15 |
+
use Composer\Autoload\ClassLoader;
|
16 |
+
use Composer\Semver\VersionParser;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* This class is copied in every Composer installed project and available to all
|
20 |
+
*
|
21 |
+
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
22 |
+
*
|
23 |
+
* To require its presence, you can require `composer-runtime-api ^2.0`
|
24 |
+
*/
|
25 |
+
class InstalledVersions
|
26 |
+
{
|
27 |
+
private static $installed;
|
28 |
+
private static $canGetVendors;
|
29 |
+
private static $installedByVendor = array();
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
33 |
+
*
|
34 |
+
* @return string[]
|
35 |
+
* @psalm-return list<string>
|
36 |
+
*/
|
37 |
+
public static function getInstalledPackages()
|
38 |
+
{
|
39 |
+
$packages = array();
|
40 |
+
foreach (self::getInstalled() as $installed) {
|
41 |
+
$packages[] = array_keys($installed['versions']);
|
42 |
+
}
|
43 |
+
|
44 |
+
if (1 === \count($packages)) {
|
45 |
+
return $packages[0];
|
46 |
+
}
|
47 |
+
|
48 |
+
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Returns a list of all package names with a specific type e.g. 'library'
|
53 |
+
*
|
54 |
+
* @param string $type
|
55 |
+
* @return string[]
|
56 |
+
* @psalm-return list<string>
|
57 |
+
*/
|
58 |
+
public static function getInstalledPackagesByType($type)
|
59 |
+
{
|
60 |
+
$packagesByType = array();
|
61 |
+
|
62 |
+
foreach (self::getInstalled() as $installed) {
|
63 |
+
foreach ($installed['versions'] as $name => $package) {
|
64 |
+
if (isset($package['type']) && $package['type'] === $type) {
|
65 |
+
$packagesByType[] = $name;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
return $packagesByType;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Checks whether the given package is installed
|
75 |
+
*
|
76 |
+
* This also returns true if the package name is provided or replaced by another package
|
77 |
+
*
|
78 |
+
* @param string $packageName
|
79 |
+
* @param bool $includeDevRequirements
|
80 |
+
* @return bool
|
81 |
+
*/
|
82 |
+
public static function isInstalled($packageName, $includeDevRequirements = true)
|
83 |
+
{
|
84 |
+
foreach (self::getInstalled() as $installed) {
|
85 |
+
if (isset($installed['versions'][$packageName])) {
|
86 |
+
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
return false;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Checks whether the given package satisfies a version constraint
|
95 |
+
*
|
96 |
+
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
97 |
+
*
|
98 |
+
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
99 |
+
*
|
100 |
+
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
101 |
+
* @param string $packageName
|
102 |
+
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
103 |
+
* @return bool
|
104 |
+
*/
|
105 |
+
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
106 |
+
{
|
107 |
+
$constraint = $parser->parseConstraints($constraint);
|
108 |
+
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
109 |
+
|
110 |
+
return $provided->matches($constraint);
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Returns a version constraint representing all the range(s) which are installed for a given package
|
115 |
+
*
|
116 |
+
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
117 |
+
* whether a given version of a package is installed, and not just whether it exists
|
118 |
+
*
|
119 |
+
* @param string $packageName
|
120 |
+
* @return string Version constraint usable with composer/semver
|
121 |
+
*/
|
122 |
+
public static function getVersionRanges($packageName)
|
123 |
+
{
|
124 |
+
foreach (self::getInstalled() as $installed) {
|
125 |
+
if (!isset($installed['versions'][$packageName])) {
|
126 |
+
continue;
|
127 |
+
}
|
128 |
+
|
129 |
+
$ranges = array();
|
130 |
+
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
131 |
+
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
132 |
+
}
|
133 |
+
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
134 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
135 |
+
}
|
136 |
+
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
137 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
138 |
+
}
|
139 |
+
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
140 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
141 |
+
}
|
142 |
+
|
143 |
+
return implode(' || ', $ranges);
|
144 |
+
}
|
145 |
+
|
146 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* @param string $packageName
|
151 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
152 |
+
*/
|
153 |
+
public static function getVersion($packageName)
|
154 |
+
{
|
155 |
+
foreach (self::getInstalled() as $installed) {
|
156 |
+
if (!isset($installed['versions'][$packageName])) {
|
157 |
+
continue;
|
158 |
+
}
|
159 |
+
|
160 |
+
if (!isset($installed['versions'][$packageName]['version'])) {
|
161 |
+
return null;
|
162 |
+
}
|
163 |
+
|
164 |
+
return $installed['versions'][$packageName]['version'];
|
165 |
+
}
|
166 |
+
|
167 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* @param string $packageName
|
172 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
173 |
+
*/
|
174 |
+
public static function getPrettyVersion($packageName)
|
175 |
+
{
|
176 |
+
foreach (self::getInstalled() as $installed) {
|
177 |
+
if (!isset($installed['versions'][$packageName])) {
|
178 |
+
continue;
|
179 |
+
}
|
180 |
+
|
181 |
+
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
182 |
+
return null;
|
183 |
+
}
|
184 |
+
|
185 |
+
return $installed['versions'][$packageName]['pretty_version'];
|
186 |
+
}
|
187 |
+
|
188 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* @param string $packageName
|
193 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
194 |
+
*/
|
195 |
+
public static function getReference($packageName)
|
196 |
+
{
|
197 |
+
foreach (self::getInstalled() as $installed) {
|
198 |
+
if (!isset($installed['versions'][$packageName])) {
|
199 |
+
continue;
|
200 |
+
}
|
201 |
+
|
202 |
+
if (!isset($installed['versions'][$packageName]['reference'])) {
|
203 |
+
return null;
|
204 |
+
}
|
205 |
+
|
206 |
+
return $installed['versions'][$packageName]['reference'];
|
207 |
+
}
|
208 |
+
|
209 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* @param string $packageName
|
214 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
215 |
+
*/
|
216 |
+
public static function getInstallPath($packageName)
|
217 |
+
{
|
218 |
+
foreach (self::getInstalled() as $installed) {
|
219 |
+
if (!isset($installed['versions'][$packageName])) {
|
220 |
+
continue;
|
221 |
+
}
|
222 |
+
|
223 |
+
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
224 |
+
}
|
225 |
+
|
226 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* @return array
|
231 |
+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
232 |
+
*/
|
233 |
+
public static function getRootPackage()
|
234 |
+
{
|
235 |
+
$installed = self::getInstalled();
|
236 |
+
|
237 |
+
return $installed[0]['root'];
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Returns the raw installed.php data for custom implementations
|
242 |
+
*
|
243 |
+
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
244 |
+
* @return array[]
|
245 |
+
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
246 |
+
*/
|
247 |
+
public static function getRawData()
|
248 |
+
{
|
249 |
+
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
250 |
+
|
251 |
+
if (null === self::$installed) {
|
252 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
253 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
254 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
255 |
+
self::$installed = include __DIR__ . '/installed.php';
|
256 |
+
} else {
|
257 |
+
self::$installed = array();
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
return self::$installed;
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
266 |
+
*
|
267 |
+
* @return array[]
|
268 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
269 |
+
*/
|
270 |
+
public static function getAllRawData()
|
271 |
+
{
|
272 |
+
return self::getInstalled();
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Lets you reload the static array from another file
|
277 |
+
*
|
278 |
+
* This is only useful for complex integrations in which a project needs to use
|
279 |
+
* this class but then also needs to execute another project's autoloader in process,
|
280 |
+
* and wants to ensure both projects have access to their version of installed.php.
|
281 |
+
*
|
282 |
+
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
283 |
+
* the data it needs from this class, then call reload() with
|
284 |
+
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
285 |
+
* the project in which it runs can then also use this class safely, without
|
286 |
+
* interference between PHPUnit's dependencies and the project's dependencies.
|
287 |
+
*
|
288 |
+
* @param array[] $data A vendor/composer/installed.php data set
|
289 |
+
* @return void
|
290 |
+
*
|
291 |
+
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
292 |
+
*/
|
293 |
+
public static function reload($data)
|
294 |
+
{
|
295 |
+
self::$installed = $data;
|
296 |
+
self::$installedByVendor = array();
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* @return array[]
|
301 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
302 |
+
*/
|
303 |
+
private static function getInstalled()
|
304 |
+
{
|
305 |
+
if (null === self::$canGetVendors) {
|
306 |
+
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
307 |
+
}
|
308 |
+
|
309 |
+
$installed = array();
|
310 |
+
|
311 |
+
if (self::$canGetVendors) {
|
312 |
+
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
313 |
+
if (isset(self::$installedByVendor[$vendorDir])) {
|
314 |
+
$installed[] = self::$installedByVendor[$vendorDir];
|
315 |
+
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
316 |
+
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
317 |
+
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
318 |
+
self::$installed = $installed[count($installed) - 1];
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
}
|
323 |
+
|
324 |
+
if (null === self::$installed) {
|
325 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
326 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
327 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
328 |
+
self::$installed = require __DIR__ . '/installed.php';
|
329 |
+
} else {
|
330 |
+
self::$installed = array();
|
331 |
+
}
|
332 |
+
}
|
333 |
+
$installed[] = self::$installed;
|
334 |
+
|
335 |
+
return $installed;
|
336 |
+
}
|
337 |
+
}
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -7,4 +7,10 @@ $baseDir = dirname($vendorDir);
|
|
7 |
|
8 |
return array(
|
9 |
'Automattic\\Jetpack\\Assets\\Logo' => $vendorDir . '/automattic/jetpack-logo/src/class-logo.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
);
|
7 |
|
8 |
return array(
|
9 |
'Automattic\\Jetpack\\Assets\\Logo' => $vendorDir . '/automattic/jetpack-logo/src/class-logo.php',
|
10 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php',
|
11 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php',
|
12 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php',
|
13 |
+
'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php',
|
14 |
+
'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php',
|
15 |
+
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
16 |
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -6,8 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'VariableAnalysis\\' => array($vendorDir . '/sirbrillig/phpcs-variable-analysis/VariableAnalysis'),
|
10 |
-
'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => array($vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src'),
|
11 |
-
'Automattic\\Jetpack\\Standards\\' => array($vendorDir . '/automattic/jetpack-standards'),
|
12 |
'Automattic\\Jetpack\\Autoloader\\' => array($vendorDir . '/automattic/jetpack-autoloader/src'),
|
13 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
|
|
|
|
9 |
'Automattic\\Jetpack\\Autoloader\\' => array($vendorDir . '/automattic/jetpack-autoloader/src'),
|
10 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,32 +22,23 @@ class ComposerAutoloaderInitabbe6786ee8beb5eddaaf6583db0467b
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
-
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
-
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
-
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
-
foreach ($map as $namespace => $path) {
|
37 |
-
$loader->set($namespace, $path);
|
38 |
-
}
|
39 |
-
|
40 |
-
$map = require __DIR__ . '/autoload_psr4.php';
|
41 |
-
foreach ($map as $namespace => $path) {
|
42 |
-
$loader->setPsr4($namespace, $path);
|
43 |
-
}
|
44 |
-
|
45 |
$classMap = require __DIR__ . '/autoload_classmap.php';
|
46 |
if ($classMap) {
|
47 |
$loader->addClassMap($classMap);
|
48 |
}
|
49 |
}
|
50 |
|
|
|
51 |
$loader->register(true);
|
52 |
|
53 |
return $loader;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta', 'loadClassLoader'), true, true);
|
26 |
+
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
+
require __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta::getInitializer($loader));
|
34 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
$classMap = require __DIR__ . '/autoload_classmap.php';
|
36 |
if ($classMap) {
|
37 |
$loader->addClassMap($classMap);
|
38 |
}
|
39 |
}
|
40 |
|
41 |
+
$loader->setClassMapAuthoritative(true);
|
42 |
$loader->register(true);
|
43 |
|
44 |
return $loader;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,37 +4,16 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
-
'V' =>
|
11 |
-
array (
|
12 |
-
'VariableAnalysis\\' => 17,
|
13 |
-
),
|
14 |
-
'D' =>
|
15 |
-
array (
|
16 |
-
'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => 55,
|
17 |
-
),
|
18 |
'A' =>
|
19 |
array (
|
20 |
-
'Automattic\\Jetpack\\Standards\\' => 29,
|
21 |
'Automattic\\Jetpack\\Autoloader\\' => 30,
|
22 |
),
|
23 |
);
|
24 |
|
25 |
public static $prefixDirsPsr4 = array (
|
26 |
-
'VariableAnalysis\\' =>
|
27 |
-
array (
|
28 |
-
0 => __DIR__ . '/..' . '/sirbrillig/phpcs-variable-analysis/VariableAnalysis',
|
29 |
-
),
|
30 |
-
'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' =>
|
31 |
-
array (
|
32 |
-
0 => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src',
|
33 |
-
),
|
34 |
-
'Automattic\\Jetpack\\Standards\\' =>
|
35 |
-
array (
|
36 |
-
0 => __DIR__ . '/..' . '/automattic/jetpack-standards',
|
37 |
-
),
|
38 |
'Automattic\\Jetpack\\Autoloader\\' =>
|
39 |
array (
|
40 |
0 => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src',
|
@@ -43,14 +22,20 @@ class ComposerStaticInitabbe6786ee8beb5eddaaf6583db0467b
|
|
43 |
|
44 |
public static $classMap = array (
|
45 |
'Automattic\\Jetpack\\Assets\\Logo' => __DIR__ . '/..' . '/automattic/jetpack-logo/src/class-logo.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
);
|
47 |
|
48 |
public static function getInitializer(ClassLoader $loader)
|
49 |
{
|
50 |
return \Closure::bind(function () use ($loader) {
|
51 |
-
$loader->prefixLengthsPsr4 =
|
52 |
-
$loader->prefixDirsPsr4 =
|
53 |
-
$loader->classMap =
|
54 |
|
55 |
}, null, ClassLoader::class);
|
56 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
'A' =>
|
11 |
array (
|
|
|
12 |
'Automattic\\Jetpack\\Autoloader\\' => 30,
|
13 |
),
|
14 |
);
|
15 |
|
16 |
public static $prefixDirsPsr4 = array (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
'Automattic\\Jetpack\\Autoloader\\' =>
|
18 |
array (
|
19 |
0 => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src',
|
22 |
|
23 |
public static $classMap = array (
|
24 |
'Automattic\\Jetpack\\Assets\\Logo' => __DIR__ . '/..' . '/automattic/jetpack-logo/src/class-logo.php',
|
25 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php',
|
26 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php',
|
27 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php',
|
28 |
+
'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php',
|
29 |
+
'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/ManifestGenerator.php',
|
30 |
+
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
31 |
);
|
32 |
|
33 |
public static function getInitializer(ClassLoader $loader)
|
34 |
{
|
35 |
return \Closure::bind(function () use ($loader) {
|
36 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta::$prefixLengthsPsr4;
|
37 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta::$prefixDirsPsr4;
|
38 |
+
$loader->classMap = ComposerStaticInit9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta::$classMap;
|
39 |
|
40 |
}, null, ClassLoader::class);
|
41 |
}
|
vendor/composer/installed.json
CHANGED
@@ -1,495 +1,107 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
"
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
"dist": {
|
12 |
-
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/7c6736eeee0f9fc49fa691fe3e958725efb27ca0",
|
14 |
-
"reference": "7c6736eeee0f9fc49fa691fe3e958725efb27ca0",
|
15 |
-
"shasum": ""
|
16 |
-
},
|
17 |
-
"require": {
|
18 |
-
"composer-plugin-api": "^1.1"
|
19 |
-
},
|
20 |
-
"require-dev": {
|
21 |
-
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5"
|
22 |
-
},
|
23 |
-
"time": "2020-04-23T02:28:37+00:00",
|
24 |
-
"type": "composer-plugin",
|
25 |
-
"extra": {
|
26 |
-
"class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin"
|
27 |
-
},
|
28 |
-
"installation-source": "dist",
|
29 |
-
"autoload": {
|
30 |
-
"psr-4": {
|
31 |
-
"Automattic\\Jetpack\\Autoloader\\": "src"
|
32 |
-
}
|
33 |
-
},
|
34 |
-
"notification-url": "https://packagist.org/downloads/",
|
35 |
-
"license": [
|
36 |
-
"GPL-2.0-or-later"
|
37 |
-
],
|
38 |
-
"description": "Creates a custom autoloader for a plugin or theme."
|
39 |
-
},
|
40 |
-
{
|
41 |
-
"name": "automattic/jetpack-logo",
|
42 |
-
"version": "v1.2.0",
|
43 |
-
"version_normalized": "1.2.0.0",
|
44 |
-
"source": {
|
45 |
-
"type": "git",
|
46 |
-
"url": "https://github.com/Automattic/jetpack-logo.git",
|
47 |
-
"reference": "d7840f25d7836ab69de979bcb67e8190220e53a3"
|
48 |
-
},
|
49 |
-
"dist": {
|
50 |
-
"type": "zip",
|
51 |
-
"url": "https://api.github.com/repos/Automattic/jetpack-logo/zipball/d7840f25d7836ab69de979bcb67e8190220e53a3",
|
52 |
-
"reference": "d7840f25d7836ab69de979bcb67e8190220e53a3",
|
53 |
-
"shasum": ""
|
54 |
-
},
|
55 |
-
"require-dev": {
|
56 |
-
"php-mock/php-mock": "^2.1",
|
57 |
-
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5"
|
58 |
-
},
|
59 |
-
"time": "2020-03-27T21:57:58+00:00",
|
60 |
-
"type": "library",
|
61 |
-
"installation-source": "dist",
|
62 |
-
"autoload": {
|
63 |
-
"classmap": [
|
64 |
-
"src/"
|
65 |
-
]
|
66 |
-
},
|
67 |
-
"notification-url": "https://packagist.org/downloads/",
|
68 |
-
"license": [
|
69 |
-
"GPL-2.0-or-later"
|
70 |
-
],
|
71 |
-
"description": "A logo for Jetpack"
|
72 |
-
},
|
73 |
-
{
|
74 |
-
"name": "automattic/jetpack-standards",
|
75 |
-
"version": "dev-master",
|
76 |
-
"version_normalized": "9999999-dev",
|
77 |
-
"source": {
|
78 |
-
"type": "git",
|
79 |
-
"url": "https://github.com/Automattic/jetpack-standards.git",
|
80 |
-
"reference": "1453b5eafe67bc82d0361e4d76a113cbd11c8149"
|
81 |
-
},
|
82 |
-
"dist": {
|
83 |
-
"type": "zip",
|
84 |
-
"url": "https://api.github.com/repos/Automattic/jetpack-standards/zipball/1453b5eafe67bc82d0361e4d76a113cbd11c8149",
|
85 |
-
"reference": "1453b5eafe67bc82d0361e4d76a113cbd11c8149",
|
86 |
-
"shasum": ""
|
87 |
-
},
|
88 |
-
"require": {
|
89 |
-
"composer-plugin-api": "^1.1",
|
90 |
-
"dealerdirect/phpcodesniffer-composer-installer": "0.5.0",
|
91 |
-
"phpcompatibility/phpcompatibility-wp": "2.0.0",
|
92 |
-
"sirbrillig/phpcs-variable-analysis": "2.6.4",
|
93 |
-
"wp-coding-standards/wpcs": "2.1.1"
|
94 |
-
},
|
95 |
-
"time": "2019-05-21T18:08:46+00:00",
|
96 |
-
"type": "composer-plugin",
|
97 |
-
"extra": {
|
98 |
-
"class": "Automattic\\Jetpack\\Standards\\PostInstall"
|
99 |
-
},
|
100 |
-
"installation-source": "source",
|
101 |
-
"autoload": {
|
102 |
-
"psr-4": {
|
103 |
-
"Automattic\\Jetpack\\Standards\\": ""
|
104 |
-
}
|
105 |
-
},
|
106 |
-
"notification-url": "https://packagist.org/downloads/",
|
107 |
-
"license": [
|
108 |
-
"GPL-2.0-or-later"
|
109 |
-
],
|
110 |
-
"description": "Adds basic Jetpack standards to a project."
|
111 |
-
},
|
112 |
-
{
|
113 |
-
"name": "dealerdirect/phpcodesniffer-composer-installer",
|
114 |
-
"version": "v0.5.0",
|
115 |
-
"version_normalized": "0.5.0.0",
|
116 |
-
"source": {
|
117 |
-
"type": "git",
|
118 |
-
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
|
119 |
-
"reference": "e749410375ff6fb7a040a68878c656c2e610b132"
|
120 |
-
},
|
121 |
-
"dist": {
|
122 |
-
"type": "zip",
|
123 |
-
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132",
|
124 |
-
"reference": "e749410375ff6fb7a040a68878c656c2e610b132",
|
125 |
-
"shasum": ""
|
126 |
-
},
|
127 |
-
"require": {
|
128 |
-
"composer-plugin-api": "^1.0",
|
129 |
-
"php": "^5.3|^7",
|
130 |
-
"squizlabs/php_codesniffer": "^2|^3"
|
131 |
-
},
|
132 |
-
"require-dev": {
|
133 |
-
"composer/composer": "*",
|
134 |
-
"phpcompatibility/php-compatibility": "^9.0",
|
135 |
-
"sensiolabs/security-checker": "^4.1.0"
|
136 |
-
},
|
137 |
-
"time": "2018-10-26T13:21:45+00:00",
|
138 |
-
"type": "composer-plugin",
|
139 |
-
"extra": {
|
140 |
-
"class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
|
141 |
-
},
|
142 |
-
"installation-source": "dist",
|
143 |
-
"autoload": {
|
144 |
-
"psr-4": {
|
145 |
-
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
|
146 |
-
}
|
147 |
-
},
|
148 |
-
"notification-url": "https://packagist.org/downloads/",
|
149 |
-
"license": [
|
150 |
-
"MIT"
|
151 |
-
],
|
152 |
-
"authors": [
|
153 |
-
{
|
154 |
-
"name": "Franck Nijhof",
|
155 |
-
"email": "franck.nijhof@dealerdirect.com",
|
156 |
-
"homepage": "http://www.frenck.nl",
|
157 |
-
"role": "Developer / IT Manager"
|
158 |
-
}
|
159 |
-
],
|
160 |
-
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
|
161 |
-
"homepage": "http://www.dealerdirect.com",
|
162 |
-
"keywords": [
|
163 |
-
"PHPCodeSniffer",
|
164 |
-
"PHP_CodeSniffer",
|
165 |
-
"code quality",
|
166 |
-
"codesniffer",
|
167 |
-
"composer",
|
168 |
-
"installer",
|
169 |
-
"phpcs",
|
170 |
-
"plugin",
|
171 |
-
"qa",
|
172 |
-
"quality",
|
173 |
-
"standard",
|
174 |
-
"standards",
|
175 |
-
"style guide",
|
176 |
-
"stylecheck",
|
177 |
-
"tests"
|
178 |
-
]
|
179 |
-
},
|
180 |
-
{
|
181 |
-
"name": "phpcompatibility/php-compatibility",
|
182 |
-
"version": "9.3.4",
|
183 |
-
"version_normalized": "9.3.4.0",
|
184 |
-
"source": {
|
185 |
-
"type": "git",
|
186 |
-
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
|
187 |
-
"reference": "1f37659196e4f3113ea506a7efba201c52303bf1"
|
188 |
-
},
|
189 |
-
"dist": {
|
190 |
-
"type": "zip",
|
191 |
-
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1f37659196e4f3113ea506a7efba201c52303bf1",
|
192 |
-
"reference": "1f37659196e4f3113ea506a7efba201c52303bf1",
|
193 |
-
"shasum": ""
|
194 |
-
},
|
195 |
-
"require": {
|
196 |
-
"php": ">=5.3",
|
197 |
-
"squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
|
198 |
-
},
|
199 |
-
"conflict": {
|
200 |
-
"squizlabs/php_codesniffer": "2.6.2"
|
201 |
-
},
|
202 |
-
"require-dev": {
|
203 |
-
"phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
|
204 |
-
},
|
205 |
-
"suggest": {
|
206 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
|
207 |
-
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
208 |
-
},
|
209 |
-
"time": "2019-11-15T04:12:02+00:00",
|
210 |
-
"type": "phpcodesniffer-standard",
|
211 |
-
"installation-source": "dist",
|
212 |
-
"notification-url": "https://packagist.org/downloads/",
|
213 |
-
"license": [
|
214 |
-
"LGPL-3.0-or-later"
|
215 |
-
],
|
216 |
-
"authors": [
|
217 |
-
{
|
218 |
-
"name": "Wim Godden",
|
219 |
-
"homepage": "https://github.com/wimg",
|
220 |
-
"role": "lead"
|
221 |
},
|
222 |
-
{
|
223 |
-
"
|
224 |
-
"
|
225 |
-
"
|
|
|
226 |
},
|
227 |
-
{
|
228 |
-
"
|
229 |
-
"homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
|
230 |
-
}
|
231 |
-
],
|
232 |
-
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
|
233 |
-
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
|
234 |
-
"keywords": [
|
235 |
-
"compatibility",
|
236 |
-
"phpcs",
|
237 |
-
"standards"
|
238 |
-
]
|
239 |
-
},
|
240 |
-
{
|
241 |
-
"name": "phpcompatibility/phpcompatibility-paragonie",
|
242 |
-
"version": "1.3.0",
|
243 |
-
"version_normalized": "1.3.0.0",
|
244 |
-
"source": {
|
245 |
-
"type": "git",
|
246 |
-
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
|
247 |
-
"reference": "b862bc32f7e860d0b164b199bd995e690b4b191c"
|
248 |
-
},
|
249 |
-
"dist": {
|
250 |
-
"type": "zip",
|
251 |
-
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c",
|
252 |
-
"reference": "b862bc32f7e860d0b164b199bd995e690b4b191c",
|
253 |
-
"shasum": ""
|
254 |
-
},
|
255 |
-
"require": {
|
256 |
-
"phpcompatibility/php-compatibility": "^9.0"
|
257 |
-
},
|
258 |
-
"require-dev": {
|
259 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5",
|
260 |
-
"paragonie/random_compat": "dev-master",
|
261 |
-
"paragonie/sodium_compat": "dev-master"
|
262 |
-
},
|
263 |
-
"suggest": {
|
264 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
265 |
-
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
266 |
-
},
|
267 |
-
"time": "2019-11-04T15:17:54+00:00",
|
268 |
-
"type": "phpcodesniffer-standard",
|
269 |
-
"installation-source": "dist",
|
270 |
-
"notification-url": "https://packagist.org/downloads/",
|
271 |
-
"license": [
|
272 |
-
"LGPL-3.0-or-later"
|
273 |
-
],
|
274 |
-
"authors": [
|
275 |
-
{
|
276 |
-
"name": "Wim Godden",
|
277 |
-
"role": "lead"
|
278 |
},
|
279 |
-
{
|
280 |
-
"
|
281 |
-
"
|
282 |
-
}
|
283 |
-
],
|
284 |
-
"description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
|
285 |
-
"homepage": "http://phpcompatibility.com/",
|
286 |
-
"keywords": [
|
287 |
-
"compatibility",
|
288 |
-
"paragonie",
|
289 |
-
"phpcs",
|
290 |
-
"polyfill",
|
291 |
-
"standards"
|
292 |
-
]
|
293 |
-
},
|
294 |
-
{
|
295 |
-
"name": "phpcompatibility/phpcompatibility-wp",
|
296 |
-
"version": "2.0.0",
|
297 |
-
"version_normalized": "2.0.0.0",
|
298 |
-
"source": {
|
299 |
-
"type": "git",
|
300 |
-
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
|
301 |
-
"reference": "cb303f0067cd5b366a41d4fb0e254fb40ff02efd"
|
302 |
-
},
|
303 |
-
"dist": {
|
304 |
-
"type": "zip",
|
305 |
-
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/cb303f0067cd5b366a41d4fb0e254fb40ff02efd",
|
306 |
-
"reference": "cb303f0067cd5b366a41d4fb0e254fb40ff02efd",
|
307 |
-
"shasum": ""
|
308 |
-
},
|
309 |
-
"require": {
|
310 |
-
"phpcompatibility/php-compatibility": "^9.0",
|
311 |
-
"phpcompatibility/phpcompatibility-paragonie": "^1.0"
|
312 |
-
},
|
313 |
-
"require-dev": {
|
314 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
|
315 |
-
},
|
316 |
-
"suggest": {
|
317 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
318 |
-
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
319 |
-
},
|
320 |
-
"time": "2018-10-07T18:31:37+00:00",
|
321 |
-
"type": "phpcodesniffer-standard",
|
322 |
-
"installation-source": "dist",
|
323 |
-
"notification-url": "https://packagist.org/downloads/",
|
324 |
-
"license": [
|
325 |
-
"LGPL-3.0-or-later"
|
326 |
-
],
|
327 |
-
"authors": [
|
328 |
-
{
|
329 |
-
"name": "Wim Godden",
|
330 |
-
"role": "lead"
|
331 |
},
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
]
|
345 |
-
},
|
346 |
-
{
|
347 |
-
"name": "sirbrillig/phpcs-variable-analysis",
|
348 |
-
"version": "v2.6.4",
|
349 |
-
"version_normalized": "2.6.4.0",
|
350 |
-
"source": {
|
351 |
-
"type": "git",
|
352 |
-
"url": "https://github.com/sirbrillig/phpcs-variable-analysis.git",
|
353 |
-
"reference": "fd217f2077fbcc287aded2b52147e68d208ace4b"
|
354 |
-
},
|
355 |
-
"dist": {
|
356 |
-
"type": "zip",
|
357 |
-
"url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/fd217f2077fbcc287aded2b52147e68d208ace4b",
|
358 |
-
"reference": "fd217f2077fbcc287aded2b52147e68d208ace4b",
|
359 |
-
"shasum": ""
|
360 |
-
},
|
361 |
-
"require": {
|
362 |
-
"php": ">=5.6.0"
|
363 |
-
},
|
364 |
-
"require-dev": {
|
365 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
|
366 |
-
"limedeck/phpunit-detailed-printer": "^3.1",
|
367 |
-
"phpunit/phpunit": "^6.5",
|
368 |
-
"sirbrillig/phpcs-import-detection": "^1.1",
|
369 |
-
"squizlabs/php_codesniffer": "^3.1"
|
370 |
-
},
|
371 |
-
"time": "2019-05-10T21:08:30+00:00",
|
372 |
-
"type": "phpcodesniffer-standard",
|
373 |
-
"installation-source": "dist",
|
374 |
-
"autoload": {
|
375 |
-
"psr-4": {
|
376 |
-
"VariableAnalysis\\": "VariableAnalysis/"
|
377 |
-
}
|
378 |
-
},
|
379 |
-
"notification-url": "https://packagist.org/downloads/",
|
380 |
-
"license": [
|
381 |
-
"BSD-2-Clause"
|
382 |
-
],
|
383 |
-
"authors": [
|
384 |
-
{
|
385 |
-
"name": "Payton Swick",
|
386 |
-
"email": "payton@foolord.com"
|
387 |
},
|
388 |
-
|
389 |
-
|
390 |
-
"
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
"
|
402 |
-
"
|
403 |
-
|
404 |
-
|
405 |
-
"
|
406 |
-
|
407 |
-
|
408 |
-
"
|
409 |
-
|
410 |
-
|
411 |
-
"
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
"
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
"
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
"
|
445 |
-
"
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
"type": "zip",
|
459 |
-
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bd9c33152115e6741e3510ff7189605b35167908",
|
460 |
-
"reference": "bd9c33152115e6741e3510ff7189605b35167908",
|
461 |
-
"shasum": ""
|
462 |
-
},
|
463 |
-
"require": {
|
464 |
-
"php": ">=5.4",
|
465 |
-
"squizlabs/php_codesniffer": "^3.3.1"
|
466 |
-
},
|
467 |
-
"require-dev": {
|
468 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
|
469 |
-
"phpcompatibility/php-compatibility": "^9.0",
|
470 |
-
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
471 |
-
},
|
472 |
-
"suggest": {
|
473 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
|
474 |
-
},
|
475 |
-
"time": "2019-05-21T02:50:00+00:00",
|
476 |
-
"type": "phpcodesniffer-standard",
|
477 |
-
"installation-source": "dist",
|
478 |
-
"notification-url": "https://packagist.org/downloads/",
|
479 |
-
"license": [
|
480 |
-
"MIT"
|
481 |
-
],
|
482 |
-
"authors": [
|
483 |
-
{
|
484 |
-
"name": "Contributors",
|
485 |
-
"homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors"
|
486 |
-
}
|
487 |
-
],
|
488 |
-
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
|
489 |
-
"keywords": [
|
490 |
-
"phpcs",
|
491 |
-
"standards",
|
492 |
-
"wordpress"
|
493 |
-
]
|
494 |
-
}
|
495 |
-
]
|
1 |
+
{
|
2 |
+
"packages": [
|
3 |
+
{
|
4 |
+
"name": "automattic/jetpack-autoloader",
|
5 |
+
"version": "v2.10.7",
|
6 |
+
"version_normalized": "2.10.7.0",
|
7 |
+
"source": {
|
8 |
+
"type": "git",
|
9 |
+
"url": "https://github.com/Automattic/jetpack-autoloader.git",
|
10 |
+
"reference": "e3dfa1a2679e4b8e380bc37b722081875c84a381"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
},
|
12 |
+
"dist": {
|
13 |
+
"type": "zip",
|
14 |
+
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/e3dfa1a2679e4b8e380bc37b722081875c84a381",
|
15 |
+
"reference": "e3dfa1a2679e4b8e380bc37b722081875c84a381",
|
16 |
+
"shasum": ""
|
17 |
},
|
18 |
+
"require": {
|
19 |
+
"composer-plugin-api": "^1.1 || ^2.0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
},
|
21 |
+
"require-dev": {
|
22 |
+
"automattic/jetpack-changelogger": "^2.0",
|
23 |
+
"yoast/phpunit-polyfills": "1.0.2"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
},
|
25 |
+
"time": "2021-10-07T14:29:51+00:00",
|
26 |
+
"type": "composer-plugin",
|
27 |
+
"extra": {
|
28 |
+
"autotagger": true,
|
29 |
+
"class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin",
|
30 |
+
"mirror-repo": "Automattic/jetpack-autoloader",
|
31 |
+
"changelogger": {
|
32 |
+
"link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}"
|
33 |
+
},
|
34 |
+
"branch-alias": {
|
35 |
+
"dev-master": "2.10.x-dev"
|
36 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
},
|
38 |
+
"installation-source": "dist",
|
39 |
+
"autoload": {
|
40 |
+
"classmap": [
|
41 |
+
"src/AutoloadGenerator.php"
|
42 |
+
],
|
43 |
+
"psr-4": {
|
44 |
+
"Automattic\\Jetpack\\Autoloader\\": "src"
|
45 |
+
}
|
46 |
+
},
|
47 |
+
"notification-url": "https://packagist.org/downloads/",
|
48 |
+
"license": [
|
49 |
+
"GPL-2.0-or-later"
|
50 |
+
],
|
51 |
+
"description": "Creates a custom autoloader for a plugin or theme.",
|
52 |
+
"support": {
|
53 |
+
"source": "https://github.com/Automattic/jetpack-autoloader/tree/v2.10.7"
|
54 |
+
},
|
55 |
+
"install-path": "../automattic/jetpack-autoloader"
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"name": "automattic/jetpack-logo",
|
59 |
+
"version": "v1.5.8",
|
60 |
+
"version_normalized": "1.5.8.0",
|
61 |
+
"source": {
|
62 |
+
"type": "git",
|
63 |
+
"url": "https://github.com/Automattic/jetpack-logo.git",
|
64 |
+
"reference": "c3045c4aa008507a13ee02ae5035dc91b3ff3ae4"
|
65 |
+
},
|
66 |
+
"dist": {
|
67 |
+
"type": "zip",
|
68 |
+
"url": "https://api.github.com/repos/Automattic/jetpack-logo/zipball/c3045c4aa008507a13ee02ae5035dc91b3ff3ae4",
|
69 |
+
"reference": "c3045c4aa008507a13ee02ae5035dc91b3ff3ae4",
|
70 |
+
"shasum": ""
|
71 |
+
},
|
72 |
+
"require-dev": {
|
73 |
+
"automattic/jetpack-changelogger": "^2.0",
|
74 |
+
"yoast/phpunit-polyfills": "1.0.2"
|
75 |
+
},
|
76 |
+
"time": "2021-10-07T14:29:57+00:00",
|
77 |
+
"type": "library",
|
78 |
+
"extra": {
|
79 |
+
"autotagger": true,
|
80 |
+
"mirror-repo": "Automattic/jetpack-logo",
|
81 |
+
"changelogger": {
|
82 |
+
"link-template": "https://github.com/Automattic/jetpack-logo/compare/v${old}...v${new}"
|
83 |
+
},
|
84 |
+
"branch-alias": {
|
85 |
+
"dev-master": "1.5.x-dev"
|
86 |
+
}
|
87 |
+
},
|
88 |
+
"installation-source": "dist",
|
89 |
+
"autoload": {
|
90 |
+
"classmap": [
|
91 |
+
"src/"
|
92 |
+
]
|
93 |
+
},
|
94 |
+
"notification-url": "https://packagist.org/downloads/",
|
95 |
+
"license": [
|
96 |
+
"GPL-2.0-or-later"
|
97 |
+
],
|
98 |
+
"description": "A logo for Jetpack",
|
99 |
+
"support": {
|
100 |
+
"source": "https://github.com/Automattic/jetpack-logo/tree/v1.5.8"
|
101 |
+
},
|
102 |
+
"install-path": "../automattic/jetpack-logo"
|
103 |
+
}
|
104 |
+
],
|
105 |
+
"dev": false,
|
106 |
+
"dev-package-names": []
|
107 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/composer/installed.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php return array(
|
2 |
+
'root' => array(
|
3 |
+
'pretty_version' => 'dev-master',
|
4 |
+
'version' => 'dev-master',
|
5 |
+
'type' => 'wordpress-plugin',
|
6 |
+
'install_path' => __DIR__ . '/../../',
|
7 |
+
'aliases' => array(),
|
8 |
+
'reference' => NULL,
|
9 |
+
'name' => 'automattic/vaultpress',
|
10 |
+
'dev' => false,
|
11 |
+
),
|
12 |
+
'versions' => array(
|
13 |
+
'automattic/jetpack-autoloader' => array(
|
14 |
+
'pretty_version' => 'v2.10.7',
|
15 |
+
'version' => '2.10.7.0',
|
16 |
+
'type' => 'composer-plugin',
|
17 |
+
'install_path' => __DIR__ . '/../automattic/jetpack-autoloader',
|
18 |
+
'aliases' => array(),
|
19 |
+
'reference' => 'e3dfa1a2679e4b8e380bc37b722081875c84a381',
|
20 |
+
'dev_requirement' => false,
|
21 |
+
),
|
22 |
+
'automattic/jetpack-logo' => array(
|
23 |
+
'pretty_version' => 'v1.5.8',
|
24 |
+
'version' => '1.5.8.0',
|
25 |
+
'type' => 'library',
|
26 |
+
'install_path' => __DIR__ . '/../automattic/jetpack-logo',
|
27 |
+
'aliases' => array(),
|
28 |
+
'reference' => 'c3045c4aa008507a13ee02ae5035dc91b3ff3ae4',
|
29 |
+
'dev_requirement' => false,
|
30 |
+
),
|
31 |
+
'automattic/vaultpress' => array(
|
32 |
+
'pretty_version' => 'dev-master',
|
33 |
+
'version' => 'dev-master',
|
34 |
+
'type' => 'wordpress-plugin',
|
35 |
+
'install_path' => __DIR__ . '/../../',
|
36 |
+
'aliases' => array(),
|
37 |
+
'reference' => NULL,
|
38 |
+
'dev_requirement' => false,
|
39 |
+
),
|
40 |
+
),
|
41 |
+
);
|
vendor/composer/jetpack_autoload_classmap.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// This file `jetpack_autoload_classmap.php` was auto generated by automattic/jetpack-autoloader.
|
4 |
+
|
5 |
+
$vendorDir = dirname(__DIR__);
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => array(
|
10 |
+
'version' => '2.10.7.0',
|
11 |
+
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php'
|
12 |
+
),
|
13 |
+
'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => array(
|
14 |
+
'version' => '2.10.7.0',
|
15 |
+
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php'
|
16 |
+
),
|
17 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array(
|
18 |
+
'version' => '2.10.7.0',
|
19 |
+
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php'
|
20 |
+
),
|
21 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => array(
|
22 |
+
'version' => '2.10.7.0',
|
23 |
+
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php'
|
24 |
+
),
|
25 |
+
'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => array(
|
26 |
+
'version' => '2.10.7.0',
|
27 |
+
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php'
|
28 |
+
),
|
29 |
+
'Automattic\\Jetpack\\Assets\\Logo' => array(
|
30 |
+
'version' => '1.5.8.0',
|
31 |
+
'path' => $vendorDir . '/automattic/jetpack-logo/src/class-logo.php'
|
32 |
+
),
|
33 |
+
);
|
vendor/jetpack-autoloader/class-autoloader-handler.php
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
use Automattic\Jetpack\Autoloader\AutoloadGenerator;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* This class selects the package version for the autoloader.
|
16 |
+
*/
|
17 |
+
class Autoloader_Handler {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* The PHP_Autoloader instance.
|
21 |
+
*
|
22 |
+
* @var PHP_Autoloader
|
23 |
+
*/
|
24 |
+
private $php_autoloader;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The Hook_Manager instance.
|
28 |
+
*
|
29 |
+
* @var Hook_Manager
|
30 |
+
*/
|
31 |
+
private $hook_manager;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* The Manifest_Reader instance.
|
35 |
+
*
|
36 |
+
* @var Manifest_Reader
|
37 |
+
*/
|
38 |
+
private $manifest_reader;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* The Version_Selector instance.
|
42 |
+
*
|
43 |
+
* @var Version_Selector
|
44 |
+
*/
|
45 |
+
private $version_selector;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* The constructor.
|
49 |
+
*
|
50 |
+
* @param PHP_Autoloader $php_autoloader The PHP_Autoloader instance.
|
51 |
+
* @param Hook_Manager $hook_manager The Hook_Manager instance.
|
52 |
+
* @param Manifest_Reader $manifest_reader The Manifest_Reader instance.
|
53 |
+
* @param Version_Selector $version_selector The Version_Selector instance.
|
54 |
+
*/
|
55 |
+
public function __construct( $php_autoloader, $hook_manager, $manifest_reader, $version_selector ) {
|
56 |
+
$this->php_autoloader = $php_autoloader;
|
57 |
+
$this->hook_manager = $hook_manager;
|
58 |
+
$this->manifest_reader = $manifest_reader;
|
59 |
+
$this->version_selector = $version_selector;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Checks to see whether or not an autoloader is currently in the process of initializing.
|
64 |
+
*
|
65 |
+
* @return bool
|
66 |
+
*/
|
67 |
+
public function is_initializing() {
|
68 |
+
// If no version has been set it means that no autoloader has started initializing yet.
|
69 |
+
global $jetpack_autoloader_latest_version;
|
70 |
+
if ( ! isset( $jetpack_autoloader_latest_version ) ) {
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
// When the version is set but the classmap is not it ALWAYS means that this is the
|
75 |
+
// latest autoloader and is being included by an older one.
|
76 |
+
global $jetpack_packages_classmap;
|
77 |
+
if ( empty( $jetpack_packages_classmap ) ) {
|
78 |
+
return true;
|
79 |
+
}
|
80 |
+
|
81 |
+
// Version 2.4.0 added a new global and altered the reset semantics. We need to check
|
82 |
+
// the other global as well since it may also point at initialization.
|
83 |
+
// Note: We don't need to check for the class first because every autoloader that
|
84 |
+
// will set the latest version global requires this class in the classmap.
|
85 |
+
$replacing_version = $jetpack_packages_classmap[ AutoloadGenerator::class ]['version'];
|
86 |
+
if ( $this->version_selector->is_dev_version( $replacing_version ) || version_compare( $replacing_version, '2.4.0.0', '>=' ) ) {
|
87 |
+
global $jetpack_autoloader_loader;
|
88 |
+
if ( ! isset( $jetpack_autoloader_loader ) ) {
|
89 |
+
return true;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Activates an autoloader using the given plugins and activates it.
|
98 |
+
*
|
99 |
+
* @param string[] $plugins The plugins to initialize the autoloader for.
|
100 |
+
*/
|
101 |
+
public function activate_autoloader( $plugins ) {
|
102 |
+
global $jetpack_packages_psr4;
|
103 |
+
$jetpack_packages_psr4 = array();
|
104 |
+
$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_psr4.php', $jetpack_packages_psr4 );
|
105 |
+
|
106 |
+
global $jetpack_packages_classmap;
|
107 |
+
$jetpack_packages_classmap = array();
|
108 |
+
$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_classmap.php', $jetpack_packages_classmap );
|
109 |
+
|
110 |
+
global $jetpack_packages_filemap;
|
111 |
+
$jetpack_packages_filemap = array();
|
112 |
+
$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_filemap.php', $jetpack_packages_filemap );
|
113 |
+
|
114 |
+
$loader = new Version_Loader(
|
115 |
+
$this->version_selector,
|
116 |
+
$jetpack_packages_classmap,
|
117 |
+
$jetpack_packages_psr4,
|
118 |
+
$jetpack_packages_filemap
|
119 |
+
);
|
120 |
+
|
121 |
+
$this->php_autoloader->register_autoloader( $loader );
|
122 |
+
|
123 |
+
// Now that the autoloader is active we can load the filemap.
|
124 |
+
$loader->load_filemap();
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Resets the active autoloader and all related global state.
|
129 |
+
*/
|
130 |
+
public function reset_autoloader() {
|
131 |
+
$this->php_autoloader->unregister_autoloader();
|
132 |
+
$this->hook_manager->reset();
|
133 |
+
|
134 |
+
// Clear all of the autoloader globals so that older autoloaders don't do anything strange.
|
135 |
+
global $jetpack_autoloader_latest_version;
|
136 |
+
$jetpack_autoloader_latest_version = null;
|
137 |
+
|
138 |
+
global $jetpack_packages_classmap;
|
139 |
+
$jetpack_packages_classmap = array(); // Must be array to avoid exceptions in old autoloaders!
|
140 |
+
|
141 |
+
global $jetpack_packages_psr4;
|
142 |
+
$jetpack_packages_psr4 = array(); // Must be array to avoid exceptions in old autoloaders!
|
143 |
+
|
144 |
+
global $jetpack_packages_filemap;
|
145 |
+
$jetpack_packages_filemap = array(); // Must be array to avoid exceptions in old autoloaders!
|
146 |
+
}
|
147 |
+
}
|
vendor/jetpack-autoloader/class-autoloader-locator.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
use Automattic\Jetpack\Autoloader\AutoloadGenerator;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* This class locates autoloaders.
|
16 |
+
*/
|
17 |
+
class Autoloader_Locator {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* The object for comparing autoloader versions.
|
21 |
+
*
|
22 |
+
* @var Version_Selector
|
23 |
+
*/
|
24 |
+
private $version_selector;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The constructor.
|
28 |
+
*
|
29 |
+
* @param Version_Selector $version_selector The version selector object.
|
30 |
+
*/
|
31 |
+
public function __construct( $version_selector ) {
|
32 |
+
$this->version_selector = $version_selector;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Finds the path to the plugin with the latest autoloader.
|
37 |
+
*
|
38 |
+
* @param array $plugin_paths An array of plugin paths.
|
39 |
+
* @param string $latest_version The latest version reference.
|
40 |
+
*
|
41 |
+
* @return string|null
|
42 |
+
*/
|
43 |
+
public function find_latest_autoloader( $plugin_paths, &$latest_version ) {
|
44 |
+
$latest_plugin = null;
|
45 |
+
|
46 |
+
foreach ( $plugin_paths as $plugin_path ) {
|
47 |
+
$version = $this->get_autoloader_version( $plugin_path );
|
48 |
+
if ( ! $this->version_selector->is_version_update_required( $latest_version, $version ) ) {
|
49 |
+
continue;
|
50 |
+
}
|
51 |
+
|
52 |
+
$latest_version = $version;
|
53 |
+
$latest_plugin = $plugin_path;
|
54 |
+
}
|
55 |
+
|
56 |
+
return $latest_plugin;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Gets the path to the autoloader.
|
61 |
+
*
|
62 |
+
* @param string $plugin_path The path to the plugin.
|
63 |
+
*
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
public function get_autoloader_path( $plugin_path ) {
|
67 |
+
return trailingslashit( $plugin_path ) . 'vendor/autoload_packages.php';
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Gets the version for the autoloader.
|
72 |
+
*
|
73 |
+
* @param string $plugin_path The path to the plugin.
|
74 |
+
*
|
75 |
+
* @return string|null
|
76 |
+
*/
|
77 |
+
public function get_autoloader_version( $plugin_path ) {
|
78 |
+
$classmap = trailingslashit( $plugin_path ) . 'vendor/composer/jetpack_autoload_classmap.php';
|
79 |
+
if ( ! file_exists( $classmap ) ) {
|
80 |
+
return null;
|
81 |
+
}
|
82 |
+
|
83 |
+
$classmap = require $classmap;
|
84 |
+
if ( isset( $classmap[ AutoloadGenerator::class ] ) ) {
|
85 |
+
return $classmap[ AutoloadGenerator::class ]['version'];
|
86 |
+
}
|
87 |
+
|
88 |
+
return null;
|
89 |
+
}
|
90 |
+
}
|
vendor/jetpack-autoloader/class-autoloader.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class handles management of the actual PHP autoloader.
|
14 |
+
*/
|
15 |
+
class Autoloader {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Checks to see whether or not the autoloader should be initialized and then initializes it if so.
|
19 |
+
*
|
20 |
+
* @param Container|null $container The container we want to use for autoloader initialization. If none is given
|
21 |
+
* then a container will be created automatically.
|
22 |
+
*/
|
23 |
+
public static function init( $container = null ) {
|
24 |
+
// The container holds and manages the lifecycle of our dependencies
|
25 |
+
// to make them easier to work with and increase flexibility.
|
26 |
+
if ( ! isset( $container ) ) {
|
27 |
+
require_once __DIR__ . '/class-container.php';
|
28 |
+
$container = new Container();
|
29 |
+
}
|
30 |
+
|
31 |
+
// phpcs:disable Generic.Commenting.DocComment.MissingShort
|
32 |
+
|
33 |
+
/** @var Autoloader_Handler $autoloader_handler */
|
34 |
+
$autoloader_handler = $container->get( Autoloader_Handler::class );
|
35 |
+
|
36 |
+
// If the autoloader is already initializing it means that it has included us as the latest.
|
37 |
+
$was_included_by_autoloader = $autoloader_handler->is_initializing();
|
38 |
+
|
39 |
+
/** @var Plugin_Locator $plugin_locator */
|
40 |
+
$plugin_locator = $container->get( Plugin_Locator::class );
|
41 |
+
|
42 |
+
/** @var Plugins_Handler $plugins_handler */
|
43 |
+
$plugins_handler = $container->get( Plugins_Handler::class );
|
44 |
+
|
45 |
+
// The current plugin is the one that we are attempting to initialize here.
|
46 |
+
$current_plugin = $plugin_locator->find_current_plugin();
|
47 |
+
|
48 |
+
// The active plugins are those that we were able to discover on the site. This list will not
|
49 |
+
// include mu-plugins, those activated by code, or those who are hidden by filtering. We also
|
50 |
+
// want to take care to not consider the current plugin unknown if it was included by an
|
51 |
+
// autoloader. This avoids the case where a plugin will be marked "active" while deactivated
|
52 |
+
// due to it having the latest autoloader.
|
53 |
+
$active_plugins = $plugins_handler->get_active_plugins( true, ! $was_included_by_autoloader );
|
54 |
+
|
55 |
+
// The cached plugins are all of those that were active or discovered by the autoloader during a previous request.
|
56 |
+
// Note that it's possible this list will include plugins that have since been deactivated, but after a request
|
57 |
+
// the cache should be updated and the deactivated plugins will be removed.
|
58 |
+
$cached_plugins = $plugins_handler->get_cached_plugins();
|
59 |
+
|
60 |
+
// We combine the active list and cached list to preemptively load classes for plugins that are
|
61 |
+
// presently unknown but will be loaded during the request. While this may result in us considering packages in
|
62 |
+
// deactivated plugins there shouldn't be any problems as a result and the eventual consistency is sufficient.
|
63 |
+
$all_plugins = array_merge( $active_plugins, $cached_plugins );
|
64 |
+
|
65 |
+
// In particular we also include the current plugin to address the case where it is the latest autoloader
|
66 |
+
// but also unknown (and not cached). We don't want it in the active list because we don't know that it
|
67 |
+
// is active but we need it in the all plugins list so that it is considered by the autoloader.
|
68 |
+
$all_plugins[] = $current_plugin;
|
69 |
+
|
70 |
+
// We require uniqueness in the array to avoid processing the same plugin more than once.
|
71 |
+
$all_plugins = array_values( array_unique( $all_plugins ) );
|
72 |
+
|
73 |
+
/** @var Latest_Autoloader_Guard $guard */
|
74 |
+
$guard = $container->get( Latest_Autoloader_Guard::class );
|
75 |
+
if ( $guard->should_stop_init( $current_plugin, $all_plugins, $was_included_by_autoloader ) ) {
|
76 |
+
return;
|
77 |
+
}
|
78 |
+
|
79 |
+
// Initialize the autoloader using the handler now that we're ready.
|
80 |
+
$autoloader_handler->activate_autoloader( $all_plugins );
|
81 |
+
|
82 |
+
/** @var Hook_Manager $hook_manager */
|
83 |
+
$hook_manager = $container->get( Hook_Manager::class );
|
84 |
+
|
85 |
+
// Register a shutdown handler to clean up the autoloader.
|
86 |
+
$hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) );
|
87 |
+
|
88 |
+
// phpcs:enable Generic.Commenting.DocComment.MissingShort
|
89 |
+
}
|
90 |
+
}
|
vendor/jetpack-autoloader/class-container.php
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class manages the files and dependencies of the autoloader.
|
14 |
+
*/
|
15 |
+
class Container {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Since each autoloader's class files exist within their own namespace we need a map to
|
19 |
+
* convert between the local class and a shared key. Note that no version checking is
|
20 |
+
* performed on these dependencies and the first autoloader to register will be the
|
21 |
+
* one that is utilized.
|
22 |
+
*/
|
23 |
+
const SHARED_DEPENDENCY_KEYS = array(
|
24 |
+
Hook_Manager::class => 'Hook_Manager',
|
25 |
+
);
|
26 |
+
|
27 |
+
/**
|
28 |
+
* A map of all the dependencies we've registered with the container and created.
|
29 |
+
*
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
+
protected $dependencies;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* The constructor.
|
36 |
+
*/
|
37 |
+
public function __construct() {
|
38 |
+
$this->dependencies = array();
|
39 |
+
|
40 |
+
$this->register_shared_dependencies();
|
41 |
+
$this->register_dependencies();
|
42 |
+
$this->initialize_globals();
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Gets a dependency out of the container.
|
47 |
+
*
|
48 |
+
* @param string $class The class to fetch.
|
49 |
+
*
|
50 |
+
* @return mixed
|
51 |
+
* @throws \InvalidArgumentException When a class that isn't registered with the container is fetched.
|
52 |
+
*/
|
53 |
+
public function get( $class ) {
|
54 |
+
if ( ! isset( $this->dependencies[ $class ] ) ) {
|
55 |
+
throw new \InvalidArgumentException( "Class '$class' is not registered with the container." );
|
56 |
+
}
|
57 |
+
|
58 |
+
return $this->dependencies[ $class ];
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Registers all of the dependencies that are shared between all instances of the autoloader.
|
63 |
+
*/
|
64 |
+
private function register_shared_dependencies() {
|
65 |
+
global $jetpack_autoloader_container_shared;
|
66 |
+
if ( ! isset( $jetpack_autoloader_container_shared ) ) {
|
67 |
+
$jetpack_autoloader_container_shared = array();
|
68 |
+
}
|
69 |
+
|
70 |
+
$key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ];
|
71 |
+
if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) {
|
72 |
+
require_once __DIR__ . '/class-hook-manager.php';
|
73 |
+
$jetpack_autoloader_container_shared[ $key ] = new Hook_Manager();
|
74 |
+
}
|
75 |
+
$this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ];
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Registers all of the dependencies with the container.
|
80 |
+
*/
|
81 |
+
private function register_dependencies() {
|
82 |
+
require_once __DIR__ . '/class-path-processor.php';
|
83 |
+
$this->dependencies[ Path_Processor::class ] = new Path_Processor();
|
84 |
+
|
85 |
+
require_once __DIR__ . '/class-plugin-locator.php';
|
86 |
+
$this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator(
|
87 |
+
$this->get( Path_Processor::class )
|
88 |
+
);
|
89 |
+
|
90 |
+
require_once __DIR__ . '/class-version-selector.php';
|
91 |
+
$this->dependencies[ Version_Selector::class ] = new Version_Selector();
|
92 |
+
|
93 |
+
require_once __DIR__ . '/class-autoloader-locator.php';
|
94 |
+
$this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator(
|
95 |
+
$this->get( Version_Selector::class )
|
96 |
+
);
|
97 |
+
|
98 |
+
require_once __DIR__ . '/class-php-autoloader.php';
|
99 |
+
$this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader();
|
100 |
+
|
101 |
+
require_once __DIR__ . '/class-manifest-reader.php';
|
102 |
+
$this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader(
|
103 |
+
$this->get( Version_Selector::class )
|
104 |
+
);
|
105 |
+
|
106 |
+
require_once __DIR__ . '/class-plugins-handler.php';
|
107 |
+
$this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler(
|
108 |
+
$this->get( Plugin_Locator::class ),
|
109 |
+
$this->get( Path_Processor::class )
|
110 |
+
);
|
111 |
+
|
112 |
+
require_once __DIR__ . '/class-autoloader-handler.php';
|
113 |
+
$this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler(
|
114 |
+
$this->get( PHP_Autoloader::class ),
|
115 |
+
$this->get( Hook_Manager::class ),
|
116 |
+
$this->get( Manifest_Reader::class ),
|
117 |
+
$this->get( Version_Selector::class )
|
118 |
+
);
|
119 |
+
|
120 |
+
require_once __DIR__ . '/class-latest-autoloader-guard.php';
|
121 |
+
$this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard(
|
122 |
+
$this->get( Plugins_Handler::class ),
|
123 |
+
$this->get( Autoloader_Handler::class ),
|
124 |
+
$this->get( Autoloader_Locator::class )
|
125 |
+
);
|
126 |
+
|
127 |
+
// Register any classes that we will use elsewhere.
|
128 |
+
require_once __DIR__ . '/class-version-loader.php';
|
129 |
+
require_once __DIR__ . '/class-shutdown-handler.php';
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Initializes any of the globals needed by the autoloader.
|
134 |
+
*/
|
135 |
+
private function initialize_globals() {
|
136 |
+
/*
|
137 |
+
* This global was retired in version 2.9. The value is set to 'false' to maintain
|
138 |
+
* compatibility with older versions of the autoloader.
|
139 |
+
*/
|
140 |
+
global $jetpack_autoloader_including_latest;
|
141 |
+
$jetpack_autoloader_including_latest = false;
|
142 |
+
|
143 |
+
// Not all plugins can be found using the locator. In cases where a plugin loads the autoloader
|
144 |
+
// but was not discoverable, we will record them in this array to track them as "active".
|
145 |
+
global $jetpack_autoloader_activating_plugins_paths;
|
146 |
+
if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) {
|
147 |
+
$jetpack_autoloader_activating_plugins_paths = array();
|
148 |
+
}
|
149 |
+
}
|
150 |
+
}
|
vendor/jetpack-autoloader/class-hook-manager.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Allows the latest autoloader to register hooks that can be removed when the autoloader is reset.
|
14 |
+
*/
|
15 |
+
class Hook_Manager {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* An array containing all of the hooks that we've registered.
|
19 |
+
*
|
20 |
+
* @var array
|
21 |
+
*/
|
22 |
+
private $registered_hooks;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The constructor.
|
26 |
+
*/
|
27 |
+
public function __construct() {
|
28 |
+
$this->registered_hooks = array();
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Adds an action to WordPress and registers it internally.
|
33 |
+
*
|
34 |
+
* @param string $tag The name of the action which is hooked.
|
35 |
+
* @param callable $callable The function to call.
|
36 |
+
* @param int $priority Used to specify the priority of the action.
|
37 |
+
* @param int $accepted_args Used to specify the number of arguments the callable accepts.
|
38 |
+
*/
|
39 |
+
public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
|
40 |
+
$this->registered_hooks[ $tag ][] = array(
|
41 |
+
'priority' => $priority,
|
42 |
+
'callable' => $callable,
|
43 |
+
);
|
44 |
+
|
45 |
+
add_action( $tag, $callable, $priority, $accepted_args );
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Adds a filter to WordPress and registers it internally.
|
50 |
+
*
|
51 |
+
* @param string $tag The name of the filter which is hooked.
|
52 |
+
* @param callable $callable The function to call.
|
53 |
+
* @param int $priority Used to specify the priority of the filter.
|
54 |
+
* @param int $accepted_args Used to specify the number of arguments the callable accepts.
|
55 |
+
*/
|
56 |
+
public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
|
57 |
+
$this->registered_hooks[ $tag ][] = array(
|
58 |
+
'priority' => $priority,
|
59 |
+
'callable' => $callable,
|
60 |
+
);
|
61 |
+
|
62 |
+
add_filter( $tag, $callable, $priority, $accepted_args );
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Removes all of the registered hooks.
|
67 |
+
*/
|
68 |
+
public function reset() {
|
69 |
+
foreach ( $this->registered_hooks as $tag => $hooks ) {
|
70 |
+
foreach ( $hooks as $hook ) {
|
71 |
+
remove_filter( $tag, $hook['callable'], $hook['priority'] );
|
72 |
+
}
|
73 |
+
}
|
74 |
+
$this->registered_hooks = array();
|
75 |
+
}
|
76 |
+
}
|
vendor/jetpack-autoloader/class-latest-autoloader-guard.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class ensures that we're only executing the latest autoloader.
|
14 |
+
*/
|
15 |
+
class Latest_Autoloader_Guard {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The Plugins_Handler instance.
|
19 |
+
*
|
20 |
+
* @var Plugins_Handler
|
21 |
+
*/
|
22 |
+
private $plugins_handler;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The Autoloader_Handler instance.
|
26 |
+
*
|
27 |
+
* @var Autoloader_Handler
|
28 |
+
*/
|
29 |
+
private $autoloader_handler;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The Autoloader_locator instance.
|
33 |
+
*
|
34 |
+
* @var Autoloader_Locator
|
35 |
+
*/
|
36 |
+
private $autoloader_locator;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* The constructor.
|
40 |
+
*
|
41 |
+
* @param Plugins_Handler $plugins_handler The Plugins_Handler instance.
|
42 |
+
* @param Autoloader_Handler $autoloader_handler The Autoloader_Handler instance.
|
43 |
+
* @param Autoloader_Locator $autoloader_locator The Autoloader_Locator instance.
|
44 |
+
*/
|
45 |
+
public function __construct( $plugins_handler, $autoloader_handler, $autoloader_locator ) {
|
46 |
+
$this->plugins_handler = $plugins_handler;
|
47 |
+
$this->autoloader_handler = $autoloader_handler;
|
48 |
+
$this->autoloader_locator = $autoloader_locator;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Indicates whether or not the autoloader should be initialized. Note that this function
|
53 |
+
* has the side-effect of actually loading the latest autoloader in the event that this
|
54 |
+
* is not it.
|
55 |
+
*
|
56 |
+
* @param string $current_plugin The current plugin we're checking.
|
57 |
+
* @param string[] $plugins The active plugins to check for autoloaders in.
|
58 |
+
* @param bool $was_included_by_autoloader Indicates whether or not this autoloader was included by another.
|
59 |
+
*
|
60 |
+
* @return bool True if we should stop initialization, otherwise false.
|
61 |
+
*/
|
62 |
+
public function should_stop_init( $current_plugin, $plugins, $was_included_by_autoloader ) {
|
63 |
+
global $jetpack_autoloader_latest_version;
|
64 |
+
|
65 |
+
// We need to reset the autoloader when the plugins change because
|
66 |
+
// that means the autoloader was generated with a different list.
|
67 |
+
if ( $this->plugins_handler->have_plugins_changed( $plugins ) ) {
|
68 |
+
$this->autoloader_handler->reset_autoloader();
|
69 |
+
}
|
70 |
+
|
71 |
+
// When the latest autoloader has already been found we don't need to search for it again.
|
72 |
+
// We should take care however because this will also trigger if the autoloader has been
|
73 |
+
// included by an older one.
|
74 |
+
if ( isset( $jetpack_autoloader_latest_version ) && ! $was_included_by_autoloader ) {
|
75 |
+
return true;
|
76 |
+
}
|
77 |
+
|
78 |
+
$latest_plugin = $this->autoloader_locator->find_latest_autoloader( $plugins, $jetpack_autoloader_latest_version );
|
79 |
+
if ( isset( $latest_plugin ) && $latest_plugin !== $current_plugin ) {
|
80 |
+
require $this->autoloader_locator->get_autoloader_path( $latest_plugin );
|
81 |
+
return true;
|
82 |
+
}
|
83 |
+
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
}
|
vendor/jetpack-autoloader/class-manifest-reader.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class reads autoloader manifest files.
|
14 |
+
*/
|
15 |
+
class Manifest_Reader {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The Version_Selector object.
|
19 |
+
*
|
20 |
+
* @var Version_Selector
|
21 |
+
*/
|
22 |
+
private $version_selector;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The constructor.
|
26 |
+
*
|
27 |
+
* @param Version_Selector $version_selector The Version_Selector object.
|
28 |
+
*/
|
29 |
+
public function __construct( $version_selector ) {
|
30 |
+
$this->version_selector = $version_selector;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Reads all of the manifests in the given plugin paths.
|
35 |
+
*
|
36 |
+
* @param array $plugin_paths The paths to the plugins we're loading the manifest in.
|
37 |
+
* @param string $manifest_path The path that we're loading the manifest from in each plugin.
|
38 |
+
* @param array $path_map The path map to add the contents of the manifests to.
|
39 |
+
*
|
40 |
+
* @return array $path_map The path map we've built using the manifests in each plugin.
|
41 |
+
*/
|
42 |
+
public function read_manifests( $plugin_paths, $manifest_path, &$path_map ) {
|
43 |
+
$file_paths = array_map(
|
44 |
+
function ( $path ) use ( $manifest_path ) {
|
45 |
+
return trailingslashit( $path ) . $manifest_path;
|
46 |
+
},
|
47 |
+
$plugin_paths
|
48 |
+
);
|
49 |
+
|
50 |
+
foreach ( $file_paths as $path ) {
|
51 |
+
$this->register_manifest( $path, $path_map );
|
52 |
+
}
|
53 |
+
|
54 |
+
return $path_map;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Registers a plugin's manifest file with the path map.
|
59 |
+
*
|
60 |
+
* @param string $manifest_path The absolute path to the manifest that we're loading.
|
61 |
+
* @param array $path_map The path map to add the contents of the manifest to.
|
62 |
+
*/
|
63 |
+
protected function register_manifest( $manifest_path, &$path_map ) {
|
64 |
+
if ( ! is_readable( $manifest_path ) ) {
|
65 |
+
return;
|
66 |
+
}
|
67 |
+
|
68 |
+
$manifest = require $manifest_path;
|
69 |
+
if ( ! is_array( $manifest ) ) {
|
70 |
+
return;
|
71 |
+
}
|
72 |
+
|
73 |
+
foreach ( $manifest as $key => $data ) {
|
74 |
+
$this->register_record( $key, $data, $path_map );
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Registers an entry from the manifest in the path map.
|
80 |
+
*
|
81 |
+
* @param string $key The identifier for the entry we're registering.
|
82 |
+
* @param array $data The data for the entry we're registering.
|
83 |
+
* @param array $path_map The path map to add the contents of the manifest to.
|
84 |
+
*/
|
85 |
+
protected function register_record( $key, $data, &$path_map ) {
|
86 |
+
if ( isset( $path_map[ $key ]['version'] ) ) {
|
87 |
+
$selected_version = $path_map[ $key ]['version'];
|
88 |
+
} else {
|
89 |
+
$selected_version = null;
|
90 |
+
}
|
91 |
+
|
92 |
+
if ( $this->version_selector->is_version_update_required( $selected_version, $data['version'] ) ) {
|
93 |
+
$path_map[ $key ] = array(
|
94 |
+
'version' => $data['version'],
|
95 |
+
'path' => $data['path'],
|
96 |
+
);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
vendor/jetpack-autoloader/class-path-processor.php
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class handles dealing with paths for the autoloader.
|
14 |
+
*/
|
15 |
+
class Path_Processor {
|
16 |
+
/**
|
17 |
+
* Given a path this will replace any of the path constants with a token to represent it.
|
18 |
+
*
|
19 |
+
* @param string $path The path we want to process.
|
20 |
+
*
|
21 |
+
* @return string The tokenized path.
|
22 |
+
*/
|
23 |
+
public function tokenize_path_constants( $path ) {
|
24 |
+
$path = wp_normalize_path( $path );
|
25 |
+
|
26 |
+
$constants = $this->get_normalized_constants();
|
27 |
+
foreach ( $constants as $constant => $constant_path ) {
|
28 |
+
$len = strlen( $constant_path );
|
29 |
+
if ( substr( $path, 0, $len ) !== $constant_path ) {
|
30 |
+
continue;
|
31 |
+
}
|
32 |
+
|
33 |
+
return substr_replace( $path, '{{' . $constant . '}}', 0, $len );
|
34 |
+
}
|
35 |
+
|
36 |
+
return $path;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Given a path this will replace any of the path constant tokens with the expanded path.
|
41 |
+
*
|
42 |
+
* @param string $tokenized_path The path we want to process.
|
43 |
+
*
|
44 |
+
* @return string The expanded path.
|
45 |
+
*/
|
46 |
+
public function untokenize_path_constants( $tokenized_path ) {
|
47 |
+
$tokenized_path = wp_normalize_path( $tokenized_path );
|
48 |
+
|
49 |
+
$constants = $this->get_normalized_constants();
|
50 |
+
foreach ( $constants as $constant => $constant_path ) {
|
51 |
+
$constant = '{{' . $constant . '}}';
|
52 |
+
|
53 |
+
$len = strlen( $constant );
|
54 |
+
if ( substr( $tokenized_path, 0, $len ) !== $constant ) {
|
55 |
+
continue;
|
56 |
+
}
|
57 |
+
|
58 |
+
return $this->get_real_path( substr_replace( $tokenized_path, $constant_path, 0, $len ) );
|
59 |
+
}
|
60 |
+
|
61 |
+
return $tokenized_path;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Given a file and an array of places it might be, this will find the absolute path and return it.
|
66 |
+
*
|
67 |
+
* @param string $file The plugin or theme file to resolve.
|
68 |
+
* @param array $directories_to_check The directories we should check for the file if it isn't an absolute path.
|
69 |
+
*
|
70 |
+
* @return string|false Returns the absolute path to the directory, otherwise false.
|
71 |
+
*/
|
72 |
+
public function find_directory_with_autoloader( $file, $directories_to_check ) {
|
73 |
+
$file = wp_normalize_path( $file );
|
74 |
+
|
75 |
+
if ( ! $this->is_absolute_path( $file ) ) {
|
76 |
+
$file = $this->find_absolute_plugin_path( $file, $directories_to_check );
|
77 |
+
if ( ! isset( $file ) ) {
|
78 |
+
return false;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
// We need the real path for consistency with __DIR__ paths.
|
83 |
+
$file = $this->get_real_path( $file );
|
84 |
+
|
85 |
+
// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
|
86 |
+
$directory = @is_file( $file ) ? dirname( $file ) : $file;
|
87 |
+
if ( ! @is_file( $directory . '/vendor/composer/jetpack_autoload_classmap.php' ) ) {
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
// phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged
|
91 |
+
|
92 |
+
return $directory;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Fetches an array of normalized paths keyed by the constant they came from.
|
97 |
+
*
|
98 |
+
* @return string[] The normalized paths keyed by the constant.
|
99 |
+
*/
|
100 |
+
private function get_normalized_constants() {
|
101 |
+
$raw_constants = array(
|
102 |
+
// Order the constants from most-specific to least-specific.
|
103 |
+
'WP_PLUGIN_DIR',
|
104 |
+
'WPMU_PLUGIN_DIR',
|
105 |
+
'WP_CONTENT_DIR',
|
106 |
+
'ABSPATH',
|
107 |
+
);
|
108 |
+
|
109 |
+
$constants = array();
|
110 |
+
foreach ( $raw_constants as $raw ) {
|
111 |
+
if ( ! defined( $raw ) ) {
|
112 |
+
continue;
|
113 |
+
}
|
114 |
+
|
115 |
+
$path = wp_normalize_path( constant( $raw ) );
|
116 |
+
if ( isset( $path ) ) {
|
117 |
+
$constants[ $raw ] = $path;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
return $constants;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Indicates whether or not a path is absolute.
|
126 |
+
*
|
127 |
+
* @param string $path The path to check.
|
128 |
+
*
|
129 |
+
* @return bool True if the path is absolute, otherwise false.
|
130 |
+
*/
|
131 |
+
private function is_absolute_path( $path ) {
|
132 |
+
if ( 0 === strlen( $path ) || '.' === $path[0] ) {
|
133 |
+
return false;
|
134 |
+
}
|
135 |
+
|
136 |
+
// Absolute paths on Windows may begin with a drive letter.
|
137 |
+
if ( preg_match( '/^[a-zA-Z]:[\/\\\\]/', $path ) ) {
|
138 |
+
return true;
|
139 |
+
}
|
140 |
+
|
141 |
+
// A path starting with / or \ is absolute; anything else is relative.
|
142 |
+
return ( '/' === $path[0] || '\\' === $path[0] );
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Given a file and a list of directories to check, this method will try to figure out
|
147 |
+
* the absolute path to the file in question.
|
148 |
+
*
|
149 |
+
* @param string $normalized_path The normalized path to the plugin or theme file to resolve.
|
150 |
+
* @param array $directories_to_check The directories we should check for the file if it isn't an absolute path.
|
151 |
+
*
|
152 |
+
* @return string|null The absolute path to the plugin file, otherwise null.
|
153 |
+
*/
|
154 |
+
private function find_absolute_plugin_path( $normalized_path, $directories_to_check ) {
|
155 |
+
// We're only able to find the absolute path for plugin/theme PHP files.
|
156 |
+
if ( ! is_string( $normalized_path ) || '.php' !== substr( $normalized_path, -4 ) ) {
|
157 |
+
return null;
|
158 |
+
}
|
159 |
+
|
160 |
+
foreach ( $directories_to_check as $directory ) {
|
161 |
+
$normalized_check = wp_normalize_path( trailingslashit( $directory ) ) . $normalized_path;
|
162 |
+
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
163 |
+
if ( @is_file( $normalized_check ) ) {
|
164 |
+
return $normalized_check;
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
return null;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Given a path this will figure out the real path that we should be using.
|
173 |
+
*
|
174 |
+
* @param string $path The path to resolve.
|
175 |
+
*
|
176 |
+
* @return string The resolved path.
|
177 |
+
*/
|
178 |
+
private function get_real_path( $path ) {
|
179 |
+
// We want to resolve symbolic links for consistency with __DIR__ paths.
|
180 |
+
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
181 |
+
$real_path = @realpath( $path );
|
182 |
+
if ( false === $real_path ) {
|
183 |
+
// Let the autoloader deal with paths that don't exist.
|
184 |
+
$real_path = $path;
|
185 |
+
}
|
186 |
+
|
187 |
+
// Using realpath will make it platform-specific so we must normalize it after.
|
188 |
+
if ( $path !== $real_path ) {
|
189 |
+
$real_path = wp_normalize_path( $real_path );
|
190 |
+
}
|
191 |
+
|
192 |
+
return $real_path;
|
193 |
+
}
|
194 |
+
}
|
vendor/jetpack-autoloader/class-php-autoloader.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class handles management of the actual PHP autoloader.
|
14 |
+
*/
|
15 |
+
class PHP_Autoloader {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Registers the autoloader with PHP so that it can begin autoloading classes.
|
19 |
+
*
|
20 |
+
* @param Version_Loader $version_loader The class loader to use in the autoloader.
|
21 |
+
*/
|
22 |
+
public function register_autoloader( $version_loader ) {
|
23 |
+
// Make sure no other autoloaders are registered.
|
24 |
+
$this->unregister_autoloader();
|
25 |
+
|
26 |
+
// Set the global so that it can be used to load classes.
|
27 |
+
global $jetpack_autoloader_loader;
|
28 |
+
$jetpack_autoloader_loader = $version_loader;
|
29 |
+
|
30 |
+
// Ensure that the autoloader is first to avoid contention with others.
|
31 |
+
spl_autoload_register( array( self::class, 'load_class' ), true, true );
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Unregisters the active autoloader so that it will no longer autoload classes.
|
36 |
+
*/
|
37 |
+
public function unregister_autoloader() {
|
38 |
+
// Remove any v2 autoloader that we've already registered.
|
39 |
+
$autoload_chain = spl_autoload_functions();
|
40 |
+
foreach ( $autoload_chain as $autoloader ) {
|
41 |
+
// We can identify a v2 autoloader using the namespace.
|
42 |
+
$namespace_check = null;
|
43 |
+
|
44 |
+
// Functions are recorded as strings.
|
45 |
+
if ( is_string( $autoloader ) ) {
|
46 |
+
$namespace_check = $autoloader;
|
47 |
+
} elseif ( is_array( $autoloader ) && is_string( $autoloader[0] ) ) {
|
48 |
+
// Static method calls have the class as the first array element.
|
49 |
+
$namespace_check = $autoloader[0];
|
50 |
+
} else {
|
51 |
+
// Since the autoloader has only ever been a function or a static method we don't currently need to check anything else.
|
52 |
+
continue;
|
53 |
+
}
|
54 |
+
|
55 |
+
// Check for the namespace without the generated suffix.
|
56 |
+
if ( 'Automattic\\Jetpack\\Autoloader\\jp' === substr( $namespace_check, 0, 32 ) ) {
|
57 |
+
spl_autoload_unregister( $autoloader );
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
// Clear the global now that the autoloader has been unregistered.
|
62 |
+
global $jetpack_autoloader_loader;
|
63 |
+
$jetpack_autoloader_loader = null;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Loads a class file if one could be found.
|
68 |
+
*
|
69 |
+
* Note: This function is static so that the autoloader can be easily unregistered. If
|
70 |
+
* it was a class method we would have to unwrap the object to check the namespace.
|
71 |
+
*
|
72 |
+
* @param string $class_name The name of the class to autoload.
|
73 |
+
*
|
74 |
+
* @return bool Indicates whether or not a class file was loaded.
|
75 |
+
*/
|
76 |
+
public static function load_class( $class_name ) {
|
77 |
+
global $jetpack_autoloader_loader;
|
78 |
+
if ( ! isset( $jetpack_autoloader_loader ) ) {
|
79 |
+
return;
|
80 |
+
}
|
81 |
+
|
82 |
+
$file = $jetpack_autoloader_loader->find_class_file( $class_name );
|
83 |
+
if ( ! isset( $file ) ) {
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
|
87 |
+
require $file;
|
88 |
+
return true;
|
89 |
+
}
|
90 |
+
}
|
vendor/jetpack-autoloader/class-plugin-locator.php
ADDED
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class scans the WordPress installation to find active plugins.
|
14 |
+
*/
|
15 |
+
class Plugin_Locator {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The path processor for finding plugin paths.
|
19 |
+
*
|
20 |
+
* @var Path_Processor
|
21 |
+
*/
|
22 |
+
private $path_processor;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The constructor.
|
26 |
+
*
|
27 |
+
* @param Path_Processor $path_processor The Path_Processor instance.
|
28 |
+
*/
|
29 |
+
public function __construct( $path_processor ) {
|
30 |
+
$this->path_processor = $path_processor;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Finds the path to the current plugin.
|
35 |
+
*
|
36 |
+
* @return string $path The path to the current plugin.
|
37 |
+
*
|
38 |
+
* @throws \RuntimeException If the current plugin does not have an autoloader.
|
39 |
+
*/
|
40 |
+
public function find_current_plugin() {
|
41 |
+
// Escape from `vendor/__DIR__` to root plugin directory.
|
42 |
+
$plugin_directory = dirname( dirname( __DIR__ ) );
|
43 |
+
|
44 |
+
// Use the path processor to ensure that this is an autoloader we're referencing.
|
45 |
+
$path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() );
|
46 |
+
if ( false === $path ) {
|
47 |
+
throw new \RuntimeException( 'Failed to locate plugin ' . $plugin_directory );
|
48 |
+
}
|
49 |
+
|
50 |
+
return $path;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Checks a given option for plugin paths.
|
55 |
+
*
|
56 |
+
* @param string $option_name The option that we want to check for plugin information.
|
57 |
+
* @param bool $site_option Indicates whether or not we want to check the site option.
|
58 |
+
*
|
59 |
+
* @return array $plugin_paths The list of absolute paths we've found.
|
60 |
+
*/
|
61 |
+
public function find_using_option( $option_name, $site_option = false ) {
|
62 |
+
$raw = $site_option ? get_site_option( $option_name ) : get_option( $option_name );
|
63 |
+
if ( false === $raw ) {
|
64 |
+
return array();
|
65 |
+
}
|
66 |
+
|
67 |
+
return $this->convert_plugins_to_paths( $raw );
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Checks for plugins in the `action` request parameter.
|
72 |
+
*
|
73 |
+
* @param string[] $allowed_actions The actions that we're allowed to return plugins for.
|
74 |
+
*
|
75 |
+
* @return array $plugin_paths The list of absolute paths we've found.
|
76 |
+
*/
|
77 |
+
public function find_using_request_action( $allowed_actions ) {
|
78 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Note: we're not actually checking the nonce here because it's too early
|
82 |
+
* in the execution. The pluggable functions are not yet loaded to give
|
83 |
+
* plugins a chance to plug their versions. Therefore we're doing the bare
|
84 |
+
* minimum: checking whether the nonce exists and it's in the right place.
|
85 |
+
* The request will fail later if the nonce doesn't pass the check.
|
86 |
+
*/
|
87 |
+
if ( empty( $_REQUEST['_wpnonce'] ) ) {
|
88 |
+
return array();
|
89 |
+
}
|
90 |
+
|
91 |
+
$action = isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : false;
|
92 |
+
if ( ! in_array( $action, $allowed_actions, true ) ) {
|
93 |
+
return array();
|
94 |
+
}
|
95 |
+
|
96 |
+
$plugin_slugs = array();
|
97 |
+
switch ( $action ) {
|
98 |
+
case 'activate':
|
99 |
+
case 'deactivate':
|
100 |
+
if ( empty( $_REQUEST['plugin'] ) ) {
|
101 |
+
break;
|
102 |
+
}
|
103 |
+
|
104 |
+
$plugin_slugs[] = wp_unslash( $_REQUEST['plugin'] );
|
105 |
+
break;
|
106 |
+
|
107 |
+
case 'activate-selected':
|
108 |
+
case 'deactivate-selected':
|
109 |
+
if ( empty( $_REQUEST['checked'] ) ) {
|
110 |
+
break;
|
111 |
+
}
|
112 |
+
|
113 |
+
$plugin_slugs = wp_unslash( $_REQUEST['checked'] );
|
114 |
+
break;
|
115 |
+
}
|
116 |
+
|
117 |
+
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
118 |
+
return $this->convert_plugins_to_paths( $plugin_slugs );
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Given an array of plugin slugs or paths, this will convert them to absolute paths and filter
|
123 |
+
* out the plugins that are not directory plugins. Note that array keys will also be included
|
124 |
+
* if they are plugin paths!
|
125 |
+
*
|
126 |
+
* @param string[] $plugins Plugin paths or slugs to filter.
|
127 |
+
*
|
128 |
+
* @return string[]
|
129 |
+
*/
|
130 |
+
private function convert_plugins_to_paths( $plugins ) {
|
131 |
+
if ( ! is_array( $plugins ) || empty( $plugins ) ) {
|
132 |
+
return array();
|
133 |
+
}
|
134 |
+
|
135 |
+
// We're going to look for plugins in the standard directories.
|
136 |
+
$path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR );
|
137 |
+
|
138 |
+
$plugin_paths = array();
|
139 |
+
foreach ( $plugins as $key => $value ) {
|
140 |
+
$path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants );
|
141 |
+
if ( $path ) {
|
142 |
+
$plugin_paths[] = $path;
|
143 |
+
}
|
144 |
+
|
145 |
+
$path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants );
|
146 |
+
if ( $path ) {
|
147 |
+
$plugin_paths[] = $path;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
return $plugin_paths;
|
152 |
+
}
|
153 |
+
}
|
vendor/jetpack-autoloader/class-plugins-handler.php
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class handles locating and caching all of the active plugins.
|
14 |
+
*/
|
15 |
+
class Plugins_Handler {
|
16 |
+
/**
|
17 |
+
* The transient key for plugin paths.
|
18 |
+
*/
|
19 |
+
const TRANSIENT_KEY = 'jetpack_autoloader_plugin_paths';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The locator for finding plugins in different locations.
|
23 |
+
*
|
24 |
+
* @var Plugin_Locator
|
25 |
+
*/
|
26 |
+
private $plugin_locator;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* The processor for transforming cached paths.
|
30 |
+
*
|
31 |
+
* @var Path_Processor
|
32 |
+
*/
|
33 |
+
private $path_processor;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The constructor.
|
37 |
+
*
|
38 |
+
* @param Plugin_Locator $plugin_locator The locator for finding active plugins.
|
39 |
+
* @param Path_Processor $path_processor The processor for transforming cached paths.
|
40 |
+
*/
|
41 |
+
public function __construct( $plugin_locator, $path_processor ) {
|
42 |
+
$this->plugin_locator = $plugin_locator;
|
43 |
+
$this->path_processor = $path_processor;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Gets all of the active plugins we can find.
|
48 |
+
*
|
49 |
+
* @param bool $include_deactivating When true, plugins deactivating this request will be considered active.
|
50 |
+
* @param bool $record_unknown When true, the current plugin will be marked as active and recorded when unknown.
|
51 |
+
*
|
52 |
+
* @return string[]
|
53 |
+
*/
|
54 |
+
public function get_active_plugins( $include_deactivating, $record_unknown ) {
|
55 |
+
global $jetpack_autoloader_activating_plugins_paths;
|
56 |
+
|
57 |
+
// We're going to build a unique list of plugins from a few different sources
|
58 |
+
// to find all of our "active" plugins. While we need to return an integer
|
59 |
+
// array, we're going to use an associative array internally to reduce
|
60 |
+
// the amount of time that we're going to spend checking uniqueness
|
61 |
+
// and merging different arrays together to form the output.
|
62 |
+
$active_plugins = array();
|
63 |
+
|
64 |
+
// Make sure that plugins which have activated this request are considered as "active" even though
|
65 |
+
// they probably won't be present in any option.
|
66 |
+
if ( is_array( $jetpack_autoloader_activating_plugins_paths ) ) {
|
67 |
+
foreach ( $jetpack_autoloader_activating_plugins_paths as $path ) {
|
68 |
+
$active_plugins[ $path ] = $path;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
// This option contains all of the plugins that have been activated.
|
73 |
+
$plugins = $this->plugin_locator->find_using_option( 'active_plugins' );
|
74 |
+
foreach ( $plugins as $path ) {
|
75 |
+
$active_plugins[ $path ] = $path;
|
76 |
+
}
|
77 |
+
|
78 |
+
// This option contains all of the multisite plugins that have been activated.
|
79 |
+
if ( is_multisite() ) {
|
80 |
+
$plugins = $this->plugin_locator->find_using_option( 'active_sitewide_plugins', true );
|
81 |
+
foreach ( $plugins as $path ) {
|
82 |
+
$active_plugins[ $path ] = $path;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
// These actions contain plugins that are being activated/deactivated during this request.
|
87 |
+
$plugins = $this->plugin_locator->find_using_request_action( array( 'activate', 'activate-selected', 'deactivate', 'deactivate-selected' ) );
|
88 |
+
foreach ( $plugins as $path ) {
|
89 |
+
$active_plugins[ $path ] = $path;
|
90 |
+
}
|
91 |
+
|
92 |
+
// When the current plugin isn't considered "active" there's a problem.
|
93 |
+
// Since we're here, the plugin is active and currently being loaded.
|
94 |
+
// We can support this case (mu-plugins and non-standard activation)
|
95 |
+
// by adding the current plugin to the active list and marking it
|
96 |
+
// as an unknown (activating) plugin. This also has the benefit
|
97 |
+
// of causing a reset because the active plugins list has
|
98 |
+
// been changed since it was saved in the global.
|
99 |
+
$current_plugin = $this->plugin_locator->find_current_plugin();
|
100 |
+
if ( $record_unknown && ! in_array( $current_plugin, $active_plugins, true ) ) {
|
101 |
+
$active_plugins[ $current_plugin ] = $current_plugin;
|
102 |
+
$jetpack_autoloader_activating_plugins_paths[] = $current_plugin;
|
103 |
+
}
|
104 |
+
|
105 |
+
// When deactivating plugins aren't desired we should entirely remove them from the active list.
|
106 |
+
if ( ! $include_deactivating ) {
|
107 |
+
// These actions contain plugins that are being deactivated during this request.
|
108 |
+
$plugins = $this->plugin_locator->find_using_request_action( array( 'deactivate', 'deactivate-selected' ) );
|
109 |
+
foreach ( $plugins as $path ) {
|
110 |
+
unset( $active_plugins[ $path ] );
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
// Transform the array so that we don't have to worry about the keys interacting with other array types later.
|
115 |
+
return array_values( $active_plugins );
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Gets all of the cached plugins if there are any.
|
120 |
+
*
|
121 |
+
* @return string[]
|
122 |
+
*/
|
123 |
+
public function get_cached_plugins() {
|
124 |
+
$cached = get_transient( self::TRANSIENT_KEY );
|
125 |
+
if ( ! is_array( $cached ) || empty( $cached ) ) {
|
126 |
+
return array();
|
127 |
+
}
|
128 |
+
|
129 |
+
// We need to expand the tokens to an absolute path for this webserver.
|
130 |
+
return array_map( array( $this->path_processor, 'untokenize_path_constants' ), $cached );
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Saves the plugin list to the cache.
|
135 |
+
*
|
136 |
+
* @param array $plugins The plugin list to save to the cache.
|
137 |
+
*/
|
138 |
+
public function cache_plugins( $plugins ) {
|
139 |
+
// We store the paths in a tokenized form so that that webservers with different absolute paths don't break.
|
140 |
+
$plugins = array_map( array( $this->path_processor, 'tokenize_path_constants' ), $plugins );
|
141 |
+
|
142 |
+
set_transient( self::TRANSIENT_KEY, $plugins );
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Checks to see whether or not the plugin list given has changed when compared to the
|
147 |
+
* shared `$jetpack_autoloader_cached_plugin_paths` global. This allows us to deal
|
148 |
+
* with cases where the active list may change due to filtering..
|
149 |
+
*
|
150 |
+
* @param string[] $plugins The plugins list to check against the global cache.
|
151 |
+
*
|
152 |
+
* @return bool True if the plugins have changed, otherwise false.
|
153 |
+
*/
|
154 |
+
public function have_plugins_changed( $plugins ) {
|
155 |
+
global $jetpack_autoloader_cached_plugin_paths;
|
156 |
+
|
157 |
+
if ( $jetpack_autoloader_cached_plugin_paths !== $plugins ) {
|
158 |
+
$jetpack_autoloader_cached_plugin_paths = $plugins;
|
159 |
+
return true;
|
160 |
+
}
|
161 |
+
|
162 |
+
return false;
|
163 |
+
}
|
164 |
+
}
|
vendor/jetpack-autoloader/class-shutdown-handler.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class handles the shutdown of the autoloader.
|
14 |
+
*/
|
15 |
+
class Shutdown_Handler {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The Plugins_Handler instance.
|
19 |
+
*
|
20 |
+
* @var Plugins_Handler
|
21 |
+
*/
|
22 |
+
private $plugins_handler;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The plugins cached by this autoloader.
|
26 |
+
*
|
27 |
+
* @var string[]
|
28 |
+
*/
|
29 |
+
private $cached_plugins;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Indicates whether or not this autoloader was included by another.
|
33 |
+
*
|
34 |
+
* @var bool
|
35 |
+
*/
|
36 |
+
private $was_included_by_autoloader;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Constructor.
|
40 |
+
*
|
41 |
+
* @param Plugins_Handler $plugins_handler The Plugins_Handler instance to use.
|
42 |
+
* @param string[] $cached_plugins The plugins cached by the autoloaer.
|
43 |
+
* @param bool $was_included_by_autoloader Indicates whether or not the autoloader was included by another.
|
44 |
+
*/
|
45 |
+
public function __construct( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) {
|
46 |
+
$this->plugins_handler = $plugins_handler;
|
47 |
+
$this->cached_plugins = $cached_plugins;
|
48 |
+
$this->was_included_by_autoloader = $was_included_by_autoloader;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Handles the shutdown of the autoloader.
|
53 |
+
*/
|
54 |
+
public function __invoke() {
|
55 |
+
// Don't save a broken cache if an error happens during some plugin's initialization.
|
56 |
+
if ( ! did_action( 'plugins_loaded' ) ) {
|
57 |
+
// Ensure that the cache is emptied to prevent consecutive failures if the cache is to blame.
|
58 |
+
if ( ! empty( $this->cached_plugins ) ) {
|
59 |
+
$this->plugins_handler->cache_plugins( array() );
|
60 |
+
}
|
61 |
+
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
|
65 |
+
// Load the active plugins fresh since the list we pulled earlier might not contain
|
66 |
+
// plugins that were activated but did not reset the autoloader. This happens
|
67 |
+
// when a plugin is in the cache but not "active" when the autoloader loads.
|
68 |
+
// We also want to make sure that plugins which are deactivating are not
|
69 |
+
// considered "active" so that they will be removed from the cache now.
|
70 |
+
try {
|
71 |
+
$active_plugins = $this->plugins_handler->get_active_plugins( false, ! $this->was_included_by_autoloader );
|
72 |
+
} catch ( \Exception $ex ) {
|
73 |
+
// When the package is deleted before shutdown it will throw an exception.
|
74 |
+
// In the event this happens we should erase the cache.
|
75 |
+
if ( ! empty( $this->cached_plugins ) ) {
|
76 |
+
$this->plugins_handler->cache_plugins( array() );
|
77 |
+
}
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
// The paths should be sorted for easy comparisons with those loaded from the cache.
|
82 |
+
// Note we don't need to sort the cached entries because they're already sorted.
|
83 |
+
sort( $active_plugins );
|
84 |
+
|
85 |
+
// We don't want to waste time saving a cache that hasn't changed.
|
86 |
+
if ( $this->cached_plugins === $active_plugins ) {
|
87 |
+
return;
|
88 |
+
}
|
89 |
+
|
90 |
+
$this->plugins_handler->cache_plugins( $active_plugins );
|
91 |
+
}
|
92 |
+
}
|
vendor/jetpack-autoloader/class-version-loader.php
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* This class loads other classes based on given parameters.
|
14 |
+
*/
|
15 |
+
class Version_Loader {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The Version_Selector object.
|
19 |
+
*
|
20 |
+
* @var Version_Selector
|
21 |
+
*/
|
22 |
+
private $version_selector;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* A map of available classes and their version and file path.
|
26 |
+
*
|
27 |
+
* @var array
|
28 |
+
*/
|
29 |
+
private $classmap;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* A map of PSR-4 namespaces and their version and directory path.
|
33 |
+
*
|
34 |
+
* @var array
|
35 |
+
*/
|
36 |
+
private $psr4_map;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* A map of all the files that we should load.
|
40 |
+
*
|
41 |
+
* @var array
|
42 |
+
*/
|
43 |
+
private $filemap;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* The constructor.
|
47 |
+
*
|
48 |
+
* @param Version_Selector $version_selector The Version_Selector object.
|
49 |
+
* @param array $classmap The verioned classmap to load using.
|
50 |
+
* @param array $psr4_map The versioned PSR-4 map to load using.
|
51 |
+
* @param array $filemap The versioned filemap to load.
|
52 |
+
*/
|
53 |
+
public function __construct( $version_selector, $classmap, $psr4_map, $filemap ) {
|
54 |
+
$this->version_selector = $version_selector;
|
55 |
+
$this->classmap = $classmap;
|
56 |
+
$this->psr4_map = $psr4_map;
|
57 |
+
$this->filemap = $filemap;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Finds the file path for the given class.
|
62 |
+
*
|
63 |
+
* @param string $class_name The class to find.
|
64 |
+
*
|
65 |
+
* @return string|null $file_path The path to the file if found, null if no class was found.
|
66 |
+
*/
|
67 |
+
public function find_class_file( $class_name ) {
|
68 |
+
$data = $this->select_newest_file(
|
69 |
+
isset( $this->classmap[ $class_name ] ) ? $this->classmap[ $class_name ] : null,
|
70 |
+
$this->find_psr4_file( $class_name )
|
71 |
+
);
|
72 |
+
if ( ! isset( $data ) ) {
|
73 |
+
return null;
|
74 |
+
}
|
75 |
+
|
76 |
+
return $data['path'];
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Load all of the files in the filemap.
|
81 |
+
*/
|
82 |
+
public function load_filemap() {
|
83 |
+
if ( empty( $this->filemap ) ) {
|
84 |
+
return;
|
85 |
+
}
|
86 |
+
|
87 |
+
foreach ( $this->filemap as $file_identifier => $file_data ) {
|
88 |
+
if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) {
|
89 |
+
require_once $file_data['path'];
|
90 |
+
|
91 |
+
$GLOBALS['__composer_autoload_files'][ $file_identifier ] = true;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Compares different class sources and returns the newest.
|
98 |
+
*
|
99 |
+
* @param array|null $classmap_data The classmap class data.
|
100 |
+
* @param array|null $psr4_data The PSR-4 class data.
|
101 |
+
*
|
102 |
+
* @return array|null $data
|
103 |
+
*/
|
104 |
+
private function select_newest_file( $classmap_data, $psr4_data ) {
|
105 |
+
if ( ! isset( $classmap_data ) ) {
|
106 |
+
return $psr4_data;
|
107 |
+
} elseif ( ! isset( $psr4_data ) ) {
|
108 |
+
return $classmap_data;
|
109 |
+
}
|
110 |
+
|
111 |
+
if ( $this->version_selector->is_version_update_required( $classmap_data['version'], $psr4_data['version'] ) ) {
|
112 |
+
return $psr4_data;
|
113 |
+
}
|
114 |
+
|
115 |
+
return $classmap_data;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Finds the file for a given class in a PSR-4 namespace.
|
120 |
+
*
|
121 |
+
* @param string $class_name The class to find.
|
122 |
+
*
|
123 |
+
* @return array|null $data The version and path path to the file if found, null otherwise.
|
124 |
+
*/
|
125 |
+
private function find_psr4_file( $class_name ) {
|
126 |
+
if ( ! isset( $this->psr4_map ) ) {
|
127 |
+
return null;
|
128 |
+
}
|
129 |
+
|
130 |
+
// Don't bother with classes that have no namespace.
|
131 |
+
$class_index = strrpos( $class_name, '\\' );
|
132 |
+
if ( ! $class_index ) {
|
133 |
+
return null;
|
134 |
+
}
|
135 |
+
$class_for_path = str_replace( '\\', '/', $class_name );
|
136 |
+
|
137 |
+
// Search for the namespace by iteratively cutting off the last segment until
|
138 |
+
// we find a match. This allows us to check the most-specific namespaces
|
139 |
+
// first as well as minimize the amount of time spent looking.
|
140 |
+
for (
|
141 |
+
$class_namespace = substr( $class_name, 0, $class_index );
|
142 |
+
! empty( $class_namespace );
|
143 |
+
$class_namespace = substr( $class_namespace, 0, strrpos( $class_namespace, '\\' ) )
|
144 |
+
) {
|
145 |
+
$namespace = $class_namespace . '\\';
|
146 |
+
if ( ! isset( $this->psr4_map[ $namespace ] ) ) {
|
147 |
+
continue;
|
148 |
+
}
|
149 |
+
$data = $this->psr4_map[ $namespace ];
|
150 |
+
|
151 |
+
foreach ( $data['path'] as $path ) {
|
152 |
+
$path .= '/' . substr( $class_for_path, strlen( $namespace ) ) . '.php';
|
153 |
+
if ( file_exists( $path ) ) {
|
154 |
+
return array(
|
155 |
+
'version' => $data['version'],
|
156 |
+
'path' => $path,
|
157 |
+
);
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
return null;
|
163 |
+
}
|
164 |
+
}
|
vendor/jetpack-autoloader/class-version-selector.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file was automatically generated by automattic/jetpack-autoloader.
|
4 |
+
*
|
5 |
+
* @package automattic/jetpack-autoloader
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_0_beta;
|
9 |
+
|
10 |
+
// phpcs:ignore
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Used to select package versions.
|
14 |
+
*/
|
15 |
+
class Version_Selector {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Checks whether the selected package version should be updated. Composer development
|
19 |
+
* package versions ('9999999-dev' or versions that start with 'dev-') are favored
|
20 |
+
* when the JETPACK_AUTOLOAD_DEV constant is set to true.
|
21 |
+
*
|
22 |
+
* @param String $selected_version The currently selected package version.
|
23 |
+
* @param String $compare_version The package version that is being evaluated to
|
24 |
+
* determine if the version needs to be updated.
|
25 |
+
*
|
26 |
+
* @return bool Returns true if the selected package version should be updated,
|
27 |
+
* else false.
|
28 |
+
*/
|
29 |
+
public function is_version_update_required( $selected_version, $compare_version ) {
|
30 |
+
$use_dev_versions = defined( 'JETPACK_AUTOLOAD_DEV' ) && JETPACK_AUTOLOAD_DEV;
|
31 |
+
|
32 |
+
if ( is_null( $selected_version ) ) {
|
33 |
+
return true;
|
34 |
+
}
|
35 |
+
|
36 |
+
if ( $use_dev_versions && $this->is_dev_version( $selected_version ) ) {
|
37 |
+
return false;
|
38 |
+
}
|
39 |
+
|
40 |
+
if ( $this->is_dev_version( $compare_version ) ) {
|
41 |
+
if ( $use_dev_versions ) {
|
42 |
+
return true;
|
43 |
+
} else {
|
44 |
+
return false;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
if ( version_compare( $selected_version, $compare_version, '<' ) ) {
|
49 |
+
return true;
|
50 |
+
}
|
51 |
+
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Checks whether the given package version is a development version.
|
57 |
+
*
|
58 |
+
* @param String $version The package version.
|
59 |
+
*
|
60 |
+
* @return bool True if the version is a dev version, else false.
|
61 |
+
*/
|
62 |
+
public function is_dev_version( $version ) {
|
63 |
+
if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) {
|
64 |
+
return true;
|
65 |
+
}
|
66 |
+
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
}
|