78% awesome-surveys

Code Review | Awesome Surveys

WordPress plugin Awesome Surveys scored 78% from 54 tests.

About plugin

  • Plugin page: awesome-surveys
  • Plugin version: 2.0.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-4.4
  • WordPress version: 6.3.1
  • First release: Jun 9, 2014
  • Latest release: Jun 5, 2016
  • Number of updates: 64
  • Update frequency: every 11.4 days
  • Top authors: WilltheWebMechanic (100%)

Code review

54 tests

User reviews

62 reviews

Install metrics

700+ active / 54,769 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▲2.13ms] Passed 4 tests

Analyzing server-side resources used by Awesome Surveys
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.06 ▲5.75
Dashboard /wp-admin3.40 ▲0.1051.75 ▲3.24
Posts /wp-admin/edit.php3.51 ▲0.1651.80 ▲3.19
Add New Post /wp-admin/post-new.php6.00 ▲0.1195.52 ▼3.68
Media Library /wp-admin/upload.php3.32 ▲0.0942.76 ▲7.50
New Survey /wp-admin/post-new.php?post_type=awesome-surveys3.5048.08
WtWM Plugins /wp-admin/admin.php?page=wwm_plugins3.2940.68
My Surveys /wp-admin/edit.php?post_type=awesome-surveys3.3736.73

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 202 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Awesome Surveys
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲12013.21 ▼1.166.07 ▲4.4745.86 ▼1.20
Dashboard /wp-admin2,224 ▲385.88 ▼0.16122.32 ▼51.0673.21 ▲6.20
Posts /wp-admin/edit.php2,122 ▲302.00 ▼0.0244.35 ▼3.8040.83 ▼0.90
Add New Post /wp-admin/post-new.php1,548 ▲1922.89 ▲0.01726.88 ▲28.7568.99 ▲9.15
Media Library /wp-admin/upload.php1,418 ▲274.21 ▼0.00107.83 ▼1.3378.85 ▲30.17
New Survey /wp-admin/post-new.php?post_type=awesome-surveys1,6663.2469.0079.08
WtWM Plugins /wp-admin/admin.php?page=wwm_plugins8072.0134.7436.27
Survey Options /wp-admin/awesome-surveys.php260.440.0618.05
My Surveys /wp-admin/edit.php?post_type=awesome-surveys1,0801.9536.6731.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 53× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Element_Radio' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/YesNo.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'View' not found in wp-content/plugins/awesome-surveys/includes/PFBC/View/Vertical.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Element' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/Hidden.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Element_Textbox' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/Search.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Element_Textbox' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/jQueryUIDate.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Element_Textarea' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/CKEditor.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Element' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/File.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Element_Textarea' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/TinyMCE.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Element_Textbox' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/Url.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Element_Textbox' not found in wp-content/plugins/awesome-surveys/includes/PFBC/Element/DateTime.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/awesome-surveys.php
    • > Network (severe)
    wp-admin/awesome-surveys.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (The form builder), #2 (Survey form built, ready to save), #3 (Survey form output on the frontend), #4 (The thank you message displayed after the survey has been submitted), #5 (Survey results view), #6 (How to View Results - Hover your mouse, click link)
You can take inspiration from this readme.txt

awesome-surveys/awesome-surveys.php Passed 13 tests

The principal PHP file in "Awesome Surveys" v. 2.0.10 is loaded by WordPress automatically on each request
89 characters long description:
Easily create surveys for your WordPress website and publish them with a simple shortcode

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected7,369 lines of code in 148 files:
LanguageFilesBlank linesComment linesLines of code
PHP593625313,216
PO File68021,2261,601
JavaScript64192301,483
CSS13141200617
Markdown1970236
Sass4230203
Bourne Shell10213

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity9.15
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes612.50%
▷ Concrete classes4287.50%
▷ Final classes00.00%
Methods181
▷ Static methods84.42%
▷ Public methods15686.19%
▷ Protected methods2111.60%
▷ Private methods42.21%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
32 PNG files occupy 0.78MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
css/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
screenshot-5.png119.63KB31.06KB▼ 74.03%
screenshot-1.png213.35KB69.17KB▼ 67.58%
css/images/ui-bg_glass_100_fdf5ce_1x400.png0.34KB0.16KB▼ 54.02%