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