diff --git a/algolia-woo-indexer.php b/algolia-woo-indexer.php index 565eab2..61085c7 100644 --- a/algolia-woo-indexer.php +++ b/algolia-woo-indexer.php @@ -5,11 +5,11 @@ * Text Domain: algolia-woo-indexer * Author: Daniel F * Requires at least: 5.3 - * Tested up to: 5.4 - * Requires PHP: 7.2 - * WC requires at least: 4.2.0 - * WC tested up to: 4.3.0 - * Version: 1.0.1 + * Tested up to: 5.5 + * Requires PHP: 7.3 + * WC requires at least: 4.5.0 + * WC tested up to: 4.5.2 + * Version: 1.0.2 * * @package algolia-woo-indexer * @license GNU version 3 diff --git a/classes/class-algolia-woo-indexer.php b/classes/class-algolia-woo-indexer.php index cd4462d..5650911 100644 --- a/classes/class-algolia-woo-indexer.php +++ b/classes/class-algolia-woo-indexer.php @@ -503,19 +503,14 @@ function () { foreach ( $products as $product ) { /** - * Check if product is in stock if $index_in_stock is set to 0 + * Check if product is in stock if $index_in_stock is set to 1 */ if ( '1' === $index_in_stock && $product->is_in_stock() ) { - /** * Extract image from $product->get_image() */ - - print_r ( $product->get_image()); - - - preg_match_all( '//i', $product->get_image(), $matches ); - $product_image = implode( $matches[1] ); + preg_match('/get_image(), $result); + $product_image = array_pop($result); /** * Build the record array using the information from the WooCommerce product */ @@ -534,12 +529,12 @@ function () { * Do not check if product is in stock if $index_in_stock is set to 0 */ if ( '0' === $index_in_stock ) { - /** * Extract image from $product->get_image() */ - preg_match_all( '//i', $product->get_image(), $matches ); - $product_image = implode( $matches[1] ); + preg_match('/get_image(), $result); + $product_image = array_pop($result); + /** * Build the record array using the information from the WooCommerce product */ diff --git a/readme.txt b/readme.txt index 36c8fe6..f71bd9e 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: Daniel F Tags: algolia, woocommerce, search, algolia search, algolia indexing Requires at least: not tested -Tested up to: 5.4 +Tested up to: 5.5.1 Stable tag: 1.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html