Skip to content

Commit

Permalink
Release new version 2.4.12
Browse files Browse the repository at this point in the history
= 2.4.12 - 2021/07/19 =
* This maintenance release has code tweaks for WordPress 5.8 compatibility plus more Security hardening
* Tweak - Test for compatibility with WordPress 5.8
* Security - Get variable via name instead of use extract
  • Loading branch information
alextuan committed Jul 19, 2021
1 parent cb56a5b commit 0cf5051
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions page-views-count.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Plugin Name: Page Views Count
Description: Show front end users all time views and views today on posts, pages, index pages and custom post types with the Page Views Count Plugin. Use the Page Views Count function to add page views to any content type or object created by your theme or plugins.
Version: 2.4.11
Version: 2.4.12
Requires at least: 5.0
Tested up to: 5.8
Author: a3rev Software
Expand All @@ -23,7 +23,7 @@

define( 'A3_PVC_KEY', 'a3_page_view_count' );
define( 'A3_PVC_PREFIX', 'wp_pvc_' );
define( 'A3_PVC_VERSION', '2.4.11' );
define( 'A3_PVC_VERSION', '2.4.12' );
define( 'A3_PVC_G_FONTS', false );

use \A3Rev\PageViewsCount\FrameWork;
Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: a3rev, a3rev Software, nguyencongtuan
Tags: wordpress page view, page view count , post views, post view count, gutenberg
Requires at least: 5.0
Tested up to: 5.8
Stable tag: 2.4.11
Stable tag: 2.4.12
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -103,6 +103,11 @@ The manual installation method involves down loading our plugin and uploading it

== Changelog ==

= 2.4.12 - 2021/07/19 =
* This maintenance release has code tweaks for WordPress 5.8 compatibility plus more Security hardening
* Tweak - Test for compatibility with WordPress 5.8
* Security - Get variable via name instead of use extract

= 2.4.11 - 2021/07/13 =
* This maintenance release has more code security hardening
* Security - Add more variable, options and html escaping
Expand Down Expand Up @@ -468,6 +473,9 @@ The manual installation method involves down loading our plugin and uploading it

== Upgrade Notice ==

= 2.4.12 =
This maintenance release has code tweaks for WordPress 5.8 compatibility plus more Security hardening

= 2.4.11 =
This maintenance release has more code security hardening.

Expand Down
9 changes: 5 additions & 4 deletions src/pvc_shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ public function parse_shortcode( $attr = array() ) {
return '';
}

extract( shortcode_atts(
$attr = shortcode_atts(
array(
'postid' => '',
'increase' => 1,
'show_views_today' => 1,
), $attr )
);
), $attr );

$postid = esc_attr( $postid ); // XSS ok
$postid = esc_attr( $attr['postid'] ); // XSS ok
$increase = intval( $attr['increase'] );
$show_views_today = intval( $attr['show_views_today'] );

$output = apply_filters( 'pvc_stats_shortcode', '', $postid, $increase, $show_views_today );

Expand Down
7 changes: 3 additions & 4 deletions src/pvc_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function __construct() {
}

function widget( $args, $instance ) {
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$postid = sanitize_text_field( $instance['postid'] );
$increase = intval( $instance['increase'] );
Expand All @@ -32,14 +31,14 @@ function widget( $args, $instance ) {
return '';
}

echo $before_widget;
echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
if ( $title ) {
echo $before_title . $title . $after_title;
echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
}

echo $pvc_stats_output;

echo $after_widget;
echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
}

public function pvc_stats_widget( $output = '', $postid = '', $increase = 1, $show_views_today = 1 ) {
Expand Down

0 comments on commit 0cf5051

Please sign in to comment.