78% diyva-voice-survey

Code Review | DIYVA Voice Survey

WordPress plugin DIYVA Voice Survey scored 78% from 54 tests.

About plugin

  • Plugin page: diyva-voice-survey
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8.1
  • WordPress version: 6.3.1
  • First release: Nov 29, 2021
  • Latest release: Nov 29, 2021
  • Number of updates: 13
  • Update frequency: every 0.5 days
  • Top authors: diyva (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 276 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.02MB] [CPU: ▼5.49ms] Passed 4 tests

An overview of server-side resources used by DIYVA Voice Survey
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.30 ▼22.78
Dashboard /wp-admin3.33 ▲0.0252.99 ▲0.88
Posts /wp-admin/edit.php3.38 ▲0.0247.25 ▼6.35
Add New Post /wp-admin/post-new.php5.93 ▲0.04120.15 ▲22.55
Media Library /wp-admin/upload.php3.25 ▲0.0243.34 ▲6.31
Dialog Settings /wp-admin/admin.php?page=diyva-voice-survey-plugin-dialog-settings3.2533.33
Display Settings /wp-admin/admin.php?page=diyva-voice-survey-plugin-display-settings3.2735.57
DIYVA Voice Survey /wp-admin/admin.php?page=diyva-voice-survey-plugin3.2433.62
Query Parameters /wp-admin/admin.php?page=diyva-voice-survey-plugin-query-parameters3.2834.03

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for DIYVA Voice Survey
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲16114.11 ▲0.895.92 ▲3.6740.33 ▼9.17
Dashboard /wp-admin2,229 ▲204.90 ▼0.19104.05 ▼8.0681.14 ▲36.82
Posts /wp-admin/edit.php2,130 ▲412.02 ▲0.0335.78 ▼4.8235.23 ▼0.97
Add New Post /wp-admin/post-new.php1,552 ▲3323.25 ▲0.05774.82 ▲106.6160.82 ▼0.72
Media Library /wp-admin/upload.php1,426 ▲384.20 ▼0.2299.91 ▼11.1983.48 ▲37.55
Dialog Settings /wp-admin/admin.php?page=diyva-voice-survey-plugin-dialog-settings8392.1924.5628.56
Display Settings /wp-admin/admin.php?page=diyva-voice-survey-plugin-display-settings1,1301.7225.1628.71
DIYVA Voice Survey /wp-admin/admin.php?page=diyva-voice-survey-plugin8332.0524.4628.14
Query Parameters /wp-admin/admin.php?page=diyva-voice-survey-plugin-query-parameters8882.0223.6226.10

Uninstaller [IO: ✅] [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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/diyva-voice-survey/public/partials/diyva-voice-survey-public-display.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/diyva-voice-survey/admin/partials/diyva-voice-survey-admin-query-parameters.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/diyva-voice-survey/admin/partials/diyva-voice-survey-admin-display.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/diyva-voice-survey/admin/partials/diyva-voice-survey-admin-dialog-settings.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/diyva-voice-survey/admin/partials/diyva-voice-survey-admin-display-settings.php:21

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

diyva-voice-survey/diyva-voice-survey.php Passed 13 tests

The main file in "DIYVA Voice Survey" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
129 characters long description:
Use this plugin to enable frictionless conversational voice surveys to gather product feedback and measure customer satisfaction.

Code Analysis 97% from 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 plugin838 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP15264637718
CSS215889
JavaScript265431

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 116)
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity21.86
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity5.71
▷ Minimum method complexity1.00
▷ Maximum method complexity116.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected