| @@ -353,9 +353,9 @@ | ||
| 353 | 353 | if ( isset($product) && $product->get_type() === 'variation' ) { |
| 354 | 354 | $new_order['var_product_id'] = $item->get_variation_id(); |
| 355 | 355 | } |
| 356 | 356 | $new_order['product_id'] = $item->get_product_id(); |
| 357 | - $new_order['title'] = strip_tags($product_data['title']); | |
| 357 | + $new_order['title'] = wp_strip_all_tags($product_data['title']); | |
| 358 | 358 | $new_order['link'] = $product_data['link']; |
| 359 | 359 | } |
| 360 | 360 | if($date && method_exists($date, 'getTimestamp')){ |
| 361 | 361 | $new_order['timestamp'] = $date->getTimestamp(); |
| @@ -428,9 +428,9 @@ | ||
| 428 | 428 | public function get_orders($data = array()) { |
| 429 | 429 | if (empty($data) || !function_exists('wc_get_orders')) return null; |
| 430 | 430 | $orders = []; |
| 431 | 431 | $time = Helper::generate_time_string($data); |
| 432 | - $from = strtotime(date('Y-m-d h:i', $time)); | |
| 432 | + $from = strtotime(gmdate('Y-m-d h:i', $time)); | |
| 433 | 433 | $status = !empty($data['order_status']) ? $data['order_status'] : ['wc-completed', 'wc-processing']; |
| 434 | 434 | $wc_orders = \wc_get_orders([ |
| 435 | 435 | 'status' => $status, |
| 436 | 436 | 'date_created' => '>' . $from, |
| @@ -467,8 +467,9 @@ | ||
| 467 | 467 | |
| 468 | 468 | |
| 469 | 469 | public function wpml_translate($entry, $settings) { |
| 470 | 470 | if(!empty($entry['product_id'])){ |
| 471 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context. | |
| 471 | 472 | $product_id = apply_filters( 'wpml_object_id', $entry['product_id'], 'product', false); |
| 472 | 473 | $product = wc_get_product($product_id); |
| 473 | 474 | if($product){ |
| 474 | 475 | // $current_lang = apply_filters( 'wpml_current_language', NULL ); |
| @@ -489,8 +490,9 @@ | ||
| 489 | 490 | return $link; |
| 490 | 491 | } |
| 491 | 492 | |
| 492 | 493 | public function multiorder_combine($data, $settings) { |
| 494 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context. | |
| 493 | 495 | $should_combine = apply_filters('nx_should_combine', true, $data, $settings); |
| 494 | 496 | if (!$should_combine || empty($settings['combine_multiorder']) || intval($settings['combine_multiorder']) != 1 ) { |
| 495 | 497 | return $data; |
| 496 | 498 | } |
| @@ -525,25 +527,28 @@ | ||
| 525 | 527 | $item_titles[$key] |
| 526 | 528 | ); |
| 527 | 529 | } else { |
| 528 | 530 | $singular = !empty($settings['combine_multiorder_text']) |
| 529 | - ? __($settings['combine_multiorder_text'], 'notificationx') | |
| 531 | + ? $settings['combine_multiorder_text'] | |
| 530 | 532 | : __('more product', 'notificationx'); |
| 531 | 533 | |
| 532 | 534 | $plural = !empty($settings['combine_multiorder_text_plural']) |
| 533 | - ? __($settings['combine_multiorder_text_plural'], 'notificationx') | |
| 535 | + ? $settings['combine_multiorder_text_plural'] | |
| 534 | 536 | : __('more products', 'notificationx'); |
| 535 | 537 | |
| 536 | - // Proper plural handling | |
| 538 | + // Both forms are already resolved here - either a user-entered | |
| 539 | + // override or an already-translated default - so they are never | |
| 540 | + // catalogue msgids. _n() would find no entry and fall back to | |
| 541 | + // exactly this choice, so make it explicit. | |
| 537 | 542 | $more_product_text = sprintf( |
| 538 | - _n($singular, $plural, $item, 'notificationx'), | |
| 543 | + 1 == $item ? $singular : $plural, | |
| 539 | 544 | $item |
| 540 | 545 | ); |
| 541 | 546 | $products_more_title = sprintf('%d %s', $item, $more_product_text); |
| 542 | 547 | } |
| 543 | 548 | |
| 544 | - // translators: %1$s: title, %2$s: combined more products text. | |
| 545 | 549 | $items[$key]['title'] = sprintf( |
| 550 | + /* translators: %1$s: product title, %2$s: combined "and N more products" text */ | |
| 546 | 551 | __('%1$s & %2$s', 'notificationx'), |
| 547 | 552 | $items[$key]['title'], |
| 548 | 553 | $products_more_title |
| 549 | 554 | ); |
| @@ -602,8 +607,9 @@ | ||
| 602 | 607 | return $data; |
| 603 | 608 | } |
| 604 | 609 | |
| 605 | 610 | public function doc(){ |
| 611 | + /* translators: %1$s: WooCommerce installed & activated link URL, %2$s: documentation link URL, %3$s: Watch video tutorial link URL, %4$s: Best FOMO and Social Proof Plugin link URL, %5$s: boost WooCommerce Sales link URL */ | |
| 606 | 612 | return sprintf(__('<p>Make sure that you have <a target="_blank" href="%1$s">WooCommerce installed & activated</a> to use this campaign. For further assistance, check out our step by step <a target="_blank" href="%2$s">documentation</a>.</p> |
| 607 | 613 | <p>🎦 <a href="%3$s" target="_blank">Watch video tutorial</a> to learn quickly</p> |
| 608 | 614 | <p>⭐ NotificationX Integration with WooCommerce</p> |
| 609 | 615 | <p><strong>Recommended Blog:</strong></p> |