PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.9.16
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.9.16
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / includes / updates / update-1.8.13.php

update-1.8.13.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.9.16, at includes/updates/update-1.8.13.php

41 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Update to 1.8.13.
4 *
5 * Safely remove exact duplicate postmeta rows from POS-touched products and
6 * variations. This repair keeps one row per exact
7 * (post_id, meta_key, meta_value) tuple.
8 *
9 * @author Paul Kilmurray <paul@kilbot.com>
10 *
11 * @see http://wcpos.com
12 * @package WCPOS\WooCommercePOS
13 */
14
15 namespace WCPOS\WooCommercePOS;
16
17 use WCPOS\WooCommercePOS\Services\Meta_Data_Repair;
18
19 $woocommerce_pos_meta_repair_result = Meta_Data_Repair::remove_exact_duplicate_postmeta_rows(
20 array(
21 'dry_run' => false,
22 'batch_size' => 500,
23 'max_batches' => 400,
24 )
25 );
26
27 if ( \function_exists( 'wc_get_logger' ) ) {
28 $wcpos_logger = wc_get_logger(); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- update script file scope.
29
30 $wcpos_logger->info( // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- update script file scope.
31 sprintf(
32 'WCPOS 1.8.13 migration: processed %1$d duplicate groups, deleted %2$d rows (errors: %3$d, batch_limit_hit: %4$s).',
33 (int) $woocommerce_pos_meta_repair_result['groups_processed'],
34 (int) $woocommerce_pos_meta_repair_result['rows_deleted'],
35 (int) $woocommerce_pos_meta_repair_result['errors'],
36 $woocommerce_pos_meta_repair_result['hit_batch_limit'] ? 'yes' : 'no'
37 ),
38 array( 'source' => 'woocommerce-pos' )
39 );
40 }
41