77% ultimate-reviews

Code Review | Ultimate Reviews

WordPress plugin Ultimate Reviews scored77%from 54 tests.

About plugin

  • Plugin page: ultimate-reviews
  • Plugin version: 3.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 7.1-6.4
  • WordPress version: 6.3.1
  • First release: Sep 11, 2015
  • Latest release: Nov 7, 2023
  • Number of updates: 447
  • Update frequency: every 6.7 days
  • Top authors: Rustaurius (100%)

Code review

54 tests

User reviews

58 reviews

Install metrics

1,000+ active /202,325 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲2.00MB] [CPU: ▲9.30ms] Passed 4 tests

A check of server-side resources used by Ultimate Reviews
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.41 ▲1.9548.20 ▲3.88
Dashboard /wp-admin5.32 ▲2.0256.34 ▲7.29
Posts /wp-admin/edit.php5.35 ▲2.0068.19 ▲21.64
Add New Post /wp-admin/post-new.php8.13 ▲2.24102.38 ▲11.50
Media Library /wp-admin/upload.php5.25 ▲2.0351.02 ▲14.51
Review Categories /wp-admin/edit-tags.php?taxonomy=urp-review-category&post_type=urp_review5.2246.09
Import /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-import5.1843.00
Export /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-export5.1845.27
Ultimate Reviews - Welcome! /wp-admin/index.php?page=ewd-urp-getting-started5.1843.19
Settings /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-settings5.2954.80
All Reviews /wp-admin/edit.php?post_type=urp_review5.2751.74
Add New /wp-admin/post-new.php?post_type=urp_review8.1598.82
Dashboard /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-dashboard5.2052.99
About Us /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-about-us5.1945.84

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 589 new files
Database: no new tables, 12 new options
New WordPress options
widget_theysaidso_widget
ewd-urp-installation-time
widget_ewd_urp_selected_reviews_widget
db_upgraded
widget_ewd_urp_popular_reviews_widget
widget_recent-posts
ewd-urp-permission-level
widget_recent-comments
theysaidso_admin_options
widget_ewd_urp_reviews_slider_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Ultimate Reviews
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲10714.69 ▼0.081.90 ▼0.1740.02 ▼4.75
Dashboard /wp-admin2,254 ▲805.66 ▲0.0896.28 ▼4.4442.59 ▼1.12
Posts /wp-admin/edit.php2,159 ▲562.01 ▲0.0639.71 ▲3.7436.91 ▲5.37
Add New Post /wp-admin/post-new.php6,445 ▲4,90928.06 ▲4.80811.31 ▲165.9635.74 ▼14.72
Media Library /wp-admin/upload.php1,459 ▲624.38 ▲0.1597.24 ▼2.5344.30 ▲0.17
Review Categories /wp-admin/edit-tags.php?taxonomy=urp-review-category&post_type=urp_review1,3861.9137.8033.46
Import /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-import9552.2028.5643.22
Export /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-export9342.2130.4634.84
Ultimate Reviews - Welcome! /wp-admin/index.php?page=ewd-urp-getting-started1,2062.2430.7333.09
Settings /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-settings1,9733.6460.8042.06
All Reviews /wp-admin/edit.php?post_type=urp_review1,3952.1538.5538.02
Add New /wp-admin/post-new.php?post_type=urp_review6,43720.36940.6143.80
Dashboard /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-dashboard1,2752.2132.0759.52
About Us /wp-admin/edit.php?post_type=urp_review&page=ewd-urp-about-us1,3862.2131.6831.27

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_ewd_urp_popular_reviews_widget
    • widget_recent-comments
    • widget_ewd_urp_selected_reviews_widget
    • ewd-urp-permission-level
    • ewd-urp-installation-time
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_ewd_urp_recent_reviews_widget
    • ...

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ultimate-reviews/ewd-urp-templates/summary-statistics-clear-score-filter.php
    • > /wp-content/plugins/ultimate-reviews/ewd-urp-templates/submit-review-recaptcha.php
    • > /wp-content/plugins/ultimate-reviews/ewd-urp-templates/reviews-review-container-close.php
    • > /wp-content/plugins/ultimate-reviews/ewd-urp-templates/reviews-review-container-open.php
  • 197× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader' not found in wp-content/plugins/ultimate-reviews/lib/PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Style\\Supervisor' not found in wp-content/plugins/ultimate-reviews/lib/PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader' not found in wp-content/plugins/ultimate-reviews/lib/PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\CacheInterface' not found in wp-content/plugins/ultimate-reviews/lib/PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\BaseWriter' not found in wp-content/plugins/ultimate-reviews/lib/PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ultimate-reviews/ewd-urp-templates/summary-statistics.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'PhpOffice\\PhpSpreadsheet\\Reader\\IReadFilter' not found in wp-content/plugins/ultimate-reviews/lib/PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ultimate-reviews/ewd-urp-templates/submit-review-field-review-image.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ultimate-reviews/ewd-urp-templates/submit-review-submitted-review-message.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'sapAdminPageSetting_2_6_13' not found in wp-content/plugins/ultimate-reviews/lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (27 tag instead of maximum 10)
You can take inspiration from this readme.txt

ultimate-reviews/ultimate-reviews.php 85% from 13 tests

The principal PHP file in "Ultimate Reviews" v. 3.2.8 is loaded by WordPress automatically on each request
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "7.1")
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)

Code Analysis 95% from 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 plugin76,752 lines of code in 473 files:
LanguageFilesBlank linesComment linesLines of code
PHP35515,23131,55164,416
CSS203232404,110
JavaScript737583683,450
PO File51,1131,2592,546
Markdown1041101,855
JSON300245
YAML5191284
Bourne Again Shell16324
XML10022

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,016)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 387)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity41.40
▷ Minimum class complexity1.00
▷ Maximum class complexity1,016.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity387.00
Code structure
Namespaces40
Interfaces10
Traits0
Classes263
▷ Abstract classes145.32%
▷ Concrete classes24994.68%
▷ Final classes00.00%
Methods3,138
▷ Static methods60819.38%
▷ Public methods2,53080.62%
▷ Protected methods752.39%
▷ Private methods53316.99%
Functions27
▷ Named functions2281.48%
▷ Anonymous functions518.52%
Constants773
▷ Global constants81.03%
▷ Class constants76598.97%
▷ Public constants765100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
65 PNG files occupy 2.35MB with 1.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/urp-buttonsicons-03.png5.51KB2.74KB▼ 50.25%
assets/img/support_icons_urp-01.png1.00KB0.47KB▼ 53.02%
assets/img/UPCP_Icons-07-300x300.png37.38KB16.24KB▼ 56.55%
assets/img/options-asset-lock.png1.05KB0.50KB▼ 52.28%
assets/img/ewd-support-icon-forum.png5.77KB2.17KB▼ 62.41%