ibtekarlabs
Forum Replies Created
-
Forum: Plugins
In reply to: [Wallet for WooCommerce] _load_textdomain_just_in_time()Hi,
Had same issue, modified the plugin code temporary until its fixed in future updates.
just delay theWooWallet::instance()call until plugins loaded
In woo-wallet.php
replace:$GLOBALS['woo_wallet'] = woo_wallet();
with:add_action('init', function () {
$GLOBALS['woo_wallet'] = woo_wallet();
});Hello again,
I just wanted to give you a quick heads-up about another small PHP deprecation warning I noticed[09-Mar-2025 21:48:45 UTC] PHP Deprecated: Implicit conversion from float 1093477.5 to int loses precision in /bitnami/wordpress/wp-content/plugins/mpdf-addon-for-pdf-invoices/vendor/mpdf/mpdf/src/Mpdf.php on line 15244Thank you
Forum: Plugins
In reply to: [Organization chart] Multilingual SupportHi @wpdevart,
Noted, thank you.
Incase anyone interested in making the chart translatable we adjustedconstruct_nodesfunction in thewpda_org_chart_front_tree_makerclass to make the note title and description translatable using wordpress localization functions:esc_html__( $this->remove_js_and_js_atributes_from_content(htmlspecialchars_decode($node['node_info']['node_description'])), 'wpdevart-org-chart' );esc_html__( $this->remove_js_and_js_atributes_from_content(htmlspecialchars_decode($node['node_info']['node_title'])), 'wpdevart-org-chart' );Noted!
Thank you.Hello,
Thank you for your fast response.
I created the following function which seems to be doing the job.function get_nextgen_image($attachment_id, $size = 'full', $additional_attrs = array()) {
// Get the image attributes for the requested size
$image_src = wp_get_attachment_image_src($attachment_id, $size);
$image_srcset = wp_get_attachment_image_srcset($attachment_id, $size);
$image_sizes = wp_get_attachment_image_sizes($attachment_id, $size);
// If no image is found, return an empty string
if (!$image_src) {
return '';
}
// Get the WebP version URL
$image_webp_src = $image_src[0] . '.webp';
// Check if the WebP version exists
$webp_exists = file_exists(str_replace(get_home_url(), ABSPATH, $image_webp_src));
// Prepare additional attributes
$attr_string = '';
foreach ($additional_attrs as $attr_name => $attr_value) {
$attr_string .= sprintf(' %s="%s"', $attr_name, esc_attr($attr_value));
}
// Build the <picture> element only if WebP exists
$image_html = '<picture decoding="async" ' . $attr_string . '>';
if ($webp_exists) {
$image_webp_srcset = str_replace(['.png', '.jpg'], ['.png.webp', '.jpg.webp'], $image_srcset);
$image_html .= '<source type="image/webp" srcset="' . esc_attr($image_webp_srcset) . '" sizes="' . esc_attr($image_sizes) . '">';
}
// Fallback <img> tag
$image_html .= '<img src="' . esc_url($image_src[0]) . '" srcset="' . esc_attr($image_srcset) . '" sizes="' . esc_attr($image_sizes) . '" width="' . esc_attr($image_src[1]) . '" height="' . esc_attr($image_src[2]) . '" alt="' . esc_attr(get_the_title($attachment_id)) . '" loading="lazy" decoding="async">';
$image_html .= '</picture>';
return $image_html;
}However, am wondering if I can use any of Imagify function to check the availability of the .webp version instead of the manual approach I used in the code. Are there specific Imagify functions, hooks, or filters designed for this purpose?
thank you ,Forum: Plugins
In reply to: [Payment Plugins for Stripe WooCommerce] Get Card Issuer or BINHello @mrclayton,
Thank you the filter worked perfectly!add_filter('wc_stripe_get_error_messages', 'custom_stripe_error_messages', 10, 1);
function custom_stripe_error_messages($error_messages) {
if (isset($error_messages['generic_decline'])) {
// Check if a coupon code is applied
$applied_coupons = WC()->cart->get_applied_coupons();
if (!empty($applied_coupons)) {
$coupon_code = implode(', ', $applied_coupons);
$error_messages['generic_decline'] = 'The card was declined. Make sure the card used is eligible to be used with the coupon: ' . $coupon_code;
}
}
return $error_messages;
}Forum: Plugins
In reply to: [Payment Plugins for Stripe WooCommerce] Get Card Issuer or BINThe workaround worked with me,
add_filter('wc_stripe_payment_intent_args', 'add_coupon_to_stripe_metadata', 10, 2);
function add_coupon_to_stripe_metadata($args, $order) {
$coupons = $order->get_coupon_codes();
if (!empty($coupons)) {
$uppercase_coupons = array_map('strtoupper', $coupons);
$args['metadata']['coupon'] = implode(', ', $uppercase_coupons);
} else {
$args['metadata']['coupon'] = '';
}
return $args;
}For the Card BIN I had to create a list @adcb_bin with all the BIN numbers for the bank and used the following radar rule
Block if (::coupon:: = ‘DISCOUNT’) AND not(:card_bin: IN @adcb_bin)
Now when the rule applies I get that error message in woocommerce “The card has been declined for an unknown reason.” am wondering if it’s possible to customize the message based on the returned error code
Forum: Plugins
In reply to: [Payment Plugins for Stripe WooCommerce] Get Card Issuer or BINHi @mrclayton,
Thank you will try to implement that workaround and update the ticket with the codes
Regards,Forum: Plugins
In reply to: [Payment Plugins for Stripe WooCommerce] Get Card Issuer or BINHi @mrclayton,
Seems that the only way to control that is to use the Stripe Radar (https://docs.stripe.com/radar/rules/supported-attributes) , which allow blocking transactions based on certain rules.
something like this would work I think
Block if (::Discount_Coupon:: = ‘adb15’) AND (:card_bin: != ‘123456’ OR :card_bin: != ‘234567’)
but is discount_coupon passed to stripe as metadata ?
regardsForum: Plugins
In reply to: [Payment Plugins for Stripe WooCommerce] Get Card Issuer or BIN@mrclayton
Hello,
Actually the website owner would like to provide Coupon discount for certain bank customers only as a deal between the store and the bank.
So I need to get the Card issuer/Card_BIN after the card number filled, to verify if the order is eligible for the discount or not.
In case I get care issuer information I can directly validate.
In case it possible to get the Card BIN# I will use it the API from https://www.handyapi.com/ to get the bank name and validate.Thank you, I have enabled the Apple and google pay Express checkout.
Hi @wfphil,
Done!Forum: Fixing WordPress
In reply to: Theme editor ‘Content-Type: text/html’ issueHi @mrtom414
Am not having any issue with my theme, am just stating an issue with the wordpress theme editor that any kind of file even if it’s .txt if it has ‘Content-Type: text/html’ it cant be updated and you get this error: ‘Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over http://FTP.’Forum: Fixing WordPress
In reply to: Error in tiny_mceHello @terra3110,
Try to check if you get the same error in another browser, I had the same issue and it was caused by ‘Honey’ Browser extension.- This reply was modified 2 years, 9 months ago by ibtekarlabs.
Hi @wfphil
According the the guide added the following code to the .htaccess for the subdirectory but still facing same issue.<IfModule mod_php7.c>
php_value auto_prepend_file none
</IfModule>