[2 lines collapsed] * Plugin Name: SBI ePay for WooCommerce * Plugin URI: https://icariivr.org.in * Description: SBI ePay payment gateway + India Post order tracking (admin form, customer My Account). * Version: 1.4.13 * Version: 1.4.14 * Author: ICAR IIVR * Text Domain: sbi-epay-woocommerce * Requires at least: 5.0 * Requires PHP: 8.2 * WC requires at least: 4.0 * WC tested up to: 8.x */ defined('ABSPATH') || exit; if (!defined('SBI_EPAY_VERSION')) { define('SBI_EPAY_VERSION', '1.4.13'); define('SBI_EPAY_VERSION', '1.4.14'); } /** [339 lines collapsed] $order->delete_meta_data('_sbi_invoice_attachment_mime'); $order->delete_meta_data('_sbi_invoice_customer_sent'); $order->delete_meta_data('_sbi_invoice_manager_sent'); $order->delete_meta_data('_sbi_order_confirm_customer_sent'); $order->delete_meta_data('_sbi_order_confirm_manager_sent'); $order->save(); if ($attach !== '' && is_file($attach)) { [113 lines collapsed] } function sbi_epay_build_invoice_html($order, $invoice_number, $for_pdf = false) { $logo_src = sbi_epay_invoice_logo_src_for_pdf(); // Base64 logo only in PDF — embedding it in HTML email can stall SMTP and block other order mail. $logo_src = $for_pdf ? sbi_epay_invoice_logo_src_for_pdf() : ''; if ($logo_src === '' && !$for_pdf) { $logo_file = plugin_dir_path(__FILE__) . 'assets/icar-logo.png'; if (is_readable($logo_file)) { $logo_src = plugins_url('assets/icar-logo.png', __FILE__); } } $logo_block = $logo_src !== '' ? '' : ''; [9 lines collapsed] $payment_title = $order->get_payment_method_title(); $payment_label = $payment_title !== '' ? $payment_title : 'SBIePay'; $billing_html = sbi_epay_invoice_format_address_html($order, 'billing'); $billing_html = function_exists('sbi_epay_invoice_format_address_html') ? sbi_epay_invoice_format_address_html($order, 'billing') : wp_kses_post($order->get_formatted_billing_address()); if ($billing_html === '') { $billing_html = esc_html__('—', 'sbi-epay-woocommerce'); } $shipping_html = sbi_epay_invoice_format_address_html($order, 'shipping'); $shipping_html = function_exists('sbi_epay_invoice_format_address_html') ? sbi_epay_invoice_format_address_html($order, 'shipping') : wp_kses_post($order->get_formatted_shipping_address()); // Always print a shipping block: use shipping address, else fall back to billing. if ($shipping_html === '') { $shipping_html = $billing_html; [257 lines collapsed] return array($html_path, 'text/html'); } function sbi_epay_mail_invoice_if_needed($order_id, $force_resend = false) { /** * Lightweight paid-order confirmation (no PDF). Sent before invoice so a Dompdf/SMTP * failure cannot swallow shop + customer order mail. * * @param int $order_id Order ID. * @param bool $force Resend even if already marked sent. * @return bool True if at least one confirmation mail was attempted successfully. */ function sbi_epay_send_paid_order_confirmations($order_id, $force = false) { if (!function_exists('wc_get_order')) { return; return false; } $order = wc_get_order($order_id); if (!$order || !is_a($order, 'WC_Order') || !sbi_epay_order_qualifies_for_invoice($order)) { return; return false; } if ($force_resend) { $order->delete_meta_data('_sbi_invoice_customer_sent'); $order->delete_meta_data('_sbi_invoice_manager_sent'); $order->save(); } list($attach_path, $mime) = sbi_epay_generate_invoice_attachment($order, $force_resend); if ($attach_path === '' || !is_readable($attach_path)) { $order->add_order_note(__('SBI ePay: Invoice file could not be created. Check uploads folder permissions or Dompdf vendor/.', 'sbi-epay-woocommerce')); $order->save(); return; } $invoice_number = absint($order->get_meta('_sbi_invoice_number', true)); $any_ok = false; $headers = sbi_epay_mail_headers(); $use_html_inline = ($mime === 'text/html' || preg_match('/\.html$/i', $attach_path)); $attachments = $use_html_inline ? array() : array($attach_path); $customer_email = sanitize_email($order->get_billing_email()); if (is_email($customer_email) && ($force_resend || !$order->get_meta('_sbi_invoice_customer_sent', true))) { if (is_email($customer_email) && ($force || !$order->get_meta('_sbi_order_confirm_customer_sent', true))) { $subject = sprintf( /* translators: 1: invoice number, 2: order number */ __('Invoice #%1$s for order #%2$s – ICAR-IIVR Seed Portal', 'sbi-epay-woocommerce'), $invoice_number, /* translators: %s: order number */ __('Order confirmation #%s – ICAR-IIVR Seed Portal', 'sbi-epay-woocommerce'), $order->get_order_number() ); if ($use_html_inline) { $intro = '

' . sprintf( /* translators: %s: customer first name */ esc_html__('Hello %s,', 'sbi-epay-woocommerce'), esc_html($order->get_billing_first_name() ?: __('Customer', 'sbi-epay-woocommerce')) ) . '

' . '

' . esc_html__('Your invoice is shown below. Thank you for your order. You can print this email or save it as a PDF from your mail program if you need a file copy.', 'sbi-epay-woocommerce') . '

'; $body = $intro . '
' . sbi_epay_extract_invoice_body_inner(sbi_epay_build_invoice_html($order, $invoice_number)) . '
'; } else { $body = '

' . sprintf( /* translators: %s: customer first name */ esc_html__('Hello %s,', 'sbi-epay-woocommerce'), esc_html($order->get_billing_first_name() ?: __('Customer', 'sbi-epay-woocommerce')) ) . '

' . '

' . esc_html__('Please find your invoice attached. Thank you for your order.', 'sbi-epay-woocommerce') . '

'; $lines = ''; foreach ($order->get_items() as $item) { $qty = (float) $item->get_quantity(); $lines .= '
  • ' . esc_html($item->get_name()) . ' × ' . esc_html(wc_format_decimal($qty, 0)) . '
  • '; } if (wp_mail($customer_email, $subject, $body, $headers, $attachments)) { $order->update_meta_data('_sbi_invoice_customer_sent', 'yes'); $body = '
    '; $body .= '

    ' . sprintf( /* translators: %s: customer first name */ esc_html__('Hello %s,', 'sbi-epay-woocommerce'), esc_html($order->get_billing_first_name() ?: __('Customer', 'sbi-epay-woocommerce')) ) . '

    '; $body .= '

    ' . esc_html__('Thank you. We have received your paid order. This is your confirmation.', 'sbi-epay-woocommerce') . '

    '; $body .= '

    ' . esc_html__('Order:', 'sbi-epay-woocommerce') . ' #' . esc_html($order->get_order_number()) . '
    '; $body .= '' . esc_html__('Total:', 'sbi-epay-woocommerce') . ' ' . esc_html(wp_strip_all_tags($order->get_formatted_order_total())) . '

    '; if ($lines !== '') { $body .= '

    ' . esc_html__('Items:', 'sbi-epay-woocommerce') . '

    '; } $body .= '

    ' . esc_html__('Your invoice is sent in a separate email.', 'sbi-epay-woocommerce') . '

    '; $body .= '
    '; if (wp_mail($customer_email, $subject, $body, $headers)) { $order->update_meta_data('_sbi_order_confirm_customer_sent', 'yes'); $any_ok = true; } else { $order->add_order_note(sprintf( /* translators: %s: customer email */ __('SBI ePay: Invoice email to customer (%s) failed — check WordPress mail / SMTP.', 'sbi-epay-woocommerce'), __('SBI ePay: Order confirmation to customer (%s) failed — check WordPress mail / SMTP.', 'sbi-epay-woocommerce'), $customer_email )); } } $manager_sent = false; foreach (sbi_epay_get_shop_manager_emails() as $manager_email) { if (!$force_resend && $order->get_meta('_sbi_invoice_manager_sent', true)) { Dr. Shailesh Kumar Tiwari - ICAR-IIVR | Indian Institute of Vegetable Research
    Text size

    Profile & Professional Details

    Institute: ICAR-Indian Institute of Vegetable Research, Varanasi

    Email: tiwarishailu@gmail.com

    Mobile: +91-9473877501; +91-8318669811 (Whatsapp)

    Field of Specialization

    Vegetable Breeding, Plant Genetic Resources

    Research Interests

    Genetic improvement of brinjal. Understanding and managing biotic and abiotic stresses in brinjal crops and developing resistant and high yielding varieties/hybrids through conventional and modern breeding approaches.

    Educational Qualification (Undergraduate Onwards)

    • B.Sc. (Agriculture), Jawaharlal Nehru Krishi Vishwavidyalaya, Jabalpur, 1998.
    • M.Sc. (Plant Genetic Resources), ICAR-Indian Agricultural Research Institute, New Delhi, 2001.
    • Ph.D. (Plant Genetic Resources), ICAR-Indian Agricultural Research Institute, New Delhi, 2007.

    Professional Experience

    • Senior Scientist (Genetics and Plant Breeding), Division of Vegetable Improvement, ICAR-IIVR, Varanasi (2017 – Present).
    • Scientist (Genetics and Plant Breeding), Division of Vegetable Improvement, ICAR-IIVR, Varanasi (2009 – 2017).
    • Research Associate, ICAR-NBPGR, New Delhi – ICAR funded “Technology Mission on Cotton” (2008 – 2009).

    Publications

    1. Verma S. et al. (2007). Genetic diversity in Eremostachys superba Royle ex Benth. Genetic Resources and Crop Evolution, 54: 221-229.
    2. Kumar G. et al. (2008). Morphological diversity in brinjal germplasm accessions. Plant Genetic Resources: Evaluation and Utilization, 6: 232-236.
    3. Gupta S. et al. (2008). ISSR and RAPD markers analysis in Jatropha curcas. African Journal of Biotechnology, 7: 4230-4243.
    4. Mishra G.P. et al. (2008). Inheritance of lentil resistance to rust. Indian Journal of Agricultural Sciences, 78: 994-996.
    5. Tiwari Shailesh K. et al. (2009). Molecular characterization of brinjal cultivars. Journal of Plant Biochemistry and Biotechnology, 18: 189-195.
    6. Singh B.K. et al. (2012). Transferability of Brassica-derived microsatellites. National Academy Science Letters, 35 (1): 37-44.
    7. Kumar G. et al. (2013). Diversity analysis in eggplant germplasm using DIVA-GIS approach. Indian Journal of Horticulture, 70 (4): 519-525.
    8. Yasin J.K. et al. (2014). Alternate defence mechanisms for moisture stress in Horse gram. Legume Research, 37 (2): 139-148.
    9. Singh P.K. et al. (2016). Antioxidant and phytochemical levels in water spinach. Indian Journal of Agricultural Sciences, 86 (3): 347-354.
    10. Dixit J. et al. (2024). Direct shoot regeneration and genetic fidelity assessment in Uraria picta. Industrial Crops and Products, 219: 119064.