Changeset 2142176
- Timestamp:
- 08/19/2019 08:51:16 PM (7 years ago)
- Location:
- cart66-cloud-members/trunk
- Files:
-
- 6 added
- 7 edited
-
cart66-members.php (modified) (1 diff)
-
includes/admin/class-cm-admin-settings-notifications.php (modified) (1 diff)
-
includes/class-cm-cart66-members.php (modified) (4 diffs)
-
includes/class-cm-client-page-meta-box.php (added)
-
includes/class-cm-client-page.php (added)
-
includes/class-cm-monitor.php (modified) (1 diff)
-
includes/class-cm-route-handler.php (added)
-
includes/class-cm-routes.php (added)
-
includes/class-cm-visitor.php (modified) (4 diffs)
-
includes/cloud/class-cm-cloud-expiring-products.php (modified) (3 diffs)
-
readme.txt (modified) (4 diffs)
-
resources/js/content-visibility.js (added)
-
resources/js/js-cookie.js (added)
Legend:
- Unmodified
- Added
- Removed
-
cart66-cloud-members/trunk/cart66-members.php
r1512814 r2142176 4 4 Plugin URI: http://cart66.com 5 5 Description: Membership functionality for Cart66 Cloud 6 Version: 1.1. 67 Author: Reality666 Version: 1.1.7 7 Author: reality66 8 8 Author URI: http://www.reality66.com 9 9 -
cart66-cloud-members/trunk/includes/admin/class-cm-admin-settings-notifications.php
r1201264 r2142176 37 37 $home = new CC_Admin_Settings_Select_Box( $home_title, 'member_home' ); 38 38 $home->new_option( __( 'Secure Order History', 'cart66' ), 'order_history', false ); 39 $home->new_option( __( 'Client Page', 'cart66'), 'client-home', false ); 39 40 $home->description = __( 'The page where members will be directed after logging in', 'cart66-members' ); 40 41 $this->build_member_homepage_list( $home, $option_values['member_home'] ); 42 $home->set_selected( $option_values['member_home']); 41 43 $section->add_field( $home ); 42 44 -
cart66-cloud-members/trunk/includes/class-cm-cart66-members.php
r1400676 r2142176 29 29 $plugin_dir = basename(dirname(__DIR__)); 30 30 31 define( 'CM_VERSION_NUMBER', '1.1. 5' );31 define( 'CM_VERSION_NUMBER', '1.1.7' ); 32 32 define( 'CM_PATH', WP_PLUGIN_DIR . '/' . $plugin_dir . '/' ); 33 33 define( 'CM_URL', WP_PLUGIN_URL . '/' . $plugin_dir . '/' ); … … 40 40 if ( class_exists('Cart66_Cloud') ) { 41 41 // 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"); } ); 43 43 } else { 44 44 // If Cart66 Cloud is not loaded show and admin notice … … 66 66 // Initialize shortcodes for managing access to content 67 67 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'] ); 68 77 69 78 do_action ( 'after_cart66_members_init' ); … … 100 109 add_action( 'wp_enqueue_scripts', array( $monitor, 'enqueue_css' ) ); 101 110 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 102 118 // Check if current visitor is logged signed in to the cloud 103 119 $visitor = CM_Visitor::get_instance(); -
cart66-cloud-members/trunk/includes/class-cm-monitor.php
r1512814 r2142176 132 132 } 133 133 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 134 142 } -
cart66-cloud-members/trunk/includes/class-cm-visitor.php
r1372547 r2142176 172 172 exit(); 173 173 } 174 elseif ( 'client-home' == $member_home ) { 175 $client_home = trailingslashit( get_site_url() ) . 'client-home/'; 176 wp_redirect( $client_home ); 177 exit(); 178 } 174 179 elseif ( $page_id != $member_home ) { 175 180 // redirect to member home page … … 186 191 $_COOKIE['ccm_token'] = $data; 187 192 $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); 189 194 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); 191 196 CM_Log::write("Logging in CC Member: $data"); 192 197 } … … 204 209 setcookie('ccm_token', ' ', time() - 3600, COOKIEPATH); 205 210 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); 207 212 } 208 213 } … … 297 302 $memberships = get_post_meta( $post_id, '_ccm_required_memberships', true ); 298 303 $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 } 299 318 300 319 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 2 2 3 3 class CM_Cloud_Expiring_Products { 4 5 4 6 5 /** … … 91 90 } 92 91 93 94 92 public function expiring_product_list() { 93 $memberships = []; 95 94 $products = $this->load(); 96 95 … … 102 101 } 103 102 104 105 106 103 } -
cart66-cloud-members/trunk/readme.txt
r1548191 r2142176 3 3 Donate link: http://cart66.com 4 4 Tags: ecommerce, e-commerce membership, subscription, content restriction, sell access, courses, private posts 5 Requires at least: 3.56 Tested up to: 4.7 7 Stable tag: 1.1.6 8 5 Requires at least: 4.0 6 Requires PHP: 7.2 7 Tested up to: 5.2 8 Stable tag: 1.1.7 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 14 14 == Description == 15 15 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 unlim ted number of memberships. You can even drip access to your content based on how long a person has had their membership.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 unlimited number of memberships. You can even drip access to your content based on how long a person has had their membership. 17 17 18 18 == Features == … … 30 30 = Minimum Requirements = 31 31 32 * WordPress 3.5or greater33 * PHP version 5.5or greater32 * WordPress 5.0 or greater 33 * PHP version 7.2 or greater 34 34 * MySQL version 5.0 or greater 35 35 … … 76 76 77 77 == 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 78 83 79 84 = Version 1.1.6 - 10/11/2016 =
Note: See TracChangeset
for help on using the changeset viewer.