78% questionnaire

Code Review | Questionnaire

WordPress plugin Questionnaire scored 78% from 54 tests.

About plugin

  • Plugin page: questionnaire
  • Plugin version: 2.8.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-4.4.2
  • WordPress version: 6.3.1
  • First release: Jul 31, 2015
  • Latest release: Mar 24, 2016
  • Number of updates: 81
  • Update frequency: every 3.0 days
  • Top authors: kurohara (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 7,421 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
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼9.70ms] Passed 4 tests

A check of server-side resources used by Questionnaire
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0736.60 ▼3.69
Dashboard /wp-admin3.38 ▲0.0743.50 ▼5.04
Posts /wp-admin/edit.php3.43 ▲0.0745.85 ▼3.60
Add New Post /wp-admin/post-new.php5.96 ▲0.0780.70 ▼26.48
Media Library /wp-admin/upload.php3.30 ▲0.0733.65 ▲0.32
Questionnaire /wp-admin/edit.php?post_type=questionnaire3.3434.66
Add New /wp-admin/post-new.php?post_type=questionnaire3.4754.80

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 431 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_qstnr_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Questionnaire
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲10913.26 ▼1.414.80 ▲3.1446.66 ▲6.20
Dashboard /wp-admin2,227 ▲425.85 ▼0.03103.28 ▲3.6741.01 ▼6.65
Posts /wp-admin/edit.php2,116 ▲271.98 ▼0.0539.49 ▼1.2036.76 ▼1.43
Add New Post /wp-admin/post-new.php1,565 ▲2318.16 ▼0.08617.32 ▲9.8756.39 ▲12.41
Media Library /wp-admin/upload.php1,418 ▲304.24 ▲0.0494.38 ▼2.2541.25 ▼5.93
Questionnaire /wp-admin/edit.php?post_type=questionnaire1,1312.0031.5531.21
Add New /wp-admin/post-new.php?post_type=questionnaire3,4838.12188.3394.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_qstnr_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/questionnaire/widget.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/questionnaire/widget.php:6

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/post-new.php?post_type=questionnaire
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: this._addClass is not a function" "TypeError: this._addClass is not a function\n at e.\u003Ccomputed>.\u003Ccomputed>._create (/wp-includes/js/jquery/ui/sortable.min.js?ver=1.13.2:9:912)\n at e.\u003Ccomputed>.\u003Ccomputed>._create (/wp-content/plugins/questionnaire/jquery-ui.min.js?ver=6.3.1:6:7841)\n at e.\u003Ccomputed>.\u003Ccomputed>._createWidget (/wp-content/plugins/questionnaire/jquery-ui.min.js?ver=6.3.1:6:9910)\n at new e.\u003Ccomputed>.\u003Ccomputed> (/wp-content/plugins/questionnaire/jquery-ui.min.js?ver=6.3.1:6:7399)\n at HTMLDivElement.\u003Canonymous> (/wp-content/plugins/questionnaire/jquery-ui.min.js?ver=6.3.1:6:9182)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:3129)\n at e.\u003Ccomputed>.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:1594)\n at e.fn.\u003Ccomputed> [as sortable] (/wp-content/plugins/questionnaire/jquery-ui.min.js?ver=6.3.1:6:9092)\n at Object.init (/wp-admin/js/postbox.min.js?ver=6.3.1:2:3686)\n at Object.add_postbox_toggles (/wp-admin/js/postbox.min.js?ver=6.3.1:2:2725)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=questionnaire
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: this._addClass is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: questionnaire, vote, survey, plugin

questionnaire/questionnaire.php Passed 13 tests

The principal PHP file in "Questionnaire" v. 2.8.0 is loaded by WordPress automatically on each request
42 characters long description:
Application for collecting questionnaires.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin146,262 lines of code in 297 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript859,98821,27991,253
HTML1222,1594026,641
JSON60019,944
CSS7861873,690
PHP173076041,847
Markdown342601,320
SVG563701,057
PO File1191194510

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.50
▷ Minimum class complexity5.00
▷ Maximum class complexity12.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions106
▷ Named functions10599.06%
▷ Anonymous functions10.94%
Constants19
▷ Global constants19100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
93 PNG files occupy 1.39MB with 0.55MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
amcharts/amcharts/patterns/white/pattern12.png0.16KB0.10KB▼ 35.00%
amcharts/amcharts/patterns/black/pattern20.png0.16KB0.10KB▼ 35.40%
amcharts/amcharts/patterns/black/pattern4.png0.15KB0.10KB▼ 35.06%
amcharts/amcharts/plugins/responsive/examples/images/bicycle.png1.15KB0.50KB▼ 56.50%
amcharts/amcharts/patterns/white/pattern13.png0.15KB0.10KB▼ 35.06%