78% dw-question-answer

Code Review | DW Question & Answer

WordPress plugin DW Question & Answer scored 78% from 54 tests.

About plugin

  • Plugin page: dw-question-answer
  • Plugin version: 1.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 5.8.1
  • First release: Nov 8, 2013
  • Latest release: Aug 20, 2019
  • Number of updates: 84
  • Update frequency: every 25.1 days
  • Top authors: designwall (100%)

Code review

54 tests

User reviews

104 reviews

Install metrics

10,000+ active / 406,255 total downloads

Benchmarks

Plugin footprint 82% 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: ▲1.87MB] [CPU: ▼128.95ms] 75% from 4 tests

An overview of server-side resources used by DW Question & Answer
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 5,517.47ms on /wp-admin/edit.php?post_type=dwqa-question&page=dwqa-settings)
PageMemory (MB)CPU Time (ms)
Home /4.65 ▲1.9355.51 ▲32.59
Dashboard /wp-admin4.98 ▲1.92103.49 ▲57.39
Posts /wp-admin/edit.php4.97 ▲1.8659.81 ▲13.42
Add New Post /wp-admin/post-new.php7.27 ▲1.8399.95 ▼571.47
Media Library /wp-admin/upload.php4.85 ▲1.8446.65 ▲9.65
Question Tags /wp-admin/edit-tags.php?taxonomy=dwqa-question_tag&post_type=dwqa-question4.8442.51
Answers /wp-admin/edit.php?post_type=dwqa-answer4.9247.41
Add New Question /wp-admin/post-new.php?post_type=dwqa-question5.0862.47
Extensions /wp-admin/edit.php?post_type=dwqa-question&page=dwqa-extensions4.8241.72
Question Category /wp-admin/edit-tags.php?taxonomy=dwqa-question_category&post_type=dwqa-question4.8548.05
Settings /wp-admin/edit.php?post_type=dwqa-question&page=dwqa-settings4.925,517.47
Questions /wp-admin/edit.php?post_type=dwqa-question4.9251.97

Server storage [IO: ▲2.53MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 158 new files
Database: no new tables, 9 new options
New WordPress options
widget_dwqa-related-question
dwqa_enable_email_delay
dwqa_permission
widget_dwqa-latest-question
widget_dwqa-closed-question
dwqa_has_roles
dwqa_options
dwqa-question_category_children
widget_dwqa-popular-question

Browser metrics Passed 4 tests

DW Question & Answer: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,889 ▲28316.32 ▲0.7713.51 ▲5.8649.10 ▼0.54
Dashboard /wp-admin3,043 ▲1125.98 ▼0.16135.05 ▼5.06106.13 ▼6.64
Posts /wp-admin/edit.php2,809 ▲702.75 ▲0.0368.54 ▲3.2288.96 ▼0.89
Add New Post /wp-admin/post-new.php1,545 ▼51218.84 ▼0.51357.13 ▼14.41113.22 ▲0.79
Media Library /wp-admin/upload.php1,876 ▲695.10 ▲0.07146.06 ▼0.17122.03 ▲8.38
Question Tags /wp-admin/edit-tags.php?taxonomy=dwqa-question_tag&post_type=dwqa-question1,7812.4260.9081.19
Answers /wp-admin/edit.php?post_type=dwqa-answer1,8232.6660.3770.40
Add New Question /wp-admin/post-new.php?post_type=dwqa-question4,1099.13232.70147.57
Extensions /wp-admin/edit.php?post_type=dwqa-question&page=dwqa-extensions1,7602.3455.8490.53
Question Category /wp-admin/edit-tags.php?taxonomy=dwqa-question_category&post_type=dwqa-question1,8542.4259.8292.10
Settings /wp-admin/edit.php?post_type=dwqa-question&page=dwqa-settings1,5642.5557.2799.10
Questions /wp-admin/edit.php?post_type=dwqa-question1,9723.3489.2376.64

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_dwqa-related-question
    • dwqa_enable_email_delay
    • dwqa-question_category_children
    • widget_dwqa-closed-question
    • dwqa_permission
    • widget_dwqa-popular-question
    • dwqa_has_roles
    • widget_dwqa-latest-question
    • dwqa_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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/dw-question-answer/templates/content-edit.php
  • 37× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_user_by() in wp-content/plugins/dw-question-answer/templates/content-comment.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dwqa_current_user_can() in wp-content/plugins/dw-question-answer/templates/content-none.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Category' not found in wp-content/plugins/dw-question-answer/inc/Walker/Tag.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dw-question-answer/inc/Answer_List_Table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dw-question-answer/inc/helper/plugin-compatibility.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'DWQA_Posts_Base' not found in wp-content/plugins/dw-question-answer/inc/Posts/Question.php:90
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dw-question-answer/inc/User.php:143
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dw-question-answer/inc/helper/functions.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/dw-question-answer/templates/archive-question.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/dw-question-answer/templates/answer-submit-form.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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:
  • Screenshots: Screenshot #1 (Front-end appearance) image required
The official readme.txt is a good inspiration

dw-question-answer/dw-question-answer.php Passed 13 tests

This is the main PHP file of "DW Question & Answer" version 1.5.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
135 characters long description:
A WordPress plugin was make by DesignWall.com to build an Question Answer system for support, asking and comunitcate with your customer

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
Good job! No executable or dangerous file extensions detected36,909 lines of code in 114 files:
LanguageFilesBlank linesComment linesLines of code
PO File2714,05422,35221,869
PHP591,6769619,382
XML17162,912
LESS2281271987
JavaScript85112865
CSS914241715
HTML700162
Markdown110017

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity26.29
▷ Minimum class complexity1.00
▷ Maximum class complexity141.00
Average method complexity4.13
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes00.00%
▷ Concrete classes38100.00%
▷ Final classes00.00%
Methods307
▷ Static methods92.93%
▷ Public methods29696.42%
▷ Protected methods00.00%
▷ Private methods113.58%
Functions200
▷ Named functions200100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/assets/img/icon-search.png1.20KB0.48KB▼ 60.18%
assets/img/dw-widgets.png4.14KB1.47KB▼ 64.57%
assets/img/dw-leaderboard.png1.07KB1.28KB0.00%
assets/img/dw-embedquestion.png2.71KB2.46KB▼ 9.47%
assets/img/dw-captcha.png2.71KB2.71KB0.00%