68% wp-survey-form

Code Review | WP Survey Form

WordPress plugin WP Survey Form scored68%from 54 tests.

About plugin

  • Plugin page: wp-survey-form
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Feb 7, 2019
  • Latest release: May 10, 2019
  • Number of updates: 6
  • Update frequency: every 15.3 days
  • Top authors: rishishah (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /675 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.46ms] Passed 4 tests

An overview of server-side resources used by WP Survey Form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.42 ▼8.64
Dashboard /wp-admin3.39 ▲0.0961.45 ▲10.72
Posts /wp-admin/edit.php3.44 ▲0.0950.87 ▼3.30
Add New Post /wp-admin/post-new.php5.99 ▲0.1191.63 ▼10.43
Media Library /wp-admin/upload.php3.31 ▲0.0938.53 ▲4.53
Display Survey Form /wp-admin/admin.php?page=display_survey_form3.2929.67
Add New Survey Form /wp-admin/admin.php?page=add_new_survey_form3.3037.12

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP Survey Form
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19613.68 ▼0.756.35 ▲4.4356.09 ▲10.53
Dashboard /wp-admin2,234 ▲495.89 ▲0.0198.99 ▼6.3736.84 ▼9.84
Posts /wp-admin/edit.php2,120 ▲302.05 ▼0.0038.19 ▲1.1636.54 ▲4.11
Add New Post /wp-admin/post-new.php1,540 ▲2623.10 ▲5.48679.09 ▲56.0152.50 ▲2.72
Media Library /wp-admin/upload.php1,413 ▲314.16 ▼0.0597.55 ▼4.3544.02 ▼4.20
Display Survey Form /wp-admin/admin.php?page=display_survey_form7862.0529.3224.26
Add New Survey Form /wp-admin/admin.php?page=add_new_survey_form9041.7426.1428.78

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_survey_form_data
    • wp_survey_form_data_count
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=display_survey_form
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=display_survey_form
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)

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
The following issues need your attention
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-survey-form/admin/HTML/DisplaySurveyForm.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-survey-form/public/class-wp-survey-form-public.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-survey-form/admin/HTML/DisplaySurveyForm.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-survey-form/wp-survey-form.php:17
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-survey-form/admin/HTML/AddNewSurveyForm.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-survey-form/admin/HTML/AddNewSurveyForm.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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 an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: survey form generator, take survey, survey form

wp-survey-form/wp-survey-form.php Passed 13 tests

"WP Survey Form" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
53 characters long description:
Just another survey form plugin. Simple but flexible.

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
No dangerous file extensions were detected1,672 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31831091,140
PHP683139447
CSS23564
Markdown16021

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity14.50
▷ Minimum class complexity8.00
▷ Maximum class complexity21.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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 images were found in this plugin