10% survey-maker-lite

Code Review | Survey Maker Lite

WordPress plugin Survey Maker Lite scored10%from 54 tests.

About plugin

  • Plugin page: survey-maker-lite
  • Plugin version: 0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.2-3.5
  • WordPress version: 6.3.1
  • First release: Dec 22, 2012
  • Latest release: Dec 22, 2012
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: misterpah (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,726 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/survey-maker-lite/index.php+68
    Undefined variable: table_name

Server metrics [RAM: ▼1.21MB] [CPU: ▼40.17ms] Passed 4 tests

This is a short check of server-side resources used by Survey Maker Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.76 ▼0.7014.28 ▼26.91
Dashboard /wp-admin2.80 ▼0.5118.08 ▼30.61
Posts /wp-admin/edit.php2.80 ▼0.5614.59 ▼31.78
Add New Post /wp-admin/post-new.php2.80 ▼3.0916.76 ▼71.38
Media Library /wp-admin/upload.php2.80 ▼0.4320.31 ▼17.63

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 31 new files
Database: 3 new tables, 6 new options
New tables
wp_sm_result
wp_sm
wp_sm_survey
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Survey Maker Lite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲10613.19 ▼1.184.40 ▲2.2642.71 ▼6.44
Dashboard /wp-admin2,222 ▲345.76 ▼0.11102.60 ▼0.8941.27 ▼4.40
Posts /wp-admin/edit.php2,105 ▲161.99 ▼0.0238.51 ▲2.0732.46 ▼4.39
Add New Post /wp-admin/post-new.php1,552 ▲3323.29 ▲0.12672.07 ▼38.1953.67 ▲4.30
Media Library /wp-admin/upload.php1,401 ▲104.23 ▼0.0596.49 ▼3.8141.75 ▼2.54

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/survey-maker-lite/index.php+153
    Undefined index: sm
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_sm_survey
    • wp_sm_result
    • wp_sm
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/survey-maker-lite/php/admin_new.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/survey-maker-lite/php/shortcode.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/survey-maker-lite/php/tableClass.php on line 3
    • > PHP Warning
      Use of undefined constant PLUGIN_TABLE_INDEX - assumed 'PLUGIN_TABLE_INDEX' (this will throw an Error in a future version of PHP) in wp-content/plugins/survey-maker-lite/php/admin_result.php on line 29
    • > PHP Warning
      Use of undefined constant PLUGIN_TABLE_SURVEY - assumed 'PLUGIN_TABLE_SURVEY' (this will throw an Error in a future version of PHP) in wp-content/plugins/survey-maker-lite/php/admin_edit.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/survey-maker-lite/index.php:16
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/survey-maker-lite/php/admin_result.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'sortableTable2' not found in wp-content/plugins/survey-maker-lite/php/admin_index.php:14
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/survey-maker-lite/php/admin_edit.php:32
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/survey-maker-lite/php/tableClass.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/survey-maker-lite/php/admin_delete.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (http://misterpah.com/wp-content/uploads/2012/12/Screenshot-from-2012-12-19-135759.png) image required
The official readme.txt might help

survey-maker-lite/index.php 92% from 13 tests

The main PHP script in "Survey Maker Lite" version 0.8 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("survey-maker-lite.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin5,120 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript79466903,812
PHP8316225856
HTML110230
CSS3290222

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.55
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
8 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/jPaginate/bg.png3.96KB1.94KB▼ 50.86%
js/jPaginate/about.png1.83KB1.16KB▼ 36.44%
js/jPaginate/images/snext.png3.05KB0.41KB▼ 86.51%
js/jPaginate/images/previous.png2.86KB0.21KB▼ 92.58%
css/cursor_drag_arrow.png5.92KB0.74KB▼ 87.45%