68% likert-survey-master

Code Review | Likert Survey Master

WordPress plugin Likert Survey Master scored68%from 54 tests.

About plugin

  • Plugin page: likert-survey-master
  • Plugin version: 0.8.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 23, 2015
  • Latest release: Apr 4, 2023
  • Number of updates: 14
  • Update frequency: every 209.6 days
  • Top authors: prasunsen (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active /3,024 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼2.79ms] Passed 4 tests

A check of server-side resources used by Likert Survey Master
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1943.93 ▲5.41
Dashboard /wp-admin3.50 ▲0.1954.30 ▲4.02
Posts /wp-admin/edit.php3.61 ▲0.2553.63 ▼1.44
Add New Post /wp-admin/post-new.php6.08 ▲0.1997.03 ▼14.99
Media Library /wp-admin/upload.php3.42 ▲0.1939.53 ▲1.27
Question Categories /wp-admin/admin.php?page=likertm_survey3.3637.81
Create Survey /wp-admin/admin.php?page=likert_master3.4437.04
Manage Surveys /wp-admin/admin.php?page=likertm_surveys3.3933.11
Manage Questions /wp-admin/admin.php?page=likertm_questions3.3634.03
Question Categories /wp-admin/admin.php?page=likertm_qcats3.3933.57
Stats Per Question /wp-admin/admin.php?page=likertm_per_question3.3635.88
View Answers /wp-admin/admin.php?page=likertm_results3.3633.37

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: 6 new tables, 7 new options
New tables
wp_likertm_surveys
wp_likertm_qcats
wp_likertm_questions
wp_likertm_user_answers
wp_likertm_takings
wp_likertm_choices
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
likertm_version
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Likert Survey Master
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲17113.84 ▼0.528.60 ▲6.6142.92 ▼0.13
Dashboard /wp-admin2,255 ▲525.89 ▲0.9996.64 ▼8.4538.32 ▼7.05
Posts /wp-admin/edit.php2,131 ▲312.01 ▲0.0041.74 ▲2.7735.09 ▲1.93
Add New Post /wp-admin/post-new.php1,570 ▲4423.06 ▲5.30649.28 ▲13.4259.34 ▼1.84
Media Library /wp-admin/upload.php1,434 ▲344.25 ▲0.0596.95 ▼9.2544.11 ▼2.93
Question Categories /wp-admin/admin.php?page=likertm_survey6951.146.7618.02
Create Survey /wp-admin/admin.php?page=likert_master1,1472.1524.3431.27
Manage Surveys /wp-admin/admin.php?page=likertm_surveys8122.1423.6429.28
Manage Questions /wp-admin/admin.php?page=likertm_questions8042.0524.5227.23
Question Categories /wp-admin/admin.php?page=likertm_qcats8092.0223.9826.81
Stats Per Question /wp-admin/admin.php?page=likertm_per_question7932.0226.8627.21
View Answers /wp-admin/admin.php?page=likertm_results7992.0524.5826.74

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 6 tables in the database
    • wp_likertm_qcats
    • wp_likertm_surveys
    • wp_likertm_takings
    • wp_likertm_user_answers
    • wp_likertm_choices
    • wp_likertm_questions
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • likertm_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=likertm_survey
    • > Notice in wp-content/plugins/likert-survey-master/controllers/main.php+80
    Undefined index: id
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=likertm_results
    • > Notice in wp-content/plugins/likert-survey-master/controllers/results.php+8
    Undefined index: survey_id
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=likertm_results
    • > Notice in wp-content/plugins/likert-survey-master/views/view-results.html.php+6
    Trying to get property 'id' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=likertm_results
    • > Notice in wp-content/plugins/likert-survey-master/views/view-results.html.php+2
    Trying to get property 'title' of non-object

SRP 50% 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
  • 22× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: survey in wp-content/plugins/likert-survey-master/views/display-survey.html.php on line 14
    • > PHP Notice
      Trying to get property 'id' of non-object in wp-content/plugins/likert-survey-master/views/display-survey.html.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/likert-survey-master/views/questions.html.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/likert-survey-master/views/choice.html.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/likert-survey-master/views/main.html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/likert-survey-master/views/stats-per-question.html.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/likert-survey-master/views/display-survey.html.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/likert-survey-master/views/display-survey.html.php:26
    • > PHP Notice
      Trying to get property 'id' of non-object in wp-content/plugins/likert-survey-master/views/display-survey.html.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/likert-survey-master/views/surveys.html.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

likert-survey-master/likert-survey.php 85% from 13 tests

The entry point to "Likert Survey Master" version 0.8.0.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("likert-survey-master.php" instead of "likert-survey.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,129 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP202491211,069
JavaScript112449
CSS12111

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity15.57
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity6.67
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods18
▷ Static methods1372.22%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/arrow-up.png0.23KB0.25KB0.00%
img/arrow-down.png0.24KB0.25KB0.00%