PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 2.2.4
Wp Social Login and Register Social Counter v2.2.4
trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.8 2.2.9 3.0.0 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0
wp-social / lib / provider / counter / counter.php
wp-social / lib / provider / counter Last commit date
comments-counter.php 5 years ago counter-interface.php 5 years ago counter.php 5 years ago dribbble-counter.php 5 years ago facebook-counter.php 3 years ago instagram-counter.php 4 years ago no-provider-counter.php 5 years ago pinterest-counter.php 5 years ago posts-counter.php 5 years ago twitter-counter.php 5 years ago youtube-counter.php 5 years ago
counter.php
39 lines
1 <?php
2
3 namespace WP_Social\Lib\Provider\Counter;
4
5
6 abstract class Counter implements Counter_Interface {
7
8 protected $cache_time;
9
10
11 public static function get_last_cache_time() {
12
13 return get_option(static::get_last_cache_key(), -1);
14 }
15
16
17 public static function get_cache_time_verbose() {
18
19 $time = self::get_last_cache_time();
20
21 if($time < 0) {
22
23 return __('No cache found', 'wp-social');
24 }
25
26 return human_time_diff($time, time()). ' ago';
27 }
28
29 public function get_cached_count() {
30
31 return $this->get_count($this->cache_time);
32 }
33
34 public function set_cache_time($time) {
35
36 $this->cache_time = $time;
37 }
38 }
39