68% ecommerce-smart-survey

Code Review | Ecommerce Smart Survey

WordPress plugin Ecommerce Smart Survey scored 68% from 54 tests.

About plugin

  • Plugin page: ecommerce-smart-s...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9
  • WordPress version: 5.8.1
  • First release: Jul 28, 2018
  • Latest release: Jul 28, 2018
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: danishmicro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 313 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.34MB] [CPU: ▼136.09ms] Passed 4 tests

An overview of server-side resources used by Ecommerce Smart Survey
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.16 ▲0.4438.44 ▲17.44
Dashboard /wp-admin3.43 ▲0.3748.32 ▲11.06
Posts /wp-admin/edit.php3.49 ▲0.3847.90 ▲4.27
Add New Post /wp-admin/post-new.php5.73 ▲0.2993.23 ▼563.97
Media Library /wp-admin/upload.php3.31 ▲0.3137.24 ▲4.30
All ES Surveys /wp-admin/admin.php?page=e-smart-survey-master3.3335.53
Add ES Survey /wp-admin/admin.php?page=e-smart-survey-master-create3.3437.76
Settings /wp-admin/admin.php?page=e-smart-survey-master-setting3.3331.70

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 51 new files
Database: 4 new tables, 3 new options
New tables
wp_ES_SURVEY_responds
wp_ES_SURVEY_answers
wp_ES_SURVEY_respond_answers
wp_ES_SURVEY_questions
New WordPress options
ES_SURVEY_db_version
__ES_SURVEY_base_path_old
ES_SURVEY_is_installed

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ecommerce Smart Survey
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,853 ▲24716.22 ▲0.5011.54 ▲1.5872.44 ▲23.59
Dashboard /wp-admin2,998 ▲645.89 ▼0.07135.81 ▼10.04124.85 ▲14.33
Posts /wp-admin/edit.php2,789 ▲502.71 ▼0.0063.78 ▲0.0088.36 ▲5.19
Add New Post /wp-admin/post-new.php1,697 ▲19719.06 ▲0.49367.97 ▼7.32114.57 ▲8.77
Media Library /wp-admin/upload.php1,789 ▼185.00 ▼0.03126.81 ▼21.05148.02 ▲30.17
All ES Surveys /wp-admin/admin.php?page=e-smart-survey-master1,4924.2782.06135.76
Add ES Survey /wp-admin/admin.php?page=e-smart-survey-master-create1,7954.4284.28112.69
Settings /wp-admin/admin.php?page=e-smart-survey-master-setting1,5514.2482.64120.09

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_ES_SURVEY_respond_answers
    • wp_ES_SURVEY_questions
    • wp_ES_SURVEY_answers
    • wp_ES_SURVEY_responds
  • Zombie WordPress options were found after uninstall: 3 options
    • ES_SURVEY_db_version
    • ES_SURVEY_is_installed
    • __ES_SURVEY_base_path_old

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ES_SURVEY_PAGENAME - assumed 'ES_SURVEY_PAGENAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecommerce-smart-survey/app/views/admin/general/header.php on line 12
    • > PHP Warning
      Use of undefined constant ES_SURVEY_PAGENAME - assumed 'ES_SURVEY_PAGENAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecommerce-smart-survey/app/views/admin/general/header.php on line 10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ecommerce-smart-survey/app/views/admin/main/content-general.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/ecommerce-smart-survey/app/templates/single-smart-survey.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ecommerce-smart-survey/app/views/admin/main/content.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ecommerce-smart-survey/app/views/admin/main/survey-setting.php:3
    • > PHP Warning
      Use of undefined constant ES_SURVEY_PAGENAME - assumed 'ES_SURVEY_PAGENAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecommerce-smart-survey/app/views/admin/general/header.php on line 11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ecommerce-smart-survey/app/views/admin/dashboard.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ecommerce-smart-survey/app/views/admin/general/header.php:14
    • > PHP Warning
      Use of undefined constant ES_SURVEY_LIB - assumed 'ES_SURVEY_LIB' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecommerce-smart-survey/app/app.php on line 12

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)
Please fix the following user-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=e-smart-survey-master-setting
    • > Javascript (severe) in unknown
    /wp-content/plugins/ecommerce-smart-survey/assets/js/admin-customize.js?ver=1 1:32 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: smart survey, sell with survey, ecommerce smart survey

ecommerce-smart-survey/ecommerce-smart-survey.php Passed 13 tests

Analyzing the main PHP file in "Ecommerce Smart Survey" version 1.0
80 characters long description:
How To Sell More And Increase Conversions By Adding A Simple Survey To Any Offer

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
Everything looks great! No dangerous files found in this plugin21,763 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
CSS61619315,373
JavaScript78044803,107
PHP255308772,995
SVG100288

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity24.85
▷ Minimum class complexity3.00
▷ Maximum class complexity102.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods113
▷ Static methods2118.58%
▷ Public methods6658.41%
▷ Protected methods3833.63%
▷ Private methods97.96%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/left-icon.png1.43KB1.32KB▼ 7.59%