Paid Listings + WooCommerce Subscriptions Integration

[updated 7/4/25 with latest improvements. Still bugged :anguished_face:]

Dear HivePress Team and Community,

I’m reaching out after spending several months attempting to develop a custom integration between HivePress’s Paid Listings extension and WooCommerce Subscriptions.

Background

I conceptualized a website whose entire business model depends on this integration. Unfortunately, despite extensive research, I discovered that this functionality doesn’t exist natively - a significant roadblock for my project.

My Efforts So Far

Without professional development experience or the financial means to hire a developer, I’ve spent over a month:

  • Researching HivePress’s architecture and extension patterns
  • Investing in the HivePress extensions bundle and WooCommerce Subscriptions
  • Creating and testing over 500 iterations of a custom plugin with the help of AI

Current Status

I’ve made surprising progress for a non-developer, with roughly 99% of the intended functionality working at various points. However, achieving a stable, bug-free version has proven challenging, as each fix often introduces new issues.

I’ve noticed posts from HivePress staff dating back to 2022 mentioning an official integration in development, but as we’re now in 2025 with no release, I’ve continued my efforts.

Community Request

I’m sharing my work in hopes that more experienced developers might help refine it into a fully functional solution. My latest version (streamlined to about 8 files) accomplishes most of the intended functionality.

GitHub Repository: https://github.com/Chris-B92/forhivepress

Download ZIP: https://github.com/Chris-B92/forhivepress/archive/refs/tags/bugged.zip

I’ve attached links to see what I’ve managed to put together, but I honestly can’t put into words how much this plugin means to me. Perhaps together we can create something that benefits the entire HivePress community.

Thank you for your consideration,
Chris

Here’s a detailed breakdown of what it aims to do:

Subscription Renewals for HivePress: Detailed Description

This WordPress plugin provides seamless integration between WooCommerce Subscriptions and HivePress, automating the management of listings based on users’ subscription status. It solves the critical business problem of maintaining listing visibility and status in sync with subscription payments.

Core Purpose

The plugin bridges the gap between subscription payments and content visibility by automatically managing HivePress listings based on a user’s WooCommerce subscription status. When a subscription is active, listings remain visible; when a subscription expires or is cancelled, listings are automatically drafted to prevent unpaid content from displaying.

Key Features and Functionality

Subscription Status Management

  1. Active Subscription Handling:
  • Automatically updates all listing expiry dates to match the subscription’s next payment date
  • Maintains user’s listing front-end visibility choices (published listings stay published)
  • Respects pending cancellation status as still active until the billing period ends
  • Restores front-end visibility controls when a subscription becomes active
  • Links subscription orders to specific HivePress packages
  1. Cancelled/Expired Subscription Handling:
  • Automatically drafts all user’s published listings when a subscription is cancelled or expired
  • Hides front-end visibility controls to prevent users from re-publishing without an active subscription
  • Deletes and removes assigned packages when a subscription is cancelled or expired
  • Tags listings with a special meta flag (_hpsr_subscription_drafted) to identify listings drafted due to subscription status
  1. Renewal and Resubscription Handling:
  • Restores front-end visibility controls when a user resubscribes
  • Automatically republishes listings that were drafted due to subscription status
  • Optionally resets the package submission limit on renewal
  • Handles multi-subscription scenarios where a user may have multiple active subscriptions

WooCommerce Integration

  1. Order Processing:
  • Force-completes orders for WooCommerce virtual items and subscriptions
  • Detects and processes “stuck” orders that should be completed
  • Tracks subscription renewal payments and processes appropriate listing updates

Administrative Tools

  1. User Management:
  • Advanced user lookup tool to search by ID, email, or username
  • Detailed user information display showing subscriptions, packages, and listings
  • Manual subscription synchronization for individual users
  • Debug tools for troubleshooting listing expiry dates
  1. System Tools:
  • Manual sync functionality for all users’ subscription data
  • Process stuck orders functionality
  • Cron job health checks and rescheduling
  • Detailed logging system with save, copy, and clear functionality
  1. Reporting and Statistics:
  • Dashboard widget with subscription and listing overview
  • Detailed reports showing subscription status counts
  • Package assignment statistics
  • Listing status breakdown

Configuration Options

  1. Admin Settings:
  • Admin bypass option allowing administrators to publish listings without requiring a subscription
  • Debug mode toggle for detailed logging
  • Option to hide WordPress toolbar for non-admins
  • Option to reset submission limits on subscription renewal

Technical Implementation

  1. Integration Points:
  • Hooks into WooCommerce Subscription status changes (active, on-hold, cancelled, expired, pending-cancel)
  • Monitors renewal payments and initial subscription creation
  • Validates listing submissions against subscription status
  • Uses WordPress cron for scheduled synchronization
  1. Data Management:
  • Extends HivePress models (Listing, User_Listing_Package)
  • Maintains metadata relationships between subscriptions, packages, and listings
  • Caches statistics for performance optimization
  • Implements proper database interaction following WordPress standards
  1. User Interface Enhancements:
  • Adds CSS to conditionally hide visibility controls based on subscription status
  • Provides color-coded status indicators in the admin interface
  • Creates a responsive admin dashboard with tabbed navigation
  • Offers user-friendly tools for subscription management
  1. Error Handling and Logging:
  • Comprehensive logging system with different severity levels
  • Log rotation to prevent excessive file sizes
  • Secure log storage with .htaccess protection
  • Debug tools for troubleshooting specific user scenarios

Unique Value Proposition

This plugin solves several critical problems for HivePress website owners:

  1. Automation: Eliminates manual management of listing status when subscriptions change
  2. Revenue Protection: Ensures users must maintain an active subscription to keep listings visible
  3. User Experience: Automatically restores listings when payments resume
  4. Administrative Efficiency: Provides comprehensive tools for managing and troubleshooting subscriptions
  5. Flexibility: Offers configuration options to adapt to different business models

The plugin is particularly valuable for membership sites, directories, classifieds, or marketplace websites that use HivePress and want to monetize through recurring subscription payments rather than one-time listing fees.

Technical Requirements

  • WordPress 5.0 or higher
  • PHP 7.0 or higher
  • HivePress core plugin
  • WooCommerce plugin
  • WooCommerce Subscriptions plugin
  • HivePress Paid Listings extension
2 Likes

I asked AI to help summarize me rambling on yesterday, but just to clarify;

  • I have no experience developing anything like this.
  • All of the code has been written and rewritten about 500 times through month-long iterations over hundreds of chats with various Paid and Free versions of AI
  • As you can probably tell, I have become absolutely obsessed with trying to achieve this, and for someone who can crash a site with a comma or bracket in the wrong place, I’ve already blown my mind with what I’ve managed to achieve.
  • Sadly, AI isn’t currently at the stage where it can fully process everything I want it to yet, so I’ve had to feed it the highly complex HivePress developers documention and used other AI tools to help correctly identify the hooks/meta keys, etc. in existing plugins to target and manipulate the data that’s intended.
  • At various points throughout my development attempts, almost every intended function has appeared to work at one point or another, but having everything work seamlessly together has become a real challenge.
  • As much the AI has helped, sadly the complex nature of HivePress’s custom ‘way of doing things’ has only made this much harder to anyone to wrap their heads around.
  • I will continue in my quest to achieve this and link to any new versions that seem to make a giant leap forward, though linking to every version seems like a bit of a waste of time since it’s still very much in development, and because of my lack of skills/knowledge, I tend to make a step forward and three steps back at the same time.

Obviously, if I have the funds to finance this I would have hired a professional developer to ensure a seamless integration, but sadly I cannot do this at the moment.

I’m happy to share my work-in-progress in hopes that a more seasoned developer may be able to help perfect my attempts, or if the HivePress team are able to use all/some of my ideas that I’ve uncovered during my attempts, that would be cool.

Ultimately, I just need this plugin working! <3

I understand what I have set out to achieve is highly ambitous for someone with very little experience with this sort of thing, but the plugin is crucial, so I don’t have much choice.

1 Like

Hello,

It’s not so difficult to implement hivepress paid listings with WooCommerce subscriptions.

I know someone who did it.
But for privacy reasons, I will not give away his name.

I personally implemented an affiliation program with another solution (SliceWP), it was smooth and seamless. I guess it should be about the same for Woo Subs.

If you have bought the plugin from Woo, you should benefit from their support. So try to ask them.

Look at other discussions regarding this topic, it may help.

Cheers,

1 Like

Thanks for sharing your findings and the resulting code, really appreciate this. While I can’t provide the detailed guidance for implementing WooSubscriptions in Paid Listings, I recommend waiting for the Memberships update - we’ve merged Paid Listings functionality into it, and plan to release it this week. The next step is adding subscriptions to it, and this functionality should be delivered within 2 weeks.

1 Like

Hey @ihor,

Many thanks for getting back to me. I’m over-the-moon to hear the latest news about Memberships and the official implementation (hopefully) coming within the next 2 weeks or so! :partying_face:

Like I said I’m not a ‘real’ developer, simply obsessed with my idea! :slight_smile: I know you’ll probably not want to share too much about it yet, but can you please confirm if the official implementation will at least check all of the boxes to provide a seamless renewal experience for end-users. e.g:

For users with an active subscription:

  1. Automatically update all of the user’s listing’s expiry dates to match their latest subscription’s expiry date at each renewal.
  2. Respect the user’s listing front-end visibility choices so that they keep their drafts as drafts, and published listings stay published when their subscription renews.
  3. Treat subscriptions with a pending cancellation status as active in order to respect a user’s full billing period.

For users with a cancelled or expired subscription:

  1. Automatically draft all of a user’s listings when a subscription is cancelled or expired.
  2. Automatically hide the visibility of the front-end visibility toggle when a subscription is cancelled or expired.
  3. Automatically delete a user’s assigned package when a subscription is cancelled or expired.

When a user resubscribes:

  1. Automatically restore the visibility of front-end visibility toggle.
  2. Respect the user’s listing front-end visibility choices so that they keep their drafts as drafts and published listings published when their subscription renews.
  3. Potentially reset their submit limit?

And, you’re very welcome that I shared what I’ve achieved so far and hope to inspire the community! :slight_smile: - I’ve actually 2 more plugins that were initially part of this crazy all in one idea, but I found the sense to at least seperate those parts! :face_with_tears_of_joy:

Feel free to have a look at my/the AI’s approach to things - I’m still tinkering away, so the latest that I haven’t uploaded might have slightly changed. I’ve managed the renewal and woosubscriptions integration, but as I’m trying to seperate regular drafts and one’s that I’m trying to mark as ‘subscription-drafted’ to allow users to store hidden listings that don’t get republished when their subscription renews; I’m having difficulty with this part of the code.

If you have a moment, would you be able to help correct this chunk for me, please? :folded_hands:

/**
     * Drafts all published listings for a user.
     */
    public function draft_user_listings($user_id) {
        $listings = Models\Listing::query()->filter(['user' => $user_id, 'status' => 'publish'])->get();
        $this->log("Found " . $listings->count() . " published listings to draft for user [$user_id]", 'info');

        $drafted_count = 0;
        foreach ($listings as $listing) {
            $listing->set_status('draft');
            $listing->set_meta('_hpsr_subscription_drafted', '1');
            if ($listing->save(['status', '_hpsr_subscription_drafted'])) {
                $drafted_count++;
                $this->log("Drafted listing [{$listing->get_id()}]", 'info');
            } else {
                $this->log("Failed to draft listing [{$listing->get_id()}]", 'error');
            }
        }
        wp_cache_flush();
        return $drafted_count;
    }

    /**
     * Republishes drafted listings for a user.
     */
    protected function republish_drafted_listings($user_id) {
        $listings = Models\Listing::query()->filter([
            'user' => $user_id,
            'status' => 'draft',
            '_meta' => ['_hpsr_subscription_drafted' => '1']
        ])->get();
        $this->log("Found " . $listings->count() . " drafted listings to republish for user [$user_id]", 'info');

        $republished = 0;
        foreach ($listings as $listing) {
            $listing->set_status('publish');
            $listing->set_meta('_hpsr_subscription_drafted', null);
            if ($listing->save(['status', '_hpsr_subscription_drafted'])) {
                $republished++;
                $this->log("Republished listing [{$listing->get_id()}]", 'info');
            } else {
                $this->log("Failed to republish listing [{$listing->get_id()}]", 'error');
            }
        }
        wp_cache_flush();
        return $republished;
    }

I can’t help but try and get this working in the meantime, but I’ll for-sure be using the official implementation once it’s available to ensure there’s less chance of bugs, etc.

I’m afraid that there’s a bit different logic planned - the subscription expiration date will not equal to the expiration of all the user’s listings, although this may be possible with a code snippet for the upcoming Memberships version. We plan to turn Memberships into a “swiss knife” for monetizing HivePress to allow monetizing almost every feature.

Unfortunately, we can’t help with the detailed developer guidance for customizations (e.g. checking and debugging custom code), but if you plan to customize Paid Listings I can provide general guidance on the best approach - let me know if this works for you.

Hope this helps

1 Like

Thanks again for your reply, @ihor! I did manage to achieve the subscription expiration date equalling the expiration of all of a user’s listings in my/AI’s plugin’s attempts. Would you be able to see how that was achieved to help craft the snippet (or potentially add an additional option in Memberships? - It seems like quite an obvious feature, but perhaps my use-case is quite niche?) Nevertheless, I’m moving my efforts to building out the rest of my website at the moment, as the subscription plugin attempt kind of stole my focus. I’ll definitely be using the new all-in-one, swiss-army-knife Membership plugin that you speak of, though! It sounds very interesting, and I can’t wait to see all of the features on offer! :smiley:

1 Like

Thanks for your feedback, I’ll try to provide a snippet once we add subscriptions support to the upcoming Memberships version.

1 Like