Changeset 2710949
- Timestamp:
- 04/18/2022 08:36:40 AM (4 years ago)
- Location:
- e-commerce-data-interchange
- Files:
-
- 4 added
- 32 edited
- 1 copied
-
tags/1.1.0 (copied) (copied from e-commerce-data-interchange/trunk)
-
tags/1.1.0/e-commerce-data-interchange.php (modified) (1 diff)
-
tags/1.1.0/languages/edi-ru_RU.mo (modified) (previous)
-
tags/1.1.0/languages/edi-ru_RU.po (modified) (5 diffs)
-
tags/1.1.0/languages/edi.pot (modified) (5 diffs)
-
tags/1.1.0/readme.txt (modified) (3 diffs)
-
tags/1.1.0/src/CLI (added)
-
tags/1.1.0/src/CLI/EDI_CLI.php (added)
-
tags/1.1.0/src/CatalogInterchange.php (modified) (1 diff)
-
tags/1.1.0/src/EDI.php (modified) (2 diffs)
-
tags/1.1.0/src/Parsers/CategoriesParser.php (modified) (1 diff)
-
tags/1.1.0/src/Parsers/XMLParser.php (modified) (1 diff)
-
tags/1.1.0/src/Request.php (modified) (3 diffs)
-
tags/1.1.0/src/Response.php (modified) (1 diff)
-
tags/1.1.0/src/Settings.php (modified) (5 diffs)
-
tags/1.1.0/src/Utils.php (modified) (3 diffs)
-
tags/1.1.0/vendor/autoload.php (modified) (1 diff)
-
tags/1.1.0/vendor/composer/autoload_real.php (modified) (5 diffs)
-
tags/1.1.0/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/e-commerce-data-interchange.php (modified) (1 diff)
-
trunk/languages/edi-ru_RU.mo (modified) (previous)
-
trunk/languages/edi-ru_RU.po (modified) (5 diffs)
-
trunk/languages/edi.pot (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/src/CLI (added)
-
trunk/src/CLI/EDI_CLI.php (added)
-
trunk/src/CatalogInterchange.php (modified) (1 diff)
-
trunk/src/EDI.php (modified) (2 diffs)
-
trunk/src/Parsers/CategoriesParser.php (modified) (1 diff)
-
trunk/src/Parsers/XMLParser.php (modified) (1 diff)
-
trunk/src/Request.php (modified) (3 diffs)
-
trunk/src/Response.php (modified) (1 diff)
-
trunk/src/Settings.php (modified) (5 diffs)
-
trunk/src/Utils.php (modified) (3 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (5 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
e-commerce-data-interchange/tags/1.1.0/e-commerce-data-interchange.php
r2703415 r2710949 1 1 <?php declare( strict_types=1 ); 2 2 /** 3 * Plugin Name: E-Commerce Data Interchange 4 * Plugin URI: https://edi.byteperfect.dev/ 5 * Description: The plugin provides data interchange between the WooCommerce plugin and 1C. 6 * Version: 1.0.0 7 * Author: Aleksandr Levashov <me@webcodist.com> 8 * Author URI: https://webcodist.com/ 9 * Requires at least: 5.7 10 * Requires PHP: 7.4 11 * License: GPLv3 12 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 13 * Text Domain: edi 14 * Domain Path: /languages/ 3 * Plugin Name: E-Commerce Data Interchange 4 * Plugin URI: https://edi.byteperfect.dev/ 5 * Description: The plugin provides data interchange between the WooCommerce plugin and 1C. 6 * Version: 1.0.0 7 * Author: Aleksandr Levashov <me@webcodist.com> 8 * Author URI: https://webcodist.com/ 9 * Requires at least: 5.7 10 * Requires PHP: 7.4 11 * WC requires at least: 3.6.0 12 * WC tested up to: 6.4.1 13 * License: GPLv3 14 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 15 * Text Domain: edi 16 * Domain Path: /languages/ 15 17 * 16 18 * @package BytePerfect\EDI -
e-commerce-data-interchange/tags/1.1.0/languages/edi-ru_RU.po
r2703415 r2710949 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/e-commerce-data-" 7 7 "interchange\n" 8 "POT-Creation-Date: 2022-0 3-25T16:58:10+03:00\n"9 "PO-Revision-Date: 2022-0 3-25 16:59+0300\n"8 "POT-Creation-Date: 2022-04-17T12:25:11+03:00\n" 9 "PO-Revision-Date: 2022-04-17 12:26+0300\n" 10 10 "Last-Translator: Aleksandr Levashov <me@webcodist.com>\n" 11 11 "Language-Team: Aleksandr Levashov <me@webcodist.com>\n" … … 64 64 65 65 #. translators: %s: file name. 66 #: src/CatalogInterchange.php:73 66 #: src/CatalogInterchange.php:71 67 msgid "Unexpected file name: %s." 68 msgstr "Неожиданное имя файла: %s." 69 70 #. translators: %s: file name. 71 #: src/CatalogInterchange.php:79 67 72 msgid "%s was processed successfully." 68 73 msgstr "%s успешно обработан." … … 132 137 msgstr "Ошибка распаковки файла: %s" 133 138 134 #: src/EDI.php: 85139 #: src/EDI.php:90 135 140 msgid "Settings" 136 141 msgstr "Настройки" 137 142 138 143 #. translators: %s: WooCommerce URL. 139 #: src/EDI.php:11 3144 #: src/EDI.php:118 140 145 msgid "The %s plugin is required for electronic data interchange." 141 146 msgstr "Плагин %s необходим для электронного обмена данными." 142 147 143 148 #. translators: %s: access type. 144 #: src/EDI.php:1 79149 #: src/EDI.php:184 145 150 msgid "File system %s is not implemented." 146 151 msgstr "Файловая система %s не реализована." … … 167 172 168 173 #. translators: %d: parent id. 169 #: src/Parsers/CategoriesParser.php:1 49174 #: src/Parsers/CategoriesParser.php:153 170 175 msgid "Product category parent is invalid: %d" 171 176 msgstr "Родительская категория товара недействительна: %d" 172 177 173 178 #. translators: %s: error message. 174 #: src/Parsers/CategoriesParser.php:16 5179 #: src/Parsers/CategoriesParser.php:169 175 180 msgid "Error create product category: %s" 176 181 msgstr "Ошибка при создании категории товара: %s" 177 182 178 183 #. translators: %s: category data. 179 #: src/Parsers/CategoriesParser.php:19 4184 #: src/Parsers/CategoriesParser.php:198 180 185 msgid "Cannot update product category: %s" 181 186 msgstr "Невозможно обновить категорию товара: %s" … … 198 203 msgstr "Ошибка загрузки изображения: %s" 199 204 200 #: src/Request.php:17 9205 #: src/Request.php:178 201 206 msgid "Unexpected XML entry." 202 207 msgstr "Неожиданная запись XML." 203 208 204 209 #. translators: %s: property name. 205 #: src/Request.php:21 1210 #: src/Request.php:210 206 211 msgid "Undefined property: %s" 207 212 msgstr "Неопределенное свойство: %s" 208 213 209 #: src/Request.php:25 5214 #: src/Request.php:254 210 215 msgid "Synchronization was interrupted on the site side." 211 216 msgstr "Синхронизация была прервана на стороне сайта." 212 217 213 #: src/Request.php:30 1218 #: src/Request.php:305 214 219 msgid "Products synchronization" 215 220 msgstr "Синхронизация товаров" 216 221 217 #: src/Request.php:30 3222 #: src/Request.php:307 218 223 msgid "Orders synchronization" 219 224 msgstr "Синхронизация заказов" 220 225 221 #: src/Request.php:31 0226 #: src/Request.php:314 222 227 msgid "Initialization" 223 228 msgstr "Инициализация" 224 229 225 #: src/Request.php:31 2230 #: src/Request.php:316 226 231 msgid "Getting the import file" 227 232 msgstr "Получение файла импорта" 228 233 229 #: src/Request.php:31 4234 #: src/Request.php:318 230 235 msgid "Import" 231 236 msgstr "Импорт" 232 237 233 #: src/Request.php:3 16238 #: src/Request.php:320 234 239 msgid "Export orders" 235 240 msgstr "Экспорт заказов" 236 241 237 #: src/Request.php:32 1242 #: src/Request.php:325 238 243 msgid "Interrupting the import process..." 239 244 msgstr "Прерывание процесса импорта..." 240 245 241 #: src/Settings.php: 44246 #: src/Settings.php:50 242 247 msgid "EDI" 243 248 msgstr "EDI" 244 249 245 #: src/Settings.php:5 3250 #: src/Settings.php:59 246 251 msgid "General settings" 247 252 msgstr "Общие настройки" 248 253 249 #: src/Settings.php: 58254 #: src/Settings.php:64 250 255 msgid "Site URL used for 1C interchange:" 251 256 msgstr "URL сайта для обмена с 1С:" 252 257 253 #: src/Settings.php: 65258 #: src/Settings.php:71 254 259 msgid "Username" 255 260 msgstr "Имя пользователя" 256 261 257 #: src/Settings.php: 68262 #: src/Settings.php:74 258 263 msgid "Username used for 1C interchange." 259 264 msgstr "Имя пользователя для обмена с 1С." 260 265 261 #: src/Settings.php:7 3266 #: src/Settings.php:79 262 267 msgid "Password" 263 268 msgstr "Пароль" 264 269 265 #: src/Settings.php: 76270 #: src/Settings.php:82 266 271 msgid "Password used for 1C interchange." 267 272 msgstr "Пароль для обмена с 1С." 268 273 269 #: src/Settings.php:8 1274 #: src/Settings.php:87 270 275 msgid "Import categories" 271 276 msgstr "Импортировать категории" 272 277 273 #: src/Settings.php: 88278 #: src/Settings.php:94 274 279 msgid "Import products" 275 280 msgstr "Импортировать товары" 276 281 277 #: src/Settings.php: 95282 #: src/Settings.php:101 278 283 msgid "Import attributes" 279 284 msgstr "Импортировать атрибуты" 280 285 281 #: src/Settings.php:10 2286 #: src/Settings.php:108 282 287 msgid "Import images" 283 288 msgstr "Импортировать изображения" 284 289 285 #: src/Settings.php:171 290 #: src/Settings.php:116 291 msgid "Advanced settings" 292 msgstr "Продвинутые настройки" 293 294 #: src/Settings.php:119 295 msgid "" 296 "🛑 Please do not change these settings unless you are sure what you are doing!" 297 msgstr "" 298 "🛑 Пожалуйста, не меняйте эти настройки, если вы не уверены в том, что " 299 "делаете!" 300 301 #: src/Settings.php:127 302 msgid "Import chunk size (in bytes)" 303 msgstr "Размер импортируемого фрагмента (в байтах)" 304 305 #: src/Settings.php:128 306 msgid "The maximum allowed file size to transfer per request." 307 msgstr "Максимально допустимый размер файла для передачи по запросу." 308 309 #: src/Settings.php:141 310 msgid "Enable detailed logging" 311 msgstr "Включить подробное логирование" 312 313 #: src/Settings.php:212 286 314 msgid "Interrupt" 287 315 msgstr "Прервать" 288 316 289 317 #. translators: %s: attribute map value. 290 #: src/Utils.php:2 60 src/Utils.php:283318 #: src/Utils.php:275 src/Utils.php:298 291 319 msgid "Attribute map is: %s." 292 320 msgstr "Сопоставление атрибутов: %s." 293 321 294 #: src/Utils.php: 290322 #: src/Utils.php:305 295 323 msgid "Error update attribute map." 296 324 msgstr "Ошибка обновления сопоставления атрибутов." -
e-commerce-data-interchange/tags/1.1.0/languages/edi.pot
r2703415 r2710949 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2022-0 3-25T16:58:10+03:00\n"12 "POT-Creation-Date: 2022-04-17T12:25:11+03:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.6.0\n" … … 59 59 60 60 #. translators: %s: file name. 61 #: src/CatalogInterchange.php:73 61 #: src/CatalogInterchange.php:71 62 msgid "Unexpected file name: %s." 63 msgstr "" 64 65 #. translators: %s: file name. 66 #: src/CatalogInterchange.php:79 62 67 msgid "%s was processed successfully." 63 68 msgstr "" … … 127 132 msgstr "" 128 133 129 #: src/EDI.php: 85134 #: src/EDI.php:90 130 135 msgid "Settings" 131 136 msgstr "" 132 137 133 138 #. translators: %s: WooCommerce URL. 134 #: src/EDI.php:11 3139 #: src/EDI.php:118 135 140 msgid "The %s plugin is required for electronic data interchange." 136 141 msgstr "" 137 142 138 143 #. translators: %s: access type. 139 #: src/EDI.php:1 79144 #: src/EDI.php:184 140 145 msgid "File system %s is not implemented." 141 146 msgstr "" … … 162 167 163 168 #. translators: %d: parent id. 164 #: src/Parsers/CategoriesParser.php:1 49169 #: src/Parsers/CategoriesParser.php:153 165 170 msgid "Product category parent is invalid: %d" 166 171 msgstr "" 167 172 168 173 #. translators: %s: error message. 169 #: src/Parsers/CategoriesParser.php:16 5174 #: src/Parsers/CategoriesParser.php:169 170 175 msgid "Error create product category: %s" 171 176 msgstr "" 172 177 173 178 #. translators: %s: category data. 174 #: src/Parsers/CategoriesParser.php:19 4179 #: src/Parsers/CategoriesParser.php:198 175 180 msgid "Cannot update product category: %s" 176 181 msgstr "" … … 194 199 msgstr "" 195 200 196 #: src/Request.php:17 9201 #: src/Request.php:178 197 202 msgid "Unexpected XML entry." 198 203 msgstr "" 199 204 200 205 #. translators: %s: property name. 201 #: src/Request.php:21 1206 #: src/Request.php:210 202 207 msgid "Undefined property: %s" 203 208 msgstr "" 204 209 205 #: src/Request.php:25 5210 #: src/Request.php:254 206 211 msgid "Synchronization was interrupted on the site side." 207 212 msgstr "" 208 213 209 #: src/Request.php:30 1214 #: src/Request.php:305 210 215 msgid "Products synchronization" 211 216 msgstr "" 212 217 213 #: src/Request.php:30 3218 #: src/Request.php:307 214 219 msgid "Orders synchronization" 215 220 msgstr "" 216 221 217 #: src/Request.php:31 0222 #: src/Request.php:314 218 223 msgid "Initialization" 219 224 msgstr "" 220 225 221 #: src/Request.php:31 2226 #: src/Request.php:316 222 227 msgid "Getting the import file" 223 228 msgstr "" 224 229 225 #: src/Request.php:31 4230 #: src/Request.php:318 226 231 msgid "Import" 227 232 msgstr "" 228 233 229 #: src/Request.php:3 16234 #: src/Request.php:320 230 235 msgid "Export orders" 231 236 msgstr "" 232 237 233 #: src/Request.php:32 1238 #: src/Request.php:325 234 239 msgid "Interrupting the import process..." 235 240 msgstr "" 236 241 237 #: src/Settings.php: 44242 #: src/Settings.php:50 238 243 msgid "EDI" 239 244 msgstr "" 240 245 241 #: src/Settings.php:5 3246 #: src/Settings.php:59 242 247 msgid "General settings" 243 248 msgstr "" 244 249 245 #: src/Settings.php: 58250 #: src/Settings.php:64 246 251 msgid "Site URL used for 1C interchange:" 247 252 msgstr "" 248 253 249 #: src/Settings.php: 65254 #: src/Settings.php:71 250 255 msgid "Username" 251 256 msgstr "" 252 257 253 #: src/Settings.php: 68258 #: src/Settings.php:74 254 259 msgid "Username used for 1C interchange." 255 260 msgstr "" 256 261 257 #: src/Settings.php:7 3262 #: src/Settings.php:79 258 263 msgid "Password" 259 264 msgstr "" 260 265 261 #: src/Settings.php: 76266 #: src/Settings.php:82 262 267 msgid "Password used for 1C interchange." 263 268 msgstr "" 264 269 265 #: src/Settings.php:8 1270 #: src/Settings.php:87 266 271 msgid "Import categories" 267 272 msgstr "" 268 273 269 #: src/Settings.php: 88274 #: src/Settings.php:94 270 275 msgid "Import products" 271 276 msgstr "" 272 277 273 #: src/Settings.php: 95278 #: src/Settings.php:101 274 279 msgid "Import attributes" 275 280 msgstr "" 276 281 277 #: src/Settings.php:10 2282 #: src/Settings.php:108 278 283 msgid "Import images" 279 284 msgstr "" 280 285 281 #: src/Settings.php:171 286 #: src/Settings.php:116 287 msgid "Advanced settings" 288 msgstr "" 289 290 #: src/Settings.php:119 291 msgid "🛑 Please do not change these settings unless you are sure what you are doing!" 292 msgstr "" 293 294 #: src/Settings.php:127 295 msgid "Import chunk size (in bytes)" 296 msgstr "" 297 298 #: src/Settings.php:128 299 msgid "The maximum allowed file size to transfer per request." 300 msgstr "" 301 302 #: src/Settings.php:141 303 msgid "Enable detailed logging" 304 msgstr "" 305 306 #: src/Settings.php:212 282 307 msgid "Interrupt" 283 308 msgstr "" 284 309 285 310 #. translators: %s: attribute map value. 286 #: src/Utils.php:2 60287 #: src/Utils.php:2 83311 #: src/Utils.php:275 312 #: src/Utils.php:298 288 313 msgid "Attribute map is: %s." 289 314 msgstr "" 290 315 291 #: src/Utils.php: 290316 #: src/Utils.php:305 292 317 msgid "Error update attribute map." 293 318 msgstr "" -
e-commerce-data-interchange/tags/1.1.0/readme.txt
r2703415 r2710949 1 === EDI ===1 === EDI - Обмен данными между WooCommerce и 1С === 2 2 Contributors: webcodist 3 3 Tags: 1c, 1с, commerceml, integration, e-commerce, ecommerce, commerce, shop, cart, woothemes, woocommerce 4 4 Donate link: https://boosty.to/byteperfect 5 5 Requires at least: 5.7 6 Tested up to: 5.9. 26 Tested up to: 5.9.3 7 7 Requires PHP: 7.4 8 Stable tag: 1. 0.08 Stable tag: 1.1.0 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 17 17 **Особенностью плагина является отсутствие специальных требований к хостингу. Это позволяет плагину стабильно работать даже на дешевых shared-хостингах. Плагин готов к работе сразу после установки!** 18 18 19 = Плагин EDI - Обмен данными между WooCommerce и 1С позволяет:=19 = Плагин EDI - Обмен данными между WooCommerce и 1С позволяет: = 20 20 ✅ Осуществлять выгрузку товаров: 21 21 - список товаров и вариантов*, … … 57 57 58 58 == Changelog == 59 60 = 1.1.0 = 61 *Дата релиза - 18 апреля 2022* 62 63 * Поддержка WordPress v5.9.3 64 * Поддержка WooCommerce v6.4.1 65 * Исправлена синхронизация ранее синхронизированных категории. 66 * Добавлена опция включения подробного логирования. 67 * Добавлены команды WP-CLI. 68 * Доработано определение имени XML-файла импорта. 69 * Реализована возможность указать максимально допустимый размер файла импорта. 70 * Различные улучшения. 71 72 59 73 = 1.0.0 = 74 *Дата релиза - 1 апреля 2022* 75 60 76 Публичный релиз плагина. 61 77 -
e-commerce-data-interchange/tags/1.1.0/src/CatalogInterchange.php
r2703415 r2710949 62 62 EDI::log()->debug( sprintf( __( 'Processing %s ...', 'edi' ), $this->request->filename ) ); 63 63 64 if ( 'import.xml' === $this->request->filename) {64 if ( 0 === strpos( $this->request->filename, 'import' ) ) { 65 65 $parser_class_name = '\BytePerfect\EDI\Parsers\ImportXMLParser'; 66 } elseif ( 0 === strpos( $this->request->filename, 'offers' ) ) { 67 $parser_class_name = '\BytePerfect\EDI\Parsers\OffersXMLParser'; 66 68 } else { 67 $parser_class_name = '\BytePerfect\EDI\Parsers\OffersXMLParser'; 69 throw new Exception( 70 /* translators: %s: file name. */ 71 sprintf( __( 'Unexpected file name: %s.', 'edi' ), $this->request->filename ) 72 ); 68 73 } 74 69 75 $parser = new $parser_class_name( $this->request ); 70 76 if ( $parser->parse() ) { -
e-commerce-data-interchange/tags/1.1.0/src/EDI.php
r2703415 r2710949 8 8 namespace BytePerfect\EDI; 9 9 10 use BytePerfect\EDI\CLI\EDI_CLI; 10 11 use Exception; 11 12 use WC_Logger; … … 39 40 40 41 new Settings(); 42 43 if ( defined( 'WP_CLI' ) && WP_CLI ) { 44 new EDI_CLI(); 45 } 41 46 42 47 register_activation_hook( -
e-commerce-data-interchange/tags/1.1.0/src/Parsers/CategoriesParser.php
r2703415 r2710949 83 83 ); 84 84 85 if ( is_null( $category_id ) ) { 85 if ( 86 is_null( $category_id ) 87 || 88 ! get_term_by( 'id', $category_id, 'product_cat' ) 89 ) { 86 90 $category_id = $this->create_category( $name, $parent_id ); 87 91 -
e-commerce-data-interchange/tags/1.1.0/src/Parsers/XMLParser.php
r2703415 r2710949 123 123 ! $this->eof 124 124 && 125 ( defined( 'WP_CLI') || ( ! $this->time_exceeded() && ! $this->memory_exceeded() ) )125 ( ( defined( 'WP_CLI' ) && WP_CLI ) || ( ! $this->time_exceeded() && ! $this->memory_exceeded() ) ) 126 126 ); 127 127 -
e-commerce-data-interchange/tags/1.1.0/src/Request.php
r2703415 r2710949 27 27 const EDI_ENDPOINT = '/edi/1c'; 28 28 29 const XML_IMPORT_FILENAME_MASK = '/^(?:import|offers).*\.xml$/'; 30 29 31 const ZIP_IMPORT_FILENAME_MASK = '/^v8_.+\.zip$/'; 30 32 … … 152 154 ! empty( $this->filename ) 153 155 && 154 ! in_array( $this->filename, array( 'import.xml', 'offers.xml' ), true )156 ! preg_match( self::XML_IMPORT_FILENAME_MASK, $this->filename ) 155 157 && 156 158 ! preg_match( self::ZIP_IMPORT_FILENAME_MASK, $this->filename ) … … 262 264 */ 263 265 protected function authorize(): void { 266 // Bypass authorization if WP_CLI request. 267 if ( defined( 'WP_CLI' ) && WP_CLI ) { 268 return; 269 } 270 264 271 $username = Settings::get_username(); 265 272 $password = Settings::get_password(); -
e-commerce-data-interchange/tags/1.1.0/src/Response.php
r2703415 r2710949 52 52 } 53 53 54 if ( 'failure' === $this->type || ( defined( 'EDI_DEBUG' ) && EDI_DEBUG) ) {54 if ( 'failure' === $this->type || Settings::get_detailed_logging() ) { 55 55 EDI::log()->notice( '🔙' . $message ); 56 56 } -
e-commerce-data-interchange/tags/1.1.0/src/Settings.php
r2703415 r2710949 20 20 * @method static get_password(): string 21 21 * @method static get_export_from_timestamp() 22 * @method static get_import_chunk_size(): int 23 * @method static get_import_categories() 24 * @method static get_import_products() 25 * @method static get_import_attributes() 26 * @method static get_import_images() 27 * @method static get_detailed_logging() 22 28 * 23 29 * @package BytePerfect\EDI … … 29 35 public function __construct() { 30 36 add_action( 'cmb2_admin_init', array( $this, 'register_options_metabox' ) ); 31 add_action( 'admin_bar_menu', array( $this, 'admin_bar_render' ) ); 32 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_script' ), PHP_INT_MAX ); 37 38 if ( is_admin() ) { 39 add_action( 'admin_bar_menu', array( $this, 'admin_bar_render' ) ); 40 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_script' ), PHP_INT_MAX ); 41 } 33 42 } 34 43 … … 107 116 108 117 do_action( 'edi_register_options_metabox', $cmb_options ); 118 119 $cmb_options->add_field( 120 array( 121 'name' => __( 'Advanced settings', 'edi' ), 122 'id' => 'expert_settings', 123 'type' => 'title', 124 'desc' => __( 125 '🛑 Please do not change these settings unless you are sure what you are doing!', 126 'edi' 127 ), 128 ) 129 ); 130 $cmb_options->add_field( 131 array( 132 'name' => __( 'Import chunk size (in bytes)', 'edi' ), 133 'desc' => __( 'The maximum allowed file size to transfer per request.', 'edi' ), 134 'id' => 'import_chunk_size', 135 'type' => 'text_small', 136 'attributes' => array( 137 'type' => 'number', 138 'min' => '0', 139 ), 140 'default' => 1000000, 141 'sanitization_cb' => array( $this, 'sanitize_import_chunk_size' ), 142 ) 143 ); 144 $cmb_options->add_field( 145 array( 146 'name' => __( 'Enable detailed logging', 'edi' ), 147 'id' => 'detailed_logging', 148 'type' => 'checkbox', 149 ) 150 ); 109 151 } 110 152 … … 135 177 'import_attributes' => '', 136 178 'import_images' => '', 179 'import_chunk_size' => 1000000, 180 'detailed_logging' => '', 137 181 ) 138 182 ), … … 202 246 ); 203 247 } 248 249 /** 250 * Sanitize import chunk size value. 251 * 252 * @param string $value Import chunk size. 253 * 254 * @return int 255 */ 256 public function sanitize_import_chunk_size( string $value ): int { 257 return absint( $value ); 258 } 204 259 } -
e-commerce-data-interchange/tags/1.1.0/src/Utils.php
r2703415 r2710949 25 25 */ 26 26 public static function get_file_limit(): int { 27 // Получаю все значения. 27 28 $file_limits = array( 29 Settings::get_import_chunk_size(), 28 30 self::filesize_to_bytes( (string) ini_get( 'post_max_size' ) ), 29 31 self::filesize_to_bytes( (string) ini_get( 'upload_max_filesize' ) ), … … 31 33 ); 32 34 33 return (int) min( $file_limits ); 35 // Убираю все "пустые" значения. 36 $file_limits = array_filter( $file_limits ); 37 38 // Нахожу минимальное значение, иначе использую значение по-умолчанию 64 килобайта. 39 $file_limit = empty( $file_limits ) ? 64000 : min( $file_limits ); 40 // Определяю 90% от найденного значения. 41 $file_limit = $file_limit * 0.9; 42 43 return (int) $file_limit; 34 44 } 35 45 … … 53 63 return (int) $filesize * 1000; 54 64 default: 55 return (int) $filesize; 65 $filesize = (int) $filesize; 66 if ( $filesize < 0 ) { 67 $filesize = 0; 68 } 69 70 return $filesize; 56 71 } 57 72 } -
e-commerce-data-interchange/tags/1.1.0/vendor/autoload.php
r2703415 r2710949 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 2ea6fe8ada44306e7b1a1f2958fc19d4::getLoader();7 return ComposerAutoloaderInit107406ad375ef1ce4b81c91b6324180f::getLoader(); -
e-commerce-data-interchange/tags/1.1.0/vendor/composer/autoload_real.php
r2703415 r2710949 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 2ea6fe8ada44306e7b1a1f2958fc19d45 class ComposerAutoloaderInit107406ad375ef1ce4b81c91b6324180f 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 2ea6fe8ada44306e7b1a1f2958fc19d4', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit107406ad375ef1ce4b81c91b6324180f', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 2ea6fe8ada44306e7b1a1f2958fc19d4', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit107406ad375ef1ce4b81c91b6324180f', 'loadClassLoader')); 30 30 31 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 33 33 require __DIR__ . '/autoload_static.php'; 34 34 35 call_user_func(\Composer\Autoload\ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::getInitializer($loader)); 36 36 } else { 37 37 $map = require __DIR__ . '/autoload_namespaces.php'; … … 54 54 55 55 if ($useStaticLoader) { 56 $includeFiles = Composer\Autoload\ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::$files;56 $includeFiles = Composer\Autoload\ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::$files; 57 57 } else { 58 58 $includeFiles = require __DIR__ . '/autoload_files.php'; 59 59 } 60 60 foreach ($includeFiles as $fileIdentifier => $file) { 61 composerRequire 2ea6fe8ada44306e7b1a1f2958fc19d4($fileIdentifier, $file);61 composerRequire107406ad375ef1ce4b81c91b6324180f($fileIdentifier, $file); 62 62 } 63 63 … … 71 71 * @return void 72 72 */ 73 function composerRequire 2ea6fe8ada44306e7b1a1f2958fc19d4($fileIdentifier, $file)73 function composerRequire107406ad375ef1ce4b81c91b6324180f($fileIdentifier, $file) 74 74 { 75 75 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { -
e-commerce-data-interchange/tags/1.1.0/vendor/composer/autoload_static.php
r2703415 r2710949 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d47 class ComposerStaticInit107406ad375ef1ce4b81c91b6324180f 8 8 { 9 9 public static $files = array ( … … 32 32 { 33 33 return \Closure::bind(function () use ($loader) { 34 $loader->prefixLengthsPsr4 = ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::$prefixLengthsPsr4;35 $loader->prefixDirsPsr4 = ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::$prefixDirsPsr4;36 $loader->classMap = ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::$classMap;34 $loader->prefixLengthsPsr4 = ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::$prefixLengthsPsr4; 35 $loader->prefixDirsPsr4 = ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::$prefixDirsPsr4; 36 $loader->classMap = ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::$classMap; 37 37 38 38 }, null, ClassLoader::class); -
e-commerce-data-interchange/trunk/e-commerce-data-interchange.php
r2703415 r2710949 1 1 <?php declare( strict_types=1 ); 2 2 /** 3 * Plugin Name: E-Commerce Data Interchange 4 * Plugin URI: https://edi.byteperfect.dev/ 5 * Description: The plugin provides data interchange between the WooCommerce plugin and 1C. 6 * Version: 1.0.0 7 * Author: Aleksandr Levashov <me@webcodist.com> 8 * Author URI: https://webcodist.com/ 9 * Requires at least: 5.7 10 * Requires PHP: 7.4 11 * License: GPLv3 12 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 13 * Text Domain: edi 14 * Domain Path: /languages/ 3 * Plugin Name: E-Commerce Data Interchange 4 * Plugin URI: https://edi.byteperfect.dev/ 5 * Description: The plugin provides data interchange between the WooCommerce plugin and 1C. 6 * Version: 1.0.0 7 * Author: Aleksandr Levashov <me@webcodist.com> 8 * Author URI: https://webcodist.com/ 9 * Requires at least: 5.7 10 * Requires PHP: 7.4 11 * WC requires at least: 3.6.0 12 * WC tested up to: 6.4.1 13 * License: GPLv3 14 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 15 * Text Domain: edi 16 * Domain Path: /languages/ 15 17 * 16 18 * @package BytePerfect\EDI -
e-commerce-data-interchange/trunk/languages/edi-ru_RU.po
r2703415 r2710949 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/e-commerce-data-" 7 7 "interchange\n" 8 "POT-Creation-Date: 2022-0 3-25T16:58:10+03:00\n"9 "PO-Revision-Date: 2022-0 3-25 16:59+0300\n"8 "POT-Creation-Date: 2022-04-17T12:25:11+03:00\n" 9 "PO-Revision-Date: 2022-04-17 12:26+0300\n" 10 10 "Last-Translator: Aleksandr Levashov <me@webcodist.com>\n" 11 11 "Language-Team: Aleksandr Levashov <me@webcodist.com>\n" … … 64 64 65 65 #. translators: %s: file name. 66 #: src/CatalogInterchange.php:73 66 #: src/CatalogInterchange.php:71 67 msgid "Unexpected file name: %s." 68 msgstr "Неожиданное имя файла: %s." 69 70 #. translators: %s: file name. 71 #: src/CatalogInterchange.php:79 67 72 msgid "%s was processed successfully." 68 73 msgstr "%s успешно обработан." … … 132 137 msgstr "Ошибка распаковки файла: %s" 133 138 134 #: src/EDI.php: 85139 #: src/EDI.php:90 135 140 msgid "Settings" 136 141 msgstr "Настройки" 137 142 138 143 #. translators: %s: WooCommerce URL. 139 #: src/EDI.php:11 3144 #: src/EDI.php:118 140 145 msgid "The %s plugin is required for electronic data interchange." 141 146 msgstr "Плагин %s необходим для электронного обмена данными." 142 147 143 148 #. translators: %s: access type. 144 #: src/EDI.php:1 79149 #: src/EDI.php:184 145 150 msgid "File system %s is not implemented." 146 151 msgstr "Файловая система %s не реализована." … … 167 172 168 173 #. translators: %d: parent id. 169 #: src/Parsers/CategoriesParser.php:1 49174 #: src/Parsers/CategoriesParser.php:153 170 175 msgid "Product category parent is invalid: %d" 171 176 msgstr "Родительская категория товара недействительна: %d" 172 177 173 178 #. translators: %s: error message. 174 #: src/Parsers/CategoriesParser.php:16 5179 #: src/Parsers/CategoriesParser.php:169 175 180 msgid "Error create product category: %s" 176 181 msgstr "Ошибка при создании категории товара: %s" 177 182 178 183 #. translators: %s: category data. 179 #: src/Parsers/CategoriesParser.php:19 4184 #: src/Parsers/CategoriesParser.php:198 180 185 msgid "Cannot update product category: %s" 181 186 msgstr "Невозможно обновить категорию товара: %s" … … 198 203 msgstr "Ошибка загрузки изображения: %s" 199 204 200 #: src/Request.php:17 9205 #: src/Request.php:178 201 206 msgid "Unexpected XML entry." 202 207 msgstr "Неожиданная запись XML." 203 208 204 209 #. translators: %s: property name. 205 #: src/Request.php:21 1210 #: src/Request.php:210 206 211 msgid "Undefined property: %s" 207 212 msgstr "Неопределенное свойство: %s" 208 213 209 #: src/Request.php:25 5214 #: src/Request.php:254 210 215 msgid "Synchronization was interrupted on the site side." 211 216 msgstr "Синхронизация была прервана на стороне сайта." 212 217 213 #: src/Request.php:30 1218 #: src/Request.php:305 214 219 msgid "Products synchronization" 215 220 msgstr "Синхронизация товаров" 216 221 217 #: src/Request.php:30 3222 #: src/Request.php:307 218 223 msgid "Orders synchronization" 219 224 msgstr "Синхронизация заказов" 220 225 221 #: src/Request.php:31 0226 #: src/Request.php:314 222 227 msgid "Initialization" 223 228 msgstr "Инициализация" 224 229 225 #: src/Request.php:31 2230 #: src/Request.php:316 226 231 msgid "Getting the import file" 227 232 msgstr "Получение файла импорта" 228 233 229 #: src/Request.php:31 4234 #: src/Request.php:318 230 235 msgid "Import" 231 236 msgstr "Импорт" 232 237 233 #: src/Request.php:3 16238 #: src/Request.php:320 234 239 msgid "Export orders" 235 240 msgstr "Экспорт заказов" 236 241 237 #: src/Request.php:32 1242 #: src/Request.php:325 238 243 msgid "Interrupting the import process..." 239 244 msgstr "Прерывание процесса импорта..." 240 245 241 #: src/Settings.php: 44246 #: src/Settings.php:50 242 247 msgid "EDI" 243 248 msgstr "EDI" 244 249 245 #: src/Settings.php:5 3250 #: src/Settings.php:59 246 251 msgid "General settings" 247 252 msgstr "Общие настройки" 248 253 249 #: src/Settings.php: 58254 #: src/Settings.php:64 250 255 msgid "Site URL used for 1C interchange:" 251 256 msgstr "URL сайта для обмена с 1С:" 252 257 253 #: src/Settings.php: 65258 #: src/Settings.php:71 254 259 msgid "Username" 255 260 msgstr "Имя пользователя" 256 261 257 #: src/Settings.php: 68262 #: src/Settings.php:74 258 263 msgid "Username used for 1C interchange." 259 264 msgstr "Имя пользователя для обмена с 1С." 260 265 261 #: src/Settings.php:7 3266 #: src/Settings.php:79 262 267 msgid "Password" 263 268 msgstr "Пароль" 264 269 265 #: src/Settings.php: 76270 #: src/Settings.php:82 266 271 msgid "Password used for 1C interchange." 267 272 msgstr "Пароль для обмена с 1С." 268 273 269 #: src/Settings.php:8 1274 #: src/Settings.php:87 270 275 msgid "Import categories" 271 276 msgstr "Импортировать категории" 272 277 273 #: src/Settings.php: 88278 #: src/Settings.php:94 274 279 msgid "Import products" 275 280 msgstr "Импортировать товары" 276 281 277 #: src/Settings.php: 95282 #: src/Settings.php:101 278 283 msgid "Import attributes" 279 284 msgstr "Импортировать атрибуты" 280 285 281 #: src/Settings.php:10 2286 #: src/Settings.php:108 282 287 msgid "Import images" 283 288 msgstr "Импортировать изображения" 284 289 285 #: src/Settings.php:171 290 #: src/Settings.php:116 291 msgid "Advanced settings" 292 msgstr "Продвинутые настройки" 293 294 #: src/Settings.php:119 295 msgid "" 296 "🛑 Please do not change these settings unless you are sure what you are doing!" 297 msgstr "" 298 "🛑 Пожалуйста, не меняйте эти настройки, если вы не уверены в том, что " 299 "делаете!" 300 301 #: src/Settings.php:127 302 msgid "Import chunk size (in bytes)" 303 msgstr "Размер импортируемого фрагмента (в байтах)" 304 305 #: src/Settings.php:128 306 msgid "The maximum allowed file size to transfer per request." 307 msgstr "Максимально допустимый размер файла для передачи по запросу." 308 309 #: src/Settings.php:141 310 msgid "Enable detailed logging" 311 msgstr "Включить подробное логирование" 312 313 #: src/Settings.php:212 286 314 msgid "Interrupt" 287 315 msgstr "Прервать" 288 316 289 317 #. translators: %s: attribute map value. 290 #: src/Utils.php:2 60 src/Utils.php:283318 #: src/Utils.php:275 src/Utils.php:298 291 319 msgid "Attribute map is: %s." 292 320 msgstr "Сопоставление атрибутов: %s." 293 321 294 #: src/Utils.php: 290322 #: src/Utils.php:305 295 323 msgid "Error update attribute map." 296 324 msgstr "Ошибка обновления сопоставления атрибутов." -
e-commerce-data-interchange/trunk/languages/edi.pot
r2703415 r2710949 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2022-0 3-25T16:58:10+03:00\n"12 "POT-Creation-Date: 2022-04-17T12:25:11+03:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.6.0\n" … … 59 59 60 60 #. translators: %s: file name. 61 #: src/CatalogInterchange.php:73 61 #: src/CatalogInterchange.php:71 62 msgid "Unexpected file name: %s." 63 msgstr "" 64 65 #. translators: %s: file name. 66 #: src/CatalogInterchange.php:79 62 67 msgid "%s was processed successfully." 63 68 msgstr "" … … 127 132 msgstr "" 128 133 129 #: src/EDI.php: 85134 #: src/EDI.php:90 130 135 msgid "Settings" 131 136 msgstr "" 132 137 133 138 #. translators: %s: WooCommerce URL. 134 #: src/EDI.php:11 3139 #: src/EDI.php:118 135 140 msgid "The %s plugin is required for electronic data interchange." 136 141 msgstr "" 137 142 138 143 #. translators: %s: access type. 139 #: src/EDI.php:1 79144 #: src/EDI.php:184 140 145 msgid "File system %s is not implemented." 141 146 msgstr "" … … 162 167 163 168 #. translators: %d: parent id. 164 #: src/Parsers/CategoriesParser.php:1 49169 #: src/Parsers/CategoriesParser.php:153 165 170 msgid "Product category parent is invalid: %d" 166 171 msgstr "" 167 172 168 173 #. translators: %s: error message. 169 #: src/Parsers/CategoriesParser.php:16 5174 #: src/Parsers/CategoriesParser.php:169 170 175 msgid "Error create product category: %s" 171 176 msgstr "" 172 177 173 178 #. translators: %s: category data. 174 #: src/Parsers/CategoriesParser.php:19 4179 #: src/Parsers/CategoriesParser.php:198 175 180 msgid "Cannot update product category: %s" 176 181 msgstr "" … … 194 199 msgstr "" 195 200 196 #: src/Request.php:17 9201 #: src/Request.php:178 197 202 msgid "Unexpected XML entry." 198 203 msgstr "" 199 204 200 205 #. translators: %s: property name. 201 #: src/Request.php:21 1206 #: src/Request.php:210 202 207 msgid "Undefined property: %s" 203 208 msgstr "" 204 209 205 #: src/Request.php:25 5210 #: src/Request.php:254 206 211 msgid "Synchronization was interrupted on the site side." 207 212 msgstr "" 208 213 209 #: src/Request.php:30 1214 #: src/Request.php:305 210 215 msgid "Products synchronization" 211 216 msgstr "" 212 217 213 #: src/Request.php:30 3218 #: src/Request.php:307 214 219 msgid "Orders synchronization" 215 220 msgstr "" 216 221 217 #: src/Request.php:31 0222 #: src/Request.php:314 218 223 msgid "Initialization" 219 224 msgstr "" 220 225 221 #: src/Request.php:31 2226 #: src/Request.php:316 222 227 msgid "Getting the import file" 223 228 msgstr "" 224 229 225 #: src/Request.php:31 4230 #: src/Request.php:318 226 231 msgid "Import" 227 232 msgstr "" 228 233 229 #: src/Request.php:3 16234 #: src/Request.php:320 230 235 msgid "Export orders" 231 236 msgstr "" 232 237 233 #: src/Request.php:32 1238 #: src/Request.php:325 234 239 msgid "Interrupting the import process..." 235 240 msgstr "" 236 241 237 #: src/Settings.php: 44242 #: src/Settings.php:50 238 243 msgid "EDI" 239 244 msgstr "" 240 245 241 #: src/Settings.php:5 3246 #: src/Settings.php:59 242 247 msgid "General settings" 243 248 msgstr "" 244 249 245 #: src/Settings.php: 58250 #: src/Settings.php:64 246 251 msgid "Site URL used for 1C interchange:" 247 252 msgstr "" 248 253 249 #: src/Settings.php: 65254 #: src/Settings.php:71 250 255 msgid "Username" 251 256 msgstr "" 252 257 253 #: src/Settings.php: 68258 #: src/Settings.php:74 254 259 msgid "Username used for 1C interchange." 255 260 msgstr "" 256 261 257 #: src/Settings.php:7 3262 #: src/Settings.php:79 258 263 msgid "Password" 259 264 msgstr "" 260 265 261 #: src/Settings.php: 76266 #: src/Settings.php:82 262 267 msgid "Password used for 1C interchange." 263 268 msgstr "" 264 269 265 #: src/Settings.php:8 1270 #: src/Settings.php:87 266 271 msgid "Import categories" 267 272 msgstr "" 268 273 269 #: src/Settings.php: 88274 #: src/Settings.php:94 270 275 msgid "Import products" 271 276 msgstr "" 272 277 273 #: src/Settings.php: 95278 #: src/Settings.php:101 274 279 msgid "Import attributes" 275 280 msgstr "" 276 281 277 #: src/Settings.php:10 2282 #: src/Settings.php:108 278 283 msgid "Import images" 279 284 msgstr "" 280 285 281 #: src/Settings.php:171 286 #: src/Settings.php:116 287 msgid "Advanced settings" 288 msgstr "" 289 290 #: src/Settings.php:119 291 msgid "🛑 Please do not change these settings unless you are sure what you are doing!" 292 msgstr "" 293 294 #: src/Settings.php:127 295 msgid "Import chunk size (in bytes)" 296 msgstr "" 297 298 #: src/Settings.php:128 299 msgid "The maximum allowed file size to transfer per request." 300 msgstr "" 301 302 #: src/Settings.php:141 303 msgid "Enable detailed logging" 304 msgstr "" 305 306 #: src/Settings.php:212 282 307 msgid "Interrupt" 283 308 msgstr "" 284 309 285 310 #. translators: %s: attribute map value. 286 #: src/Utils.php:2 60287 #: src/Utils.php:2 83311 #: src/Utils.php:275 312 #: src/Utils.php:298 288 313 msgid "Attribute map is: %s." 289 314 msgstr "" 290 315 291 #: src/Utils.php: 290316 #: src/Utils.php:305 292 317 msgid "Error update attribute map." 293 318 msgstr "" -
e-commerce-data-interchange/trunk/readme.txt
r2703415 r2710949 1 === EDI ===1 === EDI - Обмен данными между WooCommerce и 1С === 2 2 Contributors: webcodist 3 3 Tags: 1c, 1с, commerceml, integration, e-commerce, ecommerce, commerce, shop, cart, woothemes, woocommerce 4 4 Donate link: https://boosty.to/byteperfect 5 5 Requires at least: 5.7 6 Tested up to: 5.9. 26 Tested up to: 5.9.3 7 7 Requires PHP: 7.4 8 Stable tag: 1. 0.08 Stable tag: 1.1.0 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 17 17 **Особенностью плагина является отсутствие специальных требований к хостингу. Это позволяет плагину стабильно работать даже на дешевых shared-хостингах. Плагин готов к работе сразу после установки!** 18 18 19 = Плагин EDI - Обмен данными между WooCommerce и 1С позволяет:=19 = Плагин EDI - Обмен данными между WooCommerce и 1С позволяет: = 20 20 ✅ Осуществлять выгрузку товаров: 21 21 - список товаров и вариантов*, … … 57 57 58 58 == Changelog == 59 60 = 1.1.0 = 61 *Дата релиза - 18 апреля 2022* 62 63 * Поддержка WordPress v5.9.3 64 * Поддержка WooCommerce v6.4.1 65 * Исправлена синхронизация ранее синхронизированных категории. 66 * Добавлена опция включения подробного логирования. 67 * Добавлены команды WP-CLI. 68 * Доработано определение имени XML-файла импорта. 69 * Реализована возможность указать максимально допустимый размер файла импорта. 70 * Различные улучшения. 71 72 59 73 = 1.0.0 = 74 *Дата релиза - 1 апреля 2022* 75 60 76 Публичный релиз плагина. 61 77 -
e-commerce-data-interchange/trunk/src/CatalogInterchange.php
r2703415 r2710949 62 62 EDI::log()->debug( sprintf( __( 'Processing %s ...', 'edi' ), $this->request->filename ) ); 63 63 64 if ( 'import.xml' === $this->request->filename) {64 if ( 0 === strpos( $this->request->filename, 'import' ) ) { 65 65 $parser_class_name = '\BytePerfect\EDI\Parsers\ImportXMLParser'; 66 } elseif ( 0 === strpos( $this->request->filename, 'offers' ) ) { 67 $parser_class_name = '\BytePerfect\EDI\Parsers\OffersXMLParser'; 66 68 } else { 67 $parser_class_name = '\BytePerfect\EDI\Parsers\OffersXMLParser'; 69 throw new Exception( 70 /* translators: %s: file name. */ 71 sprintf( __( 'Unexpected file name: %s.', 'edi' ), $this->request->filename ) 72 ); 68 73 } 74 69 75 $parser = new $parser_class_name( $this->request ); 70 76 if ( $parser->parse() ) { -
e-commerce-data-interchange/trunk/src/EDI.php
r2703415 r2710949 8 8 namespace BytePerfect\EDI; 9 9 10 use BytePerfect\EDI\CLI\EDI_CLI; 10 11 use Exception; 11 12 use WC_Logger; … … 39 40 40 41 new Settings(); 42 43 if ( defined( 'WP_CLI' ) && WP_CLI ) { 44 new EDI_CLI(); 45 } 41 46 42 47 register_activation_hook( -
e-commerce-data-interchange/trunk/src/Parsers/CategoriesParser.php
r2703415 r2710949 83 83 ); 84 84 85 if ( is_null( $category_id ) ) { 85 if ( 86 is_null( $category_id ) 87 || 88 ! get_term_by( 'id', $category_id, 'product_cat' ) 89 ) { 86 90 $category_id = $this->create_category( $name, $parent_id ); 87 91 -
e-commerce-data-interchange/trunk/src/Parsers/XMLParser.php
r2703415 r2710949 123 123 ! $this->eof 124 124 && 125 ( defined( 'WP_CLI') || ( ! $this->time_exceeded() && ! $this->memory_exceeded() ) )125 ( ( defined( 'WP_CLI' ) && WP_CLI ) || ( ! $this->time_exceeded() && ! $this->memory_exceeded() ) ) 126 126 ); 127 127 -
e-commerce-data-interchange/trunk/src/Request.php
r2703415 r2710949 27 27 const EDI_ENDPOINT = '/edi/1c'; 28 28 29 const XML_IMPORT_FILENAME_MASK = '/^(?:import|offers).*\.xml$/'; 30 29 31 const ZIP_IMPORT_FILENAME_MASK = '/^v8_.+\.zip$/'; 30 32 … … 152 154 ! empty( $this->filename ) 153 155 && 154 ! in_array( $this->filename, array( 'import.xml', 'offers.xml' ), true )156 ! preg_match( self::XML_IMPORT_FILENAME_MASK, $this->filename ) 155 157 && 156 158 ! preg_match( self::ZIP_IMPORT_FILENAME_MASK, $this->filename ) … … 262 264 */ 263 265 protected function authorize(): void { 266 // Bypass authorization if WP_CLI request. 267 if ( defined( 'WP_CLI' ) && WP_CLI ) { 268 return; 269 } 270 264 271 $username = Settings::get_username(); 265 272 $password = Settings::get_password(); -
e-commerce-data-interchange/trunk/src/Response.php
r2703415 r2710949 52 52 } 53 53 54 if ( 'failure' === $this->type || ( defined( 'EDI_DEBUG' ) && EDI_DEBUG) ) {54 if ( 'failure' === $this->type || Settings::get_detailed_logging() ) { 55 55 EDI::log()->notice( '🔙' . $message ); 56 56 } -
e-commerce-data-interchange/trunk/src/Settings.php
r2703415 r2710949 20 20 * @method static get_password(): string 21 21 * @method static get_export_from_timestamp() 22 * @method static get_import_chunk_size(): int 23 * @method static get_import_categories() 24 * @method static get_import_products() 25 * @method static get_import_attributes() 26 * @method static get_import_images() 27 * @method static get_detailed_logging() 22 28 * 23 29 * @package BytePerfect\EDI … … 29 35 public function __construct() { 30 36 add_action( 'cmb2_admin_init', array( $this, 'register_options_metabox' ) ); 31 add_action( 'admin_bar_menu', array( $this, 'admin_bar_render' ) ); 32 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_script' ), PHP_INT_MAX ); 37 38 if ( is_admin() ) { 39 add_action( 'admin_bar_menu', array( $this, 'admin_bar_render' ) ); 40 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_script' ), PHP_INT_MAX ); 41 } 33 42 } 34 43 … … 107 116 108 117 do_action( 'edi_register_options_metabox', $cmb_options ); 118 119 $cmb_options->add_field( 120 array( 121 'name' => __( 'Advanced settings', 'edi' ), 122 'id' => 'expert_settings', 123 'type' => 'title', 124 'desc' => __( 125 '🛑 Please do not change these settings unless you are sure what you are doing!', 126 'edi' 127 ), 128 ) 129 ); 130 $cmb_options->add_field( 131 array( 132 'name' => __( 'Import chunk size (in bytes)', 'edi' ), 133 'desc' => __( 'The maximum allowed file size to transfer per request.', 'edi' ), 134 'id' => 'import_chunk_size', 135 'type' => 'text_small', 136 'attributes' => array( 137 'type' => 'number', 138 'min' => '0', 139 ), 140 'default' => 1000000, 141 'sanitization_cb' => array( $this, 'sanitize_import_chunk_size' ), 142 ) 143 ); 144 $cmb_options->add_field( 145 array( 146 'name' => __( 'Enable detailed logging', 'edi' ), 147 'id' => 'detailed_logging', 148 'type' => 'checkbox', 149 ) 150 ); 109 151 } 110 152 … … 135 177 'import_attributes' => '', 136 178 'import_images' => '', 179 'import_chunk_size' => 1000000, 180 'detailed_logging' => '', 137 181 ) 138 182 ), … … 202 246 ); 203 247 } 248 249 /** 250 * Sanitize import chunk size value. 251 * 252 * @param string $value Import chunk size. 253 * 254 * @return int 255 */ 256 public function sanitize_import_chunk_size( string $value ): int { 257 return absint( $value ); 258 } 204 259 } -
e-commerce-data-interchange/trunk/src/Utils.php
r2703415 r2710949 25 25 */ 26 26 public static function get_file_limit(): int { 27 // Получаю все значения. 27 28 $file_limits = array( 29 Settings::get_import_chunk_size(), 28 30 self::filesize_to_bytes( (string) ini_get( 'post_max_size' ) ), 29 31 self::filesize_to_bytes( (string) ini_get( 'upload_max_filesize' ) ), … … 31 33 ); 32 34 33 return (int) min( $file_limits ); 35 // Убираю все "пустые" значения. 36 $file_limits = array_filter( $file_limits ); 37 38 // Нахожу минимальное значение, иначе использую значение по-умолчанию 64 килобайта. 39 $file_limit = empty( $file_limits ) ? 64000 : min( $file_limits ); 40 // Определяю 90% от найденного значения. 41 $file_limit = $file_limit * 0.9; 42 43 return (int) $file_limit; 34 44 } 35 45 … … 53 63 return (int) $filesize * 1000; 54 64 default: 55 return (int) $filesize; 65 $filesize = (int) $filesize; 66 if ( $filesize < 0 ) { 67 $filesize = 0; 68 } 69 70 return $filesize; 56 71 } 57 72 } -
e-commerce-data-interchange/trunk/vendor/autoload.php
r2703415 r2710949 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 2ea6fe8ada44306e7b1a1f2958fc19d4::getLoader();7 return ComposerAutoloaderInit107406ad375ef1ce4b81c91b6324180f::getLoader(); -
e-commerce-data-interchange/trunk/vendor/composer/autoload_real.php
r2703415 r2710949 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 2ea6fe8ada44306e7b1a1f2958fc19d45 class ComposerAutoloaderInit107406ad375ef1ce4b81c91b6324180f 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 2ea6fe8ada44306e7b1a1f2958fc19d4', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit107406ad375ef1ce4b81c91b6324180f', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 2ea6fe8ada44306e7b1a1f2958fc19d4', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit107406ad375ef1ce4b81c91b6324180f', 'loadClassLoader')); 30 30 31 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 33 33 require __DIR__ . '/autoload_static.php'; 34 34 35 call_user_func(\Composer\Autoload\ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::getInitializer($loader)); 36 36 } else { 37 37 $map = require __DIR__ . '/autoload_namespaces.php'; … … 54 54 55 55 if ($useStaticLoader) { 56 $includeFiles = Composer\Autoload\ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::$files;56 $includeFiles = Composer\Autoload\ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::$files; 57 57 } else { 58 58 $includeFiles = require __DIR__ . '/autoload_files.php'; 59 59 } 60 60 foreach ($includeFiles as $fileIdentifier => $file) { 61 composerRequire 2ea6fe8ada44306e7b1a1f2958fc19d4($fileIdentifier, $file);61 composerRequire107406ad375ef1ce4b81c91b6324180f($fileIdentifier, $file); 62 62 } 63 63 … … 71 71 * @return void 72 72 */ 73 function composerRequire 2ea6fe8ada44306e7b1a1f2958fc19d4($fileIdentifier, $file)73 function composerRequire107406ad375ef1ce4b81c91b6324180f($fileIdentifier, $file) 74 74 { 75 75 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { -
e-commerce-data-interchange/trunk/vendor/composer/autoload_static.php
r2703415 r2710949 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d47 class ComposerStaticInit107406ad375ef1ce4b81c91b6324180f 8 8 { 9 9 public static $files = array ( … … 32 32 { 33 33 return \Closure::bind(function () use ($loader) { 34 $loader->prefixLengthsPsr4 = ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::$prefixLengthsPsr4;35 $loader->prefixDirsPsr4 = ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::$prefixDirsPsr4;36 $loader->classMap = ComposerStaticInit 2ea6fe8ada44306e7b1a1f2958fc19d4::$classMap;34 $loader->prefixLengthsPsr4 = ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::$prefixLengthsPsr4; 35 $loader->prefixDirsPsr4 = ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::$prefixDirsPsr4; 36 $loader->classMap = ComposerStaticInit107406ad375ef1ce4b81c91b6324180f::$classMap; 37 37 38 38 }, null, ClassLoader::class);
Note: See TracChangeset
for help on using the changeset viewer.