From 6194589dee3bb9457abe4fe80ab00ecdb8456060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Mon, 20 Jul 2020 12:18:02 +0300 Subject: [PATCH] remove reduntant directory for customs --- src/retailcrm.php | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/retailcrm.php b/src/retailcrm.php index d1f0695..05e3d79 100644 --- a/src/retailcrm.php +++ b/src/retailcrm.php @@ -134,26 +134,10 @@ if (!class_exists( 'WC_Integration_Retailcrm')) : */ public static function checkCustomFile($file) { - $oldCustomizationFiles = array( - 'include/class-wc-retailcrm-icml.php', - 'include/class-wc-retailcrm-orders.php', - 'include/class-wc-retailcrm-customers.php', - 'include/class-wc-retailcrm-inventories.php', - 'include/class-wc-retailcrm-history.php', - 'include/class-wc-retailcrm-ga.php', - 'include/class-wc-retailcrm-daemon-collector.php' - ); + $withoutInclude = WP_CONTENT_DIR . '/retailcrm-custom/' . str_replace('include/', '', $file); - if (in_array($file, $oldCustomizationFiles)) { - $pathWithoutInclude = WP_CONTENT_DIR . '/retailcrm-custom/' . str_replace('include/', '', $file); - - if (file_exists($pathWithoutInclude)) { - return $pathWithoutInclude; - } - } - - if (file_exists( WP_CONTENT_DIR . '/retailcrm-custom/' . $file)) { - return WP_CONTENT_DIR . '/retailcrm-custom/' . $file; + if (file_exists($withoutInclude)) { + return $withoutInclude; } return WP_PLUGIN_DIR . '/woo-retailcrm/' . $file;