PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.20
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.20
1.10.20 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 All 164 releases
← All changes | includes/Sync/Revision.php +3 -11 1.10.1 → 1.10.20 View file →
@@ -74,16 +74,8 @@
74 74 public static function compute( array $data ): string {
75 75 return 'sha256:' . hash( 'sha256', (string) wp_json_encode( self::canonicalize( $data ) ) );
76 76 }
77 77
78 - public static function pre_taxonomy_sort_revision( array $data ): string {
79 - $excluded = apply_filters( 'woocommerce_pos_sync_revision_excluded_fields', array( 'related_ids', '_links', 'links' ) );
80 - foreach ( (array) $excluded as $field ) {
81 - unset( $data[ $field ] );
82 - }
83 - return 'sha256:' . hash( 'sha256', (string) wp_json_encode( self::sort_keys_recursive( $data, false ) ) );
84 - }
85 -
86 78 public static function canonicalize( array $data ): array {
87 79 $excluded = apply_filters( 'woocommerce_pos_sync_revision_excluded_fields', array( 'related_ids', '_links', 'links' ) );
88 80 foreach ( (array) $excluded as $field ) {
89 81 unset( $data[ $field ] );
@@ -90,15 +82,15 @@
90 82 }
91 83 return self::sort_keys_recursive( $data );
92 84 }
93 85
94 - private static function sort_keys_recursive( array $data, bool $sort_taxonomy_terms = true ): array {
86 + private static function sort_keys_recursive( array $data ): array {
95 87 ksort( $data );
96 88 foreach ( $data as $key => $value ) {
97 89 if ( is_array( $value ) ) {
98 - $data[ $key ] = self::sort_keys_recursive( $value, $sort_taxonomy_terms );
90 + $data[ $key ] = self::sort_keys_recursive( $value );
99 91 // Taxonomy collections are sets; other lists retain semantic order.
100 - if ( ! $sort_taxonomy_terms || ! in_array( $key, array( 'categories', 'tags', 'brands' ), true ) || count( $value ) < 2 || array_keys( $value ) !== range( 0, count( $value ) - 1 ) ) {
92 + if ( ! in_array( $key, array( 'categories', 'tags', 'brands' ), true ) || count( $value ) < 2 || array_keys( $value ) !== range( 0, count( $value ) - 1 ) ) {
101 93 continue;
102 94 }
103 95 foreach ( $value as $term ) {
104 96 $id = is_array( $term ) ? ( $term['id'] ?? null ) : ( is_object( $term ) ? ( $term->id ?? null ) : null );