diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 4f9bc817650..312c357c738 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -4,6 +4,7 @@ filter: - apigen/* - includes/api/v1/* - includes/libraries/* + - includes/updates/* - includes/gateways/mijireh/includes/* - includes/gateways/simplify-commerce/includes/* diff --git a/includes/updates/woocommerce-update-1.4.php b/includes/updates/woocommerce-update-1.4.php deleted file mode 100644 index e93b4be11fa..00000000000 --- a/includes/updates/woocommerce-update-1.4.php +++ /dev/null @@ -1,36 +0,0 @@ -term_id, 'product_type' ); - foreach ( $products as $product ) { - update_post_meta( $product, '_downloadable', 'yes' ); - update_post_meta( $product, '_virtual', 'yes' ); - wp_set_object_terms( $product, 'simple', 'product_type'); - } -} - -$virtual_type = get_term_by( 'slug', 'virtual', 'product_type' ); -if ( $virtual_type ) { - $products = get_objects_in_term( $virtual_type->term_id, 'product_type' ); - foreach ( $products as $product ) { - update_post_meta( $product, '_downloadable', 'no' ); - update_post_meta( $product, '_virtual', 'yes' ); - wp_set_object_terms( $product, 'simple', 'product_type'); - } -} diff --git a/includes/updates/woocommerce-update-1.5.php b/includes/updates/woocommerce-update-1.5.php deleted file mode 100644 index b08ebccddfc..00000000000 --- a/includes/updates/woocommerce-update-1.5.php +++ /dev/null @@ -1,49 +0,0 @@ -get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE order_id = 0;" ); - -if ( $results ) foreach ( $results as $result ) { - - if ( ! $result->order_key ) - continue; - - $order_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_order_key' AND meta_value = '%s' LIMIT 1;", $result->order_key ) ); - - if ( $order_id ) { - - $wpdb->update( $wpdb->prefix . "woocommerce_downloadable_product_permissions", array( - 'order_id' => $order_id, - ), array( - 'product_id' => $result->product_id, - 'order_key' => $result->order_key - ), array( '%s' ), array( '%s', '%s' ) ); - - } - -} - -// Upgrade old meta keys for product data -$meta = array( 'sku', 'downloadable', 'virtual', 'price', 'visibility', 'stock', 'stock_status', 'backorders', 'manage_stock', 'sale_price', 'regular_price', 'weight', 'length', 'width', 'height', 'tax_status', 'tax_class', 'upsell_ids', 'crosssell_ids', 'sale_price_dates_from', 'sale_price_dates_to', 'min_variation_price', 'max_variation_price', 'featured', 'product_attributes', 'file_path', 'download_limit', 'product_url', 'min_variation_price', 'max_variation_price' ); - -$wpdb->query( " - UPDATE {$wpdb->postmeta} - LEFT JOIN {$wpdb->posts} ON ( {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID ) - SET meta_key = CONCAT( '_', meta_key ) - WHERE meta_key IN ( '" . implode( "', '", $meta ) . "' ) - AND {$wpdb->posts}.post_type IN ('product', 'product_variation') -" );