Skip to content

Fix recurring listings expiring with active subscriptions - #3035

Open
the-sohan wants to merge 1 commit into
sovware:developmentfrom
the-sohan:fix/6910-recurring-subscription-expiry
Open

the-sohan wants to merge 1 commit into
sovware:developmentfrom
the-sohan:fix/6910-recurring-subscription-expiry

Conversation

@the-sohan

@the-sohan the-sohan commented Sep 22, 2026

Copy link
Copy Markdown

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

Directorist's listing-expiry cron fires the directorist_update_listings_expired_status_query_arguments filter with an unintended trailing space. Extensions register the documented hook name without that space, so their query protections never run. In WooCommerce Pricing Plans, this allows a recurring-plan listing to be marked expired when its stored _expiry_date passes even though its WooCommerce subscription is still active.

This change removes the trailing space from the filter name. Registered extension callbacks can now exclude active recurring listings from the expiry query as intended.

Before

Recurring-plan listing expired before the fix

The recurring-plan listing is changed to Expired after the expiry cron runs.

After

Recurring-plan listing remains published after the fix

The same scenario remains Published after the expiry cron runs because the extension filter is now applied.

How to reproduce the issue or test the changes:

  1. Activate Directorist and an extension that filters directorist_update_listings_expired_status_query_arguments, such as Directorist - WooCommerce Pricing Plans.
  2. Create a published listing assigned to a recurring plan and give it a past _expiry_date.
  3. Run Directorist's scheduled expiry task on the current development branch and confirm that the listing becomes expired because the extension callback is not invoked.
  4. Check out this branch, restore the listing to published, and run the same expiry task.
  5. Confirm that the extension callback runs and the recurring-plan listing stays published.

Local verification:

  • php -l includes/classes/class-cron.php
  • Created an isolated recurring-plan listing with a past expiry date and ran ATBDP_Cron::update_expired_status() against only that fixture. Before the change its status became expired; after the change it remained publish.
  • git diff --check

Notes:

  • The repository's Composer dependencies were not installed in the isolated worktree, so the PHPCS command was unavailable. The changed line was manually checked against the existing WordPress formatting in the file.

Any linked issues

Checklist

Files changed

  • includes/classes/class-cron.php — Corrects the expiry-query filter name so extension callbacks can protect recurring listings.

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

Successfully merging this pull request may close these issues.

1 participant