72% survey-maker

Code Review | Survey Maker - Best WordPress Survey Plugin

WordPress plugin Survey Maker - Best WordPress Survey Plugin scored72%from 54 tests.

About plugin

  • Plugin page: survey-maker
  • Plugin version: 3.9.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 22, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 612
  • Update frequency: every 1.8 days
  • Top authors: ays-pro (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

5,000+ active /178,477 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲3.21MB] [CPU: ▲14.64ms] Passed 4 tests

This is a short check of server-side resources used by Survey Maker - Best WordPress Survey Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.63 ▲3.1659.73 ▲18.99
Dashboard /wp-admin6.53 ▲3.2365.54 ▲16.71
Posts /wp-admin/edit.php6.57 ▲3.2171.29 ▲22.90
Add New Post /wp-admin/post-new.php9.26 ▲3.37105.48 ▼0.06
Media Library /wp-admin/upload.php6.47 ▲3.2457.82 ▲23.50
Survey Categories /wp-admin/admin.php?page=survey-maker-survey-categories6.5762.34
Our products /wp-admin/admin.php?page=survey-maker-our-products6.5458.21
Submissions /wp-admin/admin.php?page=survey-maker-submissions6.5861.12
Export / Import /wp-admin/admin.php?page=survey-maker-export-import6.5458.07
Surveys /wp-admin/admin.php?page=survey-maker6.5884.38
Frontend Requests /wp-admin/admin.php?page=survey-maker-requests6.5471.12
/wp-admin/admin.php?page=survey-maker-each-submission6.8257.07
How to use /wp-admin/admin.php?page=survey-maker-dashboard6.5660.52
PRO Features /wp-admin/admin.php?page=survey-maker-survey-features6.6269.04
General Settings /wp-admin/admin.php?page=survey-maker-settings7.0463.76

Server storage [IO: ▲7.47MB] [DB: ▲0.02MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 257 new files
Database: 10 new tables, 10 new options
New tables
wp_ayssurvey_surveys
wp_ayssurvey_answers
wp_ayssurvey_submissions
wp_ayssurvey_question_categories
wp_ayssurvey_sections
wp_ayssurvey_settings
wp_ayssurvey_survey_categories
wp_ayssurvey_submissions_questions
wp_ayssurvey_questions
wp_ayssurvey_popup_surveys
New WordPress options
widget_theysaidso_widget
ays_survey_sale_btn
can_compress_scripts
ays_survey_banner_time
widget_recent-comments
survey_flush_version
widget_recent-posts
ays_survey_db_version
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Survey Maker - Best WordPress Survey Plugin: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲11414.67 ▼0.041.72 ▼0.0430.29 ▼17.52
Dashboard /wp-admin2,264 ▲845.57 ▲0.0496.95 ▲8.1698.26 ▲63.68
Posts /wp-admin/edit.php2,187 ▲841.96 ▲0.0239.14 ▼0.3837.47 ▲3.35
Add New Post /wp-admin/post-new.php6,269 ▲4,74219.19 ▼3.87919.54 ▲272.9137.41 ▼29.60
Media Library /wp-admin/upload.php1,484 ▲844.17 ▲0.0595.36 ▲0.0778.19 ▲37.21
Survey Categories /wp-admin/admin.php?page=survey-maker-survey-categories1,8395.66125.24154.29
Our products /wp-admin/admin.php?page=survey-maker-our-products1,6315.45110.68109.11
Submissions /wp-admin/admin.php?page=survey-maker-submissions2,0235.5083.16119.29
Export / Import /wp-admin/admin.php?page=survey-maker-export-import2,08112.01335.69158.37
Surveys /wp-admin/admin.php?page=survey-maker2,48012.28302.58131.06
Frontend Requests /wp-admin/admin.php?page=survey-maker-requests1,6125.4276.77101.38
/wp-admin/admin.php?page=survey-maker-each-submission2,0205.4380.55112.98
How to use /wp-admin/admin.php?page=survey-maker-dashboard2,28611.81311.07167.97
PRO Features /wp-admin/admin.php?page=survey-maker-survey-features3,0625.3079.80132.93
General Settings /wp-admin/admin.php?page=survey-maker-settings6,2686.63130.04166.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • ays_survey_banner_time
    • widget_recent-posts
    • widget_recent-comments
    • ays_survey_sale_btn
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • survey_flush_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=survey-maker-each-submission
    • > Notice in wp-content/plugins/survey-maker/includes/lists/class-survey-maker-each-submission-list-table.php+56
    Undefined index: survey
    • > GET request to /wp-admin/admin.php?page=survey-maker-each-submission
    • > Notice in wp-content/plugins/survey-maker/admin/partials/submissions/survey-maker-each-submission-display.php+119
    Trying to access array offset on value of type null
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=survey-maker-each-submission
    • > Notice in wp-content/plugins/survey-maker/admin/partials/submissions/survey-maker-each-submission-display.php+570
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/survey-maker/public/partials/survey-maker-public-display.php
    • > /wp-content/plugins/survey-maker/admin/partials/subscribe/survey-maker-subscribe-email-display.php
  • 49× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: ays_tab in wp-content/plugins/survey-maker/admin/partials/surveys/actions/partials/survey-maker-surveys-actions-tab3.php on line 1
    • > PHP Warning
      Use of undefined constant SURVEY_MAKER_ADMIN_PATH - assumed 'SURVEY_MAKER_ADMIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/survey-maker/admin/partials/surveys/actions/survey-maker-survey-categories-actions.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'SURVEY_MAKER_ADMIN_PATH/partials/surveys/actions/survey-maker-survey-categories-actions-options.php' (include_path='.:/usr/share/php') in wp-content/plugins/survey-maker/admin/partials/surveys/actions/survey-maker-survey-categories-actions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/survey-maker/admin/partials/surveys/actions/partials/survey-maker-surveys-actions-tab2.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/survey-maker/admin/partials/surveys/actions/partials/survey-maker-surveys-actions-tab9.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/survey-maker/admin/partials/surveys/actions/partials/survey-maker-surveys-actions-tab3.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/survey-maker/admin/partials/surveys/actions/partials/survey-maker-survey-categories-actions-tab1.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/survey-maker/admin/partials/export-import/survey-maker-export-import-display.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Survey_Maker_Admin' not found in wp-content/plugins/survey-maker/admin/partials/surveys/survey-maker-surveys-display.php:7
    • > PHP Warning
      require_once(SURVEY_MAKER_ADMIN_PATH/partials/surveys/actions/survey-maker-surveys-actions-options.php): failed to open stream: No such file or directory in wp-content/plugins/survey-maker/admin/partials/surveys/actions/survey-maker-surveys-actions.php on line 2

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 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
8 plugin tags: form builder, forms, questionnaire, form, feedback...

survey-maker/survey-maker.php Passed 13 tests

The entry point to "Survey Maker - Best WordPress Survey Plugin" version 3.9.3 is a PHP file that has certain tags in its header comment area
107 characters long description:
Survey Maker plugin allows you to create unlimited surveys with unlimited sections and unlimited questions.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected63,925 lines of code in 167 files:
LanguageFilesBlank linesComment linesLines of code
PHP553,7893,57525,479
PO File65,4769,15814,198
CSS292,0401,81711,602
JavaScript261,1409658,849
SVG46022,887
JSON580910

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 624)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity129.27
▷ Minimum class complexity1.00
▷ Maximum class complexity834.00
Average method complexity7.47
▷ Minimum method complexity1.00
▷ Maximum method complexity624.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods436
▷ Static methods11426.15%
▷ Public methods41795.64%
▷ Protected methods102.29%
▷ Private methods92.06%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
61 PNG files occupy 0.54MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/icons/icon-popup-128x128.png11.65KB8.54KB▼ 26.73%
admin/images/icons/pd-logo-128x128.png4.23KB2.93KB▼ 30.77%
admin/images/integrations/stripe_logo.png1.82KB1.74KB▼ 4.45%
admin/images/integrations/sendgrid_logo.png0.49KB0.45KB▼ 8.80%
admin/images/integrations/klaviyo-logo.png0.57KB0.54KB▼ 5.01%