8000 Having Postie enabled slows down CP · Issue #156 · verbb/postie · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Having Postie enabled slows down CP #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hassanmah opened this issue Apr 25, 2025 · 3 comments
Open

Having Postie enabled slows down CP #156

hassanmah opened this issue Apr 25, 2025 · 3 comments

Comments

@hassanmah
Copy link

Describe the bug

Having Postie enabled slows down the CP a lot, it's impossible to navigate at times.

Here is a video of first Postie enables and navigating to Utilities, then having it disabled and doing the same thing https://share.krafft.digital/kcKD7nkF

This is my config file.


return [
    '*' => [
        'pluginName' => 'Postie',
        'enableCaching' => true,
        'enableRouteCheck' => true,
        'shippedOrderStatus' => 'shipped',
        'partiallyShippedOrderStatus' => 'partiallyShipped',
        'routesChecks' => [
            '/{cpTrigger}/commerce/orders/\d+',
            '/checkout',
        ],
    ]
];

Steps to reproduce

  1. Have Postie enabled
  2. Navigate CP
  3. Disable Postie
  4. Navigate CP

Craft CMS version

5.7.2

Plugin version

5.0.9

Multi-site?

Yes

Additional context

This only happens when Postie is enabled.

@engram-design
Copy link
Member

This is probably linked to the Variants query we do to show the badge on the left-hand side menu for showing the number of invalid variants (with no dimensions/weights).

It's possibly something we can remove. It's also something you can double check by modifying the query.

use verbb\postie\postie\Postie;
use verbb\postie\events\ModifyShippableVariantsEvent;
use yii\base\Event;

Event::on(Postie::class, Postie::EVENT_MODIFY_VARIANT_QUERY, function(ModifyShippableVariantsEvent $event) {
    $event->query->limit(1);
});

Keen to see if that makes a difference!

@hassanmah
Copy link
Author

@engram-design ah yes that query modification seems to fix it. CP is back to normal speed with Postie enabled

@engram-design
Copy link
Member

Great, and good to know. We'll likely remove that badge as even a cached value here isn't really going to be helpful, and it's just a performance hit for something not really that necessary!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0