67% wpdiscuz

Code Review | Comments - wpDiscuz

WordPress plugin Comments - wpDiscuz scored67%from 54 tests.

About plugin

  • Plugin page: wpdiscuz
  • Plugin version: 7.6.13
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 30, 2014
  • Latest release: Nov 16, 2023
  • Number of updates: 394
  • Update frequency: every 8.3 days
  • Top authors: AdvancedCoding (89.85%)taron96 (5.33%)gzakar (5.33%)

Code review

54 tests

User reviews

548 reviews

Install metrics

80,000+ active /3,040,482 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.18MB] [CPU: ▲28.24ms] 75% from 4 tests

Analyzing server-side resources used by Comments - wpDiscuz
Please have a look at the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.18MB on /wp-admin/admin.php?page=wpdiscuz_options_page)
PageMemory (MB)CPU Time (ms)
Home /8.75 ▲5.2966.11 ▲18.15
Dashboard /wp-admin8.45 ▲5.1479.98 ▲16.42
Posts /wp-admin/edit.php8.50 ▲5.1488.39 ▲38.55
Add New Post /wp-admin/post-new.php11.20 ▲5.31142.47 ▲39.85
Media Library /wp-admin/upload.php8.37 ▲5.1475.51 ▲41.42
» Addons /wp-admin/admin.php?page=wpdiscuz_addons_page8.3669.09
» Forms /wp-admin/edit.php?post_type=wpdiscuz_form8.4970.86
» Tools /wp-admin/admin.php?page=wpdiscuz_tools_page8.3667.41
» Phrases /wp-admin/admin.php?page=wpdiscuz_phrases_page8.5177.80
» Dashboard /wp-admin/admin.php?page=wpdiscuz8.4772.41
» Settings /wp-admin/admin.php?page=wpdiscuz_options_page8.6164.22

Server storage [IO: ▲13.88MB] [DB: ▲0.02MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 555 new files
Database: 6 new tables, 11 new options
New tables
wp_wc_users_rated
wp_wc_comments_subscription
wp_wc_feedback_forms
wp_wc_follow_users
wp_wc_phrases
wp_wc_users_voted
New WordPress options
widget_recent-comments
wc_plugin_version
wpd_admin_notices
theysaidso_admin_options
widget_theysaidso_widget
wc_options
wpdiscuz-addon-note-dismissed
wpdiscuz_form_content_type_rel
widget_recent-posts
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by Comments - wpDiscuz
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲19114.31 ▼0.041.66 ▼0.4635.31 ▼9.12
Dashboard /wp-admin2,346 ▲1695.60 ▼0.05102.46 ▲15.7485.08 ▲43.93
Posts /wp-admin/edit.php2,251 ▲1512.03 ▲0.0641.75 ▲4.3935.17 ▼0.33
Add New Post /wp-admin/post-new.php6,551 ▲5,02527.43 ▲4.45885.84 ▲266.8936.61 ▼15.25
Media Library /wp-admin/upload.php1,454 ▲544.28 ▲0.0999.39 ▲3.6045.83 ▲4.77
» Addons /wp-admin/admin.php?page=wpdiscuz_addons_page2,7223.1164.94111.03
» Forms /wp-admin/edit.php?post_type=wpdiscuz_form1,7652.5341.7246.88
» Tools /wp-admin/admin.php?page=wpdiscuz_tools_page1,4792.3536.6242.99
» Phrases /wp-admin/admin.php?page=wpdiscuz_phrases_page6,91016.06429.96105.80
» Dashboard /wp-admin/admin.php?page=wpdiscuz1,6973.57135.87138.18
» Settings /wp-admin/admin.php?page=wpdiscuz_options_page1,1372.2235.1638.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure failed, leaving 6 tables in the database
    • wp_wc_follow_users
    • wp_wc_users_rated
    • wp_wc_feedback_forms
    • wp_wc_comments_subscription
    • wp_wc_users_voted
    • wp_wc_phrases
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • wpdiscuz_form_content_type_rel
    • wc_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • wpdiscuz-addon-note-dismissed
    • wpd_admin_notices
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wpdiscuz/utils/ajax/wpdiscuz-ajax.php
  • 35× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'wpdFormAttr\\Field\\Field' not found in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/DefaultField/Captcha.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'WPDISCUZ_DIR_PATH/forms/wpdFormAttr/html/default-fields.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/html/admin-form-fields-list.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'wpdFormAttr\\Field\\Field' not found in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/UrlField.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'wpdFormAttr\\Field\\Field' not found in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/DefaultField/Website.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'wpdFormAttr\\Field\\Field' not found in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/CheckboxField.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'WpDiscuzConstants' not found in wp-content/plugins/wpdiscuz/includes/class.WpdiscuzDBManager.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'wpdFormAttr\\Field\\Field' not found in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/RatingField.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'wpdFormAttr\\Field\\DefaultField\\ReCaptcha\\RequestMethod' not found in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/DefaultField/ReCaptcha/RequestMethod/CurlPost.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'wpdFormAttr\\Field\\Field' not found in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/NumberField.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'wpdFormAttr\\Field\\Field' not found in wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Field/TextAreaField.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Requires php: The plugin version is formatted incorrectly
You can take inspiration from this readme.txt

wpdiscuz/class.WpdiscuzCore.php 92% from 13 tests

The principal PHP file in "Comments - wpDiscuz" v. 7.6.13 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpdiscuz.php" instead of "class.WpdiscuzCore.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected111,258 lines of code in 255 files:
LanguageFilesBlank linesComment linesLines of code
PO File1718,76726,41349,306
PHP1352,3692,40429,926
JavaScript352,44493916,202
SVG501210,230
CSS272373035,384
HTML3500171
JSON10039

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 268)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity73.73
▷ Minimum class complexity1.00
▷ Maximum class complexity833.00
Average method complexity5.59
▷ Minimum method complexity1.00
▷ Maximum method complexity268.00
Code structure
Namespaces10
Interfaces3
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods960
▷ Static methods485.00%
▷ Public methods76880.00%
▷ Protected methods343.54%
▷ Private methods15816.46%
Functions8
▷ Named functions450.00%
▷ Anonymous functions450.00%
Constants119
▷ Global constants32.52%
▷ Class constants11697.48%
▷ Public constants116100.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
167 PNG files occupy 2.32MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/dashboard/icon-comment-inlinepng.png0.30KB0.23KB▼ 22.62%
assets/img/dashboard/inline-feedback-opened.png7.71KB8.20KB0.00%
assets/img/dashboard/news/icon-layouts.png0.69KB0.59KB▼ 14.22%
assets/img/social-icons/ok-18x18-orig.png0.75KB0.74KB0.26%
assets/addons/user-mention/header.png31.04KB11.16KB▼ 64.07%