WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WP User Frontend] Subscriptions do not work

[Plugin: WP User Frontend] Subscriptions do not work

  • martinjesus
    Member

    @martinjesus

    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.

    http://wordpress.org/extend/plugins/wp-user-frontend/

Viewing 8 replies - 1 through 8 (of 8 total)
  • I have a same problem….

    sundaylau
    Member

    @sundaylau

    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

    $userdata->wpuf_sub_validity
    $userdata->wpuf_sub_pcount

    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.

    musinho
    Member

    @musinho

    Hola,

    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;
    		ob_start();
    		$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…

    justinmyoung
    Member

    @justinmyoung

    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 🙂

    Plugin Author Tareq Hasan
    Participant

    @tareq1988

    Did you tried the github version?

    justinmyoung
    Member

    @justinmyoung

    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

    Thanks
    Justin

    ChiaraNexus6
    Member

    @chiaranexus6

    Same problem.. 🙁

    Ciprian
    Participant

    @butterflymedia

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: WP User Frontend] Subscriptions do not work’ is closed to new replies.