Skip to content

Commit 2814d91

Browse files
committed
Release version 2.0.1
* Maintenance Update. 3 code tweaks for compatibility with WordPress 4.9.1 and 2 bug fixes * Tweak - Removed auto redirect to plugins admin panel on activation * Tweak - Added Settings link to plugins description on plugins menu * Tweak - Remove console log from script as it was causing theme Customizer to load slowly * Tweak - Tested for compatibility with WordPress 4.9.1 * Fix - Update regex expression in the REST endpoint so that it accepts array-like params as expected. * Fix - Get correct item ID if params is parse as array * Credit - Thanks to Cypwu for the Github contribution for REST endpoint modification
1 parent 217d74b commit 2814d91

File tree

6 files changed

+30
-21
lines changed

6 files changed

+30
-21
lines changed

admin/plugin-init.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Process when plugin is activated
44
*/
55
function pvc_install(){
6-
update_option( 'a3_pvc_version', '2.0.0' );
6+
update_option( 'a3_pvc_version', '2.0.1' );
77

88
// empty pvc_daily table for daily
99
wp_schedule_event( time(), 'daily', 'pvc_empty_daily_table_daily_event_hook' );
@@ -30,15 +30,11 @@ function pvc_deactivation() {
3030
update_option('a3rev_auth_pvc', '');
3131

3232
function a3_pvc_plugin_init() {
33-
if ( get_option('pvc_just_installed') ) {
34-
delete_option('pvc_just_installed');
35-
wp_redirect( admin_url( 'options-general.php?page=a3-pvc', 'relative' ) );
36-
exit;
37-
}
3833

3934
// Set up localisation
4035
a3_pvc_load_plugin_textdomain();
4136
}
37+
4238
add_action( 'init', 'a3_pvc_plugin_init' );
4339

4440
// Add custom style to dashboard
@@ -68,7 +64,7 @@ function pvc_empty_daily_table_do_daily() {
6864
}
6965

7066
$pvc_settings = get_option( 'pvc_settings', array( 'position' => 'bottom' ) );
71-
if ( 'top' == $pvc_settings['position'] ) {
67+
if ( isset( $pvc_settings['position'] ) && 'top' == $pvc_settings['position'] ) {
7268
add_action('genesis_before_post_content', array('A3_PVC', 'genesis_pvc_stats_echo'));
7369
} else {
7470
add_action('genesis_after_post_content', array('A3_PVC', 'genesis_pvc_stats_echo'));
@@ -135,7 +131,7 @@ function pvc_lite_upgrade_plugin () {
135131
$a3_pvc_less->plugin_build_sass();
136132
}
137133

138-
update_option('a3_pvc_version', '2.0.0');
134+
update_option('a3_pvc_version', '2.0.1');
139135

140136
}
141137

api/pvc-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,4 @@ public function view_stats( WP_REST_Request $request ) {
135135

136136
global $pvc_api;
137137
$pvc_api = new PVC_API();
138-
?>
138+
?>

assets/js/pvc.backbone.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jQuery( function( $ ) {
3636
},
3737

3838
render: function() {
39-
console.log('Rendering Page View Count of ID #' + this.model.get('post_id') + ' - Today: #' + this.model.get('today_view') + ' - Total: #' + this.model.get('total_view'));
39+
//console.log('Rendering Page View Count of ID #' + this.model.get('post_id') + ' - Today: #' + this.model.get('today_view') + ' - Total: #' + this.model.get('total_view'));
4040
this.$el.html( this.template( this.model.toJSON() ) );
4141

4242
return this;
@@ -59,22 +59,22 @@ jQuery( function( $ ) {
5959
pvc.apps.app = {
6060
initialize: function( pvc_ids, rest_api_url ) {
6161
this.rest_api_url = rest_api_url;
62-
console.log('Load Page View Count of ' + JSON.stringify(pvc_ids) );
62+
//console.log('Load Page View Count of ' + JSON.stringify(pvc_ids) );
6363

6464
view_pvc_ids = [];
6565
increase_pvc_ids = [];
6666

6767
$.each( pvc_ids, function (index, data) {
6868
if ( data.ask_update ) {
69-
increase_pvc_ids.push( post_id );
69+
increase_pvc_ids.push( data.post_id );
7070
} else {
71-
view_pvc_ids.push( post_id );
71+
view_pvc_ids.push( data.post_id );
7272
}
7373
});
7474

7575
if ( increase_pvc_ids.length ) {
7676
$.get( this.rest_api_url + '/increase/' + increase_pvc_ids.join(','), function( data_pvc ) {
77-
console.log(data_pvc);
77+
//console.log(data_pvc);
7878
if ( data_pvc.success ) {
7979
$.each( data_pvc.items, function (index, data) {
8080
collection = new pvc.collections.Stats;
@@ -88,7 +88,7 @@ jQuery( function( $ ) {
8888

8989
if ( view_pvc_ids.length ) {
9090
$.get( this.rest_api_url + '/view/' + view_pvc_ids.join(','), function( data_pvc ) {
91-
console.log(data_pvc);
91+
//console.log(data_pvc);
9292
if ( data_pvc.success ) {
9393
$.each( data_pvc.items , function (index, data) {
9494
collection = new pvc.collections.Stats;

assets/js/pvc.backbone.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

page-views-count.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/*
33
Plugin Name: Page Views Count
44
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.
5-
Version: 2.0.0
5+
Version: 2.0.1
66
Requires at least: 4.6
7-
Tested up to: 4.9.0
7+
Tested up to: 4.9.1
88
Author: a3rev Software
99
Author URI: https://a3rev.com
1010
Text Domain: page-views-count
@@ -21,7 +21,7 @@
2121
define('A3_PVC_JS_URL', A3_PVC_URL . '/assets/js');
2222
define('A3_PVC_IMAGES_URL', A3_PVC_URL . '/assets/images');
2323

24-
define('A3_PVC_VERSION', '2.0.0');
24+
define('A3_PVC_VERSION', '2.0.1');
2525

2626
/**
2727
* Load Localisation files.

readme.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: a3rev, a3rev Software, nguyencongtuan
33
Tags: wordpress page view, page view count , post views, postview count,
44
Requires at least: 4.6
5-
Tested up to: 4.9.0
6-
Stable tag: 2.0.0
5+
Tested up to: 4.9.1
6+
Stable tag: 2.0.1
77
License: GPLv3
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -89,6 +89,16 @@ The manual installation method involves down loading our plugin and uploading it
8989

9090
== Changelog ==
9191

92+
= 2.0.1 - 2017/12/13 =
93+
* Maintenance Update. 3 code tweaks for compatibility with WordPress 4.9.1 and 2 bug fixes
94+
* Tweak - Removed auto redirect to plugins admin panel on activation
95+
* Tweak - Added Settings link to plugins description on plugins menu
96+
* Tweak - Remove console log from script as it was causing theme Customizer to load slowly
97+
* Tweak - Tested for compatibility with WordPress 4.9.1
98+
* Fix - Update regex expression in the REST endpoint so that it accepts array-like params as expected.
99+
* Fix - Get correct item ID if params is parse as array
100+
* Credit - Thanks to Cypwu for the Github contribution for REST endpoint modification
101+
92102
= 2.0.0 - 2017/06/02 =
93103
* Feature - Upgrade Stats image icon to fontawesome Chart Icon
94104
* Feature - Add new + Counter Position and Style options box on plugins admin panel
@@ -254,6 +264,9 @@ The manual installation method involves down loading our plugin and uploading it
254264

255265
== Upgrade Notice ==
256266

267+
= 2.0.1 =
268+
Maintenance Update. 3 code tweaks for compatibility with WordPress 4.9.1 and 2 bug fixes
269+
257270
= 2.0.0 =
258271
Major Feature Upgrade. Release of 7 new features and 2 code tweaks for compatibility with upcoming WordPress major version 4.8.0
259272

0 commit comments

Comments
 (0)