Initial commit: Atomaste website
This commit is contained in:
22
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/autoload.php
vendored
Normal file
22
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/autoload.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException($err);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit5eb612593a2ef67b85ad25c07c19e821::getLoader();
|
||||
13
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/autoload_packages.php
vendored
Normal file
13
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/autoload_packages.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* This file was automatically generated by automattic/jetpack-autoloader.
|
||||
*
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader\jp5eb612593a2ef67b85ad25c07c19e821\al5_0_13;
|
||||
|
||||
// phpcs:ignore
|
||||
|
||||
require_once __DIR__ . '/jetpack-autoloader/class-autoloader.php';
|
||||
Autoloader::init();
|
||||
@@ -0,0 +1,552 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [5.0.13] - 2025-11-12
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [5.0.12] - 2025-11-10
|
||||
### Fixed
|
||||
- Tests: Improve compatibility with PHP 8.5. [#45771]
|
||||
|
||||
## [5.0.11] - 2025-10-06
|
||||
### Fixed
|
||||
- Tests: Replace deprecated `RunClassInSeparateProcess` attribute with `RunTestsInSeparateProcesses`. [#45370]
|
||||
|
||||
## [5.0.10] - 2025-09-15
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [5.0.9] - 2025-07-28
|
||||
### Changed
|
||||
- Exclude development files from production build of the package. [#44456]
|
||||
|
||||
## [5.0.8] - 2025-06-23
|
||||
### Fixed
|
||||
- Autoloader: Prevent double slash in autoloader path. [#44030]
|
||||
|
||||
## [5.0.7] - 2025-04-28
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [5.0.6] - 2025-03-31
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [5.0.5] - 2025-03-21
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [5.0.4] - 2025-03-17
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [5.0.3] - 2025-03-12
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [5.0.2] - 2025-02-24
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [5.0.1] - 2025-01-20
|
||||
### Changed
|
||||
- Code: Use function-style exit() and die() with a default status code of 0. [#41167]
|
||||
|
||||
## [5.0.0] - 2024-11-25
|
||||
### Removed
|
||||
- Drop support for Composer <2.2. [#40297]
|
||||
- Remove support for WordPress 6.5 and earlier. [#40200]
|
||||
|
||||
## [4.0.0] - 2024-11-14
|
||||
### Removed
|
||||
- General: Update minimum PHP version to 7.2. [#40147]
|
||||
|
||||
## [3.1.3] - 2024-11-04
|
||||
### Added
|
||||
- Enable test coverage. [#39961]
|
||||
|
||||
## [3.1.2] - 2024-10-15
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [3.1.1] - 2024-10-10
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [3.1.0] - 2024-09-06
|
||||
### Added
|
||||
- Add logic for debugging issues caused by conflicting Composer autoloaders, enabled by setting the `JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS` constant. [#38995]
|
||||
- Add logic for debugging issues caused by early class loads, enabled by setting the `JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS` constant. [#38995]
|
||||
|
||||
## [3.0.10] - 2024-08-26
|
||||
### Changed
|
||||
- Updated package dependencies. [#39004]
|
||||
|
||||
## [3.0.9] - 2024-07-10
|
||||
### Fixed
|
||||
- Avoid a deprecation notice in `Autoloader_Locator::find_latest_autoloader()`. [#38245]
|
||||
|
||||
## [3.0.8] - 2024-05-29
|
||||
### Fixed
|
||||
- `AutoloadGenerator::__construct` no longer pretends `$io` is nullable. That never worked. [#37608]
|
||||
|
||||
## [3.0.7] - 2024-05-06
|
||||
### Fixed
|
||||
- Avoid deprecation notices when plugin path is null. [#37174]
|
||||
|
||||
## [3.0.6] - 2024-04-22
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [3.0.5] - 2024-04-11
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [3.0.4] - 2024-03-18
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [3.0.3] - 2024-03-14
|
||||
### Changed
|
||||
- Internal updates.
|
||||
|
||||
## [3.0.2] - 2023-11-21
|
||||
|
||||
## [3.0.1] - 2023-11-21
|
||||
|
||||
## [3.0.0] - 2023-11-20
|
||||
### Changed
|
||||
- Updated required PHP version to >= 7.0. [#34192]
|
||||
|
||||
## [2.12.0] - 2023-09-28
|
||||
### Added
|
||||
- Add an `AutoloadGenerator::VERSION` constant, and use that for the autoloader's version in preference to whatever Composer has. [#33156]
|
||||
|
||||
## [2.11.23] - 2023-09-19
|
||||
|
||||
- Minor internal updates.
|
||||
|
||||
## [2.11.22] - 2023-08-23
|
||||
### Changed
|
||||
- Updated package dependencies. [#32605]
|
||||
|
||||
## [2.11.21] - 2023-05-22
|
||||
### Added
|
||||
- Set keywords in `composer.json`. [#30756]
|
||||
|
||||
## [2.11.20] - 2023-05-11
|
||||
|
||||
- Updated package dependencies
|
||||
|
||||
## [2.11.19] - 2023-04-25
|
||||
### Fixed
|
||||
- Fix example in README [#30225]
|
||||
|
||||
## [2.11.18] - 2023-03-28
|
||||
### Changed
|
||||
- Minor internal updates.
|
||||
|
||||
## [2.11.17] - 2023-03-27
|
||||
### Fixed
|
||||
- Don't error when processing packages specifying missing PSR paths. [#29669]
|
||||
|
||||
## [2.11.16] - 2023-02-20
|
||||
### Changed
|
||||
- Minor internal updates.
|
||||
|
||||
## [2.11.15] - 2023-01-11
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.11.14] - 2022-12-19
|
||||
### Changed
|
||||
- Use `Composer\ClassMapGenerator\ClassMapGenerator` when available (i.e. with composer 2.4). [#27812]
|
||||
|
||||
### Fixed
|
||||
- Declare fields for PHP 8.2 compatibility. [#27949]
|
||||
|
||||
## [2.11.13] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [2.11.12] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
|
||||
## [2.11.11] - 2022-10-25
|
||||
### Changed
|
||||
- Sort data in generated `vendor/composer/jetpack_autoload_classmap.php` to avoid spurious diffs. [#26929]
|
||||
|
||||
## [2.11.10] - 2022-10-05
|
||||
|
||||
- Tests: Clear `COMPOSER_AUTH` environment variable when running Composer for tests. [#26404]
|
||||
|
||||
## [2.11.9] - 2022-09-27
|
||||
### Fixed
|
||||
- Tests: Clear `COMPOSER_AUTH` environment variable when running Composer for tests. [#26404]
|
||||
|
||||
## [2.11.8] - 2022-09-20
|
||||
### Fixed
|
||||
- Tests: skip test if it requires a version of Composer not compatible with the running version of PHP. [#26143]
|
||||
|
||||
## [2.11.7] - 2022-07-26
|
||||
### Changed
|
||||
- Updated package dependencies. [#25158]
|
||||
|
||||
## [2.11.6] - 2022-06-21
|
||||
### Changed
|
||||
- Renaming `master` to `trunk`.
|
||||
|
||||
## [2.11.5] - 2022-05-18
|
||||
### Fixed
|
||||
- Fix new PHPCS sniffs. [#24366]
|
||||
|
||||
## [2.11.4] - 2022-04-26
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.11.3] - 2022-04-19
|
||||
### Changed
|
||||
- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput`
|
||||
|
||||
## [2.11.2] - 2022-03-29
|
||||
### Changed
|
||||
- Microperformance: Use === null instead of is_null
|
||||
|
||||
## [2.11.1] - 2022-03-08
|
||||
### Removed
|
||||
- Removed the Upgrade Handler.
|
||||
|
||||
## [2.11.0] - 2022-03-08
|
||||
### Added
|
||||
- On plugin update, pre-load all (non-PSR-4) classes from the plugin to avoid mid-upgrade fatals.
|
||||
|
||||
## [2.10.13] - 2022-03-01
|
||||
### Fixed
|
||||
- Fix tests for upstream phpunit change.
|
||||
|
||||
## [2.10.12] - 2022-01-25
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.10.11] - 2022-01-04
|
||||
### Changed
|
||||
- Switch to pcov for code coverage.
|
||||
- Updated package dependencies
|
||||
|
||||
## [2.10.10] - 2021-11-16
|
||||
### Added
|
||||
- Soft return if autoloader chain is not available.
|
||||
|
||||
## [2.10.9] - 2021-11-02
|
||||
### Changed
|
||||
- Set `convertDeprecationsToExceptions` true in PHPUnit config.
|
||||
|
||||
## [2.10.8] - 2021-10-13
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.10.7] - 2021-10-07
|
||||
### Changed
|
||||
- Updated package dependencies
|
||||
|
||||
## [2.10.6] - 2021-09-28
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.10.5] - 2021-08-31
|
||||
### Changed
|
||||
- Run composer update on test-php command instead of phpunit
|
||||
- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills).
|
||||
|
||||
## [2.10.4] - 2021-08-10
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.10.3] - 2021-05-25
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.10.2] - 2021-04-27
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.10.1] - 2021-03-30
|
||||
### Added
|
||||
- Composer alias for dev-master, to improve dependencies
|
||||
- Tests: Added code coverage transformation
|
||||
|
||||
### Changed
|
||||
- Update package dependencies.
|
||||
|
||||
### Fixed
|
||||
- Fix coverage test
|
||||
- Fix uninstallation fatal
|
||||
- Update tests for changed composer 2.0.9 hash.
|
||||
- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in.
|
||||
|
||||
## [2.10.0] - 2021-02-09
|
||||
|
||||
- Autoloader: test suite refactor
|
||||
|
||||
## [2.9.1] - 2021-02-05
|
||||
|
||||
- CI: Make tests more generic
|
||||
- Autoloader: stricter type-checking on WP functions
|
||||
- Autoloader: prevent transitive plugin execution
|
||||
|
||||
## [2.9.0] - 2021-01-25
|
||||
|
||||
- Autoloader: revised latest autoloader inclusion semantics
|
||||
- Add mirror-repo information to all current composer packages
|
||||
- Monorepo: Reorganize all projects
|
||||
- Autoloader: Don't cache deactivating plugins
|
||||
|
||||
## [2.8.0] - 2020-12-18
|
||||
|
||||
## [2.7.1] - 2020-12-18
|
||||
|
||||
- Autoloader: Added realpath resolution to plugin paths
|
||||
|
||||
## [2.7.0] - 2020-12-08
|
||||
|
||||
- Autoloader: Preemptively load unknown plugins from cache
|
||||
- Removed unwanted dot
|
||||
- Pin dependencies
|
||||
- Packages: Update for PHP 8 testing
|
||||
|
||||
## [2.6.0] - 2020-11-19
|
||||
|
||||
- Autoloader: AutoloadGenerator no longer extends Composer's AutoloadGenerator class
|
||||
- Autoloader: Reuse an existing autoloader suffix if available
|
||||
- Updated PHPCS: Packages and Debugger
|
||||
|
||||
## [2.5.0] - 2020-10-08
|
||||
|
||||
- Autoloader: remove the defined('JETPACK_AUTOLOAD_DEV') checks from the tests
|
||||
|
||||
## [2.4.0] - 2020-09-28
|
||||
|
||||
- Autoloader: remove the plugins_loaded bullet point from the README
|
||||
- Packages: avoid PHPCS warnings
|
||||
- Autoloader: add PSR-0 support
|
||||
- Autoloader: Detect filtering of active_plugins
|
||||
- Autoloader: Support unoptimized PSR-4
|
||||
|
||||
## [2.3.0] - 2020-08-21
|
||||
|
||||
- Autoloader: remove the plugin update hook
|
||||
|
||||
## [2.2.0] - 2020-08-14
|
||||
|
||||
- Autoloader: don't reset the autoloader version during plugin update
|
||||
- CI: Try collect js coverage
|
||||
|
||||
## [2.1.0] - 2020-07-27
|
||||
|
||||
- Autoloader: convert '\' directory separators to '/' in plugin paths
|
||||
- Autoloader: Avoid a PHP warning when an empty string is passed to `is_directory_plugin()`.
|
||||
- Autoloader: Tests: Use a string with define
|
||||
|
||||
## [2.0.2] - 2020-07-09
|
||||
|
||||
- Autoloader: Avoid a PHP warning when an empty string is passed to `is_directory_plugin()`.
|
||||
|
||||
## [2.0.1] - 2020-07-02
|
||||
|
||||
- Autoloader: Tests: Use a string with define
|
||||
|
||||
## [2.0.0] - 2020-06-29
|
||||
|
||||
## [2.0.0-beta] - 2020-06-29
|
||||
|
||||
- Autoloader: Support Composer v2.0
|
||||
- Autoloader: use paths to identify plugins instead of the directories
|
||||
- Autoloader: fix the fatal that occurs during plugin update
|
||||
- Autoloader: add fallback check for plugin path in mu-plugins
|
||||
- Autoloader: use JETPACK__PLUGIN_DIR when looking for the jetpack plugin directory.
|
||||
- Feature Branch: Update the Autoloader
|
||||
- PHPCS: Clean up the packages
|
||||
- PHPCS Updates after WPCS 2.3
|
||||
|
||||
## [1.7.0] - 2020-04-23
|
||||
|
||||
- Jetpack: Move comment notification override back to the constructor
|
||||
|
||||
## [1.6.0] - 2020-03-26
|
||||
|
||||
- Autoloader: Remove file check to improve performance.
|
||||
|
||||
## [1.5.0] - 2020-02-25
|
||||
|
||||
- Jetpack: instantiate manager object if it's null
|
||||
|
||||
## [1.4.1] - 2020-02-14
|
||||
|
||||
- Autoloader: Load only latest version of autoload files to avoid conflicts.
|
||||
|
||||
## [1.4.0] - 2020-01-23
|
||||
|
||||
- Autoloader: Remove the ignored classes
|
||||
|
||||
## [1.3.8] - 2020-01-14
|
||||
|
||||
- Trying to add deterministic initialization.
|
||||
- Autoloader: Remove Manager_Interface and Plugin\Tracking from ignored list
|
||||
- Autoloader: Remove Jetpack_IXR_Client from ignore list
|
||||
|
||||
## [1.3.7] - 2019-12-10
|
||||
|
||||
## [1.3.6] - 2019-12-09
|
||||
|
||||
- Autoloader: Use long-form sytax for array
|
||||
|
||||
## [1.3.5] - 2019-11-26
|
||||
|
||||
- Fix/php notice status
|
||||
|
||||
## [1.3.4] - 2019-11-08
|
||||
|
||||
- Deprecate Jetpack::is_development_mode() in favor of the packaged Status()->is_development_mode()
|
||||
|
||||
## [1.3.3] - 2019-10-28
|
||||
|
||||
- Packages: Add gitattributes files to all packages that need th…
|
||||
|
||||
## [1.3.2] - 2019-09-24
|
||||
|
||||
- Autoloader: Cover scenarios where composer/autoload_files.php…
|
||||
|
||||
## [1.3.1] - 2019-09-20
|
||||
|
||||
- Docs: Unify usage of @package phpdoc tags
|
||||
|
||||
## [1.3.0] - 2019-09-14
|
||||
|
||||
- Fix for empty namespaces. #13459
|
||||
- Connection: Move the Jetpack IXR client to the package
|
||||
- Adds full connection cycle capability to the Connection package.
|
||||
- Jetpack 7.5: Back compatibility package
|
||||
|
||||
## [1.2.0] - 2019-06-24
|
||||
|
||||
- Jetpack DNA: Add full classmap support to Autoloader
|
||||
- Move Jetpack_Sync_Main from legacy to PSR-4
|
||||
|
||||
## [1.1.0] - 2019-06-19
|
||||
|
||||
- Packages: Move autoloader tests to the package
|
||||
- DNA: Move Jetpack Usage tracking to its own file
|
||||
- Jetpack DNA: More isolation of Tracks Package
|
||||
- Autoloader: Ignore XMLRPC_Connector if called too early
|
||||
- Autoloader: Ignore Jetpack_Signature if called too early
|
||||
|
||||
## 1.0.0 - 2019-06-11
|
||||
|
||||
- Add Custom Autoloader
|
||||
|
||||
[5.0.13]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.12...v5.0.13
|
||||
[5.0.12]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.11...v5.0.12
|
||||
[5.0.11]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.10...v5.0.11
|
||||
[5.0.10]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.9...v5.0.10
|
||||
[5.0.9]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.8...v5.0.9
|
||||
[5.0.8]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.7...v5.0.8
|
||||
[5.0.7]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.6...v5.0.7
|
||||
[5.0.6]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.5...v5.0.6
|
||||
[5.0.5]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.4...v5.0.5
|
||||
[5.0.4]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.3...v5.0.4
|
||||
[5.0.3]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.2...v5.0.3
|
||||
[5.0.2]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.1...v5.0.2
|
||||
[5.0.1]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.0...v5.0.1
|
||||
[5.0.0]: https://github.com/Automattic/jetpack-autoloader/compare/v4.0.0...v5.0.0
|
||||
[4.0.0]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.3...v4.0.0
|
||||
[3.1.3]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.2...v3.1.3
|
||||
[3.1.2]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.1...v3.1.2
|
||||
[3.1.1]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.0...v3.1.1
|
||||
[3.1.0]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.10...v3.1.0
|
||||
[3.0.10]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.9...v3.0.10
|
||||
[3.0.9]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.8...v3.0.9
|
||||
[3.0.8]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.7...v3.0.8
|
||||
[3.0.7]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.6...v3.0.7
|
||||
[3.0.6]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.5...v3.0.6
|
||||
[3.0.5]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.4...v3.0.5
|
||||
[3.0.4]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.3...v3.0.4
|
||||
[3.0.3]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.2...v3.0.3
|
||||
[3.0.2]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.1...v3.0.2
|
||||
[3.0.1]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.0...v3.0.1
|
||||
[3.0.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.12.0...v3.0.0
|
||||
[2.12.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.23...v2.12.0
|
||||
[2.11.23]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.22...v2.11.23
|
||||
[2.11.22]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.21...v2.11.22
|
||||
[2.11.21]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.20...v2.11.21
|
||||
[2.11.20]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.19...v2.11.20
|
||||
[2.11.19]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.18...v2.11.19
|
||||
[2.11.18]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.17...v2.11.18
|
||||
[2.11.17]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.16...v2.11.17
|
||||
[2.11.16]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.15...v2.11.16
|
||||
[2.11.15]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.14...v2.11.15
|
||||
[2.11.14]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.13...v2.11.14
|
||||
[2.11.13]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.12...v2.11.13
|
||||
[2.11.12]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.11...v2.11.12
|
||||
[2.11.11]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.10...v2.11.11
|
||||
[2.11.10]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.9...v2.11.10
|
||||
[2.11.9]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.8...v2.11.9
|
||||
[2.11.8]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.7...v2.11.8
|
||||
[2.11.7]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.6...v2.11.7
|
||||
[2.11.6]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.5...v2.11.6
|
||||
[2.11.5]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.4...v2.11.5
|
||||
[2.11.4]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.3...v2.11.4
|
||||
[2.11.3]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.2...v2.11.3
|
||||
[2.11.2]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.1...v2.11.2
|
||||
[2.11.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.11.0...v2.11.1
|
||||
[2.11.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.13...v2.11.0
|
||||
[2.10.13]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.12...v2.10.13
|
||||
[2.10.12]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.11...v2.10.12
|
||||
[2.10.11]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.10...v2.10.11
|
||||
[2.10.10]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.9...v2.10.10
|
||||
[2.10.9]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.8...v2.10.9
|
||||
[2.10.8]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.7...v2.10.8
|
||||
[2.10.7]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.6...v2.10.7
|
||||
[2.10.6]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.5...v2.10.6
|
||||
[2.10.5]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.4...v2.10.5
|
||||
[2.10.4]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.3...v2.10.4
|
||||
[2.10.3]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.2...v2.10.3
|
||||
[2.10.2]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.1...v2.10.2
|
||||
[2.10.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.0...v2.10.1
|
||||
[2.10.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.9.1...v2.10.0
|
||||
[2.9.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.9.0...v2.9.1
|
||||
[2.9.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.8.0...v2.9.0
|
||||
[2.8.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.7.1...v2.8.0
|
||||
[2.7.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.7.0...v2.7.1
|
||||
[2.7.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.6.0...v2.7.0
|
||||
[2.6.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.5.0...v2.6.0
|
||||
[2.5.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.4.0...v2.5.0
|
||||
[2.4.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.3.0...v2.4.0
|
||||
[2.3.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.2.0...v2.3.0
|
||||
[2.2.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.1.0...v2.2.0
|
||||
[2.1.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.0.2...v2.1.0
|
||||
[2.0.2]: https://github.com/Automattic/jetpack-autoloader/compare/v2.0.1...v2.0.2
|
||||
[2.0.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.0.0...v2.0.1
|
||||
[2.0.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.0.0-beta...v2.0.0
|
||||
[2.0.0-beta]: https://github.com/Automattic/jetpack-autoloader/compare/v1.7.0...v2.0.0-beta
|
||||
[1.7.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.6.0...v1.7.0
|
||||
[1.6.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.5.0...v1.6.0
|
||||
[1.5.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.4.1...v1.5.0
|
||||
[1.4.1]: https://github.com/Automattic/jetpack-autoloader/compare/v1.4.0...v1.4.1
|
||||
[1.4.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.8...v1.4.0
|
||||
[1.3.8]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.7...v1.3.8
|
||||
[1.3.7]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.6...v1.3.7
|
||||
[1.3.6]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.5...v1.3.6
|
||||
[1.3.5]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.4...v1.3.5
|
||||
[1.3.4]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.3...v1.3.4
|
||||
[1.3.3]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.2...v1.3.3
|
||||
[1.3.2]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.1...v1.3.2
|
||||
[1.3.1]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.0...v1.3.1
|
||||
[1.3.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.2.0...v1.3.0
|
||||
[1.2.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.1.0...v1.2.0
|
||||
[1.1.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.0.0...v1.1.0
|
||||
@@ -0,0 +1,357 @@
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
===================================
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,47 @@
|
||||
# Security Policy
|
||||
|
||||
Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/).
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure:
|
||||
|
||||
* [Jetpack](https://jetpack.com/)
|
||||
* Jetpack Backup
|
||||
* Jetpack Boost
|
||||
* Jetpack CRM
|
||||
* Jetpack Protect
|
||||
* Jetpack Search
|
||||
* Jetpack Social
|
||||
* Jetpack VideoPress
|
||||
|
||||
**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.**
|
||||
|
||||
Our most critical targets are:
|
||||
|
||||
* Jetpack and the Jetpack composer packages (all within this repo)
|
||||
* Jetpack.com -- the primary marketing site.
|
||||
* cloud.jetpack.com -- a management site.
|
||||
* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites.
|
||||
|
||||
For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic).
|
||||
|
||||
_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._
|
||||
|
||||
## Guidelines
|
||||
|
||||
We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines:
|
||||
|
||||
* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines).
|
||||
* Pen-testing Production:
|
||||
* Please **setup a local environment** instead whenever possible. Most of our code is open source (see above).
|
||||
* If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC.
|
||||
* **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels.
|
||||
* To be eligible for a bounty, all of these guidelines must be followed.
|
||||
* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability.
|
||||
|
||||
We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties.
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "automattic/jetpack-autoloader",
|
||||
"description": "Creates a custom autoloader for a plugin or theme.",
|
||||
"type": "composer-plugin",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"keywords": [
|
||||
"autoload",
|
||||
"autoloader",
|
||||
"composer",
|
||||
"plugin",
|
||||
"jetpack",
|
||||
"wordpress"
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"composer-plugin-api": "^2.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "^2.2",
|
||||
"yoast/phpunit-polyfills": "^4.0.0",
|
||||
"automattic/jetpack-changelogger": "^6.0.10-alpha",
|
||||
"automattic/phpunit-select-config": "^1.0.3"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/AutoloadGenerator.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Automattic\\Jetpack\\Autoloader\\": "src"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"phpunit": [
|
||||
"phpunit-select-config phpunit.#.xml.dist --colors=always"
|
||||
],
|
||||
"test-coverage": [
|
||||
"php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"./tests/php/tmp/coverage-report.php\"",
|
||||
"php ./tests/php/bin/test-coverage.php \"$COVERAGE_DIR/php.cov\""
|
||||
],
|
||||
"test-php": [
|
||||
"@composer phpunit"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"extra": {
|
||||
"autotagger": true,
|
||||
"class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin",
|
||||
"mirror-repo": "Automattic/jetpack-autoloader",
|
||||
"changelogger": {
|
||||
"link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}"
|
||||
},
|
||||
"version-constants": {
|
||||
"::VERSION": "src/AutoloadGenerator.php"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-trunk": "5.0.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* Autoloader file writer.
|
||||
*
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader;
|
||||
|
||||
use Composer\IO\IOInterface;
|
||||
|
||||
/**
|
||||
* Class AutoloadFileWriter.
|
||||
*/
|
||||
class AutoloadFileWriter {
|
||||
|
||||
/**
|
||||
* The file comment to use.
|
||||
*/
|
||||
const COMMENT = <<<'AUTOLOADER_COMMENT'
|
||||
/**
|
||||
* This file was automatically generated by automattic/jetpack-autoloader.
|
||||
*
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
AUTOLOADER_COMMENT;
|
||||
|
||||
/**
|
||||
* Copies autoloader files and replaces any placeholders in them.
|
||||
*
|
||||
* @param IOInterface|null $io An IO for writing to.
|
||||
* @param string $outDir The directory to place the autoloader files in.
|
||||
* @param string $suffix The suffix to use in the autoloader's namespace.
|
||||
*/
|
||||
public static function copyAutoloaderFiles( $io, $outDir, $suffix ) {
|
||||
$renameList = array(
|
||||
'autoload.php' => '../autoload_packages.php',
|
||||
);
|
||||
$ignoreList = array(
|
||||
'AutoloadGenerator.php',
|
||||
'AutoloadProcessor.php',
|
||||
'CustomAutoloaderPlugin.php',
|
||||
'ManifestGenerator.php',
|
||||
'AutoloadFileWriter.php',
|
||||
);
|
||||
|
||||
// Copy all of the autoloader files.
|
||||
$files = scandir( __DIR__ );
|
||||
foreach ( $files as $file ) {
|
||||
// Only PHP files will be copied.
|
||||
if ( substr( $file, -4 ) !== '.php' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( in_array( $file, $ignoreList, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$newFile = $renameList[ $file ] ?? $file;
|
||||
$content = self::prepareAutoloaderFile( $file, $suffix );
|
||||
|
||||
$written = file_put_contents( $outDir . '/' . $newFile, $content );
|
||||
if ( $io ) {
|
||||
if ( $written ) {
|
||||
$io->writeError( " <info>Generated: $newFile</info>" );
|
||||
} else {
|
||||
$io->writeError( " <error>Error: $newFile</error>" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares an autoloader file to be written to the destination.
|
||||
*
|
||||
* @param String $filename a file to prepare.
|
||||
* @param String $suffix Unique suffix used in the namespace.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private static function prepareAutoloaderFile( $filename, $suffix ) {
|
||||
$header = self::COMMENT;
|
||||
$header .= PHP_EOL;
|
||||
if ( $suffix === 'Current' ) {
|
||||
// Unit testing.
|
||||
$header .= 'namespace Automattic\Jetpack\Autoloader\jpCurrent;';
|
||||
} else {
|
||||
$header .= 'namespace Automattic\Jetpack\Autoloader\jp' . $suffix . '\al' . preg_replace( '/[^0-9a-zA-Z]/', '_', AutoloadGenerator::VERSION ) . ';';
|
||||
}
|
||||
$header .= PHP_EOL . PHP_EOL;
|
||||
|
||||
$sourceLoader = fopen( __DIR__ . '/' . $filename, 'r' );
|
||||
$file_contents = stream_get_contents( $sourceLoader );
|
||||
return str_replace(
|
||||
'/* HEADER */',
|
||||
$header,
|
||||
$file_contents
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,403 @@
|
||||
<?php
|
||||
/**
|
||||
* Autoloader Generator.
|
||||
*
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\Config;
|
||||
use Composer\Installer\InstallationManager;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Repository\InstalledRepositoryInterface;
|
||||
use Composer\Util\Filesystem;
|
||||
use Composer\Util\PackageSorter;
|
||||
|
||||
/**
|
||||
* Class AutoloadGenerator.
|
||||
*/
|
||||
class AutoloadGenerator {
|
||||
|
||||
const VERSION = '5.0.13';
|
||||
|
||||
/**
|
||||
* IO object.
|
||||
*
|
||||
* @var IOInterface IO object.
|
||||
*/
|
||||
private $io;
|
||||
|
||||
/**
|
||||
* The filesystem utility.
|
||||
*
|
||||
* @var Filesystem
|
||||
*/
|
||||
private $filesystem;
|
||||
|
||||
/**
|
||||
* Instantiate an AutoloadGenerator object.
|
||||
*
|
||||
* @param IOInterface $io IO object.
|
||||
*/
|
||||
public function __construct( IOInterface $io ) {
|
||||
$this->io = $io;
|
||||
$this->filesystem = new Filesystem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump the Jetpack autoloader files.
|
||||
*
|
||||
* @param Composer $composer The Composer object.
|
||||
* @param Config $config Config object.
|
||||
* @param InstalledRepositoryInterface $localRepo Installed Repository object.
|
||||
* @param PackageInterface $mainPackage Main Package object.
|
||||
* @param InstallationManager $installationManager Manager for installing packages.
|
||||
* @param string $targetDir Path to the current target directory.
|
||||
* @param bool $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
|
||||
* @param string $suffix The autoloader suffix.
|
||||
*/
|
||||
public function dump(
|
||||
Composer $composer,
|
||||
Config $config,
|
||||
InstalledRepositoryInterface $localRepo,
|
||||
PackageInterface $mainPackage,
|
||||
InstallationManager $installationManager,
|
||||
$targetDir,
|
||||
$scanPsrPackages = false,
|
||||
$suffix = null
|
||||
) {
|
||||
$this->filesystem->ensureDirectoryExists( $config->get( 'vendor-dir' ) );
|
||||
|
||||
$packageMap = $composer->getAutoloadGenerator()->buildPackageMap( $installationManager, $mainPackage, $localRepo->getCanonicalPackages() );
|
||||
$autoloads = $this->parseAutoloads( $packageMap, $mainPackage );
|
||||
|
||||
// Convert the autoloads into a format that the manifest generator can consume more easily.
|
||||
$basePath = $this->filesystem->normalizePath( realpath( getcwd() ) );
|
||||
$vendorPath = $this->filesystem->normalizePath( realpath( $config->get( 'vendor-dir' ) ) );
|
||||
$processedAutoloads = $this->processAutoloads( $autoloads, $scanPsrPackages, $vendorPath, $basePath );
|
||||
unset( $packageMap, $autoloads );
|
||||
|
||||
// Make sure none of the legacy files remain that can lead to problems with the autoloader.
|
||||
$this->removeLegacyFiles( $vendorPath );
|
||||
|
||||
// Write all of the files now that we're done.
|
||||
$this->writeAutoloaderFiles( $vendorPath . '/jetpack-autoloader/', $suffix );
|
||||
$this->writeManifests( $vendorPath . '/' . $targetDir, $processedAutoloads );
|
||||
|
||||
if ( ! $scanPsrPackages ) {
|
||||
$this->io->writeError( '<warning>You are generating an unoptimized autoloader. If this is a production build, consider using the -o option.</warning>' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles an ordered list of namespace => path mappings
|
||||
*
|
||||
* @param array $packageMap Array of array(package, installDir-relative-to-composer.json).
|
||||
* @param PackageInterface $mainPackage Main package instance.
|
||||
*
|
||||
* @return array The list of path mappings.
|
||||
*/
|
||||
public function parseAutoloads( array $packageMap, PackageInterface $mainPackage ) {
|
||||
$rootPackageMap = array_shift( $packageMap );
|
||||
|
||||
$sortedPackageMap = $this->sortPackageMap( $packageMap );
|
||||
$sortedPackageMap[] = $rootPackageMap;
|
||||
array_unshift( $packageMap, $rootPackageMap );
|
||||
|
||||
$psr0 = $this->parseAutoloadsType( $packageMap, 'psr-0', $mainPackage );
|
||||
$psr4 = $this->parseAutoloadsType( $packageMap, 'psr-4', $mainPackage );
|
||||
$classmap = $this->parseAutoloadsType( array_reverse( $sortedPackageMap ), 'classmap', $mainPackage );
|
||||
$files = $this->parseAutoloadsType( $sortedPackageMap, 'files', $mainPackage );
|
||||
|
||||
krsort( $psr0 );
|
||||
krsort( $psr4 );
|
||||
|
||||
return array(
|
||||
'psr-0' => $psr0,
|
||||
'psr-4' => $psr4,
|
||||
'classmap' => $classmap,
|
||||
'files' => $files,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts packages by dependency weight
|
||||
*
|
||||
* Packages of equal weight retain the original order
|
||||
*
|
||||
* @param array $packageMap The package map.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function sortPackageMap( array $packageMap ) {
|
||||
$packages = array();
|
||||
$paths = array();
|
||||
|
||||
foreach ( $packageMap as $item ) {
|
||||
list( $package, $path ) = $item;
|
||||
$name = $package->getName();
|
||||
$packages[ $name ] = $package;
|
||||
$paths[ $name ] = $path;
|
||||
}
|
||||
|
||||
$sortedPackages = PackageSorter::sortPackages( $packages );
|
||||
|
||||
$sortedPackageMap = array();
|
||||
|
||||
foreach ( $sortedPackages as $package ) {
|
||||
$name = $package->getName();
|
||||
$sortedPackageMap[] = array( $packages[ $name ], $paths[ $name ] );
|
||||
}
|
||||
|
||||
return $sortedPackageMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file identifier.
|
||||
*
|
||||
* @param PackageInterface $package The package instance.
|
||||
* @param string $path The path.
|
||||
*/
|
||||
protected function getFileIdentifier( PackageInterface $package, $path ) {
|
||||
return md5( $package->getName() . ':' . $path );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path code for the given path.
|
||||
*
|
||||
* @param Filesystem $filesystem The filesystem instance.
|
||||
* @param string $basePath The base path.
|
||||
* @param string $vendorPath The vendor path.
|
||||
* @param string $path The path.
|
||||
*
|
||||
* @return string The path code.
|
||||
*/
|
||||
protected function getPathCode( Filesystem $filesystem, $basePath, $vendorPath, $path ) {
|
||||
if ( ! $filesystem->isAbsolutePath( $path ) ) {
|
||||
$path = $basePath . '/' . $path;
|
||||
}
|
||||
$path = $filesystem->normalizePath( $path );
|
||||
|
||||
$baseDir = '';
|
||||
if ( 0 === strpos( $path . '/', $vendorPath . '/' ) ) {
|
||||
$path = substr( $path, strlen( $vendorPath ) );
|
||||
$baseDir = '$vendorDir';
|
||||
|
||||
if ( false !== $path ) {
|
||||
$baseDir .= ' . ';
|
||||
}
|
||||
} else {
|
||||
$path = $filesystem->normalizePath( $filesystem->findShortestPath( $basePath, $path, true ) );
|
||||
if ( ! $filesystem->isAbsolutePath( $path ) ) {
|
||||
$baseDir = '$baseDir . ';
|
||||
$path = '/' . $path;
|
||||
}
|
||||
}
|
||||
|
||||
if ( strpos( $path, '.phar' ) !== false ) {
|
||||
$baseDir = "'phar://' . " . $baseDir;
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
return $baseDir . ( ( false !== $path ) ? var_export( $path, true ) : '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function differs from the composer parseAutoloadsType in that beside returning the path.
|
||||
* It also return the path and the version of a package.
|
||||
*
|
||||
* Supports PSR-4, PSR-0, and classmap parsing.
|
||||
*
|
||||
* @param array $packageMap Map of all the packages.
|
||||
* @param string $type Type of autoloader to use.
|
||||
* @param PackageInterface $mainPackage Instance of the Package Object.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function parseAutoloadsType( array $packageMap, $type, PackageInterface $mainPackage ) {
|
||||
$autoloads = array();
|
||||
|
||||
foreach ( $packageMap as $item ) {
|
||||
list($package, $installPath) = $item;
|
||||
$autoload = $package->getAutoload();
|
||||
$version = $package->getVersion(); // Version of the class comes from the package - should we try to parse it?
|
||||
|
||||
// Store our own actual package version, not "dev-trunk" or whatever.
|
||||
if ( $package->getName() === 'automattic/jetpack-autoloader' ) {
|
||||
$version = self::VERSION;
|
||||
}
|
||||
|
||||
if ( $package === $mainPackage ) {
|
||||
$autoload = array_merge_recursive( $autoload, $package->getDevAutoload() );
|
||||
}
|
||||
|
||||
if ( null !== $package->getTargetDir() && $package !== $mainPackage ) {
|
||||
$installPath = substr( $installPath, 0, -strlen( '/' . $package->getTargetDir() ) );
|
||||
}
|
||||
|
||||
if ( in_array( $type, array( 'psr-4', 'psr-0' ), true ) && isset( $autoload[ $type ] ) && is_array( $autoload[ $type ] ) ) {
|
||||
foreach ( $autoload[ $type ] as $namespace => $paths ) {
|
||||
$paths = is_array( $paths ) ? $paths : array( $paths );
|
||||
foreach ( $paths as $path ) {
|
||||
$relativePath = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
|
||||
$autoloads[ $namespace ][] = array(
|
||||
'path' => $relativePath,
|
||||
'version' => $version,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'classmap' === $type && isset( $autoload['classmap'] ) && is_array( $autoload['classmap'] ) ) {
|
||||
foreach ( $autoload['classmap'] as $paths ) {
|
||||
$paths = is_array( $paths ) ? $paths : array( $paths );
|
||||
foreach ( $paths as $path ) {
|
||||
$relativePath = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
|
||||
$autoloads[] = array(
|
||||
'path' => $relativePath,
|
||||
'version' => $version,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( 'files' === $type && isset( $autoload['files'] ) && is_array( $autoload['files'] ) ) {
|
||||
foreach ( $autoload['files'] as $paths ) {
|
||||
$paths = is_array( $paths ) ? $paths : array( $paths );
|
||||
foreach ( $paths as $path ) {
|
||||
$relativePath = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
|
||||
$autoloads[ $this->getFileIdentifier( $package, $path ) ] = array(
|
||||
'path' => $relativePath,
|
||||
'version' => $version,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $autoloads;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given Composer's autoloads this will convert them to a version that we can use to generate the manifests.
|
||||
*
|
||||
* When the $scanPsrPackages argument is true, PSR-4 namespaces are converted to classmaps. When $scanPsrPackages
|
||||
* is false, PSR-4 namespaces are not converted to classmaps.
|
||||
*
|
||||
* PSR-0 namespaces are always converted to classmaps.
|
||||
*
|
||||
* @param array $autoloads The autoloads we want to process.
|
||||
* @param bool $scanPsrPackages Whether or not PSR-4 packages should be converted to a classmap.
|
||||
* @param string $vendorPath The path to the vendor directory.
|
||||
* @param string $basePath The path to the current directory.
|
||||
*
|
||||
* @return array $processedAutoloads
|
||||
*/
|
||||
private function processAutoloads( $autoloads, $scanPsrPackages, $vendorPath, $basePath ) {
|
||||
$processor = new AutoloadProcessor(
|
||||
function ( $path, $excludedClasses, $namespace ) use ( $basePath ) {
|
||||
$dir = $this->filesystem->normalizePath(
|
||||
$this->filesystem->isAbsolutePath( $path ) ? $path : $basePath . '/' . $path
|
||||
);
|
||||
|
||||
// Composer 2.4 changed the name of the class.
|
||||
if ( class_exists( \Composer\ClassMapGenerator\ClassMapGenerator::class ) ) {
|
||||
if ( ! is_dir( $dir ) && ! is_file( $dir ) ) {
|
||||
return array();
|
||||
}
|
||||
$generator = new \Composer\ClassMapGenerator\ClassMapGenerator();
|
||||
$generator->scanPaths( $dir, $excludedClasses, 'classmap', empty( $namespace ) ? null : $namespace );
|
||||
return $generator->getClassMap()->getMap();
|
||||
}
|
||||
|
||||
return \Composer\Autoload\ClassMapGenerator::createMap(
|
||||
$dir,
|
||||
$excludedClasses,
|
||||
null, // Don't pass the IOInterface since the normal autoload generation will have reported already.
|
||||
empty( $namespace ) ? null : $namespace
|
||||
);
|
||||
},
|
||||
function ( $path ) use ( $basePath, $vendorPath ) {
|
||||
return $this->getPathCode( $this->filesystem, $basePath, $vendorPath, $path );
|
||||
}
|
||||
);
|
||||
|
||||
return array(
|
||||
'psr-4' => $processor->processPsr4Packages( $autoloads, $scanPsrPackages ),
|
||||
'classmap' => $processor->processClassmap( $autoloads, $scanPsrPackages ),
|
||||
'files' => $processor->processFiles( $autoloads ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all of the legacy autoloader files so they don't cause any problems.
|
||||
*
|
||||
* @param string $outDir The directory legacy files are written to.
|
||||
*/
|
||||
private function removeLegacyFiles( $outDir ) {
|
||||
$files = array(
|
||||
'autoload_functions.php',
|
||||
'class-autoloader-handler.php',
|
||||
'class-classes-handler.php',
|
||||
'class-files-handler.php',
|
||||
'class-plugins-handler.php',
|
||||
'class-version-selector.php',
|
||||
);
|
||||
foreach ( $files as $file ) {
|
||||
$this->filesystem->remove( $outDir . '/' . $file );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes all of the autoloader files to disk.
|
||||
*
|
||||
* @param string $outDir The directory to write to.
|
||||
* @param string $suffix The unique autoloader suffix.
|
||||
*/
|
||||
private function writeAutoloaderFiles( $outDir, $suffix ) {
|
||||
$this->io->writeError( "<info>Generating jetpack autoloader ($outDir)</info>" );
|
||||
|
||||
// We will remove all autoloader files to generate this again.
|
||||
$this->filesystem->emptyDirectory( $outDir );
|
||||
|
||||
// Write the autoloader files.
|
||||
AutoloadFileWriter::copyAutoloaderFiles( $this->io, $outDir, $suffix );
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes all of the manifest files to disk.
|
||||
*
|
||||
* @param string $outDir The directory to write to.
|
||||
* @param array $processedAutoloads The processed autoloads.
|
||||
*/
|
||||
private function writeManifests( $outDir, $processedAutoloads ) {
|
||||
$this->io->writeError( "<info>Generating jetpack autoloader manifests ($outDir)</info>" );
|
||||
|
||||
$manifestFiles = array(
|
||||
'classmap' => 'jetpack_autoload_classmap.php',
|
||||
'psr-4' => 'jetpack_autoload_psr4.php',
|
||||
'files' => 'jetpack_autoload_filemap.php',
|
||||
);
|
||||
|
||||
foreach ( $manifestFiles as $key => $file ) {
|
||||
// Make sure the file doesn't exist so it isn't there if we don't write it.
|
||||
$this->filesystem->remove( $outDir . '/' . $file );
|
||||
if ( empty( $processedAutoloads[ $key ] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$content = ManifestGenerator::buildManifest( $key, $file, $processedAutoloads[ $key ] );
|
||||
if ( empty( $content ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( file_put_contents( $outDir . '/' . $file, $content ) ) {
|
||||
$this->io->writeError( " <info>Generated: $file</info>" );
|
||||
} else {
|
||||
$this->io->writeError( " <error>Error: $file</error>" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/**
|
||||
* Autoload Processor.
|
||||
*
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader;
|
||||
|
||||
/**
|
||||
* Class AutoloadProcessor.
|
||||
*/
|
||||
class AutoloadProcessor {
|
||||
|
||||
/**
|
||||
* A callable for scanning a directory for all of its classes.
|
||||
*
|
||||
* @var callable
|
||||
*/
|
||||
private $classmapScanner;
|
||||
|
||||
/**
|
||||
* A callable for transforming a path into one to be used in code.
|
||||
*
|
||||
* @var callable
|
||||
*/
|
||||
private $pathCodeTransformer;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param callable $classmapScanner A callable for scanning a directory for all of its classes.
|
||||
* @param callable $pathCodeTransformer A callable for transforming a path into one to be used in code.
|
||||
*/
|
||||
public function __construct( $classmapScanner, $pathCodeTransformer ) {
|
||||
$this->classmapScanner = $classmapScanner;
|
||||
$this->pathCodeTransformer = $pathCodeTransformer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the classmap autoloads into a relative path format including the version for each file.
|
||||
*
|
||||
* @param array $autoloads The autoloads we are processing.
|
||||
* @param bool $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
|
||||
*
|
||||
* @return array|null $processed
|
||||
* @phan-param array{classmap:?array{path:string,version:string}[],psr-4:?array<string,array{path:string,version:string}[]>,psr-0:?array<string,array{path:string,version:string}[]>} $autoloads
|
||||
*/
|
||||
public function processClassmap( $autoloads, $scanPsrPackages ) {
|
||||
// We can't scan PSR packages if we don't actually have any.
|
||||
if ( empty( $autoloads['psr-4'] ) ) {
|
||||
$scanPsrPackages = false;
|
||||
}
|
||||
|
||||
if ( empty( $autoloads['classmap'] ) && ! $scanPsrPackages ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$excludedClasses = null;
|
||||
if ( ! empty( $autoloads['exclude-from-classmap'] ) ) {
|
||||
$excludedClasses = '{(' . implode( '|', $autoloads['exclude-from-classmap'] ) . ')}';
|
||||
}
|
||||
|
||||
$processed = array();
|
||||
|
||||
if ( $scanPsrPackages ) {
|
||||
foreach ( $autoloads['psr-4'] as $namespace => $sources ) {
|
||||
$namespace = empty( $namespace ) ? null : $namespace;
|
||||
|
||||
foreach ( $sources as $source ) {
|
||||
$classmap = call_user_func( $this->classmapScanner, $source['path'], $excludedClasses, $namespace );
|
||||
|
||||
foreach ( $classmap as $class => $path ) {
|
||||
$processed[ $class ] = array(
|
||||
'version' => $source['version'],
|
||||
'path' => call_user_func( $this->pathCodeTransformer, $path ),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* PSR-0 namespaces are converted to classmaps for both optimized and unoptimized autoloaders because any new
|
||||
* development should use classmap or PSR-4 autoloading.
|
||||
*/
|
||||
if ( ! empty( $autoloads['psr-0'] ) ) {
|
||||
foreach ( $autoloads['psr-0'] as $namespace => $sources ) {
|
||||
$namespace = empty( $namespace ) ? null : $namespace;
|
||||
|
||||
foreach ( $sources as $source ) {
|
||||
$classmap = call_user_func( $this->classmapScanner, $source['path'], $excludedClasses, $namespace );
|
||||
foreach ( $classmap as $class => $path ) {
|
||||
$processed[ $class ] = array(
|
||||
'version' => $source['version'],
|
||||
'path' => call_user_func( $this->pathCodeTransformer, $path ),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $autoloads['classmap'] ) ) {
|
||||
foreach ( $autoloads['classmap'] as $package ) {
|
||||
$classmap = call_user_func( $this->classmapScanner, $package['path'], $excludedClasses, null );
|
||||
|
||||
foreach ( $classmap as $class => $path ) {
|
||||
$processed[ $class ] = array(
|
||||
'version' => $package['version'],
|
||||
'path' => call_user_func( $this->pathCodeTransformer, $path ),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ksort( $processed );
|
||||
|
||||
return $processed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the PSR-4 autoloads into a relative path format including the version for each file.
|
||||
*
|
||||
* @param array $autoloads The autoloads we are processing.
|
||||
* @param bool $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
|
||||
*
|
||||
* @return array|null $processed
|
||||
*/
|
||||
public function processPsr4Packages( $autoloads, $scanPsrPackages ) {
|
||||
if ( $scanPsrPackages || empty( $autoloads['psr-4'] ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$processed = array();
|
||||
|
||||
foreach ( $autoloads['psr-4'] as $namespace => $packages ) {
|
||||
$namespace = empty( $namespace ) ? null : $namespace;
|
||||
$paths = array();
|
||||
|
||||
foreach ( $packages as $package ) {
|
||||
$paths[] = call_user_func( $this->pathCodeTransformer, $package['path'] );
|
||||
}
|
||||
|
||||
$processed[ $namespace ] = array(
|
||||
'version' => $package['version'],
|
||||
'path' => $paths,
|
||||
);
|
||||
}
|
||||
|
||||
return $processed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the file autoloads into a relative format including the version for each file.
|
||||
*
|
||||
* @param array $autoloads The autoloads we are processing.
|
||||
*
|
||||
* @return array|null $processed
|
||||
*/
|
||||
public function processFiles( $autoloads ) {
|
||||
if ( empty( $autoloads['files'] ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$processed = array();
|
||||
|
||||
foreach ( $autoloads['files'] as $file_id => $package ) {
|
||||
$processed[ $file_id ] = array(
|
||||
'version' => $package['version'],
|
||||
'path' => call_user_func( $this->pathCodeTransformer, $package['path'] ),
|
||||
);
|
||||
}
|
||||
|
||||
return $processed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
/**
|
||||
* Custom Autoloader Composer Plugin, hooks into composer events to generate the custom autoloader.
|
||||
*
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\EventDispatcher\EventSubscriberInterface;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Plugin\PluginInterface;
|
||||
use Composer\Script\Event;
|
||||
use Composer\Script\ScriptEvents;
|
||||
|
||||
/**
|
||||
* Class CustomAutoloaderPlugin.
|
||||
*
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
class CustomAutoloaderPlugin implements PluginInterface, EventSubscriberInterface {
|
||||
|
||||
/**
|
||||
* IO object.
|
||||
*
|
||||
* @var IOInterface IO object.
|
||||
*/
|
||||
private $io;
|
||||
|
||||
/**
|
||||
* Composer object.
|
||||
*
|
||||
* @var Composer Composer object.
|
||||
*/
|
||||
private $composer;
|
||||
|
||||
/**
|
||||
* Do nothing.
|
||||
*
|
||||
* @param Composer $composer Composer object.
|
||||
* @param IOInterface $io IO object.
|
||||
*/
|
||||
public function activate( Composer $composer, IOInterface $io ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
|
||||
$this->composer = $composer;
|
||||
$this->io = $io;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing.
|
||||
* phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
|
||||
*
|
||||
* @param Composer $composer Composer object.
|
||||
* @param IOInterface $io IO object.
|
||||
*/
|
||||
public function deactivate( Composer $composer, IOInterface $io ) {
|
||||
/*
|
||||
* Intentionally left empty. This is a PluginInterface method.
|
||||
* phpcs:enable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing.
|
||||
* phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
|
||||
*
|
||||
* @param Composer $composer Composer object.
|
||||
* @param IOInterface $io IO object.
|
||||
*/
|
||||
public function uninstall( Composer $composer, IOInterface $io ) {
|
||||
/*
|
||||
* Intentionally left empty. This is a PluginInterface method.
|
||||
* phpcs:enable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell composer to listen for events and do something with them.
|
||||
*
|
||||
* @return array List of subscribed events.
|
||||
*/
|
||||
public static function getSubscribedEvents() {
|
||||
return array(
|
||||
ScriptEvents::POST_AUTOLOAD_DUMP => 'postAutoloadDump',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the custom autolaoder.
|
||||
*
|
||||
* @param Event $event Script event object.
|
||||
*/
|
||||
public function postAutoloadDump( Event $event ) {
|
||||
// When the autoloader is not required by the root package we don't want to execute it.
|
||||
// This prevents unwanted transitive execution that generates unused autoloaders or
|
||||
// at worst throws fatal executions.
|
||||
if ( ! $this->isRequiredByRoot() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$config = $this->composer->getConfig();
|
||||
|
||||
if ( 'vendor' !== $config->raw()['config']['vendor-dir'] ) {
|
||||
$this->io->writeError( "\n<error>An error occurred while generating the autoloader files:", true );
|
||||
$this->io->writeError( 'The project\'s composer.json or composer environment set a non-default vendor directory.', true );
|
||||
$this->io->writeError( 'The default composer vendor directory must be used.</error>', true );
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
$installationManager = $this->composer->getInstallationManager();
|
||||
$repoManager = $this->composer->getRepositoryManager();
|
||||
$localRepo = $repoManager->getLocalRepository();
|
||||
$package = $this->composer->getPackage();
|
||||
$optimize = $event->getFlags()['optimize'];
|
||||
$suffix = $this->determineSuffix();
|
||||
|
||||
$generator = new AutoloadGenerator( $this->io );
|
||||
$generator->dump( $this->composer, $config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the suffix for the autoloader class.
|
||||
*
|
||||
* Reuses an existing suffix from vendor/autoload_packages.php or vendor/autoload.php if possible.
|
||||
*
|
||||
* @return string Suffix.
|
||||
*/
|
||||
private function determineSuffix() {
|
||||
$config = $this->composer->getConfig();
|
||||
$vendorPath = $config->get( 'vendor-dir' );
|
||||
|
||||
// Command line.
|
||||
$suffix = $config->get( 'autoloader-suffix' );
|
||||
if ( $suffix ) {
|
||||
return $suffix;
|
||||
}
|
||||
|
||||
// Reuse our own suffix, if any.
|
||||
if ( is_readable( $vendorPath . '/autoload_packages.php' ) ) {
|
||||
$content = file_get_contents( $vendorPath . '/autoload_packages.php' );
|
||||
if ( preg_match( '/^namespace Automattic\\\\Jetpack\\\\Autoloader\\\\jp([^;\s]+?)(?:\\\\al[^;\s]+)?;/m', $content, $match ) ) {
|
||||
return $match[1];
|
||||
}
|
||||
}
|
||||
|
||||
// Reuse Composer's suffix, if any.
|
||||
if ( is_readable( $vendorPath . '/autoload.php' ) ) {
|
||||
$content = file_get_contents( $vendorPath . '/autoload.php' );
|
||||
if ( preg_match( '{ComposerAutoloaderInit([^:\s]+)::}', $content, $match ) ) {
|
||||
return $match[1];
|
||||
}
|
||||
}
|
||||
|
||||
// Generate a random suffix.
|
||||
return md5( uniqid( '', true ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see whether or not the root package is the one that required the autoloader.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isRequiredByRoot() {
|
||||
$package = $this->composer->getPackage();
|
||||
$requires = $package->getRequires();
|
||||
if ( ! is_array( $requires ) ) { // @phan-suppress-current-line PhanRedundantCondition -- Earlier Composer versions may not have guaranteed this.
|
||||
$requires = array();
|
||||
}
|
||||
$devRequires = $package->getDevRequires();
|
||||
if ( ! is_array( $devRequires ) ) { // @phan-suppress-current-line PhanRedundantCondition -- Earlier Composer versions may not have guaranteed this.
|
||||
$devRequires = array();
|
||||
}
|
||||
$requires = array_merge( $requires, $devRequires );
|
||||
|
||||
if ( empty( $requires ) ) {
|
||||
$this->io->writeError( "\n<error>The package is not required and this should never happen?</error>", true );
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
foreach ( $requires as $require ) {
|
||||
if ( 'automattic/jetpack-autoloader' === $require->getTarget() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* Manifest Generator.
|
||||
*
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader;
|
||||
|
||||
/**
|
||||
* Class ManifestGenerator.
|
||||
*/
|
||||
class ManifestGenerator {
|
||||
|
||||
/**
|
||||
* Builds a manifest file for the given autoloader type.
|
||||
*
|
||||
* @param string $autoloaderType The type of autoloader to build a manifest for.
|
||||
* @param string $fileName The filename of the manifest.
|
||||
* @param array $content The manifest content to generate using.
|
||||
*
|
||||
* @return string|null $manifestFile
|
||||
* @throws \InvalidArgumentException When an invalid autoloader type is given.
|
||||
*/
|
||||
public static function buildManifest( $autoloaderType, $fileName, $content ) {
|
||||
if ( empty( $content ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch ( $autoloaderType ) {
|
||||
case 'classmap':
|
||||
case 'files':
|
||||
return self::buildStandardManifest( $fileName, $content );
|
||||
case 'psr-4':
|
||||
return self::buildPsr4Manifest( $fileName, $content );
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException( 'An invalid manifest type of ' . $autoloaderType . ' was passed!' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the contents for the standard manifest file.
|
||||
*
|
||||
* @param string $fileName The filename we are building.
|
||||
* @param array $manifestData The formatted data for the manifest.
|
||||
*
|
||||
* @return string|null $manifestFile
|
||||
*/
|
||||
private static function buildStandardManifest( $fileName, $manifestData ) {
|
||||
$fileContent = PHP_EOL;
|
||||
foreach ( $manifestData as $key => $data ) {
|
||||
$key = var_export( $key, true );
|
||||
$versionCode = var_export( $data['version'], true );
|
||||
$fileContent .= <<<MANIFEST_CODE
|
||||
$key => array(
|
||||
'version' => $versionCode,
|
||||
'path' => {$data['path']}
|
||||
),
|
||||
MANIFEST_CODE;
|
||||
$fileContent .= PHP_EOL;
|
||||
}
|
||||
|
||||
return self::buildFile( $fileName, $fileContent );
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the contents for the PSR-4 manifest file.
|
||||
*
|
||||
* @param string $fileName The filename we are building.
|
||||
* @param array $namespaces The formatted PSR-4 data for the manifest.
|
||||
*
|
||||
* @return string|null $manifestFile
|
||||
*/
|
||||
private static function buildPsr4Manifest( $fileName, $namespaces ) {
|
||||
$fileContent = PHP_EOL;
|
||||
foreach ( $namespaces as $namespace => $data ) {
|
||||
$namespaceCode = var_export( $namespace, true );
|
||||
$versionCode = var_export( $data['version'], true );
|
||||
$pathCode = 'array( ' . implode( ', ', $data['path'] ) . ' )';
|
||||
$fileContent .= <<<MANIFEST_CODE
|
||||
$namespaceCode => array(
|
||||
'version' => $versionCode,
|
||||
'path' => $pathCode
|
||||
),
|
||||
MANIFEST_CODE;
|
||||
$fileContent .= PHP_EOL;
|
||||
}
|
||||
|
||||
return self::buildFile( $fileName, $fileContent );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the PHP that will be used in the file.
|
||||
*
|
||||
* @param string $fileName The filename we are building.
|
||||
* @param string $content The content to be written into the file.
|
||||
*
|
||||
* @return string $fileContent
|
||||
*/
|
||||
private static function buildFile( $fileName, $content ) {
|
||||
return <<<INCLUDE_FILE
|
||||
<?php
|
||||
|
||||
// This file `$fileName` was auto generated by automattic/jetpack-autoloader.
|
||||
|
||||
\$vendorDir = dirname(__DIR__);
|
||||
\$baseDir = dirname(\$vendorDir);
|
||||
|
||||
return array($content);
|
||||
|
||||
INCLUDE_FILE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
require_once __DIR__ . '/jetpack-autoloader/class-autoloader.php';
|
||||
Autoloader::init();
|
||||
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
use Automattic\Jetpack\Autoloader\AutoloadGenerator;
|
||||
|
||||
/**
|
||||
* This class selects the package version for the autoloader.
|
||||
*/
|
||||
class Autoloader_Handler {
|
||||
|
||||
/**
|
||||
* The PHP_Autoloader instance.
|
||||
*
|
||||
* @var PHP_Autoloader
|
||||
*/
|
||||
private $php_autoloader;
|
||||
|
||||
/**
|
||||
* The Hook_Manager instance.
|
||||
*
|
||||
* @var Hook_Manager
|
||||
*/
|
||||
private $hook_manager;
|
||||
|
||||
/**
|
||||
* The Manifest_Reader instance.
|
||||
*
|
||||
* @var Manifest_Reader
|
||||
*/
|
||||
private $manifest_reader;
|
||||
|
||||
/**
|
||||
* The Version_Selector instance.
|
||||
*
|
||||
* @var Version_Selector
|
||||
*/
|
||||
private $version_selector;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param PHP_Autoloader $php_autoloader The PHP_Autoloader instance.
|
||||
* @param Hook_Manager $hook_manager The Hook_Manager instance.
|
||||
* @param Manifest_Reader $manifest_reader The Manifest_Reader instance.
|
||||
* @param Version_Selector $version_selector The Version_Selector instance.
|
||||
*/
|
||||
public function __construct( $php_autoloader, $hook_manager, $manifest_reader, $version_selector ) {
|
||||
$this->php_autoloader = $php_autoloader;
|
||||
$this->hook_manager = $hook_manager;
|
||||
$this->manifest_reader = $manifest_reader;
|
||||
$this->version_selector = $version_selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see whether or not an autoloader is currently in the process of initializing.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_initializing() {
|
||||
// If no version has been set it means that no autoloader has started initializing yet.
|
||||
global $jetpack_autoloader_latest_version;
|
||||
if ( ! isset( $jetpack_autoloader_latest_version ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// When the version is set but the classmap is not it ALWAYS means that this is the
|
||||
// latest autoloader and is being included by an older one.
|
||||
global $jetpack_packages_classmap;
|
||||
if ( empty( $jetpack_packages_classmap ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Version 2.4.0 added a new global and altered the reset semantics. We need to check
|
||||
// the other global as well since it may also point at initialization.
|
||||
// Note: We don't need to check for the class first because every autoloader that
|
||||
// will set the latest version global requires this class in the classmap.
|
||||
$replacing_version = $jetpack_packages_classmap[ AutoloadGenerator::class ]['version'];
|
||||
if ( $this->version_selector->is_dev_version( $replacing_version ) || version_compare( $replacing_version, '2.4.0.0', '>=' ) ) {
|
||||
global $jetpack_autoloader_loader;
|
||||
if ( ! isset( $jetpack_autoloader_loader ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates an autoloader using the given plugins and activates it.
|
||||
*
|
||||
* @param string[] $plugins The plugins to initialize the autoloader for.
|
||||
*/
|
||||
public function activate_autoloader( $plugins ) {
|
||||
global $jetpack_packages_psr4;
|
||||
$jetpack_packages_psr4 = array();
|
||||
$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_psr4.php', $jetpack_packages_psr4 );
|
||||
|
||||
global $jetpack_packages_classmap;
|
||||
$jetpack_packages_classmap = array();
|
||||
$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_classmap.php', $jetpack_packages_classmap );
|
||||
|
||||
global $jetpack_packages_filemap;
|
||||
$jetpack_packages_filemap = array();
|
||||
$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_filemap.php', $jetpack_packages_filemap );
|
||||
|
||||
$loader = new Version_Loader(
|
||||
$this->version_selector,
|
||||
$jetpack_packages_classmap,
|
||||
$jetpack_packages_psr4,
|
||||
$jetpack_packages_filemap
|
||||
);
|
||||
|
||||
$this->php_autoloader->register_autoloader( $loader );
|
||||
|
||||
// Now that the autoloader is active we can load the filemap.
|
||||
$loader->load_filemap();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the active autoloader and all related global state.
|
||||
*/
|
||||
public function reset_autoloader() {
|
||||
$this->php_autoloader->unregister_autoloader();
|
||||
$this->hook_manager->reset();
|
||||
|
||||
// Clear all of the autoloader globals so that older autoloaders don't do anything strange.
|
||||
global $jetpack_autoloader_latest_version;
|
||||
$jetpack_autoloader_latest_version = null;
|
||||
|
||||
global $jetpack_packages_classmap;
|
||||
$jetpack_packages_classmap = array(); // Must be array to avoid exceptions in old autoloaders!
|
||||
|
||||
global $jetpack_packages_psr4;
|
||||
$jetpack_packages_psr4 = array(); // Must be array to avoid exceptions in old autoloaders!
|
||||
|
||||
global $jetpack_packages_filemap;
|
||||
$jetpack_packages_filemap = array(); // Must be array to avoid exceptions in old autoloaders!
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
use Automattic\Jetpack\Autoloader\AutoloadGenerator;
|
||||
|
||||
/**
|
||||
* This class locates autoloaders.
|
||||
*/
|
||||
class Autoloader_Locator {
|
||||
|
||||
/**
|
||||
* The object for comparing autoloader versions.
|
||||
*
|
||||
* @var Version_Selector
|
||||
*/
|
||||
private $version_selector;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param Version_Selector $version_selector The version selector object.
|
||||
*/
|
||||
public function __construct( $version_selector ) {
|
||||
$this->version_selector = $version_selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the plugin with the latest autoloader.
|
||||
*
|
||||
* @param array $plugin_paths An array of plugin paths.
|
||||
* @param string $latest_version The latest version reference. @phan-output-reference.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function find_latest_autoloader( $plugin_paths, &$latest_version ) {
|
||||
$latest_plugin = null;
|
||||
|
||||
foreach ( $plugin_paths as $plugin_path ) {
|
||||
$version = $this->get_autoloader_version( $plugin_path );
|
||||
if ( ! $version || ! $this->version_selector->is_version_update_required( $latest_version, $version ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$latest_version = $version;
|
||||
$latest_plugin = $plugin_path;
|
||||
}
|
||||
|
||||
return $latest_plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the path to the autoloader.
|
||||
*
|
||||
* @param string $plugin_path The path to the plugin.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_autoloader_path( $plugin_path ) {
|
||||
return trailingslashit( $plugin_path ) . 'vendor/autoload_packages.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the version for the autoloader.
|
||||
*
|
||||
* @param string $plugin_path The path to the plugin.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function get_autoloader_version( $plugin_path ) {
|
||||
$classmap = trailingslashit( $plugin_path ) . 'vendor/composer/jetpack_autoload_classmap.php';
|
||||
if ( ! file_exists( $classmap ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$classmap = require $classmap;
|
||||
if ( isset( $classmap[ AutoloadGenerator::class ] ) ) {
|
||||
return $classmap[ AutoloadGenerator::class ]['version'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class handles management of the actual PHP autoloader.
|
||||
*/
|
||||
class Autoloader {
|
||||
|
||||
/**
|
||||
* Checks to see whether or not the autoloader should be initialized and then initializes it if so.
|
||||
*
|
||||
* @param Container|null $container The container we want to use for autoloader initialization. If none is given
|
||||
* then a container will be created automatically.
|
||||
*/
|
||||
public static function init( $container = null ) {
|
||||
// The container holds and manages the lifecycle of our dependencies
|
||||
// to make them easier to work with and increase flexibility.
|
||||
if ( ! isset( $container ) ) {
|
||||
require_once __DIR__ . '/class-container.php';
|
||||
$container = new Container();
|
||||
}
|
||||
|
||||
// phpcs:disable Generic.Commenting.DocComment.MissingShort
|
||||
|
||||
/** @var Autoloader_Handler $autoloader_handler */
|
||||
$autoloader_handler = $container->get( Autoloader_Handler::class );
|
||||
|
||||
// If the autoloader is already initializing it means that it has included us as the latest.
|
||||
$was_included_by_autoloader = $autoloader_handler->is_initializing();
|
||||
|
||||
/** @var Plugin_Locator $plugin_locator */
|
||||
$plugin_locator = $container->get( Plugin_Locator::class );
|
||||
|
||||
/** @var Plugins_Handler $plugins_handler */
|
||||
$plugins_handler = $container->get( Plugins_Handler::class );
|
||||
|
||||
// The current plugin is the one that we are attempting to initialize here.
|
||||
$current_plugin = $plugin_locator->find_current_plugin();
|
||||
|
||||
// The active plugins are those that we were able to discover on the site. This list will not
|
||||
// include mu-plugins, those activated by code, or those who are hidden by filtering. We also
|
||||
// want to take care to not consider the current plugin unknown if it was included by an
|
||||
// autoloader. This avoids the case where a plugin will be marked "active" while deactivated
|
||||
// due to it having the latest autoloader.
|
||||
$active_plugins = $plugins_handler->get_active_plugins( true, ! $was_included_by_autoloader );
|
||||
|
||||
// The cached plugins are all of those that were active or discovered by the autoloader during a previous request.
|
||||
// Note that it's possible this list will include plugins that have since been deactivated, but after a request
|
||||
// the cache should be updated and the deactivated plugins will be removed.
|
||||
$cached_plugins = $plugins_handler->get_cached_plugins();
|
||||
|
||||
// We combine the active list and cached list to preemptively load classes for plugins that are
|
||||
// presently unknown but will be loaded during the request. While this may result in us considering packages in
|
||||
// deactivated plugins there shouldn't be any problems as a result and the eventual consistency is sufficient.
|
||||
$all_plugins = array_merge( $active_plugins, $cached_plugins );
|
||||
|
||||
// In particular we also include the current plugin to address the case where it is the latest autoloader
|
||||
// but also unknown (and not cached). We don't want it in the active list because we don't know that it
|
||||
// is active but we need it in the all plugins list so that it is considered by the autoloader.
|
||||
$all_plugins[] = $current_plugin;
|
||||
|
||||
// We require uniqueness in the array to avoid processing the same plugin more than once.
|
||||
$all_plugins = array_values( array_unique( $all_plugins ) );
|
||||
|
||||
/** @var Latest_Autoloader_Guard $guard */
|
||||
$guard = $container->get( Latest_Autoloader_Guard::class );
|
||||
if ( $guard->should_stop_init( $current_plugin, $all_plugins, $was_included_by_autoloader ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize the autoloader using the handler now that we're ready.
|
||||
$autoloader_handler->activate_autoloader( $all_plugins );
|
||||
|
||||
/** @var Hook_Manager $hook_manager */
|
||||
$hook_manager = $container->get( Hook_Manager::class );
|
||||
|
||||
// Register a shutdown handler to clean up the autoloader.
|
||||
$hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) );
|
||||
|
||||
// Register a plugins_loaded handler to check for conflicting autoloaders.
|
||||
$hook_manager->add_action( 'plugins_loaded', array( $guard, 'check_for_conflicting_autoloaders' ), 1 );
|
||||
|
||||
// phpcs:enable Generic.Commenting.DocComment.MissingShort
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class manages the files and dependencies of the autoloader.
|
||||
*/
|
||||
class Container {
|
||||
|
||||
/**
|
||||
* Since each autoloader's class files exist within their own namespace we need a map to
|
||||
* convert between the local class and a shared key. Note that no version checking is
|
||||
* performed on these dependencies and the first autoloader to register will be the
|
||||
* one that is utilized.
|
||||
*/
|
||||
const SHARED_DEPENDENCY_KEYS = array(
|
||||
Hook_Manager::class => 'Hook_Manager',
|
||||
);
|
||||
|
||||
/**
|
||||
* A map of all the dependencies we've registered with the container and created.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dependencies;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->dependencies = array();
|
||||
|
||||
$this->register_shared_dependencies();
|
||||
$this->register_dependencies();
|
||||
$this->initialize_globals();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a dependency out of the container.
|
||||
*
|
||||
* @param string $class The class to fetch.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \InvalidArgumentException When a class that isn't registered with the container is fetched.
|
||||
*/
|
||||
public function get( $class ) {
|
||||
if ( ! isset( $this->dependencies[ $class ] ) ) {
|
||||
throw new \InvalidArgumentException( "Class '$class' is not registered with the container." );
|
||||
}
|
||||
|
||||
return $this->dependencies[ $class ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all of the dependencies that are shared between all instances of the autoloader.
|
||||
*/
|
||||
private function register_shared_dependencies() {
|
||||
global $jetpack_autoloader_container_shared;
|
||||
if ( ! isset( $jetpack_autoloader_container_shared ) ) {
|
||||
$jetpack_autoloader_container_shared = array();
|
||||
}
|
||||
|
||||
$key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ];
|
||||
if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) {
|
||||
require_once __DIR__ . '/class-hook-manager.php';
|
||||
$jetpack_autoloader_container_shared[ $key ] = new Hook_Manager();
|
||||
}
|
||||
$this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all of the dependencies with the container.
|
||||
*/
|
||||
private function register_dependencies() {
|
||||
require_once __DIR__ . '/class-path-processor.php';
|
||||
$this->dependencies[ Path_Processor::class ] = new Path_Processor();
|
||||
|
||||
require_once __DIR__ . '/class-plugin-locator.php';
|
||||
$this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator(
|
||||
$this->get( Path_Processor::class )
|
||||
);
|
||||
|
||||
require_once __DIR__ . '/class-version-selector.php';
|
||||
$this->dependencies[ Version_Selector::class ] = new Version_Selector();
|
||||
|
||||
require_once __DIR__ . '/class-autoloader-locator.php';
|
||||
$this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator(
|
||||
$this->get( Version_Selector::class )
|
||||
);
|
||||
|
||||
require_once __DIR__ . '/class-php-autoloader.php';
|
||||
$this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader();
|
||||
|
||||
require_once __DIR__ . '/class-manifest-reader.php';
|
||||
$this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader(
|
||||
$this->get( Version_Selector::class )
|
||||
);
|
||||
|
||||
require_once __DIR__ . '/class-plugins-handler.php';
|
||||
$this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler(
|
||||
$this->get( Plugin_Locator::class ),
|
||||
$this->get( Path_Processor::class )
|
||||
);
|
||||
|
||||
require_once __DIR__ . '/class-autoloader-handler.php';
|
||||
$this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler(
|
||||
$this->get( PHP_Autoloader::class ),
|
||||
$this->get( Hook_Manager::class ),
|
||||
$this->get( Manifest_Reader::class ),
|
||||
$this->get( Version_Selector::class )
|
||||
);
|
||||
|
||||
require_once __DIR__ . '/class-latest-autoloader-guard.php';
|
||||
$this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard(
|
||||
$this->get( Plugins_Handler::class ),
|
||||
$this->get( Autoloader_Handler::class ),
|
||||
$this->get( Autoloader_Locator::class )
|
||||
);
|
||||
|
||||
// Register any classes that we will use elsewhere.
|
||||
require_once __DIR__ . '/class-version-loader.php';
|
||||
require_once __DIR__ . '/class-shutdown-handler.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes any of the globals needed by the autoloader.
|
||||
*/
|
||||
private function initialize_globals() {
|
||||
/*
|
||||
* This global was retired in version 2.9. The value is set to 'false' to maintain
|
||||
* compatibility with older versions of the autoloader.
|
||||
*/
|
||||
global $jetpack_autoloader_including_latest;
|
||||
$jetpack_autoloader_including_latest = false;
|
||||
|
||||
// Not all plugins can be found using the locator. In cases where a plugin loads the autoloader
|
||||
// but was not discoverable, we will record them in this array to track them as "active".
|
||||
global $jetpack_autoloader_activating_plugins_paths;
|
||||
if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) {
|
||||
$jetpack_autoloader_activating_plugins_paths = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* Allows the latest autoloader to register hooks that can be removed when the autoloader is reset.
|
||||
*/
|
||||
class Hook_Manager {
|
||||
|
||||
/**
|
||||
* An array containing all of the hooks that we've registered.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $registered_hooks;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->registered_hooks = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an action to WordPress and registers it internally.
|
||||
*
|
||||
* @param string $tag The name of the action which is hooked.
|
||||
* @param callable $callable The function to call.
|
||||
* @param int $priority Used to specify the priority of the action.
|
||||
* @param int $accepted_args Used to specify the number of arguments the callable accepts.
|
||||
*/
|
||||
public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
|
||||
$this->registered_hooks[ $tag ][] = array(
|
||||
'priority' => $priority,
|
||||
'callable' => $callable,
|
||||
);
|
||||
|
||||
add_action( $tag, $callable, $priority, $accepted_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a filter to WordPress and registers it internally.
|
||||
*
|
||||
* @param string $tag The name of the filter which is hooked.
|
||||
* @param callable $callable The function to call.
|
||||
* @param int $priority Used to specify the priority of the filter.
|
||||
* @param int $accepted_args Used to specify the number of arguments the callable accepts.
|
||||
*/
|
||||
public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
|
||||
$this->registered_hooks[ $tag ][] = array(
|
||||
'priority' => $priority,
|
||||
'callable' => $callable,
|
||||
);
|
||||
|
||||
add_filter( $tag, $callable, $priority, $accepted_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all of the registered hooks.
|
||||
*/
|
||||
public function reset() {
|
||||
foreach ( $this->registered_hooks as $tag => $hooks ) {
|
||||
foreach ( $hooks as $hook ) {
|
||||
remove_filter( $tag, $hook['callable'], $hook['priority'] );
|
||||
}
|
||||
}
|
||||
$this->registered_hooks = array();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class ensures that we're only executing the latest autoloader.
|
||||
*/
|
||||
class Latest_Autoloader_Guard {
|
||||
|
||||
/**
|
||||
* The Plugins_Handler instance.
|
||||
*
|
||||
* @var Plugins_Handler
|
||||
*/
|
||||
private $plugins_handler;
|
||||
|
||||
/**
|
||||
* The Autoloader_Handler instance.
|
||||
*
|
||||
* @var Autoloader_Handler
|
||||
*/
|
||||
private $autoloader_handler;
|
||||
|
||||
/**
|
||||
* The Autoloader_locator instance.
|
||||
*
|
||||
* @var Autoloader_Locator
|
||||
*/
|
||||
private $autoloader_locator;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param Plugins_Handler $plugins_handler The Plugins_Handler instance.
|
||||
* @param Autoloader_Handler $autoloader_handler The Autoloader_Handler instance.
|
||||
* @param Autoloader_Locator $autoloader_locator The Autoloader_Locator instance.
|
||||
*/
|
||||
public function __construct( $plugins_handler, $autoloader_handler, $autoloader_locator ) {
|
||||
$this->plugins_handler = $plugins_handler;
|
||||
$this->autoloader_handler = $autoloader_handler;
|
||||
$this->autoloader_locator = $autoloader_locator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether or not the autoloader should be initialized. Note that this function
|
||||
* has the side-effect of actually loading the latest autoloader in the event that this
|
||||
* is not it.
|
||||
*
|
||||
* @param string $current_plugin The current plugin we're checking.
|
||||
* @param string[] $plugins The active plugins to check for autoloaders in.
|
||||
* @param bool $was_included_by_autoloader Indicates whether or not this autoloader was included by another.
|
||||
*
|
||||
* @return bool True if we should stop initialization, otherwise false.
|
||||
*/
|
||||
public function should_stop_init( $current_plugin, $plugins, $was_included_by_autoloader ) {
|
||||
global $jetpack_autoloader_latest_version;
|
||||
|
||||
// We need to reset the autoloader when the plugins change because
|
||||
// that means the autoloader was generated with a different list.
|
||||
if ( $this->plugins_handler->have_plugins_changed( $plugins ) ) {
|
||||
$this->autoloader_handler->reset_autoloader();
|
||||
}
|
||||
|
||||
// When the latest autoloader has already been found we don't need to search for it again.
|
||||
// We should take care however because this will also trigger if the autoloader has been
|
||||
// included by an older one.
|
||||
if ( isset( $jetpack_autoloader_latest_version ) && ! $was_included_by_autoloader ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$latest_plugin = $this->autoloader_locator->find_latest_autoloader( $plugins, $jetpack_autoloader_latest_version );
|
||||
if ( isset( $latest_plugin ) && $latest_plugin !== $current_plugin ) {
|
||||
require $this->autoloader_locator->get_autoloader_path( $latest_plugin );
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for conflicting autoloaders.
|
||||
*
|
||||
* A common source of strange and confusing problems is when another plugin
|
||||
* registers a Composer autoloader at a higher priority that us. If enabled,
|
||||
* check for this problem and warn about it.
|
||||
*
|
||||
* Called from the plugins_loaded hook.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @return void
|
||||
*/
|
||||
public function check_for_conflicting_autoloaders() {
|
||||
if ( ! defined( 'JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS' ) || ! JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS ) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $jetpack_autoloader_loader;
|
||||
if ( ! isset( $jetpack_autoloader_loader ) ) {
|
||||
return;
|
||||
}
|
||||
$prefixes = array();
|
||||
foreach ( ( $jetpack_autoloader_loader->get_class_map() ?? array() ) as $classname => $data ) {
|
||||
$parts = explode( '\\', trim( $classname, '\\' ) );
|
||||
array_pop( $parts );
|
||||
while ( $parts ) {
|
||||
$prefixes[ implode( '\\', $parts ) . '\\' ] = true;
|
||||
array_pop( $parts );
|
||||
}
|
||||
}
|
||||
foreach ( ( $jetpack_autoloader_loader->get_psr4_map() ?? array() ) as $prefix => $data ) {
|
||||
$parts = explode( '\\', trim( $prefix, '\\' ) );
|
||||
while ( $parts ) {
|
||||
$prefixes[ implode( '\\', $parts ) . '\\' ] = true;
|
||||
array_pop( $parts );
|
||||
}
|
||||
}
|
||||
|
||||
$autoload_chain = spl_autoload_functions();
|
||||
if ( ! $autoload_chain ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $autoload_chain as $autoloader ) {
|
||||
// No need to check anything after us.
|
||||
if ( is_array( $autoloader ) && is_string( $autoloader[0] ) && substr( $autoloader[0], 0, strlen( __NAMESPACE__ ) + 1 ) === __NAMESPACE__ . '\\' ) {
|
||||
break;
|
||||
}
|
||||
|
||||
// We can check Composer autoloaders easily enough.
|
||||
if ( is_array( $autoloader ) && $autoloader[0] instanceof \Composer\Autoload\ClassLoader && is_callable( array( $autoloader[0], 'getPrefixesPsr4' ) ) ) {
|
||||
$composer_autoloader = $autoloader[0];
|
||||
foreach ( $composer_autoloader->getClassMap() as $classname => $path ) {
|
||||
if ( $jetpack_autoloader_loader->find_class_file( $classname ) ) {
|
||||
$msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the classes we handle (e.g. $classname => $path). This may cause strange and confusing problems.";
|
||||
wp_trigger_error( '', $msg );
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
foreach ( $composer_autoloader->getPrefixesPsr4() as $prefix => $paths ) {
|
||||
if ( isset( $prefixes[ $prefix ] ) ) {
|
||||
$path = array_pop( $paths );
|
||||
$msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems.";
|
||||
wp_trigger_error( '', $msg );
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
foreach ( $composer_autoloader->getPrefixes() as $prefix => $paths ) {
|
||||
if ( isset( $prefixes[ $prefix ] ) ) {
|
||||
$path = array_pop( $paths );
|
||||
$msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems.";
|
||||
wp_trigger_error( '', $msg );
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class reads autoloader manifest files.
|
||||
*/
|
||||
class Manifest_Reader {
|
||||
|
||||
/**
|
||||
* The Version_Selector object.
|
||||
*
|
||||
* @var Version_Selector
|
||||
*/
|
||||
private $version_selector;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param Version_Selector $version_selector The Version_Selector object.
|
||||
*/
|
||||
public function __construct( $version_selector ) {
|
||||
$this->version_selector = $version_selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads all of the manifests in the given plugin paths.
|
||||
*
|
||||
* @param array $plugin_paths The paths to the plugins we're loading the manifest in.
|
||||
* @param string $manifest_path The path that we're loading the manifest from in each plugin.
|
||||
* @param array $path_map The path map to add the contents of the manifests to.
|
||||
*
|
||||
* @return array $path_map The path map we've built using the manifests in each plugin.
|
||||
*/
|
||||
public function read_manifests( $plugin_paths, $manifest_path, &$path_map ) {
|
||||
$file_paths = array_map(
|
||||
function ( $path ) use ( $manifest_path ) {
|
||||
return trailingslashit( $path ) . $manifest_path;
|
||||
},
|
||||
$plugin_paths
|
||||
);
|
||||
|
||||
foreach ( $file_paths as $path ) {
|
||||
$this->register_manifest( $path, $path_map );
|
||||
}
|
||||
|
||||
return $path_map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a plugin's manifest file with the path map.
|
||||
*
|
||||
* @param string $manifest_path The absolute path to the manifest that we're loading.
|
||||
* @param array $path_map The path map to add the contents of the manifest to.
|
||||
*/
|
||||
protected function register_manifest( $manifest_path, &$path_map ) {
|
||||
if ( ! is_readable( $manifest_path ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$manifest = require $manifest_path;
|
||||
if ( ! is_array( $manifest ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $manifest as $key => $data ) {
|
||||
$this->register_record( $key, $data, $path_map );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an entry from the manifest in the path map.
|
||||
*
|
||||
* @param string $key The identifier for the entry we're registering.
|
||||
* @param array $data The data for the entry we're registering.
|
||||
* @param array $path_map The path map to add the contents of the manifest to.
|
||||
*/
|
||||
protected function register_record( $key, $data, &$path_map ) {
|
||||
if ( isset( $path_map[ $key ]['version'] ) ) {
|
||||
$selected_version = $path_map[ $key ]['version'];
|
||||
} else {
|
||||
$selected_version = null;
|
||||
}
|
||||
|
||||
if ( $this->version_selector->is_version_update_required( $selected_version, $data['version'] ) ) {
|
||||
$path_map[ $key ] = array(
|
||||
'version' => $data['version'],
|
||||
'path' => $data['path'],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class handles dealing with paths for the autoloader.
|
||||
*/
|
||||
class Path_Processor {
|
||||
/**
|
||||
* Given a path this will replace any of the path constants with a token to represent it.
|
||||
*
|
||||
* @param string $path The path we want to process.
|
||||
*
|
||||
* @return string The tokenized path.
|
||||
*/
|
||||
public function tokenize_path_constants( $path ) {
|
||||
$path = wp_normalize_path( $path );
|
||||
|
||||
$constants = $this->get_normalized_constants();
|
||||
foreach ( $constants as $constant => $constant_path ) {
|
||||
$len = strlen( $constant_path );
|
||||
if ( substr( $path, 0, $len ) !== $constant_path ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return substr_replace( $path, '{{' . $constant . '}}', 0, $len );
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a path this will replace any of the path constant tokens with the expanded path.
|
||||
*
|
||||
* @param string $tokenized_path The path we want to process.
|
||||
*
|
||||
* @return string The expanded path.
|
||||
*/
|
||||
public function untokenize_path_constants( $tokenized_path ) {
|
||||
$tokenized_path = wp_normalize_path( $tokenized_path );
|
||||
|
||||
$constants = $this->get_normalized_constants();
|
||||
foreach ( $constants as $constant => $constant_path ) {
|
||||
$constant = '{{' . $constant . '}}';
|
||||
|
||||
$len = strlen( $constant );
|
||||
if ( substr( $tokenized_path, 0, $len ) !== $constant ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return $this->get_real_path( substr_replace( $tokenized_path, $constant_path, 0, $len ) );
|
||||
}
|
||||
|
||||
return $tokenized_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a file and an array of places it might be, this will find the absolute path and return it.
|
||||
*
|
||||
* @param string $file The plugin or theme file to resolve.
|
||||
* @param array $directories_to_check The directories we should check for the file if it isn't an absolute path.
|
||||
*
|
||||
* @return string|false Returns the absolute path to the directory, otherwise false.
|
||||
*/
|
||||
public function find_directory_with_autoloader( $file, $directories_to_check ) {
|
||||
$file = wp_normalize_path( $file );
|
||||
|
||||
if ( ! $this->is_absolute_path( $file ) ) {
|
||||
$file = $this->find_absolute_plugin_path( $file, $directories_to_check );
|
||||
if ( ! isset( $file ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// We need the real path for consistency with __DIR__ paths.
|
||||
$file = $this->get_real_path( $file );
|
||||
|
||||
// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
|
||||
$directory = @is_file( $file ) ? dirname( $file ) : $file;
|
||||
if ( ! @is_file( $directory . '/vendor/composer/jetpack_autoload_classmap.php' ) ) {
|
||||
return false;
|
||||
}
|
||||
// phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged
|
||||
|
||||
return $directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches an array of normalized paths keyed by the constant they came from.
|
||||
*
|
||||
* @return string[] The normalized paths keyed by the constant.
|
||||
*/
|
||||
private function get_normalized_constants() {
|
||||
$raw_constants = array(
|
||||
// Order the constants from most-specific to least-specific.
|
||||
'WP_PLUGIN_DIR',
|
||||
'WPMU_PLUGIN_DIR',
|
||||
'WP_CONTENT_DIR',
|
||||
'ABSPATH',
|
||||
);
|
||||
|
||||
$constants = array();
|
||||
foreach ( $raw_constants as $raw ) {
|
||||
if ( ! defined( $raw ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$path = wp_normalize_path( constant( $raw ) );
|
||||
if ( isset( $path ) ) {
|
||||
$constants[ $raw ] = $path;
|
||||
}
|
||||
}
|
||||
|
||||
return $constants;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether or not a path is absolute.
|
||||
*
|
||||
* @param string $path The path to check.
|
||||
*
|
||||
* @return bool True if the path is absolute, otherwise false.
|
||||
*/
|
||||
private function is_absolute_path( $path ) {
|
||||
if ( empty( $path ) || 0 === strlen( $path ) || '.' === $path[0] ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Absolute paths on Windows may begin with a drive letter.
|
||||
if ( preg_match( '/^[a-zA-Z]:[\/\\\\]/', $path ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// A path starting with / or \ is absolute; anything else is relative.
|
||||
return ( '/' === $path[0] || '\\' === $path[0] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a file and a list of directories to check, this method will try to figure out
|
||||
* the absolute path to the file in question.
|
||||
*
|
||||
* @param string $normalized_path The normalized path to the plugin or theme file to resolve.
|
||||
* @param array $directories_to_check The directories we should check for the file if it isn't an absolute path.
|
||||
*
|
||||
* @return string|null The absolute path to the plugin file, otherwise null.
|
||||
*/
|
||||
private function find_absolute_plugin_path( $normalized_path, $directories_to_check ) {
|
||||
// We're only able to find the absolute path for plugin/theme PHP files.
|
||||
if ( ! is_string( $normalized_path ) || '.php' !== substr( $normalized_path, -4 ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach ( $directories_to_check as $directory ) {
|
||||
$normalized_check = wp_normalize_path( trailingslashit( $directory ) ) . $normalized_path;
|
||||
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
||||
if ( @is_file( $normalized_check ) ) {
|
||||
return $normalized_check;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a path this will figure out the real path that we should be using.
|
||||
*
|
||||
* @param string $path The path to resolve.
|
||||
*
|
||||
* @return string The resolved path.
|
||||
*/
|
||||
private function get_real_path( $path ) {
|
||||
// We want to resolve symbolic links for consistency with __DIR__ paths.
|
||||
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
||||
$real_path = @realpath( $path );
|
||||
if ( false === $real_path ) {
|
||||
// Let the autoloader deal with paths that don't exist.
|
||||
$real_path = $path;
|
||||
}
|
||||
|
||||
// Using realpath will make it platform-specific so we must normalize it after.
|
||||
if ( $path !== $real_path ) {
|
||||
$real_path = wp_normalize_path( $real_path );
|
||||
}
|
||||
|
||||
return $real_path;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class handles management of the actual PHP autoloader.
|
||||
*/
|
||||
class PHP_Autoloader {
|
||||
|
||||
/**
|
||||
* Registers the autoloader with PHP so that it can begin autoloading classes.
|
||||
*
|
||||
* @param Version_Loader $version_loader The class loader to use in the autoloader.
|
||||
*/
|
||||
public function register_autoloader( $version_loader ) {
|
||||
// Make sure no other autoloaders are registered.
|
||||
$this->unregister_autoloader();
|
||||
|
||||
// Set the global so that it can be used to load classes.
|
||||
global $jetpack_autoloader_loader;
|
||||
$jetpack_autoloader_loader = $version_loader;
|
||||
|
||||
// Ensure that the autoloader is first to avoid contention with others.
|
||||
spl_autoload_register( array( self::class, 'load_class' ), true, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters the active autoloader so that it will no longer autoload classes.
|
||||
*/
|
||||
public function unregister_autoloader() {
|
||||
// Remove any v2 autoloader that we've already registered.
|
||||
$autoload_chain = spl_autoload_functions();
|
||||
if ( ! $autoload_chain ) {
|
||||
return;
|
||||
}
|
||||
foreach ( $autoload_chain as $autoloader ) {
|
||||
// We can identify a v2 autoloader using the namespace.
|
||||
$namespace_check = null;
|
||||
|
||||
// Functions are recorded as strings.
|
||||
if ( is_string( $autoloader ) ) {
|
||||
$namespace_check = $autoloader;
|
||||
} elseif ( is_array( $autoloader ) && is_string( $autoloader[0] ) ) {
|
||||
// Static method calls have the class as the first array element.
|
||||
$namespace_check = $autoloader[0];
|
||||
} else {
|
||||
// Since the autoloader has only ever been a function or a static method we don't currently need to check anything else.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check for the namespace without the generated suffix.
|
||||
if ( 'Automattic\\Jetpack\\Autoloader\\jp' === substr( $namespace_check, 0, 32 ) ) {
|
||||
spl_autoload_unregister( $autoloader );
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the global now that the autoloader has been unregistered.
|
||||
global $jetpack_autoloader_loader;
|
||||
$jetpack_autoloader_loader = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a class file if one could be found.
|
||||
*
|
||||
* Note: This function is static so that the autoloader can be easily unregistered. If
|
||||
* it was a class method we would have to unwrap the object to check the namespace.
|
||||
*
|
||||
* @param string $class_name The name of the class to autoload.
|
||||
*
|
||||
* @return bool Indicates whether or not a class file was loaded.
|
||||
*/
|
||||
public static function load_class( $class_name ) {
|
||||
global $jetpack_autoloader_loader;
|
||||
if ( ! isset( $jetpack_autoloader_loader ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$file = $jetpack_autoloader_loader->find_class_file( $class_name );
|
||||
if ( ! isset( $file ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// A common source of strange and confusing problems is when a vendor
|
||||
// file is autoloaded before all plugins have had a chance to register
|
||||
// with the autoloader. Detect that, if a development constant is set.
|
||||
if ( defined( 'JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS' ) && JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS &&
|
||||
( strpos( $file, '/vendor/' ) !== false || strpos( $file, '/jetpack_vendor/' ) !== false ) &&
|
||||
is_callable( 'did_action' ) && ! did_action( 'plugins_loaded' )
|
||||
) {
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_wp_debug_backtrace_summary -- This is a debug log message.
|
||||
$msg = "Jetpack Autoloader: Autoloading `$class_name` before the plugins_loaded hook may cause strange and confusing problems. " . wp_debug_backtrace_summary( '', 1 );
|
||||
wp_trigger_error( '', $msg );
|
||||
}
|
||||
|
||||
require $file;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class scans the WordPress installation to find active plugins.
|
||||
*/
|
||||
class Plugin_Locator {
|
||||
|
||||
/**
|
||||
* The path processor for finding plugin paths.
|
||||
*
|
||||
* @var Path_Processor
|
||||
*/
|
||||
private $path_processor;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param Path_Processor $path_processor The Path_Processor instance.
|
||||
*/
|
||||
public function __construct( $path_processor ) {
|
||||
$this->path_processor = $path_processor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the current plugin.
|
||||
*
|
||||
* @return string $path The path to the current plugin.
|
||||
*
|
||||
* @throws \RuntimeException If the current plugin does not have an autoloader.
|
||||
*/
|
||||
public function find_current_plugin() {
|
||||
// Escape from `vendor/__DIR__` to root plugin directory.
|
||||
$plugin_directory = dirname( __DIR__, 2 );
|
||||
|
||||
// Use the path processor to ensure that this is an autoloader we're referencing.
|
||||
$path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() );
|
||||
if ( false === $path ) {
|
||||
throw new \RuntimeException( 'Failed to locate plugin ' . $plugin_directory );
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks a given option for plugin paths.
|
||||
*
|
||||
* @param string $option_name The option that we want to check for plugin information.
|
||||
* @param bool $site_option Indicates whether or not we want to check the site option.
|
||||
*
|
||||
* @return array $plugin_paths The list of absolute paths we've found.
|
||||
*/
|
||||
public function find_using_option( $option_name, $site_option = false ) {
|
||||
$raw = $site_option ? get_site_option( $option_name ) : get_option( $option_name );
|
||||
if ( false === $raw ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
return $this->convert_plugins_to_paths( $raw );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for plugins in the `action` request parameter.
|
||||
*
|
||||
* @param string[] $allowed_actions The actions that we're allowed to return plugins for.
|
||||
*
|
||||
* @return array $plugin_paths The list of absolute paths we've found.
|
||||
*/
|
||||
public function find_using_request_action( $allowed_actions ) {
|
||||
/**
|
||||
* Note: we're not actually checking the nonce here because it's too early
|
||||
* in the execution. The pluggable functions are not yet loaded to give
|
||||
* plugins a chance to plug their versions. Therefore we're doing the bare
|
||||
* minimum: checking whether the nonce exists and it's in the right place.
|
||||
* The request will fail later if the nonce doesn't pass the check.
|
||||
*/
|
||||
if ( empty( $_REQUEST['_wpnonce'] ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated just below.
|
||||
$action = isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : false;
|
||||
if ( ! in_array( $action, $allowed_actions, true ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$plugin_slugs = array();
|
||||
switch ( $action ) {
|
||||
case 'activate':
|
||||
case 'deactivate':
|
||||
if ( empty( $_REQUEST['plugin'] ) ) {
|
||||
break;
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated by convert_plugins_to_paths.
|
||||
$plugin_slugs[] = wp_unslash( $_REQUEST['plugin'] );
|
||||
break;
|
||||
|
||||
case 'activate-selected':
|
||||
case 'deactivate-selected':
|
||||
if ( empty( $_REQUEST['checked'] ) ) {
|
||||
break;
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated by convert_plugins_to_paths.
|
||||
$plugin_slugs = wp_unslash( $_REQUEST['checked'] );
|
||||
break;
|
||||
}
|
||||
|
||||
return $this->convert_plugins_to_paths( $plugin_slugs );
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an array of plugin slugs or paths, this will convert them to absolute paths and filter
|
||||
* out the plugins that are not directory plugins. Note that array keys will also be included
|
||||
* if they are plugin paths!
|
||||
*
|
||||
* @param string[] $plugins Plugin paths or slugs to filter.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
private function convert_plugins_to_paths( $plugins ) {
|
||||
if ( ! is_array( $plugins ) || empty( $plugins ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
// We're going to look for plugins in the standard directories.
|
||||
$path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR );
|
||||
|
||||
$plugin_paths = array();
|
||||
foreach ( $plugins as $key => $value ) {
|
||||
$path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants );
|
||||
if ( $path ) {
|
||||
$plugin_paths[] = $path;
|
||||
}
|
||||
|
||||
$path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants );
|
||||
if ( $path ) {
|
||||
$plugin_paths[] = $path;
|
||||
}
|
||||
}
|
||||
|
||||
return $plugin_paths;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class handles locating and caching all of the active plugins.
|
||||
*/
|
||||
class Plugins_Handler {
|
||||
/**
|
||||
* The transient key for plugin paths.
|
||||
*/
|
||||
const TRANSIENT_KEY = 'jetpack_autoloader_plugin_paths';
|
||||
|
||||
/**
|
||||
* The locator for finding plugins in different locations.
|
||||
*
|
||||
* @var Plugin_Locator
|
||||
*/
|
||||
private $plugin_locator;
|
||||
|
||||
/**
|
||||
* The processor for transforming cached paths.
|
||||
*
|
||||
* @var Path_Processor
|
||||
*/
|
||||
private $path_processor;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param Plugin_Locator $plugin_locator The locator for finding active plugins.
|
||||
* @param Path_Processor $path_processor The processor for transforming cached paths.
|
||||
*/
|
||||
public function __construct( $plugin_locator, $path_processor ) {
|
||||
$this->plugin_locator = $plugin_locator;
|
||||
$this->path_processor = $path_processor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all of the active plugins we can find.
|
||||
*
|
||||
* @param bool $include_deactivating When true, plugins deactivating this request will be considered active.
|
||||
* @param bool $record_unknown When true, the current plugin will be marked as active and recorded when unknown.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function get_active_plugins( $include_deactivating, $record_unknown ) {
|
||||
global $jetpack_autoloader_activating_plugins_paths;
|
||||
|
||||
// We're going to build a unique list of plugins from a few different sources
|
||||
// to find all of our "active" plugins. While we need to return an integer
|
||||
// array, we're going to use an associative array internally to reduce
|
||||
// the amount of time that we're going to spend checking uniqueness
|
||||
// and merging different arrays together to form the output.
|
||||
$active_plugins = array();
|
||||
|
||||
// Make sure that plugins which have activated this request are considered as "active" even though
|
||||
// they probably won't be present in any option.
|
||||
if ( is_array( $jetpack_autoloader_activating_plugins_paths ) ) {
|
||||
foreach ( $jetpack_autoloader_activating_plugins_paths as $path ) {
|
||||
$active_plugins[ $path ] = $path;
|
||||
}
|
||||
}
|
||||
|
||||
// This option contains all of the plugins that have been activated.
|
||||
$plugins = $this->plugin_locator->find_using_option( 'active_plugins' );
|
||||
foreach ( $plugins as $path ) {
|
||||
$active_plugins[ $path ] = $path;
|
||||
}
|
||||
|
||||
// This option contains all of the multisite plugins that have been activated.
|
||||
if ( is_multisite() ) {
|
||||
$plugins = $this->plugin_locator->find_using_option( 'active_sitewide_plugins', true );
|
||||
foreach ( $plugins as $path ) {
|
||||
$active_plugins[ $path ] = $path;
|
||||
}
|
||||
}
|
||||
|
||||
// These actions contain plugins that are being activated/deactivated during this request.
|
||||
$plugins = $this->plugin_locator->find_using_request_action( array( 'activate', 'activate-selected', 'deactivate', 'deactivate-selected' ) );
|
||||
foreach ( $plugins as $path ) {
|
||||
$active_plugins[ $path ] = $path;
|
||||
}
|
||||
|
||||
// When the current plugin isn't considered "active" there's a problem.
|
||||
// Since we're here, the plugin is active and currently being loaded.
|
||||
// We can support this case (mu-plugins and non-standard activation)
|
||||
// by adding the current plugin to the active list and marking it
|
||||
// as an unknown (activating) plugin. This also has the benefit
|
||||
// of causing a reset because the active plugins list has
|
||||
// been changed since it was saved in the global.
|
||||
$current_plugin = $this->plugin_locator->find_current_plugin();
|
||||
if ( $record_unknown && ! in_array( $current_plugin, $active_plugins, true ) ) {
|
||||
$active_plugins[ $current_plugin ] = $current_plugin;
|
||||
$jetpack_autoloader_activating_plugins_paths[] = $current_plugin;
|
||||
}
|
||||
|
||||
// When deactivating plugins aren't desired we should entirely remove them from the active list.
|
||||
if ( ! $include_deactivating ) {
|
||||
// These actions contain plugins that are being deactivated during this request.
|
||||
$plugins = $this->plugin_locator->find_using_request_action( array( 'deactivate', 'deactivate-selected' ) );
|
||||
foreach ( $plugins as $path ) {
|
||||
unset( $active_plugins[ $path ] );
|
||||
}
|
||||
}
|
||||
|
||||
// Transform the array so that we don't have to worry about the keys interacting with other array types later.
|
||||
return array_values( $active_plugins );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all of the cached plugins if there are any.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function get_cached_plugins() {
|
||||
$cached = get_transient( self::TRANSIENT_KEY );
|
||||
if ( ! is_array( $cached ) || empty( $cached ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
// We need to expand the tokens to an absolute path for this webserver.
|
||||
return array_map( array( $this->path_processor, 'untokenize_path_constants' ), $cached );
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the plugin list to the cache.
|
||||
*
|
||||
* @param array $plugins The plugin list to save to the cache.
|
||||
*/
|
||||
public function cache_plugins( $plugins ) {
|
||||
// We store the paths in a tokenized form so that that webservers with different absolute paths don't break.
|
||||
$plugins = array_map( array( $this->path_processor, 'tokenize_path_constants' ), $plugins );
|
||||
|
||||
set_transient( self::TRANSIENT_KEY, $plugins );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see whether or not the plugin list given has changed when compared to the
|
||||
* shared `$jetpack_autoloader_cached_plugin_paths` global. This allows us to deal
|
||||
* with cases where the active list may change due to filtering..
|
||||
*
|
||||
* @param string[] $plugins The plugins list to check against the global cache.
|
||||
*
|
||||
* @return bool True if the plugins have changed, otherwise false.
|
||||
*/
|
||||
public function have_plugins_changed( $plugins ) {
|
||||
global $jetpack_autoloader_cached_plugin_paths;
|
||||
|
||||
if ( $jetpack_autoloader_cached_plugin_paths !== $plugins ) {
|
||||
$jetpack_autoloader_cached_plugin_paths = $plugins;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class handles the shutdown of the autoloader.
|
||||
*/
|
||||
class Shutdown_Handler {
|
||||
|
||||
/**
|
||||
* The Plugins_Handler instance.
|
||||
*
|
||||
* @var Plugins_Handler
|
||||
*/
|
||||
private $plugins_handler;
|
||||
|
||||
/**
|
||||
* The plugins cached by this autoloader.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
private $cached_plugins;
|
||||
|
||||
/**
|
||||
* Indicates whether or not this autoloader was included by another.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $was_included_by_autoloader;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Plugins_Handler $plugins_handler The Plugins_Handler instance to use.
|
||||
* @param string[] $cached_plugins The plugins cached by the autoloaer.
|
||||
* @param bool $was_included_by_autoloader Indicates whether or not the autoloader was included by another.
|
||||
*/
|
||||
public function __construct( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) {
|
||||
$this->plugins_handler = $plugins_handler;
|
||||
$this->cached_plugins = $cached_plugins;
|
||||
$this->was_included_by_autoloader = $was_included_by_autoloader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the shutdown of the autoloader.
|
||||
*/
|
||||
public function __invoke() {
|
||||
// Don't save a broken cache if an error happens during some plugin's initialization.
|
||||
if ( ! did_action( 'plugins_loaded' ) ) {
|
||||
// Ensure that the cache is emptied to prevent consecutive failures if the cache is to blame.
|
||||
if ( ! empty( $this->cached_plugins ) ) {
|
||||
$this->plugins_handler->cache_plugins( array() );
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Load the active plugins fresh since the list we pulled earlier might not contain
|
||||
// plugins that were activated but did not reset the autoloader. This happens
|
||||
// when a plugin is in the cache but not "active" when the autoloader loads.
|
||||
// We also want to make sure that plugins which are deactivating are not
|
||||
// considered "active" so that they will be removed from the cache now.
|
||||
try {
|
||||
$active_plugins = $this->plugins_handler->get_active_plugins( false, ! $this->was_included_by_autoloader );
|
||||
} catch ( \Exception $ex ) {
|
||||
// When the package is deleted before shutdown it will throw an exception.
|
||||
// In the event this happens we should erase the cache.
|
||||
if ( ! empty( $this->cached_plugins ) ) {
|
||||
$this->plugins_handler->cache_plugins( array() );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// The paths should be sorted for easy comparisons with those loaded from the cache.
|
||||
// Note we don't need to sort the cached entries because they're already sorted.
|
||||
sort( $active_plugins );
|
||||
|
||||
// We don't want to waste time saving a cache that hasn't changed.
|
||||
if ( $this->cached_plugins === $active_plugins ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->plugins_handler->cache_plugins( $active_plugins );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* This class loads other classes based on given parameters.
|
||||
*/
|
||||
class Version_Loader {
|
||||
|
||||
/**
|
||||
* The Version_Selector object.
|
||||
*
|
||||
* @var Version_Selector
|
||||
*/
|
||||
private $version_selector;
|
||||
|
||||
/**
|
||||
* A map of available classes and their version and file path.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $classmap;
|
||||
|
||||
/**
|
||||
* A map of PSR-4 namespaces and their version and directory path.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $psr4_map;
|
||||
|
||||
/**
|
||||
* A map of all the files that we should load.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $filemap;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param Version_Selector $version_selector The Version_Selector object.
|
||||
* @param array $classmap The verioned classmap to load using.
|
||||
* @param array $psr4_map The versioned PSR-4 map to load using.
|
||||
* @param array $filemap The versioned filemap to load.
|
||||
*/
|
||||
public function __construct( $version_selector, $classmap, $psr4_map, $filemap ) {
|
||||
$this->version_selector = $version_selector;
|
||||
$this->classmap = $classmap;
|
||||
$this->psr4_map = $psr4_map;
|
||||
$this->filemap = $filemap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the classmap.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @return array<string, array>
|
||||
*/
|
||||
public function get_class_map() {
|
||||
return $this->classmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the psr-4 mappings.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @return array<string, array>
|
||||
*/
|
||||
public function get_psr4_map() {
|
||||
return $this->psr4_map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the file path for the given class.
|
||||
*
|
||||
* @param string $class_name The class to find.
|
||||
*
|
||||
* @return string|null $file_path The path to the file if found, null if no class was found.
|
||||
*/
|
||||
public function find_class_file( $class_name ) {
|
||||
$data = $this->select_newest_file(
|
||||
$this->classmap[ $class_name ] ?? null,
|
||||
$this->find_psr4_file( $class_name )
|
||||
);
|
||||
if ( ! isset( $data ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data['path'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all of the files in the filemap.
|
||||
*/
|
||||
public function load_filemap() {
|
||||
if ( empty( $this->filemap ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $this->filemap as $file_identifier => $file_data ) {
|
||||
if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) {
|
||||
require_once $file_data['path'];
|
||||
|
||||
$GLOBALS['__composer_autoload_files'][ $file_identifier ] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares different class sources and returns the newest.
|
||||
*
|
||||
* @param array|null $classmap_data The classmap class data.
|
||||
* @param array|null $psr4_data The PSR-4 class data.
|
||||
*
|
||||
* @return array|null $data
|
||||
*/
|
||||
private function select_newest_file( $classmap_data, $psr4_data ) {
|
||||
if ( ! isset( $classmap_data ) ) {
|
||||
return $psr4_data;
|
||||
} elseif ( ! isset( $psr4_data ) ) {
|
||||
return $classmap_data;
|
||||
}
|
||||
|
||||
if ( $this->version_selector->is_version_update_required( $classmap_data['version'], $psr4_data['version'] ) ) {
|
||||
return $psr4_data;
|
||||
}
|
||||
|
||||
return $classmap_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the file for a given class in a PSR-4 namespace.
|
||||
*
|
||||
* @param string $class_name The class to find.
|
||||
*
|
||||
* @return array|null $data The version and path path to the file if found, null otherwise.
|
||||
*/
|
||||
private function find_psr4_file( $class_name ) {
|
||||
if ( empty( $this->psr4_map ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Don't bother with classes that have no namespace.
|
||||
$class_index = strrpos( $class_name, '\\' );
|
||||
if ( ! $class_index ) {
|
||||
return null;
|
||||
}
|
||||
$class_for_path = str_replace( '\\', '/', $class_name );
|
||||
|
||||
// Search for the namespace by iteratively cutting off the last segment until
|
||||
// we find a match. This allows us to check the most-specific namespaces
|
||||
// first as well as minimize the amount of time spent looking.
|
||||
for (
|
||||
$class_namespace = substr( $class_name, 0, $class_index );
|
||||
! empty( $class_namespace );
|
||||
$class_namespace = substr( $class_namespace, 0, strrpos( $class_namespace, '\\' ) )
|
||||
) {
|
||||
$namespace = $class_namespace . '\\';
|
||||
if ( ! isset( $this->psr4_map[ $namespace ] ) ) {
|
||||
continue;
|
||||
}
|
||||
$data = $this->psr4_map[ $namespace ];
|
||||
|
||||
foreach ( $data['path'] as $path ) {
|
||||
$path .= '/' . substr( $class_for_path, strlen( $namespace ) ) . '.php';
|
||||
if ( file_exists( $path ) ) {
|
||||
return array(
|
||||
'version' => $data['version'],
|
||||
'path' => $path,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/* HEADER */ // phpcs:ignore
|
||||
|
||||
/**
|
||||
* Used to select package versions.
|
||||
*/
|
||||
class Version_Selector {
|
||||
|
||||
/**
|
||||
* Checks whether the selected package version should be updated. Composer development
|
||||
* package versions ('9999999-dev' or versions that start with 'dev-') are favored
|
||||
* when the JETPACK_AUTOLOAD_DEV constant is set to true.
|
||||
*
|
||||
* @param String $selected_version The currently selected package version.
|
||||
* @param String $compare_version The package version that is being evaluated to
|
||||
* determine if the version needs to be updated.
|
||||
*
|
||||
* @return bool Returns true if the selected package version should be updated,
|
||||
* else false.
|
||||
*/
|
||||
public function is_version_update_required( $selected_version, $compare_version ) {
|
||||
$use_dev_versions = defined( 'JETPACK_AUTOLOAD_DEV' ) && JETPACK_AUTOLOAD_DEV;
|
||||
|
||||
if ( $selected_version === null ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( $use_dev_versions && $this->is_dev_version( $selected_version ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $this->is_dev_version( $compare_version ) ) {
|
||||
if ( $use_dev_versions ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( version_compare( $selected_version, $compare_version, '<' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package version is a development version.
|
||||
*
|
||||
* @param String $version The package version.
|
||||
*
|
||||
* @return bool True if the version is a dev version, else false.
|
||||
*/
|
||||
public function is_dev_version( $version ) {
|
||||
if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
579
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/ClassLoader.php
vendored
Normal file
579
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/ClassLoader.php
vendored
Normal file
@@ -0,0 +1,579 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
$paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
396
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/InstalledVersions.php
vendored
Normal file
396
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/InstalledVersions.php
vendored
Normal file
@@ -0,0 +1,396 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
|
||||
* @internal
|
||||
*/
|
||||
private static $selfDir = null;
|
||||
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private static $installedIsLocalDir;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @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
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @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
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @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
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @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.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @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.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@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);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
|
||||
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
|
||||
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
|
||||
// so we have to assume it does not, and that may result in duplicate data being returned when listing
|
||||
// all installed packages for example
|
||||
self::$installedIsLocalDir = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private static function getSelfDir()
|
||||
{
|
||||
if (self::$selfDir === null) {
|
||||
self::$selfDir = strtr(__DIR__, '\\', '/');
|
||||
}
|
||||
|
||||
return self::$selfDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
$copiedLocalDir = false;
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
$selfDir = self::getSelfDir();
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
$vendorDir = strtr($vendorDir, '\\', '/');
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
self::$installedByVendor[$vendorDir] = $required;
|
||||
$installed[] = $required;
|
||||
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
|
||||
self::$installed = $required;
|
||||
self::$installedIsLocalDir = true;
|
||||
}
|
||||
}
|
||||
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
|
||||
$copiedLocalDir = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array() && !$copiedLocalDir) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
||||
21
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/LICENSE
vendored
Normal file
21
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/LICENSE
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php',
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
);
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
14
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/autoload_psr4.php
vendored
Normal file
14
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/autoload_psr4.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Hostinger\\WpMenuManager\\' => array($vendorDir . '/hostinger/hostinger-wp-menu-manager/src'),
|
||||
'Hostinger\\WpHelper\\' => array($vendorDir . '/hostinger/hostinger-wp-helper/src'),
|
||||
'Hostinger\\Tests\\' => array($vendorDir . '/hostinger/hostinger-wp-helper/tests/phpunit'),
|
||||
'Hostinger\\' => array($baseDir . '/includes'),
|
||||
'Automattic\\Jetpack\\Autoloader\\' => array($vendorDir . '/automattic/jetpack-autoloader/src'),
|
||||
);
|
||||
36
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/autoload_real.php
vendored
Normal file
36
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/autoload_real.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit5eb612593a2ef67b85ad25c07c19e821
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit5eb612593a2ef67b85ad25c07c19e821', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit5eb612593a2ef67b85ad25c07c19e821', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit5eb612593a2ef67b85ad25c07c19e821::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
60
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/autoload_static.php
vendored
Normal file
60
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/autoload_static.php
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit5eb612593a2ef67b85ad25c07c19e821
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'H' =>
|
||||
array (
|
||||
'Hostinger\\WpMenuManager\\' => 24,
|
||||
'Hostinger\\WpHelper\\' => 19,
|
||||
'Hostinger\\Tests\\' => 16,
|
||||
'Hostinger\\' => 10,
|
||||
),
|
||||
'A' =>
|
||||
array (
|
||||
'Automattic\\Jetpack\\Autoloader\\' => 30,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'Hostinger\\WpMenuManager\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/hostinger/hostinger-wp-menu-manager/src',
|
||||
),
|
||||
'Hostinger\\WpHelper\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/hostinger/hostinger-wp-helper/src',
|
||||
),
|
||||
'Hostinger\\Tests\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/hostinger/hostinger-wp-helper/tests/phpunit',
|
||||
),
|
||||
'Hostinger\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/includes',
|
||||
),
|
||||
'Automattic\\Jetpack\\Autoloader\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php',
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit5eb612593a2ef67b85ad25c07c19e821::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit5eb612593a2ef67b85ad25c07c19e821::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit5eb612593a2ef67b85ad25c07c19e821::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
||||
206
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/installed.json
vendored
Normal file
206
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/installed.json
vendored
Normal file
@@ -0,0 +1,206 @@
|
||||
{
|
||||
"packages": [
|
||||
{
|
||||
"name": "automattic/jetpack-autoloader",
|
||||
"version": "dev-trunk",
|
||||
"version_normalized": "dev-trunk",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Automattic/jetpack-autoloader.git",
|
||||
"reference": "b6f03f60e986af2839fdcd775ab1859c13802d8d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/b6f03f60e986af2839fdcd775ab1859c13802d8d",
|
||||
"reference": "b6f03f60e986af2839fdcd775ab1859c13802d8d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer-plugin-api": "^2.2",
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"automattic/jetpack-changelogger": "^6.0.10-alpha",
|
||||
"automattic/phpunit-select-config": "^1.0.3",
|
||||
"composer/composer": "^2.2",
|
||||
"yoast/phpunit-polyfills": "^4.0.0"
|
||||
},
|
||||
"time": "2025-11-27T17:59:55+00:00",
|
||||
"default-branch": true,
|
||||
"type": "composer-plugin",
|
||||
"extra": {
|
||||
"class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin",
|
||||
"autotagger": true,
|
||||
"mirror-repo": "Automattic/jetpack-autoloader",
|
||||
"branch-alias": {
|
||||
"dev-trunk": "5.0.x-dev"
|
||||
},
|
||||
"changelogger": {
|
||||
"link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}"
|
||||
},
|
||||
"version-constants": {
|
||||
"::VERSION": "src/AutoloadGenerator.php"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Automattic\\Jetpack\\Autoloader\\": "src"
|
||||
},
|
||||
"classmap": [
|
||||
"src/AutoloadGenerator.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL-2.0-or-later"
|
||||
],
|
||||
"description": "Creates a custom autoloader for a plugin or theme.",
|
||||
"keywords": [
|
||||
"autoload",
|
||||
"autoloader",
|
||||
"composer",
|
||||
"jetpack",
|
||||
"plugin",
|
||||
"wordpress"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/Automattic/jetpack-autoloader/tree/trunk"
|
||||
},
|
||||
"install-path": "../automattic/jetpack-autoloader"
|
||||
},
|
||||
{
|
||||
"name": "hostinger/hostinger-wp-helper",
|
||||
"version": "1.0.12",
|
||||
"version_normalized": "1.0.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-helper.git",
|
||||
"reference": "f943461ffdd9df60c84e4d808ff1dd967dfa790d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hostinger/hostinger-wp-helper/zipball/f943461ffdd9df60c84e4d808ff1dd967dfa790d",
|
||||
"reference": "f943461ffdd9df60c84e4d808ff1dd967dfa790d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"yoast/phpunit-polyfills": "^2.0"
|
||||
},
|
||||
"time": "2025-07-28T09:51:26+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpHelper\\": "src/",
|
||||
"Hostinger\\Tests\\": "tests/phpunit"
|
||||
}
|
||||
},
|
||||
"description": "A PHP package with core functions for Hostinger WordPress plugins.",
|
||||
"support": {
|
||||
"source": "https://github.com/hostinger/hostinger-wp-helper/tree/1.0.12",
|
||||
"issues": "https://github.com/hostinger/hostinger-wp-helper/issues"
|
||||
},
|
||||
"install-path": "../hostinger/hostinger-wp-helper"
|
||||
},
|
||||
{
|
||||
"name": "hostinger/hostinger-wp-menu-manager",
|
||||
"version": "1.2.20",
|
||||
"version_normalized": "1.2.20.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-menu-manager.git",
|
||||
"reference": "937e866a6c7db2ae9e9549a8f57c1ff922117ed2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hostinger/hostinger-wp-menu-manager/zipball/937e866a6c7db2ae9e9549a8f57c1ff922117ed2",
|
||||
"reference": "937e866a6c7db2ae9e9549a8f57c1ff922117ed2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"hostinger/hostinger-wp-helper": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"squizlabs/php_codesniffer": "^3.0",
|
||||
"yoast/phpunit-polyfills": "^2.0"
|
||||
},
|
||||
"time": "2025-08-18T12:17:45+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpMenuManager\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpMenuManager\\Tests\\": "tests/phpunit"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"proprietary"
|
||||
],
|
||||
"description": "Package for managing Hostinger WordPress menus and pages.",
|
||||
"support": {
|
||||
"source": "https://github.com/hostinger/hostinger-wp-menu-manager/tree/1.2.20",
|
||||
"issues": "https://github.com/hostinger/hostinger-wp-menu-manager/issues"
|
||||
},
|
||||
"install-path": "../hostinger/hostinger-wp-menu-manager"
|
||||
},
|
||||
{
|
||||
"name": "woocommerce/action-scheduler",
|
||||
"version": "3.9.3",
|
||||
"version_normalized": "3.9.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/woocommerce/action-scheduler.git",
|
||||
"reference": "c58cdbab17651303d406cd3b22cf9d75c71c986c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/c58cdbab17651303d406cd3b22cf9d75c71c986c",
|
||||
"reference": "c58cdbab17651303d406cd3b22cf9d75c71c986c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5",
|
||||
"woocommerce/woocommerce-sniffs": "0.1.0",
|
||||
"wp-cli/wp-cli": "~2.5.0",
|
||||
"yoast/phpunit-polyfills": "^2.0"
|
||||
},
|
||||
"time": "2025-07-15T09:32:30+00:00",
|
||||
"type": "wordpress-plugin",
|
||||
"extra": {
|
||||
"scripts-description": {
|
||||
"test": "Run unit tests",
|
||||
"phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer",
|
||||
"phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL-3.0-or-later"
|
||||
],
|
||||
"description": "Action Scheduler for WordPress and WooCommerce",
|
||||
"homepage": "https://actionscheduler.org/",
|
||||
"support": {
|
||||
"issues": "https://github.com/woocommerce/action-scheduler/issues",
|
||||
"source": "https://github.com/woocommerce/action-scheduler/tree/3.9.3"
|
||||
},
|
||||
"install-path": "../woocommerce/action-scheduler"
|
||||
}
|
||||
],
|
||||
"dev": false,
|
||||
"dev-package-names": []
|
||||
}
|
||||
61
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/installed.php
vendored
Normal file
61
Atomaste Reference/public_html/wp-content/plugins/hostinger/vendor/composer/installed.php
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => 'hostinger/hostinger',
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => 'a30bacd632e86ad8a21d32e5e88735f876a6483c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev' => false,
|
||||
),
|
||||
'versions' => array(
|
||||
'automattic/jetpack-autoloader' => array(
|
||||
'pretty_version' => 'dev-trunk',
|
||||
'version' => 'dev-trunk',
|
||||
'reference' => 'b6f03f60e986af2839fdcd775ab1859c13802d8d',
|
||||
'type' => 'composer-plugin',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-autoloader',
|
||||
'aliases' => array(
|
||||
0 => '5.0.x-dev',
|
||||
),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'hostinger/hostinger' => array(
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => 'a30bacd632e86ad8a21d32e5e88735f876a6483c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'hostinger/hostinger-wp-helper' => array(
|
||||
'pretty_version' => '1.0.12',
|
||||
'version' => '1.0.12.0',
|
||||
'reference' => 'f943461ffdd9df60c84e4d808ff1dd967dfa790d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../hostinger/hostinger-wp-helper',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'hostinger/hostinger-wp-menu-manager' => array(
|
||||
'pretty_version' => '1.2.20',
|
||||
'version' => '1.2.20.0',
|
||||
'reference' => '937e866a6c7db2ae9e9549a8f57c1ff922117ed2',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../hostinger/hostinger-wp-menu-manager',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'woocommerce/action-scheduler' => array(
|
||||
'pretty_version' => '3.9.3',
|
||||
'version' => '3.9.3.0',
|
||||
'reference' => 'c58cdbab17651303d406cd3b22cf9d75c71c986c',
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../woocommerce/action-scheduler',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
// This file `jetpack_autoload_classmap.php` was auto generated by automattic/jetpack-autoloader.
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array(
|
||||
'version' => '5.0.13',
|
||||
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php'
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
// This file `jetpack_autoload_psr4.php` was auto generated by automattic/jetpack-autoloader.
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Hostinger\\WpMenuManager\\' => array(
|
||||
'version' => '1.2.20.0',
|
||||
'path' => array( $vendorDir . '/hostinger/hostinger-wp-menu-manager/src' )
|
||||
),
|
||||
'Hostinger\\WpHelper\\' => array(
|
||||
'version' => '1.0.12.0',
|
||||
'path' => array( $vendorDir . '/hostinger/hostinger-wp-helper/src' )
|
||||
),
|
||||
'Hostinger\\Tests\\' => array(
|
||||
'version' => '1.0.12.0',
|
||||
'path' => array( $baseDir . '/tests/phpunit', $vendorDir . '/hostinger/hostinger-wp-helper/tests/phpunit' )
|
||||
),
|
||||
'Hostinger\\' => array(
|
||||
'version' => 'dev-main',
|
||||
'path' => array( $baseDir . '/includes' )
|
||||
),
|
||||
'Automattic\\Jetpack\\Autoloader\\' => array(
|
||||
'version' => '5.0.13',
|
||||
'path' => array( $vendorDir . '/automattic/jetpack-autoloader/src' )
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
/README.md @hostinger/wp-devs
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "hostinger/hostinger-wp-helper",
|
||||
"description": "A PHP package with core functions for Hostinger WordPress plugins.",
|
||||
"type": "library",
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
"ext-json": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpHelper\\": "src/",
|
||||
"Hostinger\\Tests\\": "tests/phpunit"
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"yoast/phpunit-polyfills": "^2.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\WpHelper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Config {
|
||||
private array $config = array();
|
||||
public const TOKEN_HEADER = 'X-Hpanel-Order-Token';
|
||||
public const DOMAIN_HEADER = 'X-Hpanel-Domain';
|
||||
public const CONFIG_PATH = ABSPATH . '.private/config.json';
|
||||
public function __construct() {
|
||||
$this->decodeConfig( self::CONFIG_PATH );
|
||||
}
|
||||
|
||||
private function decodeConfig( string $path ): void {
|
||||
if ( file_exists( $path ) ) {
|
||||
$config_content = file_get_contents( $path );
|
||||
$this->config = json_decode( $config_content, true );
|
||||
}
|
||||
}
|
||||
|
||||
public function getConfigValue( string $key, $default ): string {
|
||||
if ( $this->config && isset( $this->config[ $key ] ) && ! empty( $this->config[ $key ] ) ) {
|
||||
return $this->config[ $key ];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\WpHelper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Constants {
|
||||
public const TOKEN_HEADER = 'X-Hpanel-Order-Token';
|
||||
public const DOMAIN_HEADER = 'X-Hpanel-Domain';
|
||||
public const HOSTINGER_REST_URI = 'https://rest-hosting.hostinger.com';
|
||||
public const CONFIG_PATH = ABSPATH . '.private/config.json';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\WpHelper\Requests;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Client {
|
||||
private string $api_url;
|
||||
private array $default_headers;
|
||||
|
||||
public function __construct( $api_url, $default_headers = array() ) {
|
||||
$this->api_url = $api_url;
|
||||
$this->default_headers = $default_headers;
|
||||
}
|
||||
|
||||
public function get_api_url(): string {
|
||||
return $this->api_url;
|
||||
}
|
||||
|
||||
public function set_api_url( string $api_url ): void {
|
||||
$this->api_url = $api_url;
|
||||
}
|
||||
|
||||
public function get_default_headers(): array {
|
||||
return $this->default_headers;
|
||||
}
|
||||
|
||||
public function set_default_headers( array $default_headers ): void {
|
||||
$this->default_headers = $default_headers;
|
||||
}
|
||||
|
||||
public function get( $endpoint, $params = array(), $headers = array(), $timeout = 120 ) {
|
||||
$url = $this->api_url . $endpoint;
|
||||
$request_args = array(
|
||||
'method' => 'GET',
|
||||
'headers' => array_merge( $this->default_headers, $headers ),
|
||||
'timeout' => $timeout,
|
||||
);
|
||||
|
||||
if ( ! empty( $params ) ) {
|
||||
$url = add_query_arg( $params, $url );
|
||||
}
|
||||
|
||||
$response = wp_remote_get( $url, $request_args );
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function post( $endpoint, $params = array(), $headers = array(), $timeout = 120 ) {
|
||||
$url = $this->api_url . $endpoint;
|
||||
$request_args = array(
|
||||
'method' => 'POST',
|
||||
'timeout' => $timeout,
|
||||
'headers' => array_merge( $this->default_headers, $headers ),
|
||||
'body' => $params,
|
||||
);
|
||||
|
||||
$response = wp_remote_post( $url, $request_args );
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\WpHelper;
|
||||
|
||||
class Utils {
|
||||
|
||||
private static string $apiTokenFile;
|
||||
|
||||
private const HPANEL_DOMAIN_URL = 'https://hpanel.hostinger.com/websites/';
|
||||
private const HOSTINGER_SITE = '.hostingersite.com';
|
||||
|
||||
private static function getApiTokenPath(): void {
|
||||
$hostingerDirParts = explode( '/', __DIR__ );
|
||||
if ( count( $hostingerDirParts ) >= 3 ) {
|
||||
$hostingerServerRootPath = '/' . $hostingerDirParts[1] . '/' . $hostingerDirParts[2];
|
||||
self::$apiTokenFile = $hostingerServerRootPath . '/.api_token';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $pluginSlug
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
// Check if a specific plugin is active by its slug
|
||||
public static function isPluginActive( string $pluginSlug ): bool {
|
||||
$plugin_relative_path = $pluginSlug . '/' . $pluginSlug . '.php';
|
||||
|
||||
if ( is_multisite() ) {
|
||||
return self::checkIsPluginActiveMultiSite( $plugin_relative_path );
|
||||
}
|
||||
|
||||
return self::checkIsPluginActive( $plugin_relative_path );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $plugin_relative_path
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function checkIsPluginActiveMultiSite( string $plugin_relative_path ): bool {
|
||||
// Check network-wide active plugins
|
||||
$activePlugins = get_site_option( 'active_sitewide_plugins', [] );
|
||||
if ( in_array( $plugin_relative_path, $activePlugins ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check each site in the network
|
||||
$sites = get_sites();
|
||||
foreach ( $sites as $site ) {
|
||||
switch_to_blog( $site->blog_id );
|
||||
$activePlugins = get_option( 'active_plugins', [] );
|
||||
if ( in_array( $plugin_relative_path, $activePlugins ) ) {
|
||||
restore_current_blog();
|
||||
|
||||
return true;
|
||||
}
|
||||
restore_current_blog();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $plugin_relative_path
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function checkIsPluginActive( string $plugin_relative_path ): bool {
|
||||
// Check active plugins in a single site
|
||||
$activePlugins = get_option( 'active_plugins', [] );
|
||||
|
||||
if ( in_array( $plugin_relative_path, $activePlugins ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the content of the API token file
|
||||
public static function getApiToken(): string {
|
||||
self::getApiTokenPath();
|
||||
|
||||
if ( file_exists( self::$apiTokenFile ) ) {
|
||||
$apiToken = file_get_contents( self::$apiTokenFile );
|
||||
if ( ! empty( $apiToken ) ) {
|
||||
return $apiToken;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
// Get the host info (domain, subdomain, subdirectory)
|
||||
public function getHostInfo(): string {
|
||||
$host = $_SERVER['HTTP_HOST'] ?? '';
|
||||
$site_url = get_site_url();
|
||||
$site_url = preg_replace( '#^https?://#', '', $site_url );
|
||||
$site_url = preg_replace( '/^www\./', '', $site_url );
|
||||
|
||||
if ( ! empty( $site_url ) && ! empty( $host ) && strpos( $site_url, $host ) === 0 ) {
|
||||
if ( $site_url === $host ) {
|
||||
return $host;
|
||||
} else {
|
||||
return substr( $site_url, strlen( $host ) + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
return $host;
|
||||
}
|
||||
|
||||
// Check if the current domain is a preview domain
|
||||
public function isPreviewDomain(): bool {
|
||||
if ( function_exists( 'getallheaders' ) ) {
|
||||
$headers = getallheaders();
|
||||
}
|
||||
|
||||
if ( isset( $headers['X-Preview-Indicator'] ) && $headers['X-Preview-Indicator'] ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the current page is the specified page
|
||||
public function isThisPage( string $page ): bool {
|
||||
|
||||
if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$current_uri = sanitize_text_field( $_SERVER['REQUEST_URI'] );
|
||||
|
||||
if ( defined( 'DOING_AJAX' ) && \DOING_AJAX ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( isset( $current_uri ) && strpos( $current_uri, '/wp-json/' ) !== false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( strpos( $current_uri, $page ) !== false ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get hPanel domain URL
|
||||
public function getHpanelDomainUrl() : string {
|
||||
$parsed_url = parse_url( get_site_url() );
|
||||
$host = $parsed_url['host'];
|
||||
$directory = __DIR__;
|
||||
|
||||
// Remove 'www.' if it exists in the host
|
||||
if ( strpos( $host, 'www.' ) === 0 ) {
|
||||
$host = substr( $host, 4 );
|
||||
}
|
||||
|
||||
// Parse the host into parts
|
||||
$host_parts = explode( '.', $host );
|
||||
$is_subdomain = count( $host_parts ) > 2;
|
||||
|
||||
// Helper to get the base domain (last two parts)
|
||||
$base_domain = implode( '.', array_slice( $host_parts, -2 ) );
|
||||
|
||||
// System folders to ignore
|
||||
$system_folders = [ 'wp-content', 'plugins', 'themes', 'uploads' ];
|
||||
|
||||
// Detect if there is a subdirectory immediately after 'public_html'
|
||||
$subdirectory_name = '';
|
||||
if ( preg_match( '/\/public_html\/([^\/]+)\//', $directory, $matches ) && ! in_array( $matches[1], $system_folders ) ) {
|
||||
$subdirectory_name = $matches[1];
|
||||
}
|
||||
|
||||
// Handle preview domains
|
||||
if ( $this->isPreviewDomain() ) {
|
||||
$host_parts = explode( '.', $host );
|
||||
$base_domain = str_replace( '-', '.', $host_parts[0] );
|
||||
|
||||
return self::HPANEL_DOMAIN_URL . "$base_domain." . end( $host_parts );
|
||||
}
|
||||
|
||||
// Handle subdomain with a directory structure
|
||||
if ( $subdirectory_name !== '' ) {
|
||||
$full_domain = "$subdirectory_name.$base_domain";
|
||||
|
||||
return self::HPANEL_DOMAIN_URL . "$base_domain/wordpress/dashboard/$full_domain";
|
||||
}
|
||||
|
||||
// Handle top-level subdomain (no subdirectory structure)
|
||||
if ( $is_subdomain ) {
|
||||
return self::HPANEL_DOMAIN_URL . "$host";
|
||||
}
|
||||
|
||||
// Default to handling top-level domains (without subdomains)
|
||||
return self::HPANEL_DOMAIN_URL . "$host";
|
||||
}
|
||||
|
||||
// Check transient eligibility
|
||||
public function checkTransientEligibility( $transient_request_key, $cache_time = 3600 ): bool {
|
||||
try {
|
||||
// Set transient
|
||||
set_transient( $transient_request_key, true, $cache_time );
|
||||
|
||||
// Check if transient was set successfully
|
||||
if ( false === get_transient( $transient_request_key ) ) {
|
||||
throw new \Exception( 'Unable to create transient in WordPress.' );
|
||||
}
|
||||
|
||||
// If everything is fine, return true
|
||||
return true;
|
||||
} catch ( \Exception $exception ) {
|
||||
// If there's an exception, log the error and return false
|
||||
$this->errorLog( 'Error checking eligibility: ' . $exception->getMessage() );
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function errorLog( string $message ): void {
|
||||
if ( defined( 'WP_DEBUG' ) && \WP_DEBUG === true ) {
|
||||
error_log( print_r( $message, true ) );
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSetting( string $setting ): string {
|
||||
|
||||
if ( $setting ) {
|
||||
return get_option( 'hostinger_' . $setting, '' );
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function updateSetting( string $setting, $value, $autoload = null ): void {
|
||||
|
||||
if ( $setting ) {
|
||||
update_option( 'hostinger_' . $setting, $value, $autoload );
|
||||
}
|
||||
}
|
||||
|
||||
public static function flushLitespeedCache(): void {
|
||||
if ( has_action( 'litespeed_purge_all' ) ) {
|
||||
do_action( 'litespeed_purge_all' );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
(()=>{var e,r={144:()=>{jQuery(document).on("ready",function(){window.addEventListener("onboardingMenuToggle",function(e){var r="hostinger-hide-all-menu-items";switch(e.detail&&e.detail.operation?e.detail.operation:"show"){case"show":document.querySelector("body").classList.remove(r);break;case"hide":document.querySelector("body").classList.add(r)}}),window.addEventListener("resize",function(){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,r=document.querySelector(".hsr-wrapper__list"),t=document.querySelector(".hsr-mobile-sidebar .hsr-wrapper"),o=document.querySelector(".hsr-navbar-buttons");if(e<=1085)r&&t&&(t.appendChild(r),null!==o&&t.appendChild(o));else{var n=document.querySelector(".hsr-onboarding-navbar__wrapper");r&&n&&(n.appendChild(r),null!==o&&n.appendChild(o),document.querySelector(".hsr-mobile-sidebar").classList.remove("hsr-active"))}}),window.dispatchEvent(new Event("resize"));var e=document.querySelector(".hsr-mobile-sidebar"),r=document.querySelectorAll(".hsr-close, .hsr-mobile-menu-icon");null!==r&&r.forEach(function(r){r.addEventListener("click",function(r){e.classList.toggle("hsr-active"),document.querySelector("body").classList.toggle("hsr-sidebar-active"),r.stopPropagation()})}),document.addEventListener("click",function(r){null!==e&&(e.contains(r.target)||(e.classList.remove("hsr-active"),document.querySelector("body").classList.remove("hsr-sidebar-active")))})})},796:()=>{}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,e=[],o.O=(r,t,n,i)=>{if(!t){var s=1/0;for(l=0;l<e.length;l++){for(var[t,n,i]=e[l],a=!0,c=0;c<t.length;c++)(!1&i||s>=i)&&Object.keys(o.O).every(e=>o.O[e](t[c]))?t.splice(c--,1):(a=!1,i<s&&(s=i));if(a){e.splice(l--,1);var d=n();void 0!==d&&(r=d)}}return r}i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[t,n,i]},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={580:0,540:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var n,i,[s,a,c]=t,d=0;if(s.some(r=>0!==e[r])){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(c)var l=c(o)}for(r&&r(t);d<s.length;d++)i=s[d],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(l)},t=self.webpackChunk=self.webpackChunk||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),o.O(void 0,[540],()=>o(144));var n=o.O(void 0,[540],()=>o(796));n=o.O(n)})();
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-helper.git"
|
||||
}
|
||||
],
|
||||
"name": "hostinger/hostinger-wp-menu-manager",
|
||||
"description": "Package for managing Hostinger WordPress menus and pages.",
|
||||
"license": "proprietary",
|
||||
"type": "library",
|
||||
"require": {
|
||||
"hostinger/hostinger-wp-helper": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "^3.0",
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"yoast/phpunit-polyfills": "^2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpMenuManager\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpMenuManager\\Tests\\": "tests/phpunit"
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,69 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: Maher Souilah\n"
|
||||
"Language-Team: Arabic\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:10+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: ar\n"
|
||||
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100 >= 3 "
|
||||
"&& n%100<=10 ? 3 : n%100 >= 11 && n%100<=99 ? 4 : 5;\n"
|
||||
"X-Loco-Version: 2.7.1; wp-6.7.2"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "إجراء مطلوب:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "الإضافات المتأثرة:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "تنبيه! تم اكتشاف إضافات قديمة"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
#, fuzzy
|
||||
msgid "Go to hPanel"
|
||||
msgstr "انتقل إلى hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "حزمة إدارة قائمة هوستنجر ووردبريس لإدارة قائمة هوستنجر"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "حزمة إدارة القائمة."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "الإضافات القديمة:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "تحديث الإضافات"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"يحتوي موقعك الإلكتروني على بعض الإضافات القديمة التي قد تمنع الميزات الجديدة "
|
||||
"من العمل بشكل صحيح."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: German\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: de_DE\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Handlung erforderlich:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Betroffene Plugins:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Achtung! Veraltete Plugins entdeckt"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Gehe zu hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Menü Management Paket"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Menü-Management-Paket."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Veraltete Plugins:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Plugins aktualisieren"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Ihre Website hat einige veraltete Plugins, die verhindern können, dass neue "
|
||||
"Funktionen richtig funktionieren."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Spanish (Argentina)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: es_AR\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Acción requerida:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugins afectados:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "¡Atención! Plugins obsoletos detectados"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Ir a hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Paquete de gestión de menús"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Paquete de gestión de menús."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugins obsoletos:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Actualizar plugins"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Tu sitio web tiene algunos plugins obsoletos que podrían impedir que las "
|
||||
"nuevas funciones trabajen correctamente."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Spanish (Colombia)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:12+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: es_CO\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Acción requerida:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugins afectados:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "¡Atención! Plugins obsoletos detectados"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Ir a hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Paquete de gestión de menús"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Paquete de gestión de menús."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugins obsoletos:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Actualizar plugins"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Tu sitio web tiene algunos plugins obsoletos que podrían impedir que las "
|
||||
"nuevas funciones trabajen correctamente."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Spanish (Spain)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:12+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: es_ES\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Acción requerida:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugins afectados:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "¡Atención! Plugins obsoletos detectados"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Ir a hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Paquete de gestión de menús"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Paquete de gestión de menús."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugins obsoletos:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Actualizar plugins"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Tu sitio web tiene algunos plugins obsoletos que podrían impedir que las "
|
||||
"nuevas funciones trabajen correctamente."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Spanish (Mexico)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:12+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: es_MX\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Acción requerida:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugins afectados:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "¡Atención! Plugins obsoletos detectados"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Ir a hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Paquete de gestión de menús"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Paquete de gestión de menús."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugins obsoletos:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Actualizar plugins"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Tu sitio web tiene algunos plugins obsoletos que podrían impedir que las "
|
||||
"nuevas funciones trabajen correctamente."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: French (France)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: fr_FR\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Action requise :"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Extensions concernées :"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Attention ! Des extensions obsolètes ont été détectées"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Aller dans le hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Menu management package"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Paquet de gestion des menus."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Extensions obsolètes :"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Mettre à jour les extensions"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Votre site contient des extensions obsolètes qui pourraient empêcher le bon "
|
||||
"fonctionnement des nouvelles fonctionnalités."
|
||||
Binary file not shown.
@@ -0,0 +1,63 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Hebrew\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2025-02-21T05:56:52+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: he_IL\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "נדרשת פעולה:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "תוספים שהושפעו:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "שימו לב! זוהו תוספים מיושנים"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr ""
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr ""
|
||||
|
||||
#. URI of the plugin
|
||||
msgid "https://hostinger.com"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin
|
||||
msgid "Menu management package."
|
||||
msgstr ""
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "תוספים מיושנים:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "עדכן תוספים"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"לאתר שלכם יש כמה תוספים מיושנים שעלולים למנוע מפיצ'רים חדשים לעבוד כשורה."
|
||||
Binary file not shown.
@@ -0,0 +1,64 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Hindi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: hi_IN\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "कार्रवाई आवश्यक है:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "प्रभावित प्लगइन्स:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "कृपया ध्यान दें! आउटडेटेड प्लगइन्स का पता चला"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr ""
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr ""
|
||||
|
||||
#. URI of the plugin
|
||||
msgid "https://hostinger.com"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin
|
||||
msgid "Menu management package."
|
||||
msgstr ""
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "आउटडेटेड प्लगइन्स:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "प्लगइन्स अपडेट करें"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"आपकी वेबसाइट पर कुछ आउटडेटेड प्लगइन्स मौजूद हैं, जो नई सुविधाओं को ठीक से "
|
||||
"काम करने से रोक सकते हैं।"
|
||||
Binary file not shown.
@@ -0,0 +1,66 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Indonesian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: id_ID\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Tindakan yang diperlukan:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugin yang terdampak:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Perhatian! Update Plugin Anda"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Ke Hostinger"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Paket manajemen menu WordPress Hostinger"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Paket manajemen menu."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugin usang:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Update plugin"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Website Anda memiliki beberapa plugin usang yang menyebabkan fitur-fitur "
|
||||
"baru tidak dapat berfungsi dengan baik."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Italian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: it_IT\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Azione richiesta:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugin interessati:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Attenzione! Rilevati plugin obsoleti"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Andare al pannello hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Pacchetto di gestione del menu WordPress di Hostinger"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Pacchetto di gestione dei menu."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugin obsoleti:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Aggiorna i plugin"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Il tuo sito web ha alcuni plugin obsoleti che potrebbero impedire il "
|
||||
"corretto funzionamento di nuove funzionalità."
|
||||
Binary file not shown.
@@ -0,0 +1,66 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Japanese\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2025-02-21T05:56:52+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: ja\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "必要なアクション:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "影響を受けるプラグイン:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "注:未更新のプラグインが検出されました"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "hPanelへ"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress メニュー管理パッケージ"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "メニュー管理パッケージ。"
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "未更新のプラグイン:"
|
||||
|
||||
# Assuming this is a CTA button.
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "プラグインを更新"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr "Webサイトに以前のバージョンのプラグインが含まれているため、新しい機能が正常に動作しない可能性があります。"
|
||||
Binary file not shown.
@@ -0,0 +1,65 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Korean\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2025-02-21T05:56:52+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: ko_KR\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "조치 필요함:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "영향을 받은 플러그인:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "주의! 오래된 플러그인 감지됨"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "HPanel로 이동"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "호스팅어"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger 워드프레스 메뉴 관리 패키지"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "메뉴 관리 패키지."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "오래된 플러그인:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "업데이트 플러그인"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr "웹사이트에 일부 구식 플러그인이 포함되어 있어 새로운 기능이 정상적으로 작동하지 않을 수 있습니다."
|
||||
Binary file not shown.
@@ -0,0 +1,68 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Lithuanian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: lt_LT\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 "
|
||||
"&&(n%100<10||n%100 >= 20)? 1 : 2);\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Reikalingi veiksmai:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Paveikti įskiepiai:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Dėmesio! Aptikti pasenę įskiepiai"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Eikite į hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "\"Hostinger WordPress\" meniu valdymo paketas"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Meniu valdymo paketas."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Pasenę įskiepiai:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Atnaujinti įskiepius"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Tavo svetainėje yra pasenusių įskiepių, kurie gali trukdyti tinkamai veikti "
|
||||
"naujoms funkcijoms."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Dutch\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:10+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: nl_NL\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Vereiste actie:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Getroffen plug-ins:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Attentie! Verouderde plug-ins gedetecteerd"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Ga naar hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Menu beheerpakket"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Menu management pakket."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Verouderde plug-ins:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Plug-ins updaten"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Je website heeft een aantal verouderde plug-ins waardoor nieuwe functies "
|
||||
"mogelijk niet goed werken."
|
||||
Binary file not shown.
@@ -0,0 +1,68 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Polish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2025-02-21T05:56:52+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: pl_PL\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10 >= 2 && n%10<=4 "
|
||||
"&&(n%100<10||n%100 >= 20)? 1 : 2);\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Wymagane działanie:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Dotyczy wtyczek:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Uwaga! Wykryto nieaktualne wtyczki"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Przejdź do hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Pakiet do zarządzania menu"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Pakiet do zarządzania menu."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Nieaktualne wtyczki:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Aktualizuj wtyczki"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Niektóre wtyczki na Twojej stronie są nieaktualne i mogą powodować problemy "
|
||||
"z nowymi funkcjami. "
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Portuguese (Brazil)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: pt_BR\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Ação necessária:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugins afetados:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Atenção! Foram detectados plugins desatualizados"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Ir para o hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger Pacote de gerenciamento de menu do WordPress"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Pacote de gerenciamento de menus."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugins desatualizados:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Atualizar plugins"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Seu site tem alguns plugins desatualizados que podem impedir que novos "
|
||||
"recursos funcionem corretamente."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Portuguese (Portugal)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: pt_PT\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Ação necessária:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugins afetados:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Atenção! Detetados plugins desatualizados"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Aceder ao hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Pacote de gestão de menus"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Pacote de gestão de menus."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugins desatualizados:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Atualizar plugins"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"O seu site tem alguns plugins desatualizados que podem impedir que as novas "
|
||||
"funcionalidades funcionem corretamente."
|
||||
Binary file not shown.
@@ -0,0 +1,68 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Romanian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2025-02-21T05:56:52+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:11+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: ro_RO\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 :(((n%100>19)||(( n%100==0)&&(n!"
|
||||
"=0)))? 2 : 1));\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Acțiune necesară:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugin-uri afectate:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Atenție! A fost detectat un plugin învechit"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Mergeți la hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Pachet de gestionare a meniului WordPress Hostinger"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Pachet de gestionare a meniului."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugin-uri învechite:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Actualizează plugin-urile"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Site-ul tău are unele plugin-uri învechite care ar putea împiedica "
|
||||
"funcționarea corectă a noilor caracteristici."
|
||||
Binary file not shown.
@@ -0,0 +1,66 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Thai\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2025-02-21T05:56:52+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:12+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: th\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "การดำเนินการที่จำเป็น:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "ปลั๊กอินที่ได้รับผลกระทบ:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "คำเตือน! ตรวจพบปลั๊กอินเก่า"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "ไปที่ hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "แพ็กเกจการจัดการเมนู WordPress ของ Hostinger"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "แพ็กเกจการจัดการเมนู"
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "ปลั๊กอินรุ่นเก่า:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "อัปเดตปลั๊กอิน"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"เว็บไซต์ของคุณมีปลั๊กอินที่ล้าสมัยบางตัวที่อาจป้องกันไม่ให้ฟีเจอร์ใหม่ทำงานได้อย่างถูกต้อง"
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Turkish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:12+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: tr_TR\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Yapılması Gerekenler:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Etkilenen eklentiler:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Dikkat! Güncel Olmayan Eklentiler Tespit Edildi"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "HPanel'e git"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress Menü yönetim paketi"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Menü yönetim paketi."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Eski eklentiler:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Eklentileri güncelleyin"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Web sitenizde yeni özelliklerin düzgün çalışmasını engelleyebilecek bazı "
|
||||
"eski eklentiler var."
|
||||
Binary file not shown.
@@ -0,0 +1,68 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Ukrainian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:12+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: uk\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && "
|
||||
"n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Потрібні дії:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Плагіни:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Увага! Виявлено застарілі плагіни"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Перейдіть до hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Пакет для керування меню WordPress від Hostinger"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Пакет управління меню."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Застарілі плагіни:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Оновлення плагінів"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"На вашому сайті встановлено застарілі плагіни, які можуть перешкоджати "
|
||||
"належній роботі нових функцій."
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Vietnamese\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2025-02-21T05:56:52+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:12+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: vi\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "Yêu cầu hành động:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "Plugin bị ảnh hưởng:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "Chú ý! Phát hiện plugin lỗi thời"
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "Đi đến hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Gói quản lý menu WordPress của Hostinger"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "Gói quản lý menu."
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "Plugin lỗi thời:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "Cập nhật plugin"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr ""
|
||||
"Trang web của bạn có một số plugin lỗi thời có thể làm một số tính năng mới "
|
||||
"không hoạt động được."
|
||||
Binary file not shown.
@@ -0,0 +1,65 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Hostinger WordPress Menu management package\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Chinese (China)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-04-30T07:45:18+00:00\n"
|
||||
"PO-Revision-Date: 2025-08-18 12:10+0000\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
"Language: zh_CN\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.2.27"
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr "需要执行以下操作:"
|
||||
|
||||
#: src/Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr "已受影响的插件:"
|
||||
|
||||
#: src/Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr "请注意!检测到过期插件 "
|
||||
|
||||
#: src/templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr "转到 hPanel"
|
||||
|
||||
#: src/Menus.php:63 src/Menus.php:117 src/Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr "Hostinger"
|
||||
|
||||
#. Name of the plugin
|
||||
#, fuzzy
|
||||
msgid "Hostinger WordPress Menu management package"
|
||||
msgstr "Hostinger WordPress菜单管理套餐"
|
||||
|
||||
#. URI of the plugin
|
||||
#, fuzzy
|
||||
msgid "https://hostinger.com"
|
||||
msgstr "https://hostinger.com"
|
||||
|
||||
#. Description of the plugin
|
||||
#, fuzzy
|
||||
msgid "Menu management package."
|
||||
msgstr "菜单管理软件包。"
|
||||
|
||||
#: src/Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr "已过期的插件:"
|
||||
|
||||
#: src/Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr "更新插件 "
|
||||
|
||||
#: src/Menus.php:224
|
||||
msgid ""
|
||||
"Your website has some outdated plugins that might prevent new features from "
|
||||
"working properly."
|
||||
msgstr "您的网站存在一些过期插件,可能会妨碍新功能的正常运行。"
|
||||
@@ -0,0 +1,47 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2025-08-18T12:07:44+00:00\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"X-Generator: WP-CLI 2.12.0\n"
|
||||
"X-Domain: hostinger-wp-menu-package\n"
|
||||
|
||||
#: Menus.php:63
|
||||
#: Menus.php:117
|
||||
#: Menus.php:118
|
||||
msgid "Hostinger"
|
||||
msgstr ""
|
||||
|
||||
#: Menus.php:221
|
||||
msgid "Attention! Outdated Plugins Detected"
|
||||
msgstr ""
|
||||
|
||||
#: Menus.php:224
|
||||
msgid "Action Required:"
|
||||
msgstr ""
|
||||
|
||||
#: Menus.php:224
|
||||
msgid "Your website has some outdated plugins that might prevent new features from working properly."
|
||||
msgstr ""
|
||||
|
||||
#: Menus.php:233
|
||||
msgid "Outdated plugins:"
|
||||
msgstr ""
|
||||
|
||||
#: Menus.php:241
|
||||
msgid "Affected plugins:"
|
||||
msgstr ""
|
||||
|
||||
#: Menus.php:250
|
||||
msgid "Update plugins"
|
||||
msgstr ""
|
||||
|
||||
#: templates/menu.php:73
|
||||
msgid "Go to hPanel"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\WpMenuManager;
|
||||
|
||||
use Hostinger\WpMenuManager\Menus;
|
||||
use Hostinger\WpHelper\Utils;
|
||||
|
||||
class Assets
|
||||
{
|
||||
/**
|
||||
* @var Manager
|
||||
*/
|
||||
private Manager $manager;
|
||||
private string $assetsPath;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
if (!$this->manager->checkCompatibility()) {
|
||||
add_action('admin_enqueue_scripts', [$this, 'enqueueAdminAssets']);
|
||||
add_action('admin_head', [$this, 'addMenuHidingCss']);
|
||||
}
|
||||
$this->assetsPath = '/vendor/hostinger/hostinger-wp-menu-manager/assets';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Manager $manager
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setManager(Manager $manager): void
|
||||
{
|
||||
$this->manager = $manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function enqueueAdminAssets(): void {
|
||||
$defaultVersion = '1.0.0';
|
||||
|
||||
if ( $this->isHostingerMenuPage() ) {
|
||||
$pluginInfo = $this->manager->getPluginInfo();
|
||||
$jsScriptPath = __DIR__ . '/../assets/js/menus.min.js';
|
||||
$cssStylePath = __DIR__ . '/../assets/css/style.min.css';
|
||||
|
||||
$jsVersion = $defaultVersion;
|
||||
if (file_exists($jsScriptPath)) {
|
||||
$jsVersion = filemtime($jsScriptPath) ?: $jsVersion;
|
||||
}
|
||||
|
||||
wp_enqueue_script( 'hostinger_menu_scripts',
|
||||
$pluginInfo . $this->assetsPath . '/js/menus.min.js',
|
||||
[ 'jquery' ],
|
||||
$jsVersion,
|
||||
false
|
||||
);
|
||||
|
||||
$cssVersion = $defaultVersion;
|
||||
if (file_exists($cssStylePath)) {
|
||||
$cssVersion = filemtime($cssStylePath) ?: $cssVersion;
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'hostinger_menu_styles',
|
||||
$pluginInfo . $this->assetsPath . '/css/style.min.css',
|
||||
[],
|
||||
$cssVersion
|
||||
);
|
||||
|
||||
// Hide notices and badges in Hostinger menu pages.
|
||||
$hide_notices = '.notice { display: none !important; } .hostinger-notice { display: block !important; }';
|
||||
wp_add_inline_style( 'hostinger_menu_styles', $hide_notices );
|
||||
|
||||
if ( Utils::isPluginActive( 'wpforms' ) ) {
|
||||
$hide_wp_forms_counter = '.wp-admin #wpadminbar .wpforms-menu-notification-counter { display: none !important; }';
|
||||
wp_add_inline_style( 'hostinger_menu_styles', $hide_wp_forms_counter );
|
||||
}
|
||||
if ( Utils::isPluginActive( 'googleanalytics' ) ) {
|
||||
$hide_monsterinsights_notification = '.wp-admin .monsterinsights-menu-notification-indicator { display: none !important; }';
|
||||
wp_add_inline_style( 'hostinger_menu_styles', $hide_monsterinsights_notification );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function addMenuHidingCss(): void
|
||||
{
|
||||
// These CSS rules should be loaded on every page in WordPress admin.
|
||||
?>
|
||||
<style type="text/css">
|
||||
body.hostinger-hide-main-menu-item #toplevel_page_hostinger .wp-submenu > .wp-first-item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#wpadminbar #wp-admin-bar-hostinger_admin_bar .ab-item {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#wpadminbar #wp-admin-bar-hostinger_admin_bar .ab-sub-wrapper .ab-item svg {
|
||||
fill: #9ca1a7;
|
||||
margin-left: 3px;
|
||||
max-height: 18px;
|
||||
}
|
||||
|
||||
body.hostinger-hide-all-menu-items #toplevel_page_hostinger .wp-submenu {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
body.hostinger-hide-all-menu-items .hsr-onboarding-navbar__wrapper {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
body.hostinger-hide-all-menu-items .hsr-onboarding-navbar .hsr-mobile-menu-icon,
|
||||
body.hostinger-hide-all-menu-items .hsr-onboarding-navbar .hsr-wrapper__list {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
private function isHostingerMenuPage(): bool
|
||||
{
|
||||
$admin_path = parse_url(admin_url(), PHP_URL_PATH);
|
||||
|
||||
$pages = [
|
||||
$admin_path . 'admin.php?page=' . Menus::MENU_SLUG
|
||||
];
|
||||
|
||||
$subpages = Menus::getMenuSubpages();
|
||||
|
||||
foreach ($subpages as $page) {
|
||||
if (isset($page['menu_slug'])) {
|
||||
$pages[] = $admin_path . 'admin.php?page=' . $page['menu_slug'];
|
||||
}
|
||||
}
|
||||
|
||||
$utils = new Utils();
|
||||
|
||||
foreach ($pages as $page) {
|
||||
if ($utils->isThisPage($page)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\WpMenuManager;
|
||||
|
||||
class Manager
|
||||
{
|
||||
/**
|
||||
* @var Manager instance.
|
||||
*/
|
||||
private static ?Manager $instance = null;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private array $objects = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public array $old_plugins = [
|
||||
[
|
||||
'name' => 'Hostinger',
|
||||
'slug' => 'hostinger',
|
||||
'version' => '3.0.0',
|
||||
],
|
||||
[
|
||||
'name' => 'Hostinger Affiliate Plugin',
|
||||
'slug' => 'hostinger-affiliate-plugin',
|
||||
'version' => '2.0.0',
|
||||
],
|
||||
[
|
||||
'name' => 'Hostinger AI Assistant',
|
||||
'slug' => 'hostinger-ai-assistant',
|
||||
'version' => '2.0.0',
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public array $outdated_plugins = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public array $affected_plugins = [
|
||||
'hostinger' => 'Hostinger Tools',
|
||||
'hostinger-affiliate-plugin' => 'Hostinger Affiliate Connector',
|
||||
'hostinger-ai-assistant' => 'Hostinger AI',
|
||||
'hostinger-easy-onboarding' => 'Hostinger Easy Onboarding',
|
||||
];
|
||||
|
||||
/**
|
||||
* Allow only one instance of class
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function getInstance(): self
|
||||
{
|
||||
if (null === self::$instance) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|string[]
|
||||
*/
|
||||
public function getOutdatedPlugins(): array
|
||||
{
|
||||
return $this->outdated_plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAffectedActivePlugins(): array
|
||||
{
|
||||
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
|
||||
$plugins = [];
|
||||
|
||||
if (empty($this->getAffectedPlugins())) {
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($this->getAffectedPlugins() as $plugin_slug => $plugin_name) {
|
||||
if (\is_plugin_active($plugin_slug . DIRECTORY_SEPARATOR . $plugin_slug . '.php')) {
|
||||
$plugins[$plugin_slug] = $plugin_name;
|
||||
}
|
||||
}
|
||||
|
||||
return $plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|string[]
|
||||
*/
|
||||
public function getAffectedPlugins(): array
|
||||
{
|
||||
return $this->affected_plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function boot(): bool
|
||||
{
|
||||
// Locale.
|
||||
$this->loadTextDomain();
|
||||
|
||||
// Modules.
|
||||
$this->registerModules();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function registerModules(): void
|
||||
{
|
||||
// Assets.
|
||||
$this->objects['assets'] = new Assets();
|
||||
|
||||
// Menus.
|
||||
$this->objects['menus'] = new Menus();
|
||||
|
||||
$this->addContainer();
|
||||
|
||||
// Init after container is added.
|
||||
$this->objects['assets']->init();
|
||||
$this->objects['menus']->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function addContainer(): bool
|
||||
{
|
||||
if (empty($this->objects)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($this->objects as $object) {
|
||||
if (property_exists($object, 'manager')) {
|
||||
$object->setManager($this);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPluginInfo(): string
|
||||
{
|
||||
$plugin_url = '';
|
||||
|
||||
$plugins = get_plugins();
|
||||
foreach ($plugins as $plugin_path => $plugin_info) {
|
||||
if (str_contains(__FILE__, 'plugins/' . dirname($plugin_path) . '/')) {
|
||||
$plugin_dir = dirname($plugin_path);
|
||||
|
||||
return plugins_url($plugin_dir);
|
||||
}
|
||||
}
|
||||
|
||||
return $plugin_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function loadTextDomain(): void
|
||||
{
|
||||
load_plugin_textdomain(
|
||||
'hostinger-wp-menu-package',
|
||||
false,
|
||||
dirname(dirname(plugin_basename(__FILE__))) . '/languages/'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function checkCompatibility(): bool
|
||||
{
|
||||
$outdated_plugins = false;
|
||||
|
||||
if (empty($this->old_plugins)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($this->old_plugins as $plugin_data) {
|
||||
if ($this->checkOutdatedPluginVersion($plugin_data['slug'], $plugin_data['version'])) {
|
||||
$outdated_plugins = true;
|
||||
$this->outdated_plugins[$plugin_data['slug']] = $plugin_data['name'];
|
||||
}
|
||||
}
|
||||
|
||||
return $outdated_plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* If main hostinger plugin is outdated
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
public function maybeDoCompatibilityRedirect(): bool
|
||||
{
|
||||
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
|
||||
$plugin_name = 'hostinger';
|
||||
$current_uri = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
||||
|
||||
$plugin = current(array_filter($this->old_plugins, fn($p) => $p['slug'] === $plugin_name));
|
||||
|
||||
$hostinger_admin_url = parse_url(admin_url('admin.php?page=hostinger'), PHP_URL_PATH) . '?page=hostinger';
|
||||
|
||||
if (str_contains($current_uri, $hostinger_admin_url)) {
|
||||
if (!$this->checkOutdatedPluginVersion($plugin['slug'], $plugin['version'])) {
|
||||
wp_redirect(get_admin_url());
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $plugin_name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getPluginVersion($plugin_name): string
|
||||
{
|
||||
$version = get_file_data(WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php', array('Version'), 'plugin');
|
||||
|
||||
if (empty($version[0])) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $version[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $plugin_name
|
||||
* @param $compare_version
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function checkOutdatedPluginVersion($plugin_name, $compare_version): bool
|
||||
{
|
||||
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
|
||||
if (!\is_plugin_active($plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$version = $this->getPluginVersion($plugin_name);
|
||||
|
||||
if (empty($version)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return version_compare($version, $compare_version, '<');
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user