Forum Replies Created

Viewing 15 replies - 1 through 15 (of 18 total)
  • Hi @wpo365 ,

    unfortunately this still isn’t working on my end. Opening /wp-admin redirects to the sso/start endpoint but never reaches login.microsoftonline.com – it just stays on the spinner.

    Example URL: https://www.depak.de/wp/wp-admin/
    → redirects to https://www.depak.de/wpo/sso/start (and stops there)

    I have these two plugins:

    • WPO365 | LOGIN – version 42.4
    • WPO365 | LOGIN PLUS – version 42.1

    Quick Update: version 42.3 worked fine before

    Thanks,
    Simon

    • This reply was modified 1 week, 3 days ago by Simon Mista.

    I have the same issue with versions 42.2 and 42.1. The “redirect to front page” error occurs when trying to access /wp-admin or when clicking “Sign in with Microsoft”. Instead of redirecting to Microsoft login, the site redirects back to the homepage. Because of this, I downgraded to version 42.0, and that version works correctly.

    Please fix this issue ASAP @wpo365

    Thanks, Simon

    Thread Starter Simon Mista

    (@simonmista)

    @subratamal any updates on this issue? It’s still not working with SSO-created users, even though the user_register hook is firing correctly.

    Thread Starter Simon Mista

    (@simonmista)

    Hello @subratamal ,
    Do you have any updates or further suggestions on this?

    Thread Starter Simon Mista

    (@simonmista)

    Hi @subratamal ,
    The user_register hook is firing correctly — confirmed in the log:

    [08-Oct-2025 14:58:48 UTC] [user_register] fired for user_id=603

    Tested with:

    add_action(‘user_register’, function ($user_id) {
    error_log(‘[user_register] fired for user_id=’ . $user_id);
    }, 10, 1);

    However, the user still receives no initial credit (0.00 €).

    Could you please take a look at this? Thanks.

    Thread Starter Simon Mista

    (@simonmista)

    Any update on this issue?

    Thread Starter Simon Mista

    (@simonmista)

    I took a quick look at the 2.14.8 code and found the issue in includes/modules/labels-edit/index.php: the module loads on the init hook, which fires too late for the label-saving routine.

    Quick fix

    Open the file, scroll to line 547 and change

    add_action( 'init', 'pms_in_le_init' );
    to
    add_action( 'plugins_loaded', 'pms_in_le_init' );

    Save, refresh the admin page and the “Labels Edit” panel will accept new or edited labels again.

    Hi @19db ,

    Thank you for pointing out the importance of considering multiple VAT rates in the cart. To address this, I’ve updated the code to dynamically calculate a weighted VAT percentage based on the items in the cart. This ensures that the VAT applied to the wallet deduction is accurate even when there are multiple tax rates involved.

    add_action('woocommerce_cart_calculate_fees', function ($cart) {
    if (is_admin() && !defined('DOING_AJAX')) {
    return;
    }

    foreach ($cart->get_fees() as $fee) {
    if (isset($fee->id) && strpos($fee->id, 'wallet') !== false) {
    $original_fee_amount = $fee->amount; // Original net wallet deduction
    $total_vat_percentage = 0;
    $total_cart_net = 0;

    // Calculate weighted VAT percentage based on cart items
    foreach ($cart->get_cart() as $cart_item) {
    $product = $cart_item['data'];
    $tax_class = $product->get_tax_class(); // Product tax class
    $tax_rates = WC_Tax::get_rates($tax_class); // Tax rates based on tax class

    // Get the tax rate
    $tax_rate = !empty($tax_rates) ? array_shift($tax_rates) : null;
    $vat_percentage = isset($tax_rate['rate']) ? floatval($tax_rate['rate']) : 0;

    // Net price of the product item
    $product_price_net = $cart_item['line_total'];
    $total_cart_net += $product_price_net;

    // Add to weighted VAT percentage
    $total_vat_percentage += ($product_price_net / $cart->get_subtotal()) * $vat_percentage;
    }

    // Apply the weighted VAT percentage to the wallet deduction amount
    $fee->amount = $original_fee_amount * (1 + ($total_vat_percentage / 100));
    $fee->total = $fee->amount;

    // Debugging data
    $debug_data = [
    'fee' => [
    'fee_id' => $fee->id,
    'original_amount' => $original_fee_amount,
    'new_amount_with_vat' => $fee->amount,
    ],
    'weighted_vat_percentage' => $total_vat_percentage,
    'total_cart_net' => $total_cart_net,
    ];
    error_log(print_r($debug_data, true)); // Debug log for further analysis
    }
    }
    }, 9999);

    Explanation:

    1. Weighted VAT Percentage: The VAT percentage is calculated dynamically as a weighted average based on the net price of each cart item, ensuring that mixed VAT rates are handled accurately.
    2. Dynamic Wallet Deduction Adjustment: The wallet deduction (fee) is adjusted to include the weighted VAT, ensuring the gross value of the wallet is deducted correctly from the cart total.
    3. Debugging: The code includes an error log (error_log) that records the calculations, including the original fee amount, the weighted VAT percentage, and the final adjusted fee amount, to verify the results.

    Note: This code only works correctly when combined with the following WooCommerce modification:
    /woocommerce/includes/class-wc-cart-totals.php

    $max_discount = round( $this->get_total( 'items_total', true ) + $fee_running_total + $this->get_total( 'shipping_total', true ) + array_sum( $this->get_tax_class_costs() ) ) * -1;

    This approach ensures that the VAT calculations are accurate and consistent for carts with multiple VAT rates.

    @subratamal , could you please contact the WooCommerce support team to address these calculation issues and explain the problem? Additionally, it would be great if you could consider integrating my code into the plugin to ensure accurate VAT calculations.

    Best regards,
    Simon

    Thread Starter Simon Mista

    (@simonmista)

    Yes, thank you.
    this version now seems to work without errors.

    Thread Starter Simon Mista

    (@simonmista)

    Hi @amagsumov
    Take a look at this PHP Notice.
    (there is no stack trace available. Your plugin loads the textdomain to early) – This message was added in version WP Core -> 6.7.0.

    [17-Dec-2024 18:53:23 UTC] PHP Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the cleantalk-spam-protect domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /wp-includes/functions.php on line 6114

    PHP Version: v8.3.14
    WordPress Core: v6.7.0
    CleanTalk: v6.46

    For my setup, it only works correctly if I replace the following line of code:

    $max_discount = round( $this->get_total( 'items_total', true ) + $fee_running_total + $this->get_total( 'shipping_total', true ) + array_sum( $this->get_tax_class_costs() ) ) * -1;
    ------------> includes/class-wc-cart-total.php line no 285

    Additionally, I’ve added the following code to my theme:



    add_action('woocommerce_cart_calculate_fees', function ($cart) {
    foreach ($cart->get_fees() as $fee) {
    if (isset($fee->id) && strpos($fee->id, 'wallet') !== false) {
    $fee->amount = $fee->amount * (1 + 0.19);
    $fee->total = $fee->amount;
    }
    }
    }, 9999);

    Could you please take a look at this? This issue has been around for over 4 years… https://github.com/woocommerce/woocommerce/issues/28028

    I am experiencing a similar issue with the WooWallet plugin. The wallet balance is displayed correctly in the info window, but when applied during checkout, the deducted amount does not match the announced gross value. Instead, the deduction seems to be based on the net value, leading to inconsistencies in the final cart totals.

    For example:

    • Wallet balance: 10 € (Gross)
    • Expected deduction: -10 €
    • Actual deduction: -8.40 € (Net)

    This issue becomes even more apparent when the cart total is close to the available wallet balance. The system seems to incorrectly calculate the deduction based on the net value of the wallet, even though the gross value was announced in the info window.

    Can you confirm if the current logic refers to the net value of the cart instead of the gross value during calculation? If so, could the logic be updated to ensure that the gross wallet balance is applied consistently without modifying the cart VAT amount?

    Thank you for your help!

    Best regards,
    Simon

    Forum: Plugins
    In reply to: [WP-SCSS] 3.0 PHP Errors

    This Error is coused by this “Development Settings” -> “Always Recompile”

    u have to disable this option first before update.

    yea …
    Fatal error: Uncaught Error: Class ‘ScssPhp\ScssPhp\Block\MediaBlock’ not found in /xxxxxxxx/plugins/wp-scss/scssphp/src/Parser.php:477

    This Error is coused by this “Development Settings” -> “Always Recompile”

    • This reply was modified 3 years, 6 months ago by Simon Mista.
    Thread Starter Simon Mista

    (@simonmista)

    ok thanks,
    but this solution is not working if you dont have MANUALLY added any page here:
    /wp-admin/admin.php?page=aioseo-sitemaps#/general-sitemap

    is this correct ?

Viewing 15 replies - 1 through 15 (of 18 total)