| @@ -8,8 +8,13 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | namespace MainWP\Dashboard; |
| 11 | 11 | |
| 12 | +// Exit if accessed directly. | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit; | |
| 15 | +} | |
| 16 | + | |
| 12 | 17 | /** |
| 13 | 18 | * Class MainWP_Site_Info |
| 14 | 19 | * |
| 15 | 20 | * Grab Child Site info and build widget. |
| @@ -61,8 +66,13 @@ | ||
| 61 | 66 | if ( ! empty( $code_string ) ) { |
| 62 | 67 | $code .= ' - ' . $code_string; |
| 63 | 68 | } |
| 64 | 69 | $website_info['last_status'] = $code; |
| 70 | + | |
| 71 | + $dbsize = MainWP_DB::instance()->get_website_option( $website, 'dbsize_activitylogs' ); | |
| 72 | + if ( '' !== $dbsize && false !== $dbsize ) { | |
| 73 | + $website_info['dbsize_activitylogs'] = size_format( intval( $dbsize ) ); | |
| 74 | + } | |
| 65 | 75 | } |
| 66 | 76 | |
| 67 | 77 | $child_site_info = array( |
| 68 | 78 | 'wpversion' => esc_html__( 'WordPress Version', 'mainwp' ), |
| @@ -70,14 +80,16 @@ | ||
| 70 | 80 | 'phpversion' => esc_html__( 'PHP Version', 'mainwp' ), |
| 71 | 81 | 'child_version' => esc_html__( 'MainWP Child Version', 'mainwp' ), |
| 72 | 82 | 'memory_limit' => esc_html__( 'PHP Memory Limit', 'mainwp' ), |
| 73 | 83 | 'mysql_version' => esc_html__( 'MySQL Version', 'mainwp' ), |
| 74 | - 'child_curl_version' => esc_html__( 'cURL version', 'mainwp' ), | |
| 75 | - 'child_openssl_version' => esc_html__( 'OpenSSL version', 'mainwp' ), | |
| 84 | + 'child_curl_version' => esc_html__( 'cURL Cersion', 'mainwp' ), | |
| 85 | + 'child_openssl_version' => esc_html__( 'OpenSSL Cersion', 'mainwp' ), | |
| 76 | 86 | 'ip' => esc_html__( 'Server IP', 'mainwp' ), |
| 87 | + 'site_lang' => esc_html__( 'Site Language', 'mainwp' ), | |
| 88 | + 'site_public' => esc_html__( 'Search Engine Visibility', 'mainwp' ), | |
| 77 | 89 | 'group' => esc_html__( 'Tags', 'mainwp' ), |
| 78 | 90 | 'last_status' => esc_html__( 'Last Check Status', 'mainwp' ), |
| 79 | - | |
| 91 | + 'dbsize_activitylogs' => esc_html__( 'Network Activity Table Size', 'mainwp' ), | |
| 80 | 92 | ); |
| 81 | 93 | |
| 82 | 94 | /** |
| 83 | 95 | * Filter: mainwp_child_site_info_widget_content |
| @@ -100,23 +112,23 @@ | ||
| 100 | 112 | */ |
| 101 | 113 | public static function render_info( $website, $website_info, $child_site_info ) { // phpcs:ignore -- NOSONAR - complex. |
| 102 | 114 | ?> |
| 103 | 115 | <div class="mainwp-widget-header"> |
| 104 | - <h3 class="ui header handle-drag"> | |
| 105 | - <?php | |
| 106 | - /** | |
| 107 | - * Filter: mainwp_site_info_widget_title | |
| 108 | - * | |
| 109 | - * Filters the Site info widget title text. | |
| 110 | - * | |
| 111 | - * @param object $website Object containing the child site info. | |
| 112 | - * | |
| 113 | - * @since 4.1 | |
| 114 | - */ | |
| 115 | - echo esc_html( apply_filters( 'mainwp_site_info_widget_title', esc_html__( 'Site Info', 'mainwp' ), $website ) ); | |
| 116 | - ?> | |
| 117 | - <div class="sub header"><?php esc_html_e( 'Basic child site system information', 'mainwp' ); ?></div> | |
| 118 | - </h3> | |
| 116 | + <h2 class="ui header handle-drag"> | |
| 117 | + <?php | |
| 118 | + /** | |
| 119 | + * Filter: mainwp_site_info_widget_title | |
| 120 | + * | |
| 121 | + * Filters the Site info widget title text. | |
| 122 | + * | |
| 123 | + * @param object $website Object containing the child site info. | |
| 124 | + * | |
| 125 | + * @since 4.1 | |
| 126 | + */ | |
| 127 | + echo esc_html( apply_filters( 'mainwp_site_info_widget_title', esc_html__( 'Site Info', 'mainwp' ), $website ) ); | |
| 128 | + ?> | |
| 129 | + <div class="sub header"><?php esc_html_e( 'Basic child site system information', 'mainwp' ); ?></div> | |
| 130 | + </h2> | |
| 119 | 131 | </div> |
| 120 | 132 | |
| 121 | 133 | <div class="mainwp-widget-site-info mainwp-scrolly-overflow"> |
| 122 | 134 | <?php |
| @@ -132,15 +144,15 @@ | ||
| 132 | 144 | do_action( 'mainwp_site_info_widget_top', $website ); |
| 133 | 145 | ?> |
| 134 | 146 | <?php |
| 135 | 147 | if ( ! is_array( $website_info ) || ! isset( $website_info['wpversion'] ) ) { |
| 136 | - MainWP_UI::render_empty_element_placeholder(); | |
| 148 | + MainWP_UI::render_empty_element_placeholder( __( 'View Site Details', 'mainwp' ), __( 'No site information available.', 'mainwp' ), '<em data-emoji=":globe_with_meridians:" class="medium"></em>' ); | |
| 137 | 149 | } else { |
| 138 | 150 | |
| 139 | 151 | $website_info['group'] = empty( $website->wpgroups ) ? 'None' : $website->wpgroups; |
| 140 | 152 | |
| 141 | 153 | ?> |
| 142 | - <table class="ui celled striped table"> | |
| 154 | + <table class="ui mini very compact table"> | |
| 143 | 155 | <tbody> |
| 144 | 156 | <?php |
| 145 | 157 | /** |
| 146 | 158 | * Action: mainwp_site_info_table_top |
| @@ -156,19 +168,24 @@ | ||
| 156 | 168 | <?php |
| 157 | 169 | foreach ( $child_site_info as $index => $title ) { |
| 158 | 170 | $val = ''; |
| 159 | 171 | if ( isset( $website_info[ $index ] ) ) { |
| 172 | + $val = $website_info[ $index ]; | |
| 160 | 173 | if ( 'debug_mode' === $index ) { |
| 161 | - $val = ( 1 === (int) $website_info[ $index ] ) ? 'Enabled' : 'Disabled'; | |
| 162 | - } else { | |
| 163 | - $val = $website_info[ $index ]; | |
| 174 | + $val = ( 1 === (int) $website_info[ $index ] ) ? __( 'Enabled', 'mainwp' ) : __( 'Disabled', 'mainwp' ); | |
| 175 | + } elseif ( 'site_public' === $index ) { | |
| 176 | + $val = ( 1 === (int) $website_info[ $index ] ) ? __( 'Visible', 'mainwp' ) : __( 'Blocking', 'mainwp' ); | |
| 177 | + } elseif ( 'site_lang' === $index ) { | |
| 178 | + if ( function_exists( 'locale_get_display_name' ) ) { | |
| 179 | + $val = locale_get_display_name( $val ); | |
| 180 | + } | |
| 164 | 181 | } |
| 165 | 182 | } |
| 166 | 183 | ?> |
| 167 | - <tr> | |
| 184 | + <tr> | |
| 168 | 185 | <td><?php echo esc_html( $title ); ?></td> |
| 169 | - <td><?php echo esc_html( $val ); ?></td> | |
| 170 | - </tr> | |
| 186 | + <td class="right aligned"><?php echo esc_html( $val ); ?></td> | |
| 187 | + </tr> | |
| 171 | 188 | <?php } ?> |
| 172 | 189 | <?php |
| 173 | 190 | /** |
| 174 | 191 | * Action: mainwp_site_info_table_bottom |