Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src
File: Autoloader.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Includes the composer Autoloader used for packages and classes in the src/ directory.
[2] Fix | Delete
*/
[3] Fix | Delete
[4] Fix | Delete
namespace Automattic\WooCommerce;
[5] Fix | Delete
[6] Fix | Delete
defined( 'ABSPATH' ) || exit;
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Autoloader class.
[10] Fix | Delete
*
[11] Fix | Delete
* @since 3.7.0
[12] Fix | Delete
*/
[13] Fix | Delete
class Autoloader {
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* Static-only class.
[17] Fix | Delete
*/
[18] Fix | Delete
private function __construct() {}
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Require the autoloader and return the result.
[22] Fix | Delete
*
[23] Fix | Delete
* If the autoloader is not present, let's log the failure and display a nice admin notice.
[24] Fix | Delete
*
[25] Fix | Delete
* @return boolean
[26] Fix | Delete
*/
[27] Fix | Delete
public static function init() {
[28] Fix | Delete
$autoloader = dirname( __DIR__ ) . '/vendor/autoload_packages.php';
[29] Fix | Delete
[30] Fix | Delete
if ( ! is_readable( $autoloader ) ) {
[31] Fix | Delete
self::missing_autoloader();
[32] Fix | Delete
return false;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
$autoloader_result = require $autoloader;
[36] Fix | Delete
if ( ! $autoloader_result ) {
[37] Fix | Delete
return false;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
return $autoloader_result;
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* If the autoloader is missing, add an admin notice.
[45] Fix | Delete
*/
[46] Fix | Delete
protected static function missing_autoloader() {
[47] Fix | Delete
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
[48] Fix | Delete
// This message is not translated as at this point it's too early to load translations.
[49] Fix | Delete
error_log( // phpcs:ignore
[50] Fix | Delete
esc_html( 'Your installation of WooCommerce is incomplete. If you installed WooCommerce from GitHub, please refer to this document to set up your development environment: https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment' )
[51] Fix | Delete
);
[52] Fix | Delete
}
[53] Fix | Delete
add_action(
[54] Fix | Delete
'admin_notices',
[55] Fix | Delete
function() {
[56] Fix | Delete
?>
[57] Fix | Delete
<div class="notice notice-error">
[58] Fix | Delete
<p>
[59] Fix | Delete
<?php
[60] Fix | Delete
printf(
[61] Fix | Delete
/* translators: 1: is a link to a support document. 2: closing link */
[62] Fix | Delete
esc_html__( 'Your installation of WooCommerce is incomplete. If you installed WooCommerce from GitHub, %1$splease refer to this document%2$s to set up your development environment.', 'woocommerce' ),
[63] Fix | Delete
'<a href="' . esc_url( 'https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment' ) . '" target="_blank" rel="noopener noreferrer">',
[64] Fix | Delete
'</a>'
[65] Fix | Delete
);
[66] Fix | Delete
?>
[67] Fix | Delete
</p>
[68] Fix | Delete
</div>
[69] Fix | Delete
<?php
[70] Fix | Delete
}
[71] Fix | Delete
);
[72] Fix | Delete
}
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function