This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Astra_Memory_Limit_Notice::get_site_health_description( float $memory_percentage, string $memory_limit_formatted, string $memory_usage_formatted, string $memory_remaining_formatted, string $percentage_formatted )
Get Site Health description based on memory usage
Description
Parameters
- $memory_percentage
-
(float) (Required) Memory usage percentage.
- $memory_limit_formatted
-
(string) (Required) Formatted memory limit.
- $memory_usage_formatted
-
(string) (Required) Formatted memory usage.
- $memory_remaining_formatted
-
(string) (Required) Formatted remaining memory.
- $percentage_formatted
-
(string) (Required) Formatted percentage.
Return
(string) Description HTML.
Source
File: inc/class-astra-memory-limit-notice.php
private function get_site_health_description( $memory_percentage, $memory_limit_formatted, $memory_usage_formatted, $memory_remaining_formatted, $percentage_formatted ) { $description = '<p>'; if ( $memory_percentage >= $this->warning_threshold ) { $description .= sprintf( __( 'Your site is using %1$s of %2$s available PHP memory (%3$s%%). Only %4$s remaining.', 'astra' ), '<strong>' . esc_html( $memory_usage_formatted ) . '</strong>', '<strong>' . esc_html( $memory_limit_formatted ) . '</strong>', '<strong>' . esc_html( $percentage_formatted ) . '</strong>', '<strong>' . esc_html( $memory_remaining_formatted ) . '</strong>' ); $description .= '</p><p>'; $description .= __( 'While your site is currently functioning, this high memory usage puts you at risk of crashes and errors, especially when using memory-intensive features like the customizer, page builders, or plugins.', 'astra' ); } else { $description .= sprintf( __( 'Your site is using %1$s of %2$s available PHP memory (%3$s%%). You have %4$s remaining.', 'astra' ), '<strong>' . esc_html( $memory_usage_formatted ) . '</strong>', '<strong>' . esc_html( $memory_limit_formatted ) . '</strong>', '<strong>' . esc_html( $percentage_formatted ) . '</strong>', '<strong>' . esc_html( $memory_remaining_formatted ) . '</strong>' ); $description .= '</p><p>'; $description .= __( 'Your memory usage is within acceptable limits. The Astra theme and your plugins have sufficient memory to operate properly.', 'astra' ); } $description .= '</p>'; $description .= '<p>'; $description .= __( '<strong>About PHP Memory:</strong> PHP memory limit determines how much memory your website can use. Themes, plugins, and WordPress core all consume memory. When the limit is reached, your site may display errors or stop working.', 'astra' ); $description .= '</p>'; return $description; }
Expand full source code Collapse full source code View on Trac