76% performance-checker

Code Review | Performance Checker

WordPress plugin Performance Checker scored 76% from 54 tests.

About plugin

  • Plugin page: performance-checker
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2
  • WordPress version: 5.8.1
  • First release: Jun 26, 2019
  • Latest release: Jun 27, 2019
  • Number of updates: 13
  • Update frequency: every 0.1 days
  • Top authors: tecsys (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 571 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼142.94ms] 75% from 4 tests

This is a short check of server-side resources used by Performance Checker
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 2,181.06ms on /wp-admin/admin.php?page=pagespeed_insights)
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0039.01 ▲9.94
Dashboard /wp-admin3.07 ▲0.0147.28 ▼0.91
Posts /wp-admin/edit.php3.12 ▲0.0144.04 ▲1.06
Add New Post /wp-admin/post-new.php5.43 ▼0.0086.14 ▼572.83
Media Library /wp-admin/upload.php3.01 ▲0.0133.42 ▲0.93
GT-Metrix /wp-admin/admin.php?page=gt_metrix3.0526.00
Performance Checker /wp-admin/admin.php?page=performance_checker3.0129.20
PageSpeed Insights /wp-admin/admin.php?page=pagespeed_insights3.022,181.06

Server storage [IO: ▲0.35MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Performance Checker
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,345 ▲74916.10 ▲0.4510.77 ▲1.9656.10 ▲5.78
Dashboard /wp-admin3,612 ▲6756.18 ▲0.25156.64 ▼2.7383.27 ▼25.85
Posts /wp-admin/edit.php3,381 ▲6422.78 ▲0.0775.69 ▲0.2566.80 ▼22.71
Add New Post /wp-admin/post-new.php1,646 ▲3121.51 ▲0.15296.91 ▲2.06129.44 ▲26.11
Media Library /wp-admin/upload.php2,449 ▲6275.21 ▲0.17159.13 ▲8.75122.56 ▲5.09
GT-Metrix /wp-admin/admin.php?page=gt_metrix1,8932.3657.2470.05
Performance Checker /wp-admin/admin.php?page=performance_checker1,7592.4054.7262.42
PageSpeed Insights /wp-admin/admin.php?page=pagespeed_insights1,9042.3955.9070.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+38
    Undefined variable: url_to_test
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+45
    Undefined variable: fully_loaded_time
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+53
    Undefined variable: onload_time
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+61
    Undefined variable: page_size
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+69
    Undefined variable: page_load_time
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+79
    Undefined variable: html_load_time
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+87
    Undefined variable: yslow_score
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+95
    Undefined variable: pagespeed_score
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+103
    Undefined variable: onload_duration
    • > GET request to /wp-admin/admin.php?page=gt_metrix
    • > Notice in wp-content/plugins/performance-checker/template/gtmetrix.php+109
    Undefined variable: report_url
    • > GET request to /wp-admin/admin.php?page=pagespeed_insights
    • > Notice in wp-content/plugins/performance-checker/template/pagespeed.php+12
    Undefined index: lighthouseResult
  • 19 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pagespeed_insights
    • > Notice in wp-content/plugins/performance-checker/template/pagespeed.php+21
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/performance-checker/template/gtmetrix.php
    • > /wp-content/plugins/performance-checker/template/pagespeed.php
    • > /wp-content/plugins/performance-checker/template/Services_WTF_Test.php
    • > /wp-content/plugins/performance-checker/index.php
    • > /wp-content/plugins/performance-checker/PerformanceChecker.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: html_load_time in wp-content/plugins/performance-checker/template/gtmetrix.php on line 79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/performance-checker/template/admin.php:4
    • > PHP Notice
      Undefined variable: onload_duration in wp-content/plugins/performance-checker/template/gtmetrix.php on line 103
    • > PHP Notice
      Undefined variable: onload_time in wp-content/plugins/performance-checker/template/gtmetrix.php on line 53
    • > PHP Notice
      Undefined variable: fully_loaded_time in wp-content/plugins/performance-checker/template/gtmetrix.php on line 45
    • > PHP Notice
      Undefined variable: page_load_time in wp-content/plugins/performance-checker/template/gtmetrix.php on line 69
    • > PHP Notice
      Undefined variable: page_size in wp-content/plugins/performance-checker/template/gtmetrix.php on line 61
    • > PHP Notice
      Undefined variable: url_to_test in wp-content/plugins/performance-checker/template/gtmetrix.php on line 38
    • > PHP Notice
      Undefined variable: pagespeed_score in wp-content/plugins/performance-checker/template/gtmetrix.php on line 95
    • > PHP Notice
      Undefined variable: report_url in wp-content/plugins/performance-checker/template/gtmetrix.php on line 109

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=performance_checker
    • > Network (severe)
    wp-content/plugins/performance-checker/assets/img/logo.png%22 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=performance_checker
    • > Network (severe)
    wp-content/plugins/performance-checker/assets/img/lg.double-ring-spinner.gif%22 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: performance, gtmetrix, pagespeed

performance-checker/PerformanceChecker.php 77% from 13 tests

The primary PHP file in "Performance Checker" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("performance-checker.php" instead of "PerformanceChecker.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 188 characters long)
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin526 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP696198509
CSS21013
JavaScript2003
SVG1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity23.00
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods2492.31%
▷ Protected methods27.69%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/pagespeed_64dp.png3.34KB2.58KB▼ 22.72%
assets/img/logo.png6.45KB3.58KB▼ 44.54%