62% surveyjs

Code Review | SurveyJS

WordPress plugin SurveyJS scored62%from 54 tests.

About plugin

  • Plugin page: surveyjs
  • Plugin version: 1.9.68
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1.1
  • WordPress version: 6.3.1
  • First release: May 29, 2018
  • Latest release: Jan 16, 2023
  • Number of updates: 31
  • Update frequency: every 54.7 days
  • Top authors: devsoftbaltic (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /7,014 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.15MB] [CPU: ▼2.62ms] Passed 4 tests

This is a short check of server-side resources used by SurveyJS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1344.67 ▲1.61
Dashboard /wp-admin3.48 ▲0.1349.82 ▼10.62
Posts /wp-admin/edit.php3.61 ▲0.2562.80 ▲10.87
Add New Post /wp-admin/post-new.php6.05 ▲0.1690.25 ▼5.80
Media Library /wp-admin/upload.php3.41 ▲0.1842.73 ▲4.33
SurveyJS /wp-admin/admin.php?page=sjs-main-menu3.3937.96
/wp-admin/admin.php?page=surveyjs_results3.3735.61
/wp-admin/admin.php?page=surveyjs_editor3.3737.32
Settings /wp-admin/admin.php?page=sjs-settings3.3735.51

Server storage [IO: ▲7.51MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • The plugin illegally modified 3 files (0.00KB) outside of "wp-content/plugins/surveyjs/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/surveyjs/images/logo_500\321\205500.png"
    • (new file) "wp-content/plugins/surveyjs/images/logo_32\321\20532.png"
    • (new file) "wp-content/plugins/surveyjs/images/logo_20\321\20520.png"
Filesystem: 47 new files
Database: 2 new tables, 6 new options
New tables
wp_sjs_results
wp_sjs_my_surveys
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for SurveyJS
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,012 ▲25124.09 ▲9.88109.74 ▲107.8137.64 ▼1.45
Dashboard /wp-admin2,296 ▲11811.40 ▲5.73252.31 ▲150.0946.20 ▲3.24
Posts /wp-admin/edit.php2,227 ▲12410.29 ▲8.2990.81 ▲56.0434.49 ▼1.95
Add New Post /wp-admin/post-new.php6,373 ▲4,84228.82 ▲5.48783.92 ▲70.5439.43 ▼22.97
Media Library /wp-admin/upload.php1,525 ▲13112.95 ▲8.71136.74 ▲37.5845.50 ▼0.28
SurveyJS /wp-admin/admin.php?page=sjs-main-menu1,01515.23245.2865.12
/wp-admin/admin.php?page=surveyjs_results1,00615.19214.8429.41
/wp-admin/admin.php?page=surveyjs_editor9,98922.19490.27108.73
Settings /wp-admin/admin.php?page=sjs-settings1,00715.10101.9127.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_sjs_results
    • wp_sjs_my_surveys
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=surveyjs_editor
    • > Notice in wp-content/plugins/surveyjs/views/editor.php+10
    Undefined index: id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=surveyjs_editor
    • > Notice in wp-content/plugins/surveyjs/views/editor.php+14
    Trying to get property 'json' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=surveyjs_editor
    • > Notice in wp-content/plugins/surveyjs/views/editor.php+31
    Undefined index: name
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sjs-settings
    • > Notice in wp-content/plugins/surveyjs/views/settings.php+61
    Undefined variable: current_theme

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
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/surveyjs/surveyjs.php:55
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/surveyjs/ajax_handlers/upload_file.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/file.php' (include_path='.:/usr/share/php') in wp-content/plugins/surveyjs/ajax_handlers/upload_file.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/surveyjs/ajax_handlers/upload_file.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=surveyjs_results
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=surveyjs_results 0:0 Uncaught SyntaxError: Unexpected end of JSON input

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: survey creator, quiz, survey, quiz creator, survey maker...

surveyjs/surveyjs.php Passed 13 tests

This is the main PHP file of "SurveyJS" version 1.9.68, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
60 characters long description:
Easy to use, drag & drop Survey Builder with myriad options.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected10,065 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
CSS71,013308,588
PHP1817926926
JavaScript1522467541
SVG10110

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.18
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.77
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes15.88%
▷ Concrete classes1694.12%
▷ Final classes00.00%
Methods49
▷ Static methods714.29%
▷ Public methods4897.96%
▷ Protected methods00.00%
▷ Private methods12.04%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
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
libs/images/sort_both.png0.20KB0.29KB0.00%
images/logo_32х32.png1.27KB0.98KB▼ 22.50%
images/logo_500х500.png9.55KB4.25KB▼ 55.47%
libs/images/sort_desc.png0.15KB0.25KB0.00%
images/logo_20х20.png0.87KB0.74KB▼ 15.64%