PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.2
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.2
6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 All 155 releases
← All changes | modules/logs/widgets/widget-log-graph-wp-widget.php +23 -16 5.2 → 6.2.2 View file →
@@ -11,9 +11,15 @@
11 11 namespace MainWP\Dashboard\Module\Log;
12 12
13 13 use MainWP\Dashboard\MainWP_DB;
14 14 use MainWP\Dashboard\MainWP_Utility;
15 +use MainWP\Dashboard\MainWP_UI;
15 16
17 +// Exit if accessed directly.
18 +if ( ! defined( 'ABSPATH' ) ) {
19 + exit;
20 +}
21 +
16 22 /**
17 23 * Class Log_Graph_WP_Widget
18 24 *
19 25 * Displays the Logs info.
@@ -60,19 +66,20 @@
60 66 /**
61 67 * Render client overview Info.
62 68 */
63 69 public function render_widget() {
70 + $sites_count = MainWP_DB::instance()->get_websites_count();
64 71 ?>
65 72 <div class="mainwp-widget-header">
66 - <h3 class="ui header handle-drag">
73 + <h2 class="ui header handle-drag">
67 74 <?php esc_html_e( 'WordPress Version Distribution', 'mainwp' ); ?>
68 75 <div class="sub header">
69 76 <?php esc_html_e( 'Count of sites running each WordPress version, helping you monitor version diversity and update needs within your network.', 'mainwp' ); ?>
70 77 </div>
71 - </h3>
78 + </h2>
72 79 </div>
73 80
74 - <div class="mainwp-widget-insights-card">
81 + <div class="mainwp-widget-insights-card mainwp-scrolly-overflow">
75 82 <?php
76 83 /**
77 84 * Action: mainwp_logs_widget_top
78 85 *
@@ -83,10 +90,14 @@
83 90 do_action( 'mainwp_logs_widget_top', 'wp' );
84 91 ?>
85 92 <div id="mainwp-message-zone" style="display:none;" class="ui message"></div>
86 93 <?php
87 - wp_nonce_field( 'mainwp-admin-nonce' );
88 - $this->render_widget_content();
94 + MainWP_UI::generate_wp_nonce( 'mainwp-admin-nonce' );
95 + if ( 0 < intval( $sites_count ) ) {
96 + $this->render_widget_content();
97 + } else {
98 + MainWP_UI::render_empty_element_placeholder( __( 'No WP Version Data', 'mainwp' ), '<a href="admin.php?page=managesites&do=new">' . __( 'Start connecting your sites now', 'mainwp' ) . '</a>', '<em data-emoji=":bar_chart:" class="medium"></em>' );
99 + }
89 100 ?>
90 101 <?php
91 102 /**
92 103 * Action: mainwp_logs_widget_bottom
@@ -132,9 +143,10 @@
132 143 <script type="text/javascript">
133 144 jQuery( document ).ready( function() {
134 145 let options = {
135 146 chart: {
136 - type: 'bar'
147 + type: 'pie',
148 + height: 350,
137 149 },
138 150 series: [ {
139 151 name: 'Sites',
140 152 data: [
@@ -146,21 +158,16 @@
146 158 },
147 159 <?php endforeach; ?>
148 160 ]
149 161 } ],
150 - xaxis: {
162 + legend: {
151 163 labels: {
152 - style: {
153 - colors: '#999999',
154 - }
164 + colors: '#999'
155 165 }
156 166 },
157 - yaxis: {
158 - labels: {
159 - style: {
160 - colors: '#999999',
161 - }
162 - }
167 +
168 + stroke: {
169 + width: 0
163 170 },
164 171 tooltip: {
165 172 theme: 'dark'
166 173 },