This topic has 5 replies, 3 voices, and was last updated 11 years by adam.

  • Author

    Tagged: 

  • #35356
     adam
    Participant

    Hello – I have one last plugin to update and that is PMPro 1.7.10 to the latest version 1.7.14.2. When I try to update, the site breaks. I’ve tried updating both in wp-admin and also deleting the plugin via ftp uploading the latest version. It breaks in both cases. Even if I try to deactivate the plugin via wp-admin the site breaks. Could it be because of the functions I have related to PMPro in my functions.php file? Any suggestions? Thanks!

    #35361
     Kamal
    Moderator

    Hello Adam,
    Your site should not break if you upgrade your PMPro plugin.Did you change anything in functions.php for PMPRo plugin. If you did change, please try to undo the changes in the functions.php file. and delete plugin from your deshboard and then reinstall the plugin via FTP. Clear cache and cookies and other site data from the browser and test again. I hope this will fixed your problem. You can also give me some screenshots of site-broken errors or you can also give a link to your site to see the problem. Thanks.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #35368
     adam
    Participant

    I have a bunch of code related to PMPro in my function.php. Here it is:

    COPY CODE
    /*changes membership levels text on plans & pricing page*/
    add_filter('kleo_pmpro_level_restrictions', 'kleo_my_levels_checkmarks');
     
    function kleo_my_levels_checkmarks($settings) {
     
        $settings = array (
            array(
                'title' => __('Restrict members directory','kleo_framework'),
                'front' => __('Search couples directory','kleo_framework'),
                'name' => 'members_dir'
            ),
            array(
                'title' => __('Restrict viewing other profiles','kleo_framework'),
                'front' => __('View profiles of couples','kleo_framework'),
                'name' => 'view_profiles'
            ),
                 array(
                'title' => __('Restrict users from sending private messages','kleo_framework'),
                'front' => __('Message other couples','kleo_framework'),
                'name' => 'pm'
            ),
    
                 array(
                'title' => __('Restrict access to friendship requests','kleo_framework'),
                'front' => __('Add couples as friends','kleo_framework'),
                'name' => 'add_friends'
            ),
            array(
                'title' => __('Restrict access to groups directory','kleo_framework'),
                'front' => __('Access group directory','kleo_framework'),
                'name' => 'groups_dir'
            ),
            array(
                'title' => __('Restrict access to single group page','kleo_framework'),
                'front' => __('Join & participate in groups','kleo_framework'),
                'name' => 'view_groups'
            ),
            array(
                'title' => __('Restrict users from viewing site activity','kleo_framework'),
                'front' => __('View site activity','kleo_framework'),
                'name' => 'show_activity'
            ),
           
            array(
                'title' => __('Restrict users from adding media to their profile using rtMedia or bpAlbum','kleo_framework'),
                'front' => __('Add photos to your profile','kleo_framework'),
                'name' => 'add_media'
            )
        );
        return $settings;
    }
    
    /*initiates PMPro membership restriction messages*/
    add_action('kleo_pmro_extra_restriction_before_my_profile','kleo_my_custom_restrict');
     
    function kleo_my_custom_restrict()
    {
        //full current url
        $actual_link = kleo_full_url();
        //our request uri
        $uri = str_replace(untrailingslashit(home_url()),"",$actual_link);
     
        //restrict messaging page
        if(preg_match("/^\/".bp_get_members_root_slug()."\/". bp_get_loggedin_user_username()."\/messages\/?/", $uri))
        {
            
            $my_restrictions =  array('message' => array(
                    //2 - restrict certain levels. 0 -restrict none; 1 - restrict all
                    'type' => 2,
                    //levels that you apply the restrictions to
                    'levels' => array(0,1,2,3),
                    'not_member' => 1, 
                    'guest' => 1 
                )
            );
             kleo_check_access('message',$my_restrictions);
        }
    }
    
    /* Remove the Add friend button for users that don't have certain membership levels - remove 0 when go live so free memberships can't add friends */
    add_action('after_setup_theme', 'restrict_friend_button');
    function restrict_friend_button()
    {
        $membership_levels = array(0,1,2,3);
        if (!pmpro_hasMembershipLevel($membership_levels) ) {
            remove_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );
            remove_action('bp_directory_members_item_last','kleo_bp_member_dir_friend_button', 11);
        }
    }
    
    /*Redirects non-logged in users to registration page and logged-in users to membership level page to upgrade*/
    add_filter('kleo_pmpro_url_redirect', 'my_custom_redirect');
     
    function my_custom_redirect() {
        if (is_user_logged_in()) {
            return pmpro_url("levels");
        } else {
            return ('http://couplefriends.com/registration');
        }
    }
    
    add_action( 'gform_user_registered', 'pi_gravity_registration_autologin', 10, 4 );

    I’ve reverted back to the older PMPro for now. Do you see this code causing an issue?

    #35370
     Kamal
    Moderator

    Hi Adam,
    This code can cause problem if your paid membership pro plugin is not installed. You can remove this code first then, remove PMPro. then you can reinstall the PMPro plugin via ftp and then paste this code again to the functions.php. I hope you are using functions.php of KLEO Child theme. Please let me know if this fixes your problem. Thanks.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #35381
     Abe
    Keymaster

    Hi, the site will break because of the functions in the child theme if the plugin is not active.

    As a solution you should try and remove then until you activate the plugin and put them afterwards.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #35391
     adam
    Participant

    yes, that worked. thanks!

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Site break updating PMPro 1.7.10 to 1.7.14.2’ is closed to new replies.

Log in with your credentials

Forgot your details?