Skip to content

Commit

Permalink
Merge pull request #61 from TheCraigHewitt/release/1.2.5
Browse files Browse the repository at this point in the history
Release/1.2.5
  • Loading branch information
jonathanbossenger authored Dec 20, 2019
2 parents 864df8e + d686fec commit 64ca8a5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion partials/stats-all-episodes-pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<span class="displaying-num"><?php echo $this->total_posts . ' ' . __( 'items', 'seriously-simple-stats' ) ?></span>
<span class='pagination-links'>
<?php if ( $pagenum != 1 ) { ?>
<a class="next-page" href="<?php echo $next_page_url ?>">
<a class="next-page" href="<?php echo $prev_page_url ?>">
<span class="screen-reader-text"><?php echo __( 'Previous page', 'seriously-simple-stats' ); ?></span>
<span aria-hidden="true">«</span>
</a>
Expand Down
2 changes: 1 addition & 1 deletion partials/stats-all-episodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</thead>
<?php foreach ( $all_episodes_stats as $episode ) { ?>
<tr>
<td><?php echo $episode['date']; ?></td>
<td><?php echo $episode['formatted_date']; ?></td>
<td style="width: 50%;"><a href='<?php echo $episode['slug']; ?>'><?php echo $episode['episode_name']; ?></a></td>
<?php foreach ( $this->dates as $date ) { ?>
<td style='text-align: center;'><?php echo $episode[$date]; ?></td>
Expand Down
10 changes: 6 additions & 4 deletions php/classes/class-all-episode-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ public function render_all_episodes_stats(){
$pagenum = 1;
}
$total_pages = ceil( $this->total_posts / $this->total_per_page );
$prev_page = ( $pagenum <= 1 ) ? 1 : $pagenum - 1;
$order_by = isset( $_GET['orderby'] ) ? '&orderby=' . sanitize_text_field( $_GET['orderby'] ) : "";
$order = isset( $_GET['order'] ) ? '&order=' . sanitize_text_field( $_GET['order'] ) : "";
$next_page_url = admin_url( "edit.php?post_type=podcast&page=podcast_stats" . $order_by . $order . "&pagenum=" . $prev_page . "#last-three-months-container" );
$prev_page = ( $pagenum <= 1 ) ? 1 : $pagenum - 1;
$prev_page_url = admin_url( "edit.php?post_type=podcast&page=podcast_stats" . $order_by . $order . "&pagenum=" . $prev_page . "#last-three-months-container" );
$next_page = $pagenum + 1;
$next_page_url = admin_url( "edit.php?post_type=podcast&page=podcast_stats" . $order_by . $order . "&pagenum=" . $next_page . "#last-three-months-container" );
ob_start();
require_once SSP_STATS_DIR_PATH . 'partials/stats-all-episodes-pagination.php';
$html .= ob_get_clean();
Expand All @@ -92,7 +93,7 @@ private function get_all_episode_stats() {
global $wpdb;
$date_keys = array_keys( $this->dates );

$order_by = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'episode_name';
$order_by = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'date';
$order = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'desc';

$all_episodes_stats = array();
Expand Down Expand Up @@ -125,9 +126,10 @@ private function get_all_episode_stats() {

$episode_stats = array(
'episode_name' => $post->post_title,
'date' => date( 'm-d-Y', strtotime( $post->post_date ) ),
'date' => date( 'Y-m-d', strtotime( $post->post_date ) ),
'slug' => admin_url( 'post.php?post=' . $post->ID . '&action=edit' ),
'listens' => $lifetime_count,
'formatted_date' => date_i18n( get_option('date_format'), strtotime( $post->post_date ) ),
);

foreach ( $this->dates as $date_key => $date ) {
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: PodcastMotor, psykro, simondowdles, hlashbrooke, seriouspodcaster
Tags: seriously simple podcasting, stats, statistics, listeners, analytics, podcast, podcasting, ssp, free, add-ons, extensions, addons
Requires at least: 4.4
Tested up to: 5.1.1
Stable tag: 1.2.4
Stable tag: 1.2.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -78,6 +78,12 @@ Yes. This plugin uses the [Crawler Detect](https://github.com/JayBizzle/Crawler-

== Changelog ==

= 1.2.5 =
* 2018-08-13
* [FIX] Fixed a bug in the All episode stats pagination (props [wudanbal](https://github.com/wudanbal))
* [UPDATE] Default sorting for All episode stats set to date (props [wudanbal](https://github.com/wudanbal))
* [UPDATE] Date display field uses WordPress Date Format setting, to display date (props [wudanbal](https://github.com/wudanbal))

= 1.2.4 =
* 2018-07-31
* [FIX] Fixed a PHP warning which only occurs on the last day of the month
Expand Down
4 changes: 2 additions & 2 deletions seriously-simple-stats.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
* Plugin Name: Seriously Simple Stats
* Version: 1.2.4
* Version: 1.2.5
* Plugin URI: https://wordpress.org/plugins/seriously-simple-stats
* Description: Integrated analytics and stats tracking for Seriously Simple Podcasting.
* Author: Castos
Expand Down Expand Up @@ -29,7 +29,7 @@

require_once 'vendor/autoload.php';

define( 'SSP_STATS_VERSION', '1.2.4' );
define( 'SSP_STATS_VERSION', '1.2.5' );
define( 'SSP_STATS_DIR_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );

if ( ! function_exists( 'is_ssp_active' ) ) {
Expand Down

0 comments on commit 64ca8a5

Please sign in to comment.