Plugin Directory

Changeset 1162170


Ignore:
Timestamp:
05/17/2015 01:29:37 PM (11 years ago)
Author:
iammathews
Message:

Updated notices logic.

Location:
pricing-table-shortcode
Files:
108 added
3 edited

Legend:

Unmodified
Added
Removed
  • pricing-table-shortcode/trunk/inc/notices.php

    r1154801 r1162170  
    66    $user_id = $current_user->ID;
    77
    8     $activationDate = get_user_meta( $user_id, 'pts_plugin_activation' );
    9     $activationDateVar = $activationDate[0];
    10     $aWeekFromActivation = strtotime( $activationDateVar . '+1 week' );
    11     $twoWeeksFromActivation = strtotime( $activationDateVar . '+2 weeks' );
     8    if( get_user_meta( $user_id, 'pts_plugin_activation', true ) == '' ){
     9        update_user_meta( $user_id, 'pts_plugin_activation', date( 'F j, Y' ) );
     10    }
     11
     12    $activationDate = get_user_meta( $user_id, 'pts_plugin_activation', true );
     13    $aWeekFromActivation = strtotime( $activationDate . '+1 week' );
     14    $twoWeeksFromActivation = strtotime( $activationDate . '+2 weeks' );
    1215    $currentPluginDate = strtotime( 'now' );
    1316
     
    2023    $donateOutput .= '</div>';
    2124
    22     if( current_user_can( 'activate_plugins' ) && get_user_meta( $user_id, 'pts_rate_ignore' ) != 'true' && $currentPluginDate >= $aWeekFromActivation ){
     25    if( get_user_meta( $user_id, 'pts_rate_ignore', true ) == '' ){
     26        update_user_meta( $user_id, 'pts_rate_ignore', 'false' );
     27    }
     28    if( get_user_meta( $user_id, 'pts_donate_ignore', true ) == '' ){
     29        update_user_meta( $user_id, 'pts_donate_ignore', 'false' );
     30    }
     31
     32    if( current_user_can( 'activate_plugins' ) && get_user_meta( $user_id, 'pts_rate_ignore', true ) != 'true' && $currentPluginDate >= $aWeekFromActivation ){
    2333        echo $rateOutput;
    2434    }
    2535
    26     if( current_user_can( 'activate_plugins' ) && get_user_meta( $user_id, 'pts_donate_ignore' ) != 'true' && $currentPluginDate >= $twoWeeksFromActivation ){
     36    if( current_user_can( 'activate_plugins' ) && get_user_meta( $user_id, 'pts_donate_ignore', true ) != 'true' && $currentPluginDate >= $twoWeeksFromActivation ){
    2737        echo $donateOutput;
    2838    }
  • pricing-table-shortcode/trunk/pts.php

    r1156037 r1162170  
    44 * Plugin URI: https://wordpress.org/plugins/pricing-tables-shortcode/
    55 * Description: A pricing table plugin, that sells.
    6  * Version: 1.1
     6 * Version: 1.2
    77 * Author: Yusri Mathews
    88 * Author URI: http://yusrimathews.co.za/
     
    3131    $user_id = $current_user->ID;
    3232
    33     update_user_meta( $user_id, 'pts_plugin_activation', date( 'F j, Y' ), true );
     33    update_user_meta( $user_id, 'pts_plugin_activation', date( 'F j, Y' ) );
    3434    update_user_meta( $user_id, 'pts_rate_ignore', 'false' );
    3535    update_user_meta( $user_id, 'pts_donate_ignore', 'false' );
  • pricing-table-shortcode/trunk/readme.txt

    r1156037 r1162170  
    4848== Changelog ==
    4949
     50= 1.2 =
     51* Updated notices logic.
     52
    5053= 1.1 =
    5154* Fixed continuous loop issue.
Note: See TracChangeset for help on using the changeset viewer.