PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | vendor/jetpack-autoloader/class-php-autoloader.php +14 -2 12.2.3 → 16.3-a.1 View file →
@@ -4,9 +4,9 @@
4 4 *
5 5 * @package automattic/jetpack-autoloader
6 6 */
7 7
8 -namespace Automattic\Jetpack\Autoloader\jpf11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ12_2_1;
8 +namespace Automattic\Jetpack\Autoloader\jpf11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ16_3_a_1\al6_0_0;
9 9
10 10 // phpcs:ignore
11 11
12 12 /**
@@ -78,14 +78,26 @@
78 78 */
79 79 public static function load_class( $class_name ) {
80 80 global $jetpack_autoloader_loader;
81 81 if ( ! isset( $jetpack_autoloader_loader ) ) {
82 - return;
82 + return false;
83 83 }
84 84
85 85 $file = $jetpack_autoloader_loader->find_class_file( $class_name );
86 86 if ( ! isset( $file ) ) {
87 87 return false;
88 + }
89 +
90 + // A common source of strange and confusing problems is when a vendor
91 + // file is autoloaded before all plugins have had a chance to register
92 + // with the autoloader. Detect that, if a development constant is set.
93 + if ( defined( 'JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS' ) && JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS &&
94 + ( strpos( $file, '/vendor/' ) !== false || strpos( $file, '/jetpack_vendor/' ) !== false ) &&
95 + is_callable( 'did_action' ) && ! did_action( 'plugins_loaded' )
96 + ) {
97 + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_wp_debug_backtrace_summary -- This is a debug log message.
98 + $msg = "Jetpack Autoloader: Autoloading `$class_name` before the plugins_loaded hook may cause strange and confusing problems. " . wp_debug_backtrace_summary( '', 1 );
99 + wp_trigger_error( '', $msg );
88 100 }
89 101
90 102 require $file;
91 103 return true;