PluginProbe ʕ •ᴥ•ʔ
Rich Showcase for Google Reviews / 6.9.10
Rich Showcase for Google Reviews v6.9.10
6.9.10 6.9.9 6.9.8 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 weeks ago core 6 days ago class-activator.php 2 weeks ago class-assets.php 2 months ago class-builder-page.php 5 months ago class-deactivator.php 3 years ago class-debug-info.php 6 months ago class-feed-ajax.php 1 year ago class-feed-block.php 2 weeks ago class-feed-deserializer.php 11 months ago class-feed-old.php 4 years ago class-feed-page.php 11 months ago class-feed-serializer.php 9 months ago class-feed-shortcode.php 2 years ago class-feed-widget.php 8 months ago class-plugin-overview-ajax.php 1 year ago class-plugin-overview.php 6 months ago class-plugin-settings.php 3 days ago class-plugin-support.php 1 year ago class-plugin.php 2 months ago class-post-types.php 3 years ago class-reviews-cron.php 1 year ago class-settings-save.php 2 months ago class-view.php 3 days ago index.php 4 years ago page-setting-advance.php 2 weeks ago page-setting-fig.php 1 year ago page-setting-support.php 4 years ago
class-plugin.php
168 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\Database;
14
15 use WP_Rplg_Google_Reviews\Includes\Core\Google_Dao;
16 use WP_Rplg_Google_Reviews\Includes\Core\Connect_Helper;
17 use WP_Rplg_Google_Reviews\Includes\Core\Google_Api_Old;
18 use WP_Rplg_Google_Reviews\Includes\Core\Google_Api_New;
19 use WP_Rplg_Google_Reviews\Includes\Core\Google_Utils;
20 use WP_Rplg_Google_Reviews\Includes\Core\Google_Connect;
21
22 final class Plugin {
23
24 protected $name;
25 protected $version;
26 protected $activator;
27 protected $deactivator;
28
29 public function __construct() {
30 $this->name = 'widget-google-reviews';
31 $this->version = GRW_VERSION;
32 }
33
34 public function register() {
35 register_activation_hook(GRW_PLUGIN_FILE, array($this, 'activate'));
36 register_deactivation_hook(GRW_PLUGIN_FILE, array($this, 'deactivate'));
37
38 add_action('init', array($this, 'init'));
39 add_action('admin_init', array($this, 'admin_init'));
40 add_action('plugins_loaded', array($this, 'register_services'));
41 }
42
43 public function init() {
44 $this->init_language();
45 }
46
47 public function admin_init() {
48 if (get_option('grw_do_activation', false)) {
49 delete_option('grw_do_activation');
50 wp_safe_redirect(admin_url('admin.php?page=grw'));
51 }
52 }
53
54 public function register_services() {
55 $database = new Database();
56
57 $activator = new Activator($database);
58 $activator->register();
59
60 $assets = new Assets(GRW_ASSETS_URL, $this->version, get_option('grw_debug_mode') == '1');
61 $assets->register();
62
63 $post_types = new Post_Types();
64 $post_types->register();
65
66 $feed_deserializer = new Feed_Deserializer(new \WP_Query());
67
68 $core = new Core();
69
70 $view = new View();
71
72 $builder_page = new Builder_Page($feed_deserializer, $core, $view);
73 $builder_page->register();
74
75 $feed_page = new Feed_Page($builder_page);
76 $feed_page->register();
77
78 $feed_old = new Feed_Old();
79
80 $feed_shortcode = new Feed_Shortcode($feed_deserializer, $assets, $core, $view, $feed_old);
81 $feed_shortcode->register();
82
83 Feed_Widget::$static_feed_deserializer = $feed_deserializer;
84 Feed_Widget::$static_core = $core;
85 Feed_Widget::$static_view = $view;
86 Feed_Widget::$static_assets = $assets;
87 Feed_Widget::$static_feed_old = $feed_old;
88 add_action('widgets_init', function() {
89 register_widget('WP_Rplg_Google_Reviews\Includes\Feed_Widget');
90 });
91
92 $feed_block = new Feed_Block($feed_deserializer, $core, $view, $assets);
93 $feed_block->register();
94
95 $connect_helper = new Connect_Helper();
96 $google_dao = new Google_Dao($connect_helper);
97 $google_api_old = new Google_Api_Old($google_dao, $connect_helper);
98 $google_api_new = new Google_Api_New($google_dao, $connect_helper);
99 $google_utils = new Google_Utils($google_api_old, $google_api_new);
100
101 $reviews_cron = new Reviews_Cron($google_utils, $feed_deserializer);
102 $reviews_cron->register();
103
104 $this->deactivator = new Deactivator($reviews_cron);
105
106 if (is_admin()) {
107 $google_connect = new Google_Connect($google_api_old, $google_api_new);
108
109 $feed_serializer = new Feed_Serializer();
110 $feed_ajax = new Feed_Ajax($feed_serializer, $feed_deserializer, $core, $view);
111
112 $admin_notice = new Admin_Notice();
113 $admin_notice->register();
114
115 $admin_menu = new Admin_Menu();
116 $admin_menu->register();
117
118 $admin_tophead = new Admin_Tophead();
119 $admin_tophead->register();
120
121 $admin_feed_columns = new Admin_Feed_Columns($feed_deserializer);
122 $admin_feed_columns->register();
123
124 $plugin_overview_ajax = new Plugin_Overview_Ajax($core);
125 $plugin_overview = new Plugin_Overview($builder_page);
126 $plugin_overview->register();
127
128 $settings_save = new Settings_Save($activator, $reviews_cron);
129 $settings_save->register();
130
131 $debug_info = new Debug_Info($activator, $feed_deserializer);
132
133 $plugin_settings = new Plugin_Settings($builder_page, $debug_info);
134 $plugin_settings->register();
135
136 $plugin_support = new Plugin_Support($debug_info);
137 $plugin_support->register();
138
139 $admin_rev = new Admin_Rev();
140 $admin_rev->register();
141
142 $rateus_ajax = new Admin_Rateus_Ajax();
143 }
144 }
145
146 public function init_language() {
147 load_plugin_textdomain('widget-google-reviews', false, basename(dirname(GRW_PLUGIN_FILE)) . '/languages');
148 }
149
150 public function activate($network_wide = false) {
151 $now = time();
152 update_option('grw_activation_time', $now);
153
154 update_option('grw_is_multisite', $network_wide ? '1' : '0');
155 if (!is_multisite()) {
156 update_option('grw_is_multisite', '0');
157 }
158
159 add_option('grw_do_activation', true);
160
161 $activator = new Activator(new Database());
162 $activator->activate();
163 }
164
165 public function deactivate() {
166 $this->deactivator->deactivate();
167 }
168 }