Title: pexila's Replies | WordPress.org

---

# pexila

  [  ](https://wordpress.org/support/users/pexila/)

 *   [Profile](https://wordpress.org/support/users/pexila/)
 *   [Topics Started](https://wordpress.org/support/users/pexila/topics/)
 *   [Replies Created](https://wordpress.org/support/users/pexila/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/pexila/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/pexila/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/pexila/engagements/)
 *   [Favorites](https://wordpress.org/support/users/pexila/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[StellarPay - Stripe Payment Gateway for WooCommerce] The Plugin is to heavy and slow down the website significantly](https://wordpress.org/support/topic/the-plugin-is-to-heavy-and-slow-down-the-website-significantly/)
 *  [pexila](https://wordpress.org/support/users/pexila/)
 * (@pexila)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/the-plugin-is-to-heavy-and-slow-down-the-website-significantly/#post-18696848)
 * Hello there, i would like to say we had the same issue with cache. he is there
   exact reason why your plugin has conflict with caching. The `Cache‑Control` header
   is set to `no‑cache, must‑revalidate, max‑age=0, no‑store, private` and the `
   Pragma` header is `no‑cache`. StallerPay registers a `DeletePaymentMethod` controller
   on every front‑end page via `Hooks::addAction('wp', DeletePaymentMethod::class,'
   __invoke', 9)` in the WooCommerce service provider. When that controller runs,
   it checks whether the `delete-payment-method` query variable is present. If **
   it isn’t present**, it calls `wc_nocache_headers()`
   solution?
 * <?php
   // Disable StallerPay’s DeletePaymentMethod hook.// Note: no leading backslash
   in the class; double backslashes escape the backslash characters in the string.
   add_filter(‘stellarpay_disable_hook-wp:StellarPay\Integrations\WooCommerce\Stripe\
   Controllers\DeletePaymentMethod@__invoke’,‘__return_true’);
 * // Optional: re‑implement the delete-payment-method logic without sending no‑
   cache headers
   add_action(‘wp’, function () {// Only handle actual delete‑payment‑
   method requestsif (!isset($GLOBALS[‘wp’]->query_vars[‘delete-payment-method’])){
   return;}
 *     ```wp-block-code
       // Uncomment the next line only if you still want to bypass caching on the delete page:
       // wc_nocache_headers();
   
       $token_id = (int) get_query_var('delete-payment-method');
       $nonce    = isset($_REQUEST['_wpnonce']) ? sanitize_text_field(wp_unslash($_REQUEST['_wpnonce'])) : '';
       $token    = WC_Payment_Tokens::get($token_id);
   
       if (
           empty($nonce) ||
           !$token ||
           '\\StellarPay\\Integrations\\WooCommerce\\Stripe\\Constants'::GATEWAY_ID !== $token->get_gateway_id('edit') ||
           !wp_verify_nonce($nonce, 'delete-payment-method-' . $token_id) ||
           get_current_user_id() !== $token->get_user_id()
       ) {
           return;
       }
   
       try {
           $service = '\\StellarPay\\PaymentGateways\\Stripe\\Services\\PaymentMethodService';
           if (function_exists('StellarPay\\Core\\container')) {
               $service_instance = StellarPay\Core\container($service);
           } else {
               $service_instance = new $service();
           }
           $service_instance->detachPaymentMethod($token->get_token());
       } catch (\Exception $e) {
           wc_add_notice(
               esc_html__('We are sorry, but we could not delete your payment method at this time. Please try again shortly.', 'stellarpay'),
               'error'
           );
           wp_safe_redirect(wc_get_account_endpoint_url('payment-methods'));
           exit;
       }
       ```
   
 * }, 9);

Viewing 1 replies (of 1 total)