WP User Frontend
Subscriptions do not work (9 posts)

  1. martinjesus
    Posted 4 years ago #

    Hi to all,

    I have noticed that the subscriptions do not work.

    When a user choose a subscription, and pay it, when he returns to my "create-post" page, the meesage continues saying "You must purchase a pack before posting".

    I am not a coder, but I have been looking to the code and the Data Base, and I have found the following:

    When a subscription is paid, there is a function on "wp-user-frontend/wpuf-subscription.php" that is as following:

         * Store new subscription info on user profile
         * if data = 0, means 'unlimited'
         * @param int $user_id
         * @param int $pack_id subscription pack id
        public function new_subscription( $user_id, $pack_id ) {
            $subscription = $this->get_subscription( $pack_id );
            if ( $user_id && $subscription ) {
                //store the duration
                if ( $subscription->duration == 0 ) {
                    update_user_meta( $user_id, 'wpuf_sub_validity', 'unlimited' );
                } else {
                    //store that future date in usermeta
                    $duration = date( 'Y-m-d G:i:s', strtotime( date( 'Y-m-d G:i:s', time() ) . " +{$subscription->duration} day" ) );
                    update_user_meta( $user_id, 'wpuf_sub_validity', $duration );
                //store post count
                if ( $subscription->count == 0 ) {
                    update_user_meta( $user_id, 'wpuf_sub_pcount', 'unlimited' );
                } else {
                    update_user_meta( $user_id, 'wpuf_sub_pcount', $subscription->count );
                //store pack id
                update_user_meta( $user_id, 'wpuf_sub_pack', $subscription->id );

    That means that when a user chooses a subscription, the subscription info must be added to the user metadata of the Data Base. And I think that the problem comes here, because I have been looking to the Data Base, and any info regarding the susbcription is added in there.

    Does anyone have the same problem with the susbscriptions?

    Thanks in advance for your help.


  2. musinho
    Posted 4 years ago #

    I have a same problem....

  3. sundaylau
    Posted 4 years ago #

    I have the same problem here. I am not sure if it is an automatic case to approve the user's post. The case is

    1) User is successful to pay the pack / paynow by frontend
    2) Transactions (WP User Frontend: Payments Received) could be seen the transaction is finished.
    3) However user cannot see that he has paid for the post/packs,

    I think I might find the possible reason(s) while using var_dump in wpuf-subscription.php


    they are empty, and they cannot be saved in the $userdata while the user is finished the payment.

    Hope any professional coder or plugin owner could help! This is a very good plugin I ever met.

  4. musinho
    Posted 4 years ago #


    La función que recibe el pago crea un array con dos variables, las cuales llamarán a otra función para guardar los nuevos datos en la BBDD.

    function payment_received( $info ) {
    		global $userdata;
    		$id = get_userdata( $userdata->ID );
            if ( $info['post_id'] ) {
                $this->handle_post_publish( $info['post_id'] );
            } else if ( $info['pack_id'] ) {
                $this->new_subscription( $info['user_id'] $info['pack_id'] );

    El fallo está en esta linea:

    $this->new_subscription( $info['user_id'] $info['pack_id'] );

    $info['user_id'] está vacio, y no devuelve nada. ahora la cuestión es buscar donde carga el ID del user...

  5. justinmyoung
    Posted 3 years ago #

    I have the same issue. Hopefully it can get worked out, it's a great plugin :) I also rated the plugin (5 stars), and tried to donate but kept getting a timed out error every time I tried. Just to let you know :)

  6. Tareq Hasan
    Plugin Author

    Posted 3 years ago #

    Did you tried the github version?

  7. justinmyoung
    Posted 3 years ago #

    Hey Tareq

    Yea, I just tried the github version and it still does the same thing. I go through the payment process, then it sends me back to the page, not displaying the form, and a message that reads: You must purchase a pack before posting


  8. ChiaraNexus6
    Posted 3 years ago #

    Same problem.. :(

  9. Ciprian
    Posted 3 years ago #

    Hey Tareq, this problem still persists. I have opened a new thread, and I'm waiting for your answer. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP User Frontend
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic