PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.1
ShopBuilder – WooCommerce Builder For Elementor v3.2.1
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/AI/AiController.php +2 -9 3.4.13.2.1 View file →
@@ -38,13 +38,8 @@
38 38 public function handle_product_save( $post_id, $post ) {
39 39 if ( 'publish' !== $post->post_status ) {
40 40 return;
41 41 }
42 - $ai_data = AIFns::activated_ai_data();
43 -
44 - if ( empty( $ai_data['api_key'] ) || empty( $ai_data['client'] ) ) {
45 - return;
46 - }
47 42 $title = $post->post_title;
48 43 $content = $post->post_content;
49 44 $service = DataEmbedding::instance();
50 45 $embedded = $service->generate_and_store( $post_id, $title, $content );
@@ -75,8 +70,9 @@
75 70 update_option(
76 71 'rtsb_embedding_progress',
77 72 [
78 73 'processed' => 0,
74 + 'total' => AIFns::need_product_embedding(),
79 75 ]
80 76 );
81 77 }
82 78
@@ -84,12 +80,8 @@
84 80 /**
85 81 * @return void
86 82 */
87 83 public function process_batch() {
88 - $ai_data = AIFns::activated_ai_data();
89 - if ( empty( $ai_data['api_key'] ) ) {
90 - return;
91 - }
92 84 $products = get_posts(
93 85 [
94 86 'post_type' => 'product',
95 87 'post_status' => 'publish',
@@ -122,8 +114,9 @@
122 114 $progress = get_option(
123 115 'rtsb_embedding_progress',
124 116 [
125 117 'processed' => 0,
118 + 'total' => 0,
126 119 ]
127 120 );
128 121 $progress['processed'] += count( $products );
129 122 update_option( 'rtsb_embedding_progress', $progress );