PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.1
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.1
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-status-widget.php +29 -23 5.2 → 6.2.1 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_Status_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( 'Site Connectivity Status', 'mainwp' ); ?>
68 75 <div class="sub header">
69 76 <?php esc_html_e( 'Number of total, connected, disconnected, and suspended sites across the network for easy status monitoring.', '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', 'status' );
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 Connection Status 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
@@ -133,10 +144,22 @@
133 144 <script type="text/javascript">
134 145 jQuery( document ).ready( function() {
135 146 let options = {
136 147 chart: {
137 - type: 'bar'
148 + type: 'pie',
149 + height: 350,
138 150 },
151 + legend: {
152 + labels: {
153 + colors: '#999'
154 + }
155 + },
156 + stroke: {
157 + width: 0
158 + },
159 + tooltip: {
160 + theme: 'dark'
161 + },
139 162 series: [ {
140 163 name: 'Sites',
141 164 data: [
142 165 { x: 'Total Sites', y: <?php echo esc_js( $total ); ?>, fillColor: '#18a4e0' },
@@ -144,25 +167,8 @@
144 167 { x: 'Disconnected', y: <?php echo esc_js( $disconnected ); ?>, fillColor: '#a61718' },
145 168 { x: 'Suspended', y: <?php echo esc_js( $suspended ); ?>, fillColor: '#ffd300' },
146 169 ]
147 170 } ],
148 - xaxis: {
149 - labels: {
150 - style: {
151 - colors: '#999999',
152 - }
153 - }
154 - },
155 - yaxis: {
156 - labels: {
157 - style: {
158 - colors: '#999999',
159 - }
160 - }
161 - },
162 - tooltip: {
163 - theme: 'dark'
164 - },
165 171 }
166 172 let status = new ApexCharts(document.querySelector("#mainwp-module-log-chart-status-wrapper"), options);
167 173 setTimeout(() => {
168 174 status.render();