84% th-reviews-bar

Code Review | TH Reviews Bar

WordPress plugin TH Reviews Bar scored84%from 54 tests.

About plugin

  • Plugin page: th-reviews-bar
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7
  • WordPress version: 6.3.1
  • First release: Feb 12, 2021
  • Latest release: Apr 7, 2021
  • Number of updates: 4
  • Update frequency: every 13.7 days
  • Top authors: triopsi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,116 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.48ms] Passed 4 tests

An overview of server-side resources used by TH Reviews Bar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1640.33 ▲2.63
Dashboard /wp-admin3.47 ▲0.1646.62 ▲1.69
Posts /wp-admin/edit.php3.58 ▲0.2247.90 ▲0.58
Add New Post /wp-admin/post-new.php6.07 ▲0.1889.82 ▼6.82
Media Library /wp-admin/upload.php3.39 ▲0.1636.08 ▲2.64
Add New Review /wp-admin/post-new.php?post_type=thrb3.5049.56
TH Reviews Options /wp-admin/options-general.php?page=thrb3.3733.80
Help /wp-admin/edit.php?post_type=thrb&page=thrb_help3.3630.76
All Reviews /wp-admin/edit.php?post_type=thrb3.4650.91

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_thrbpanelwidget
db_upgraded
can_compress_scripts
thrb_plugin_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for TH Reviews Bar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲11713.45 ▼0.921.83 ▲0.1842.35 ▲3.16
Dashboard /wp-admin2,260 ▲754.99 ▼0.8899.60 ▼4.9739.05 ▼7.11
Posts /wp-admin/edit.php2,148 ▲802.33 ▲0.3441.99 ▲5.4733.20 ▼1.10
Add New Post /wp-admin/post-new.php1,563 ▲4223.36 ▲0.09656.50 ▼45.0737.74 ▼22.56
Media Library /wp-admin/upload.php1,436 ▲454.55 ▲0.35101.96 ▲4.0344.65 ▲0.59
Add New Review /wp-admin/post-new.php?post_type=thrb2,2397.61196.9275.36
TH Reviews Options /wp-admin/options-general.php?page=thrb1,0342.4142.1835.88
Help /wp-admin/edit.php?post_type=thrb&page=thrb_help1,0551.9328.5739.76
All Reviews /wp-admin/edit.php?post_type=thrb1,2463.3854.1829.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_thrbpanelwidget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 take a closer look at the following
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/th-reviews-bar/inc/thrb-shortcode.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/th-reviews-bar/inc/thrb-post-metabox.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/th-reviews-bar/inc/thrb-widget.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/th-reviews-bar/inc/thrb-types.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/th-reviews-bar/inc/thrb-setting.php:73
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/th-reviews-bar/inc/thrb-admin.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/th-reviews-bar/inc/thrb-user.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/th-reviews-bar/th-reviews-bar.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
10 plugin tags: rating, box, site, star, post...

th-reviews-bar/th-reviews-bar.php 92% from 13 tests

The primary PHP file in "TH Reviews Bar" version 1.0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,040 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP11188489704
PO File17679166
CSS22513136
JavaScript23034

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/screenshot-4.png14.77KB8.13KB▼ 44.98%