78% compare-hosting-performance

Code Review | Compare hosting performance

WordPress plugin Compare hosting performance scored78%from 54 tests.

About plugin

  • Plugin page: compare-hosting-p...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Mar 16, 2016
  • Latest release: Jan 2, 2017
  • Number of updates: 8
  • Update frequency: every 36.6 days
  • Top authors: northmule (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,199 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼5.09ms] Passed 4 tests

Server-side resources used by Compare hosting performance
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1347.45 ▲5.90
Dashboard /wp-admin3.43 ▲0.1243.61 ▼4.11
Posts /wp-admin/edit.php3.54 ▲0.1845.64 ▼1.21
Add New Post /wp-admin/post-new.php6.01 ▲0.1279.96 ▼14.73
Media Library /wp-admin/upload.php3.35 ▲0.1235.03 ▼0.30
Test Performance /wp-admin/options-general.php?page=compare-hosting-performance3.3531.49

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
chp_jornal
chp_sendtest
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Compare hosting performance
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▲0.131.86 ▲0.2345.29 ▲1.87
Dashboard /wp-admin2,210 ▲195.81 ▼0.07100.68 ▼5.6739.45 ▼2.48
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0240.84 ▲1.7536.47 ▲3.05
Add New Post /wp-admin/post-new.php1,545 ▲3118.33 ▲0.76629.25 ▼43.3756.82 ▲3.61
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.1095.47 ▼5.6643.88 ▼1.78
Test Performance /wp-admin/options-general.php?page=compare-hosting-performance1,1061.8229.8432.94

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/compare-hosting-performance/inc/core-class.php
    • > /wp-content/plugins/compare-hosting-performance/page/tab4-option1.php
    • > /wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php
  • 33× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: mySQLTest in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 54
    • > PHP Notice
      Undefined variable: networkTest in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 110
    • > PHP Notice
      Undefined variable: networkTest in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 103
    • > PHP Notice
      Undefined variable: mySQLTest in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 47
    • > PHP Notice
      Undefined variable: ipmysql in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 124
    • > PHP Notice
      Undefined variable: tmysql in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 61
    • > PHP Notice
      Undefined variable: phpAllTest in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 75
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/compare-hosting-performance/page/tab3-option1.php:1
    • > PHP Notice
      Undefined variable: summ in wp-content/plugins/compare-hosting-performance/page/ajax/tab2-testperf.php on line 117

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: php, performance, mysql

compare-hosting-performance/index.php 85% from 13 tests

The primary PHP file in "Compare hosting performance" version 1.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("compare-hosting-performance.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected8,526 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
CSS23105,899
JavaScript25821921,558
PHP10133288840
SVG100229

PHP code Passed 2 tests

A brief analysis 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.16
Average class complexity17.67
▷ Minimum class complexity3.00
▷ Maximum class complexity38.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods31
▷ Static methods722.58%
▷ Public methods2787.10%
▷ Protected methods412.90%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected