72% woo-dis-comments-and-ratings

Code Review | WooCommerce Disqus Comments and Ratings

WordPress plugin WooCommerce Disqus Comments and Ratings scored 72% from 54 tests.

About plugin

  • Plugin page: woo-dis-comments-...
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.0.3
  • WordPress version: 6.3.1
  • First release: Jun 1, 2016
  • Latest release: Oct 23, 2022
  • Number of updates: 93
  • Update frequency: every 25.1 days
  • Top authors: zamartz (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active / 10,103 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▲0.62ms] Passed 4 tests

A check of server-side resources used by WooCommerce Disqus Comments and Ratings
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.88 ▼5.79
Dashboard /wp-admin3.31 ▲0.0045.45 ▼0.81
Posts /wp-admin/edit.php3.36 ▲0.0063.94 ▲14.48
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.59 ▲8.95
Media Library /wp-admin/upload.php3.23 ▲0.0033.32 ▲0.13
Settings /wp-admin/admin.php?page=zamartz-settings3.0023.23
Dashboard /wp-admin/admin.php?page=zamartz-admin3.0022.36
Status /wp-admin/admin.php?page=zamartz-status3.0023.65

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 55 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Disqus Comments and Ratings
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.22 ▼1.141.66 ▼0.3140.91 ▼6.73
Dashboard /wp-admin2,206 ▲214.84 ▼1.04107.87 ▲6.8242.28 ▼1.78
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0740.32 ▲1.2742.60 ▲6.01
Add New Post /wp-admin/post-new.php1,533 ▲523.25 ▼0.03651.95 ▼30.0447.65 ▼13.27
Media Library /wp-admin/upload.php1,391 ▼04.13 ▼0.08104.72 ▲6.8743.44 ▲3.33
Settings /wp-admin/admin.php?page=zamartz-settings280.440.063.87
Dashboard /wp-admin/admin.php?page=zamartz-admin280.440.073.89
Status /wp-admin/admin.php?page=zamartz-status280.440.094.02

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woo-dis-comments-and-ratings/public/partials/wp-dis-comments-and-ratings-woo-public-display.php
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/class-zamartz-network-admin-addons.php on line 22
    • > PHP Fatal error
      Trait 'Zamartz_HTML_Template' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/zamartz/class-zamartz-status.php on line 12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-dis-comments-and-ratings/admin/partials/wp-dis-comments-html-form.php:22
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/class-zamartz-admin-status.php on line 22
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/class-zamartz-admin-addons.php on line 22
    • > PHP Fatal error
      Trait 'Zamartz_HTML_Template' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/zamartz/helper/trait-zamartz-rss-methods.php on line 12
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/class-wp-dis-comments-and-ratings-woo-settings.php on line 22
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/zamartz/class-zamartz-dashboard.php on line 12
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/zamartz/network/class-zamartz-network-settings.php on line 12
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/woo-dis-comments-and-ratings/admin/zamartz/network/class-zamartz-network-dashboard.php on line 12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=zamartz-settings
    • > Network (severe)
    wp-admin/admin.php?page=zamartz-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=zamartz-admin
    • > Network (severe)
    wp-admin/admin.php?page=zamartz-admin - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=zamartz-status
    • > Network (severe)
    wp-admin/admin.php?page=zamartz-status - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% 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
5 plugin tags: woocommerce, disqus, ratings, comments, zamartz

woo-dis-comments-and-ratings/wp-dis-comments-and-ratings-woo.php 77% from 13 tests

The main file in "WooCommerce Disqus Comments and Ratings" v. 2.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-dis-comments-and-ratings.php" instead of "wp-dis-comments-and-ratings-woo.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% 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
There were no executable files found in this plugin6,345 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP357441,9684,626
CSS4226521,002
JavaScript68375715
SVG2002

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 192)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity22.93
▷ Minimum class complexity1.00
▷ Maximum class complexity311.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity192.00
Code structure
Namespaces0
Interfaces0
Traits4
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods170
▷ Static methods21.18%
▷ Public methods16395.88%
▷ Protected methods00.00%
▷ Private methods74.12%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/dashboard-default.png4.25KB2.85KB▼ 32.90%
admin/zamartz/assets/images/zamartz-icon-menu.png0.43KB0.50KB0.00%