Plugin Directory

Changeset 2142176


Ignore:
Timestamp:
08/19/2019 08:51:16 PM (7 years ago)
Author:
reality66
Message:

Update to version 1.1.7

Location:
cart66-cloud-members/trunk
Files:
6 added
7 edited

Legend:

Unmodified
Added
Removed
  • cart66-cloud-members/trunk/cart66-members.php

    r1512814 r2142176  
    44Plugin URI: http://cart66.com
    55Description: Membership functionality for Cart66 Cloud
    6 Version: 1.1.6
    7 Author: Reality66
     6Version: 1.1.7
     7Author: reality66
    88Author URI: http://www.reality66.com
    99
  • cart66-cloud-members/trunk/includes/admin/class-cm-admin-settings-notifications.php

    r1201264 r2142176  
    3737        $home = new CC_Admin_Settings_Select_Box( $home_title, 'member_home' );
    3838        $home->new_option( __( 'Secure Order History', 'cart66' ), 'order_history', false );
     39        $home->new_option( __( 'Client Page', 'cart66'), 'client-home', false );
    3940        $home->description = __( 'The page where members will be directed after logging in', 'cart66-members' );
    4041        $this->build_member_homepage_list( $home, $option_values['member_home'] );
     42        $home->set_selected( $option_values['member_home']);
    4143        $section->add_field( $home );
    4244
  • cart66-cloud-members/trunk/includes/class-cm-cart66-members.php

    r1400676 r2142176  
    2929        $plugin_dir = basename(dirname(__DIR__));
    3030
    31         define( 'CM_VERSION_NUMBER', '1.1.5' );
     31        define( 'CM_VERSION_NUMBER', '1.1.7' );
    3232        define( 'CM_PATH', WP_PLUGIN_DIR . '/' . $plugin_dir . '/' );
    3333        define( 'CM_URL',  WP_PLUGIN_URL . '/' . $plugin_dir . '/' );
     
    4040        if ( class_exists('Cart66_Cloud') ) {
    4141            // If Cart66 Cloud is loaded register the account widget
    42             add_action('widgets_init', create_function('', 'return register_widget("CM_Account_Widget");'));
     42            add_action('widgets_init', function() { return register_widget("CM_Account_Widget"); } );
    4343        } else {
    4444            // If Cart66 Cloud is not loaded show and admin notice
     
    6666            // Initialize shortcodes for managing access to content
    6767            CM_Shortcode_Manager::init();
     68
     69            // Initialize routes and client page custom post type
     70            add_action( 'init', function() {
     71                CM_Client_Page::init();
     72                CM_Routes::init();
     73            });
     74
     75           
     76            add_action( 'parse_query', ['CM_Route_Handler', 'run'] );
    6877
    6978            do_action ( 'after_cart66_members_init' );
     
    100109            add_action( 'wp_enqueue_scripts', array( $monitor, 'enqueue_css' ) );
    101110
     111            // Use JS to fix caching of member content visibiltiy
     112            add_action( 'wp_enqueue_scripts', function() {
     113                CM_Log::write( 'Uhh.... enqueue scripts NOW please?');
     114                wp_enqueue_script( 'js-cookie', cm_url() . 'resources/js/js-cookie.js', ['jquery'] );
     115                wp_enqueue_script( 'content-visibility', cm_url() . 'resources/js/content-visibility.js', ['jquery', 'js-cookie'] );
     116            });
     117
    102118            // Check if current visitor is logged signed in to the cloud
    103119            $visitor = CM_Visitor::get_instance();
  • cart66-cloud-members/trunk/includes/class-cm-monitor.php

    r1512814 r2142176  
    132132    }
    133133
     134    /**
     135     * Enqueue scripts to toggle visibiltiy of member content based on CSS classes
     136     */
     137    public function enqueue_js() {
     138        wp_enqueue_script( 'js-cookie', cm_url() . 'resources/js/js-cookie.js', ['jqueyr'] );
     139        wp_enqueue_script( 'content-visibility', cm_url() . 'resources/js/content-visibility.js', ['jquery', 'js-cookie'] );
     140    }
     141
    134142}
  • cart66-cloud-members/trunk/includes/class-cm-visitor.php

    r1372547 r2142176  
    172172            exit();
    173173        }
     174        elseif ( 'client-home' == $member_home ) {
     175            $client_home = trailingslashit( get_site_url() ) . 'client-home/';
     176            wp_redirect( $client_home );
     177            exit();
     178        }
    174179        elseif ( $page_id != $member_home ) {
    175180            // redirect to member home page
     
    186191        $_COOKIE['ccm_token'] = $data;
    187192        $this->token = $data;
    188         setcookie('ccm_token', $data, $expire, COOKIEPATH, COOKIE_DOMAIN, false, true);
     193        setcookie('ccm_token', $data, $expire, COOKIEPATH, COOKIE_DOMAIN, false, false);
    189194        if (COOKIEPATH != SITECOOKIEPATH) {
    190             setcookie('ccm_token', $data, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, false, true);
     195            setcookie('ccm_token', $data, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, false, false);
    191196            CM_Log::write("Logging in CC Member: $data");
    192197        }
     
    204209        setcookie('ccm_token', ' ', time() - 3600, COOKIEPATH);
    205210        if ( COOKIEPATH != SITECOOKIEPATH ) {
    206             setcookie('ccm_token', ' ', time() - 3600, SITECOOKIEPATH, COOKIE_DOMAIN, false, true);
     211            setcookie('ccm_token', ' ', time() - 3600, SITECOOKIEPATH, COOKIE_DOMAIN, false, false);
    207212        }
    208213    }
     
    297302        $memberships = get_post_meta( $post_id, '_ccm_required_memberships', true );
    298303        $post_cat_ids = wp_get_post_categories( $post_id );
     304        $post_type = get_post_type( $post_id );
     305
     306        // Check if this is the client page post type
     307        if ( 'cm_client_page' == $post_type ) {
     308            $client_page_email = get_post_meta( $post_id, 'cm_client_email', true );
     309            $visitor_email = CC::visitor_email();
     310            if ( $client_page_email == $visitor_email ) {
     311                return true;
     312            }
     313            else {
     314                wp_redirect('/');
     315                die();
     316            }
     317        }
    299318
    300319        CM_Log::write("Categories for post id $post_id" . print_r($post_cat_ids, TRUE));
  • cart66-cloud-members/trunk/includes/cloud/class-cm-cloud-expiring-products.php

    r1372547 r2142176  
    22
    33class CM_Cloud_Expiring_Products {
    4 
    54
    65    /**
     
    9190    }
    9291
    93 
    9492    public function expiring_product_list() {
     93        $memberships = [];
    9594        $products = $this->load();
    9695
     
    102101    }
    103102
    104 
    105 
    106103}
  • cart66-cloud-members/trunk/readme.txt

    r1548191 r2142176  
    33Donate link: http://cart66.com
    44Tags: ecommerce, e-commerce membership, subscription, content restriction, sell access, courses, private posts
    5 Requires at least: 3.5
    6 Tested up to: 4.7
    7 Stable tag: 1.1.6
    8 
     5Requires at least: 4.0
     6Requires PHP: 7.2
     7Tested up to: 5.2
     8Stable tag: 1.1.7
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1414== Description ==
    1515
    16 With Cart66 Cloud Members you can sell memberships and subscriptions to give your customers access to pages, posts, or even entire post categories on your WordPress website. A person can have an unlimted number of memberships. You can even drip access to your content based on how long a person has had their membership.
     16With Cart66 Cloud Members you can sell memberships and subscriptions to give your customers access to pages, posts, or even entire post categories on your WordPress website. A person can have an unlimited number of memberships. You can even drip access to your content based on how long a person has had their membership.
    1717
    1818== Features ==
     
    3030= Minimum Requirements =
    3131
    32 * WordPress 3.5 or greater
    33 * PHP version 5.5 or greater
     32* WordPress 5.0 or greater
     33* PHP version 7.2 or greater
    3434* MySQL version 5.0 or greater
    3535
     
    7676
    7777== Changelog ==
     78
     79= Version 1.1.7 - 8/19/2019 =
     80
     81* New: Use Javascript to show and hide members content to prevent CSS caching from messing things up.
     82* Fix: Deprecated create_function changed to anonymous function for Account Widget
    7883
    7984= Version 1.1.6 - 10/11/2016 =
Note: See TracChangeset for help on using the changeset viewer.