Changeset 2825069
- Timestamp:
- 11/28/2022 07:53:43 AM (20 months ago)
- Location:
- snapplify-e-commerce
- Files:
-
- 162 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
snapplify-e-commerce/trunk/README.txt
r2810910 r2825069 4 4 Requires at least: 5.6 5 5 Tested up to: 6.0.2 6 Stable tag: 1.0. 26 Stable tag: 1.0. 7 7 Requires PHP: 7.2 8 8 License: GPLv2 or later … … 82 82 == Changelog == 83 83 84 85 86 84 87 = 1.0.2 = 85 88 * Some Bug Fixing -
snapplify-e-commerce/trunk/admin/class-snapplify-ecommerce-admin.php
r2799948 r2825069 168 168 } 169 169 170 171 172 173 174 175 176 170 177 if ( 'wcsnapplify' === $current_section ) { 171 178 … … 206 213 'css' => 'min-width:300px;', 207 214 'desc' => __( 'Enable Category Management. This setting will create categories and assign products to them automatically.', 'snapplify-ecommerce' ), 215 216 217 218 219 220 221 222 223 224 208 225 'default' => 'yes', 209 226 ); … … 256 273 'css' => 'min-width:300px;', 257 274 'desc' => __( 'The "API Key" assigned to you by Snapplify, used for authentication.', 'snapplify-ecommerce' ), 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 258 295 ); 259 296 … … 368 405 369 406 } 407 408 370 409 371 410 public function wcsnapplify_fill_custom_tab() { -
snapplify-e-commerce/trunk/changelog.txt
r2801825 r2825069 1 1 *** WooCommerce Extension Template Changelog *** 2 2022-10-20 - version 1.0.1 2 2022-11-25 - version 1.0.3 3 * Add option for manually flush the pending products queue. 4 * Add option for download product images. 5 6 2022-11-06 - version 1.0.2 7 * Some Bug Fixing 8 * Updated Json feed data file. 9 10 2022-11-02 - version 1.0.1 3 11 * Bug Fixing 4 12 -
snapplify-e-commerce/trunk/includes/class-snapplify-ecommerce.php
r2799948 r2825069 178 178 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); 179 179 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); 180 181 182 183 180 184 } 181 185 -
snapplify-e-commerce/trunk/lib/PipelineStages/class-createproduct.php
r2799948 r2825069 136 136 } 137 137 138 if ( false === $is_new ) { 139 // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 140 if ( $old_image_hash !== $data->imageMd5Hash && null !== $data->imageMd5Hash ) { 141 // delete old image. 142 wp_delete_attachment( $old_image_id, true ); 143 144 // fetch and attach new image. 138 if( get_option( 'wcsnapplify_download_product' ) === 'yes' ){ 139 if ( false === $is_new ) { 145 140 // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 146 $logger->info( 'Updating image on product, ID: ' . $id . ' OLD: ' . $old_image_hash . ' NEW: ' . $data->imageMd5Hash, $context ); 141 if ( $old_image_hash !== $data->imageMd5Hash && null !== $data->imageMd5Hash ) { 142 // delete old image. 143 wp_delete_attachment( $old_image_id, true ); 144 145 // fetch and attach new image. 146 // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 147 $logger->info( 'Updating image on product, ID: ' . $id . ' OLD: ' . $old_image_hash . ' NEW: ' . $data->imageMd5Hash, $context ); 148 try { 149 $logger->info( 'Updating image on product, ID: ' . $id, $context ); 150 // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 151 $image_result = media_sideload_image( $data->imageUrl, $id, $data->identifier, 'id' ); 152 153 if( is_wp_error( $image_result ) ){ 154 throw new \Exception( $image_result->get_error_message() ); 155 } 156 157 $product->set_image_id( $image_result ); 158 $product->save(); 159 } catch ( \Throwable $th ) { 160 $logger->error( 'Error updating image on product, ID: . ' . $id . ' ' . $th->getMessage(), $context ); 161 } 162 } 163 } else { 164 $logger->info( 'Adding image for new product, ID: ' . $id, $context ); 165 // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 147 166 try { 148 $logger->info( 'Updating image on product, ID: ' . $id, $context );149 // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase150 167 $image_result = media_sideload_image( $data->imageUrl, $id, $data->identifier, 'id' ); 151 168 152 169 if( is_wp_error( $image_result ) ){ 153 170 throw new \Exception( $image_result->get_error_message() ); 154 171 } 155 172 156 173 $product->set_image_id( $image_result ); 157 174 $product->save(); 158 175 } catch ( \Throwable $th ) { 159 $logger->error( 'Error updating image on product, ID: . ' . $id . ' ' . $th->getMessage(), $context );176 $logger->error( 'Error ing image on product, ID: . ' . $id . ' ' . $th->getMessage(), $context ); 160 177 } 161 178 } 162 } else { 163 $logger->info( 'Adding image for new product, ID: ' . $id, $context ); 164 // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 165 try { 166 $image_result = media_sideload_image( $data->imageUrl, $id, $data->identifier, 'id' ); 167 168 if( is_wp_error( $image_result ) ){ 169 throw new \Exception( $image_result->get_error_message() ); 170 } 171 172 $product->set_image_id( $image_result ); 173 $product->save(); 174 } catch ( \Throwable $th ) { 175 $logger->error( 'Error fetching image on product, ID: . ' . $id . ' ' . $th->getMessage(), $context ); 176 } 177 } 179 } 178 180 179 181 if ( 'yes' === get_option( 'wcsnapplify_auto_publish' ) ) { -
snapplify-e-commerce/trunk/public/class-snapplify-ecommerce-public.php
r2799948 r2825069 92 92 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/snapplify-ecommerce-public.js', array( 'jquery' ), $this->version, false ); 93 93 } 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 94 139 } -
snapplify-e-commerce/trunk/snapplify-ecommerce.php
r2806512 r2825069 11 11 * Plugin URI: https://www.snapplify.com/snapplify-ecommerce 12 12 * Description: Offer Snapplify products in your WooCommerce Store that can be redeemed using a voucher. 13 * Version: 1.0. 213 * Version: 1.0. 14 14 * Author: Snapplify 15 15 * Author URI: https://snapplify.com
Note: See TracChangeset
for help on using the changeset viewer.