MemberPress: Free-Views-Left Counter

function mepr_display_cookie() { if ( isset( $_COOKIE[‘mp3pi141592pw’] ) && ! empty( $_COOKIE[‘mp3pi141592pw’] ) ) { $cookie = $_COOKIE[‘mp3pi141592pw’]; $mepr_options = MeprOptions::fetch(); $num_views = base64_decode( $cookie ); if ( $num_views < $mepr_options->paywall_num_free_views ) { $free_views = $mepr_options->paywall_num_free_views – $num_views; echo ‘You…Continue reading

MemberPress: Free-Views-Used Counter

function mepr_display_cookie() { $free_views = isset( $_COOKIE[‘mp3pi141592pw’]) ? base64_decode( $_COOKIE[‘mp3pi141592pw’] ) : false; if( $free_views !== false ) { echo ‘You used ‘ . $free_views . ‘ free views!’; } } add_action( ‘init’, ‘mepr_display_cookie’ );Continue reading