You can now monitor the performance of your PHP website using the PHP Website Profiler within the Hepsia Control Panel

October 19, 2023
When a website experiences slow loading, various factors can contribute to it, including the internet connection speed, the hosting server's performance, and the website's underlying code.

While some of these factors may be outside your control, you can influence others.

Starting this week, users have the capability to perform a quick analysis of their website's PHP code. This analysis helps assess the efficiency of the code, identify elements with varying loading speeds, and more.

This analysis is easily initiated with a single click, courtesy of the newly integrated PHP Website Profiler tool, available through the Hepsia Control Panel.

What is the PHP Website Profiler all about?

PHP is renowned as one of the most widely used programming languages worldwide. A remarkable 80% of websites rely on PHP in some capacity, establishing it as a favored language for programmers and web developers.

Despite its reputation for being user-friendly, programmers frequently turn to various tools to enhance their development efforts. Within PHP's expansive ecosystem, numerous tools are at their disposal, with the PHP profiler, a performance monitoring tool, being recognized as one of the most valuable.

PHP profilers provide developers with a precise evaluation of their website's performance. They pinpoint errors on a function-by-function and query-by-query basis, delivering a comprehensive assessment of a website or application's health.

These profilers capture essential metrics, including the time spent per line of code and the frequency of method calls. Moreover, they aid in identifying inefficiencies and areas in the entire web stack that can be enhanced. In any PHP project, these tools are considered indispensable.

How does the PHP Website Profiler function?

The PHP Website Profiler, seamlessly integrated into the Hepsia Control Panel, consolidates the core functionalities of online performance monitoring tools.

This profiler has the capability to directly load a website or application from the web server and conduct an in-depth analysis of its performance at the code level. It achieves this by excluding variables such as connection speed and network performance, focusing solely on the objective performance of the site.

Upon completing the loading process of your website, the profiler generates an extensive report that specifically highlights the elements consuming the most time to load.

You have the flexibility to employ this tool on any page of your website, provided it is developed using PHP.

NOTE: Users will not be able to generate a report when running this tool on non-PHP pages.

How to utilize Hepsia's PHP Website Profiler?

Employing the PHP Website Profiler for monitoring website performance is a straightforward process. There are two methods for users to access the tool within the Control Panel.

The first approach is to click on the PHP Website Profiler icon located in the Advanced section on the index page.

Alternatively, users can choose to click on the PHP Website Profiler link situated in the Web Tools menu.

To commence profiling for a specific host, a user should simply locate the desired host in the section and click on the performance measurement icon found in the Actions column.

In the pop-up window, a user should select the protocol they want to use from the Protocol field. If necessary, users can specify the particular folder to be monitored by the profiler in the URL section. However, if a user wishes to conduct profiling for the main folder, they should leave the URL field unaltered.

The final step is to click on the Start button to initiate website profiling.

Depending on the size and complexity of a website, it may take some time for the results to be generated.

The results page will display a comprehensive graphical overview of the most frequently used PHP functions on the specified website.

The first graph (Time) illustrates which element of the entire PHP process takes the longest to execute.

The second graph (Count) reveals the number of operations within each PHP process category and the percentage they represent of the total.

Furthermore, the execution time of any installed plugins is provided.

Beneath the graph area, there is a detailed list of all PHP functions that are executed during the loading of the website.

Here is an explanation of the columns in the table:

  • Type: The type of PHP data monitored, including array functions, math functions, files, MySQL queries, parsing, and more.
  • Function: The specific function type monitored by the tool (e.g., include, query, get_option, translate, etc.).
  • Count: The number of functions executed per type.
  • Total time (in percent): The time it took to execute the function in comparison to the total load time.

For a more in-depth analysis, a user can click on the "dots" icon to the right of the listed functions. This will reveal a breakdown of all related functions.

Let's consider a specific user scenario where the PHP profiling process has produced the following results.

Upon analysis, it becomes apparent that the most time-consuming aspects of the profiled website are the MySQL queries and the cURL function.

By selecting the "dots" icon for the MySQL result, the website owner can promptly identify the precise query that consumes the most execution time.

Similarly, by clicking on the "dots" for the cURL function, the user will discover that a specific external API query requires excessive time to execute, leading to an overall decrease in performance.

By offering a fast and straightforward means to assess the efficiency of their code, the PHP Website Profiler provides users with valuable real-time insights into potential issues and helps maintain the health of their websites. The addition of this feature enhances the customer experience with the Hepsia Control Panel, making it a compelling selling point for your business.