Plugin Directory

Changeset 1567572


Ignore:
Timestamp:
01/04/2017 03:03:18 AM (9 years ago)
Author:
pushpress
Message:

Added 'spaces available' on schwedule and fixed bug in the calculation of the average lead value for FB and Google reporting

Location:
pushpress-integration/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • pushpress-integration/trunk/css/pushpress.css

    r1498520 r1567572  
    148148
    149149.wp-pushpress .schedule-name{
    150     width: 24%;
     150    width: 20%;
    151151}
    152152.wp-pushpress .schedule-hour{
    153     width: 24%;
     153    width: 20%;
    154154}
    155155.wp-pushpress .schedule-title{
    156     width: 24%;
     156    width: 20%;
    157157}
    158158.wp-pushpress .schedule-type{
    159     width: 24%;
     159    width: 20%;
     160}
     161.wp-pushpress .schedule-spots{
     162    width: 18%;
    160163}
    161164.wp-pushpress .schedule-button{
  • pushpress-integration/trunk/inc/wp_pushpress_model.php

    r1532751 r1567572  
    351351            $doy = $doyCurrent + $i;
    352352
    353             $cache_key = "pp_client_schedule_" . $doy . "_" . $year . "_class";
     353            $cache_key = "pp_client_schedule_2" . $doy . "_" . $year . "_class";
    354354           
    355355            if (! $calendar = get_transient($cache_key)){
     
    360360                            'type' => 'Class',
    361361                ));
    362 
    363362                set_transient($cache_key, $calendar, 600);
    364363            }
    365364       
    366365            foreach ($calendar['data'] as $item) {
     366               
    367367                if (($item->doy) >= $doy) {
    368368                    $timestamp = strtotime("$year-01-01 + $doy days 00:00:00");
     
    370370                    $schedulesList[$timestamp][$item->uuid]['end_timestamp'] = $item->end_timestamp;
    371371                    $schedulesList[$timestamp][$item->uuid]['title'] = $item->title;
     372                    $schedulesList[$timestamp][$item->uuid]['attendance_cap'] = $item->attendance_cap;
    372373
    373374                    $lastName = substr($item->coach_last_name, 0, 1);
     
    378379                        $status['name'] = 'Reservation available';
    379380                        $status['class'] = 'schedule-reservation';
     381                        if ($item->attendance_cap) {
     382                            $status['spots_available'] = $item->attendance_cap - $item->registration_count;
     383                        }
     384                        else {
     385                            $status['spots_available'] = -1;
     386                        }
    380387                    } else {
    381388                        $status['name'] = 'Class full';
    382389                        $status['class'] = 'schedule-full';
     390                        $status['spots_available'] = 0;
    383391                    }
    384392                    $schedulesList[$timestamp][$item->uuid]['status'] = $status;
     
    758766        if( !$settingsObj = get_transient( 'pp_client_settings_metrics' ) ){
    759767            try {
    760                 $settingsObj = Pushpress_Client::settings('metrics');
     768                $settingsObj = Pushpress_Client::settings('metrics');               
    761769            }
    762770            catch (Exception $e) {
    763771                $settingsObj = array();
    764772            }
    765             set_transient( 'pp_client_settings_metrics', $settingsObj, 3600 ); // 1 hour cache
    766         }
    767 
     773            set_transient( 'pp_client_settings_metrics', $settingsObj, 60 ); // 1 minute cache
     774        }
    768775
    769776        $metrics = array();
    770777        foreach ($settingsObj as $item) {
    771778            if (is_array($item)) {
    772                 foreach ($item as $v) {
     779                foreach ($item as $v) {                   
    773780                    $metrics[$v['name']] = $v['value'];
    774781                }
     782            }
     783            else {
     784                $metrics[$item['name']] = $item['value'];
    775785            }
    776786        }
     
    778788            $metrics['average_lead_value'] = 0;
    779789        }       
     790
    780791        return $metrics;
    781792    }
  • pushpress-integration/trunk/inc/wp_pushpress_shortcode.php

    r1532751 r1567572  
    7777            $timeNow = LocalTime::toGM($client);
    7878        } catch (Exception $e) {
    79             echo '<p>Could not show the pushpress Workouts. Please check with Administrator.</p>';
     79            echo '<p>Could not show the PushPress Schedule. Please check with Administrator.</p>';
    8080            return;
    8181        }
     
    113113            $timeNow = LocalTime::toGM($client);
    114114        } catch (Exception $e) {
    115             echo '<p>Could not show the pushpress Workouts. Please check with Administrator.</p>';
     115            echo '<p>Could not show the PushPress Workouts. Please check with Administrator.</p>';
    116116            return;
    117117        }
  • pushpress-integration/trunk/pushpress.php

    r1542137 r1567572  
    1 <?php
     1    <?php
    22/**
    33 * @package WP-PushPress
    4  * @version 1.5.8
     4 * @version 1.5.9
    55 */
    66/*
     
    99Description: Easily integrate your workouts, calendar, products, membership plans, events and more with your Wordpress blog!  This plugin is a free add-on for existing PushPress clients.  See https://pushpress.com for more info.
    1010Author: PushPress, Inc
    11 Version: 1.5.8
     11Version: 1.5.9
    1212Author URI: https://pushpress.com
    1313*/
    1414define('PUSHPRESS_LOCAL', FALSE);
    1515define('PUSHPRESS_DEV', FALSE);
    16 define( 'PP_PLUGIN_VERSION', '1.5.8');
     16define( 'PP_PLUGIN_VERSION', '1.5.9');
    1717define( 'PUSHPRESS_ERROR_REPORT', 0 );
    1818define( 'PUSHPRESS_BUTTON_CLASS',  'pushpress-button-class-' . rand(0, 10000));
     
    267267        }
    268268        function update_lead_info(){
     269
    269270            // lead_page_phone_required
    270271            $data = $this->model->get_leads();
     
    518519
    519520            $metrics = $this->model->facebook_metrics();
     521           
    520522            $value = $metrics['average_lead_value'];
    521523            $currency_iso = $this->client->currency_iso;
  • pushpress-integration/trunk/readme.txt

    r1542174 r1567572  
    44Requires at least: 3.0.1
    55Tested up to: 4.6.1
    6 Stable tag: 1.5.8
     6Stable tag: 1.5.9
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    117117= 1.5.8 =
    118118Fixed bug that was double submitting lead notes when a user entered a note.
     119
     120= 1.5.9 =
     121Fixed bug that was calculating average lead value incorrectly for FB Lead conversions.
  • pushpress-integration/trunk/templates/frontend/shortcode_schedules.php

    r1299350 r1567572  
    33$linkTo = str_replace('{subdomain}', $this->subdomain, PUSHPRESS_CLIENT) . 'schedule/index/';
    44?>
    5 
    65<div class="wp-pushpress">
    76    <div class="schedule-date">
     
    2221                    <div class="clear"></div>
    2322                </li>
     23                <li class="item-header" style="font-weight:bold;">
     24                    <span class="schedule-name">Class Time</span>
     25                    <span class="schedule-hour">Duration</span>
     26                    <span class="schedule-title">Class</span>
     27                    <span class="schedule-type">
     28                        Coach
     29                    </span>
     30                    <span class="schedule-spots">
     31                        Spaces Avail.
     32                    </span>
     33                    <div class="clear"></div>
     34                </li>
    2435                <?php
    2536                foreach ($item as $k => $value) {
     
    2839                    <li class="item-other">
    2940                        <span class="schedule-name"><?php echo date('g:i a', $value['start_timestamp']); ?></span>
    30                         <span class="schedule-hour"><?php echo ( ($value['end_timestamp'] - $value['start_timestamp']) / 3600 ) . " hr"; ?></span>
     41                        <span class="schedule-hour"><?php echo round(( ($value['end_timestamp'] - $value['start_timestamp']) / 3600 ), 2) . " hr"; ?></span>
    3142                        <span class="schedule-title"><?php echo $value['title']; ?></span>
    32                         <span class="schedule-type"><?php echo $value['fullname']; ?></span>
     43                        <span class="schedule-type">
     44                            <?php if (strlen(trim($value['fullname']))) {
     45                                echo $value['fullname'];
     46                            }
     47                            else {
     48                                echo 'Coach TBD';
     49                            }
     50                            ?>
     51                        </span>
     52                        <span class="schedule-spots">
     53                            <?php
     54                                if ($value['status']['spots_available'] == -1) {
     55                                    echo "Yes";
     56                                }
     57                                else if ($value['status']['spots_available'] == 0) {
     58                                    echo "No";
     59                                }
     60                                else {
     61                                    echo "Yes";
     62                                }                               
     63                            ?>                           
     64                        </span>
    3365                        <div class="clear"></div>
    3466                    </li>
Note: See TracChangeset for help on using the changeset viewer.