PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / trunk
Wp Social Login and Register Social Counter vtrunk
3.2.1 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-factory.php
wp-social / lib / provider Last commit date
counter 8 months ago share 8 months ago counter-factory.php 8 months ago share-factory.php 8 months ago
counter-factory.php
88 lines
1 <?php
2
3 namespace WP_Social\Lib\Provider;
4
5 use WP_Social\Lib\Provider\Counter\Comments_Counter;
6 use WP_Social\Lib\Provider\Counter\Dribbble_Counter;
7 use WP_Social\Lib\Provider\Counter\Facebook_Counter;
8 use WP_Social\Lib\Provider\Counter\Instagram_Counter;
9 use WP_Social\Lib\Provider\Counter\Tiktok_Counter;
10 use WP_Social\Lib\Provider\Counter\No_Provider_Counter;
11 use WP_Social\Lib\Provider\Counter\Pinterest_Counter;
12 use WP_Social\Lib\Provider\Counter\Posts_Counter;
13 use WP_Social\Lib\Provider\Counter\Twitter_Counter;
14 use WP_Social\Lib\Provider\Counter\Youtube_Counter;
15
16
17 class Counter_Factory {
18
19 private $provider_type;
20
21 public $factory;
22
23 private $def_cache_time;
24
25
26 public function __construct($cache_time = 43200) {
27
28 $this->def_cache_time = $cache_time;
29 }
30
31
32 public function make($type) {
33
34 $this->provider_type = $type;
35
36 switch($type) {
37
38 case 'instagram' :
39 $this->factory = new Instagram_Counter();
40 break;
41
42 case 'tiktok' :
43 $this->factory = new Tiktok_Counter();
44 break;
45
46 // case 'mailchimp' :
47 // $this->factory = new Mailchimp_Counter();
48 // break;
49
50 case 'facebook' :
51 $this->factory = new Facebook_Counter();
52 break;
53
54 case 'twitter' :
55 $this->factory = new Twitter_Counter();
56 break;
57
58 case 'pinterest' :
59 $this->factory = new Pinterest_Counter();
60 break;
61
62 case 'dribbble' :
63 $this->factory = new Dribbble_Counter();
64 break;
65
66 case 'youtube' :
67 $this->factory = new Youtube_Counter();
68 break;
69
70 case 'comments' :
71 $this->factory = new Comments_Counter();
72 break;
73
74 case 'posts' :
75 $this->factory = new Posts_Counter();
76 break;
77
78 default:
79 $this->factory = new No_Provider_Counter();
80
81 }
82
83 $this->factory->set_cache_time($this->def_cache_time);
84
85 return $this->factory;
86 }
87 }
88