Skip to content

Commit

Permalink
Release version 2.0.1
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
alextuan committed Dec 13, 2017
1 parent 217d74b commit 2814d91
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 21 deletions.
12 changes: 4 additions & 8 deletions admin/plugin-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Process when plugin is activated
*/
function pvc_install(){
update_option( 'a3_pvc_version', '2.0.0' );
update_option( 'a3_pvc_version', '2.0.1' );

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

function a3_pvc_plugin_init() {
if ( get_option('pvc_just_installed') ) {
delete_option('pvc_just_installed');
wp_redirect( admin_url( 'options-general.php?page=a3-pvc', 'relative' ) );
exit;
}

// Set up localisation
a3_pvc_load_plugin_textdomain();
}

add_action( 'init', 'a3_pvc_plugin_init' );

// Add custom style to dashboard
Expand Down Expand Up @@ -68,7 +64,7 @@ function pvc_empty_daily_table_do_daily() {
}

$pvc_settings = get_option( 'pvc_settings', array( 'position' => 'bottom' ) );
if ( 'top' == $pvc_settings['position'] ) {
if ( isset( $pvc_settings['position'] ) && 'top' == $pvc_settings['position'] ) {
add_action('genesis_before_post_content', array('A3_PVC', 'genesis_pvc_stats_echo'));
} else {
add_action('genesis_after_post_content', array('A3_PVC', 'genesis_pvc_stats_echo'));
Expand Down Expand Up @@ -135,7 +131,7 @@ function pvc_lite_upgrade_plugin () {
$a3_pvc_less->plugin_build_sass();
}

update_option('a3_pvc_version', '2.0.0');
update_option('a3_pvc_version', '2.0.1');

}

Expand Down
2 changes: 1 addition & 1 deletion api/pvc-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ public function view_stats( WP_REST_Request $request ) {

global $pvc_api;
$pvc_api = new PVC_API();
?>
?>
12 changes: 6 additions & 6 deletions assets/js/pvc.backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jQuery( function( $ ) {
},

render: function() {
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'));
//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'));
this.$el.html( this.template( this.model.toJSON() ) );

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

view_pvc_ids = [];
increase_pvc_ids = [];

$.each( pvc_ids, function (index, data) {
if ( data.ask_update ) {
increase_pvc_ids.push( post_id );
increase_pvc_ids.push( data.post_id );
} else {
view_pvc_ids.push( post_id );
view_pvc_ids.push( data.post_id );
}
});

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

if ( view_pvc_ids.length ) {
$.get( this.rest_api_url + '/view/' + view_pvc_ids.join(','), function( data_pvc ) {
console.log(data_pvc);
//console.log(data_pvc);
if ( data_pvc.success ) {
$.each( data_pvc.items , function (index, data) {
collection = new pvc.collections.Stats;
Expand Down
2 changes: 1 addition & 1 deletion assets/js/pvc.backbone.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions page-views-count.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/*
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.0.0
Version: 2.0.1
Requires at least: 4.6
Tested up to: 4.9.0
Tested up to: 4.9.1
Author: a3rev Software
Author URI: https://a3rev.com
Text Domain: page-views-count
Expand All @@ -21,7 +21,7 @@
define('A3_PVC_JS_URL', A3_PVC_URL . '/assets/js');
define('A3_PVC_IMAGES_URL', A3_PVC_URL . '/assets/images');

define('A3_PVC_VERSION', '2.0.0');
define('A3_PVC_VERSION', '2.0.1');

/**
* Load Localisation files.
Expand Down
17 changes: 15 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: a3rev, a3rev Software, nguyencongtuan
Tags: wordpress page view, page view count , post views, postview count,
Requires at least: 4.6
Tested up to: 4.9.0
Stable tag: 2.0.0
Tested up to: 4.9.1
Stable tag: 2.0.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

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

== Changelog ==

= 2.0.1 - 2017/12/13 =
* 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

= 2.0.0 - 2017/06/02 =
* Feature - Upgrade Stats image icon to fontawesome Chart Icon
* Feature - Add new + Counter Position and Style options box on plugins admin panel
Expand Down Expand Up @@ -254,6 +264,9 @@ The manual installation method involves down loading our plugin and uploading it

== Upgrade Notice ==

= 2.0.1 =
Maintenance Update. 3 code tweaks for compatibility with WordPress 4.9.1 and 2 bug fixes

= 2.0.0 =
Major Feature Upgrade. Release of 7 new features and 2 code tweaks for compatibility with upcoming WordPress major version 4.8.0

Expand Down

0 comments on commit 2814d91

Please sign in to comment.