PluginProbe ʕ •ᴥ•ʔ
Post Views Counter / 1.2.3
Post Views Counter v1.2.3
1.7.13 1.7.12 1.7.11 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.2 1.3.2.1 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.7.0 1.7.1 1.7.10 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9
post-views-counter / includes / update.php
post-views-counter / includes Last commit date
columns.php 9 years ago counter.php 9 years ago cron.php 9 years ago dashboard.php 9 years ago frontend.php 9 years ago functions.php 9 years ago query.php 9 years ago settings.php 9 years ago update.php 9 years ago widgets.php 9 years ago
update.php
34 lines
1 <?php
2 // exit if accessed directly
3 if ( ! defined( 'ABSPATH' ) )
4 exit;
5
6 /**
7 * Post_Views_Counter_Update class.
8 */
9 class Post_Views_Counter_Update {
10
11 public function __construct() {
12 // actions
13 add_action( 'init', array( $this, 'check_update' ) );
14 }
15
16 /**
17 * Check if there's a db update required
18 */
19 public function check_update() {
20 if ( ! current_user_can( 'manage_options' ) )
21 return;
22
23 // get current database version
24 $current_db_version = get_option( 'post_views_counter_version', '1.0.0' );
25
26 // new version?
27 if ( version_compare( $current_db_version, Post_Views_Counter()->defaults['version'], '<' ) ) {
28 // update plugin version
29 update_option( 'post_views_counter_version', Post_Views_Counter()->defaults['version'] );
30 }
31 }
32
33 }
34