53% mfs-survey

Code Review | MFS Survey

WordPress plugin MFS Survey scored53%from 54 tests.

About plugin

  • Plugin page: mfs-survey
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 26, 2013
  • Latest release: Jan 2, 2014
  • Number of updates: 5
  • Update frequency: every 7.6 days
  • Top authors: Mindfire-Solutions (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,424 total downloads

Benchmarks

Plugin footprint 48% 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.90MB] [CPU: ▼39.79ms] Passed 4 tests

An overview of server-side resources used by MFS Survey
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0742.62 ▼0.89
Dashboard /wp-admin3.06 ▼0.2925.95 ▼37.37
Posts /wp-admin/edit.php3.06 ▼0.3023.39 ▼36.96
Add New Post /wp-admin/post-new.php3.06 ▼2.8324.62 ▼71.93
Media Library /wp-admin/upload.php3.06 ▼0.1725.42 ▼12.88
Survey Result /wp-admin/admin.php?page=forms/survey-result-form3.0623.26
Survey Report /wp-admin/admin.php?page=forms/survey-report-form3.0624.50
Edit Survey /wp-admin/admin.php?page=forms/edit-survey-form3.0625.49
Edit Question /wp-admin/admin.php?page=forms/edit-question-form3.0623.72
Edit Page /wp-admin/admin.php?page=forms/edit-page-form3.0619.57
Add Question /wp-admin/admin.php?page=forms/question-form3.0623.41
All Surveys /wp-admin/admin.php?page=add-survey3.0621.45
Add Survey /wp-admin/admin.php?page=forms/survey-form3.0623.78
Add Page /wp-admin/admin.php?page=forms/page-form3.0626.16

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 35 new files
Database: 5 new tables, 6 new options
New tables
wp_mfs_survey
wp_mfs_survey_result
wp_mfs_survey_page
wp_mfs_survey_answer
wp_mfs_survey_question
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for MFS Survey
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲4214.73 ▲0.142.08 ▼0.2439.51 ▼2.24
Dashboard /wp-admin2,234 ▲575.59 ▼0.0190.59 ▼4.7738.75 ▲0.17
Posts /wp-admin/edit.php2,142 ▲351.96 ▲0.0240.99 ▼1.3339.24 ▼1.54
Add New Post /wp-admin/post-new.php1,557 ▲3123.23 ▲0.11630.29 ▼41.6255.87 ▲2.89
Media Library /wp-admin/upload.php1,439 ▲454.21 ▲0.0699.08 ▼6.7042.95 ▼3.11
Survey Result /wp-admin/admin.php?page=forms/survey-result-form8771.9926.0325.82
Survey Report /wp-admin/admin.php?page=forms/survey-report-form8672.0525.2725.71
Edit Survey /wp-admin/admin.php?page=forms/edit-survey-form9502.0826.4525.88
Edit Question /wp-admin/admin.php?page=forms/edit-question-form9432.0729.5622.69
Edit Page /wp-admin/admin.php?page=forms/edit-page-form9152.0826.9125.36
Add Question /wp-admin/admin.php?page=forms/question-form1,0182.0725.5225.95
All Surveys /wp-admin/admin.php?page=add-survey9182.0825.4125.27
Add Survey /wp-admin/admin.php?page=forms/survey-form8402.0324.2729.23
Add Page /wp-admin/admin.php?page=forms/page-form9062.0825.0124.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 5 tables in the database
    • wp_mfs_survey_result
    • wp_mfs_survey
    • wp_mfs_survey_page
    • wp_mfs_survey_question
    • wp_mfs_survey_answer
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 149 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=forms/page-form
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-survey
    • > Notice in wp-content/plugins/mfs-survey/forms/manage-survey.php+57
    Undefined index: paged
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=forms/edit-page-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-page-form.php+49
    Undefined index: survey_id
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=forms/edit-page-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-page-form.php+61
    Trying to get property 'survey_name' of non-object
    • > GET request to /wp-admin/admin.php?page=forms/edit-survey-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-survey-form.php+60
    Trying to get property 'fk_start_page_id' of non-object
    • > GET request to /wp-admin/admin.php?page=forms/edit-survey-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-survey-form.php+61
    Trying to get property 'fk_end_page_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=forms/edit-page-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-page-form.php+54
    Undefined index: page_id
    • > GET request to /wp-admin/admin.php?page=forms/edit-question-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-question-form.php+59
    Undefined index: question_id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=forms/edit-page-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-page-form.php+66
    Trying to get property 'page_title' of non-object
    • > GET request to /wp-admin/admin.php?page=forms/edit-question-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-question-form.php+99
    Trying to get property 'question_type' of non-object
    • > GET request to /wp-admin/admin.php?page=forms/edit-question-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-question-form.php+136
    Trying to get property 'question_data' of non-object
    • > GET request to /wp-admin/admin.php?page=forms/edit-question-form
    • > Warning in wp-content/plugins/mfs-survey/forms/edit-question-form.php+139
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=forms/edit-page-form
    • > Notice in wp-content/plugins/mfs-survey/forms/edit-page-form.php+170
    Undefined variable: question_type

SRP 50% 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
  • 48× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/mfs-survey/survey-tables.php on line 16
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/mfs-survey/survey-tables.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/mfs-survey/forms/manage-survey.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/mfs-survey/forms/question-form.php:13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/mfs-survey/survey-tables.php on line 13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/mfs-survey/survey-tables.php on line 13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/mfs-survey/survey-tables.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/mfs-survey/forms/page-form.php:13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/mfs-survey/survey-tables.php on line 14
    • > PHP Notice
      Undefined index: action in wp-content/plugins/mfs-survey/survey-action.php on line 55

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)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=forms/survey-result-form
    • > Network (severe)
    wp-content/plugins/mfs-survey/scripts/survey-report-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

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
5 plugin tags: mfs survey, wpsurvey, wp survey, wordpress survey, survey plugin

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

The principal PHP file in "MFS Survey" v. 1.0 is loaded by WordPress automatically on each request
58 characters long description:
The MFS Survey plugin lets you add surveys to your website

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
Success! There were no dangerous files found in this plugin3,695 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP168608822,447
JavaScript8437403714
CSS23353366
PO File176144168

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions52
▷ Named functions52100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin