PluginProbe ʕ •ᴥ•ʔ
Rich Showcase for Google Reviews / 3.4
Rich Showcase for Google Reviews v3.4
6.9.7 6.9.6 trunk 1.4 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.5 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 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.7 1.6.8 1.6.9 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.4 2.4.1 2.4.2 2.5 2.5.1 2.6 2.6.1 2.6.2 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.6.1 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.8.1 4.8.2 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.7.1 5.8 5.9 5.9.1 5.9.2 5.9.3 5.9.7 6.0 6.1 6.2 6.3 6.4 6.4.1 6.5 6.6 6.6.1 6.6.2 6.7 6.8 6.8.1 6.8.2 6.9 6.9.1 6.9.2 6.9.3 6.9.4 6.9.4.1 6.9.4.2 6.9.4.3 6.9.4.4 6.9.5
widget-google-reviews / includes / class-plugin.php
widget-google-reviews / includes Last commit date
admin 2 years ago core 2 years ago class-activator.php 2 years ago class-assets.php 2 years ago class-builder-page.php 3 years ago class-deactivator.php 3 years ago class-debug-info.php 2 years ago class-feed-ajax.php 2 years ago class-feed-block.php 2 years ago class-feed-deserializer.php 2 years ago class-feed-old.php 4 years ago class-feed-page.php 3 years ago class-feed-serializer.php 2 years ago class-feed-shortcode.php 2 years ago class-feed-widget.php 4 years ago class-plugin-overview-ajax.php 3 years ago class-plugin-overview.php 3 years ago class-plugin-settings.php 2 years ago class-plugin-support.php 3 years ago class-plugin.php 2 years ago class-post-types.php 3 years ago class-reviews-cron.php 2 years ago class-settings-save.php 2 years ago class-view.php 2 years ago index.php 4 years ago page-setting-fig.php 3 years ago page-setting-support.php 4 years ago
class-plugin.php
150 lines
1 <?php
2
3 namespace WP_Rplg_Google_Reviews\Includes;
4
5 use WP_Rplg_Google_Reviews\Includes\Admin\Admin_Menu;
6 use WP_Rplg_Google_Reviews\Includes\Admin\Admin_Tophead;
7 use WP_Rplg_Google_Reviews\Includes\Admin\Admin_Notice;
8 use WP_Rplg_Google_Reviews\Includes\Admin\Admin_Feed_Columns;
9 use WP_Rplg_Google_Reviews\Includes\Admin\Admin_Rev;
10 use WP_Rplg_Google_Reviews\Includes\Admin\Admin_Rateus_Ajax;
11
12 use WP_Rplg_Google_Reviews\Includes\Core\Core;
13 use WP_Rplg_Google_Reviews\Includes\Core\Connect_Google;
14 use WP_Rplg_Google_Reviews\Includes\Core\Database;
15
16 final class Plugin {
17
18 protected $name;
19 protected $version;
20 protected $activator;
21 protected $deactivator;
22
23 public function __construct() {
24 $this->name = 'widget-google-reviews';
25 $this->version = GRW_VERSION;
26 }
27
28 public function register() {
29 register_activation_hook(GRW_PLUGIN_FILE, array($this, 'activate'));
30 register_deactivation_hook(GRW_PLUGIN_FILE, array($this, 'deactivate'));
31
32 add_action('admin_init', array($this, 'admin_init'));
33 add_action('plugins_loaded', array($this, 'register_services'));
34 }
35
36 public function admin_init() {
37 if (get_option('grw_do_activation', false)) {
38 delete_option('grw_do_activation');
39 wp_safe_redirect(admin_url('admin.php?page=grw'));
40 }
41 }
42
43 public function register_services() {
44 $this->init_language();
45
46 $database = new Database();
47
48 $activator = new Activator($database);
49 $activator->register();
50
51 $assets = new Assets(GRW_ASSETS_URL, $this->version, get_option('grw_debug_mode') == '1');
52 $assets->register();
53
54 $post_types = new Post_Types();
55 $post_types->register();
56
57 $feed_deserializer = new Feed_Deserializer(new \WP_Query());
58
59 $debug_info = new Debug_Info($activator, $feed_deserializer);
60
61 $feed_page = new Feed_Page($feed_deserializer);
62 $feed_page->register();
63
64 $core = new Core();
65
66 $view = new View();
67
68 $builder_page = new Builder_Page($feed_deserializer, $core, $view);
69 $builder_page->register();
70
71 $feed_old = new Feed_Old();
72
73 $feed_shortcode = new Feed_Shortcode($feed_deserializer, $assets, $core, $view, $feed_old);
74 $feed_shortcode->register();
75
76 Feed_Widget::$static_feed_deserializer = $feed_deserializer;
77 Feed_Widget::$static_core = $core;
78 Feed_Widget::$static_view = $view;
79 Feed_Widget::$static_assets = $assets;
80 Feed_Widget::$static_feed_old = $feed_old;
81 add_action('widgets_init', function() {
82 register_widget('WP_Rplg_Google_Reviews\Includes\Feed_Widget');
83 });
84
85 $feed_block = new Feed_Block($feed_deserializer, $core, $view, $assets);
86 $feed_block->register();
87
88 $connect_google = new Connect_Google();
89
90 $reviews_cron = new Reviews_Cron($connect_google, $feed_deserializer);
91 $reviews_cron->register();
92
93 $this->deactivator = new Deactivator($reviews_cron);
94
95 if (is_admin()) {
96 $feed_serializer = new Feed_Serializer();
97 $feed_ajax = new Feed_Ajax($feed_serializer, $feed_deserializer, $core, $view);
98
99 $admin_notice = new Admin_Notice();
100 $admin_notice->register();
101
102 $admin_menu = new Admin_Menu();
103 $admin_menu->register();
104
105 $admin_tophead = new Admin_Tophead();
106 $admin_tophead->register();
107
108 $admin_feed_columns = new Admin_Feed_Columns($feed_deserializer);
109 $admin_feed_columns->register();
110
111 $plugin_overview_ajax = new Plugin_Overview_Ajax($core);
112 $plugin_overview = new Plugin_Overview();
113 $plugin_overview->register();
114
115 $settings_save = new Settings_Save($activator, $reviews_cron);
116 $settings_save->register();
117
118 $plugin_settings = new Plugin_Settings($debug_info);
119 $plugin_settings->register();
120
121 $plugin_support = new Plugin_Support();
122 $plugin_support->register();
123
124 $admin_rev = new Admin_Rev();
125 $admin_rev->register();
126
127 $rateus_ajax = new Admin_Rateus_Ajax();
128 }
129 }
130
131 public function init_language() {
132 load_plugin_textdomain('widget-google-reviews', false, basename(dirname(GRW_PLUGIN_FILE)) . '/languages');
133 }
134
135 public function activate($network_wide = false) {
136 $now = time();
137 update_option('grw_activation_time', $now);
138
139 add_option('grw_is_multisite', $network_wide);
140
141 add_option('grw_do_activation', true);
142
143 $activator = new Activator(new Database());
144 $activator->activate();
145 }
146
147 public function deactivate() {
148 $this->deactivator->deactivate();
149 }
150 }