61% wadi-survey

Code Review | Wadi Survey

WordPress plugin Wadi Survey scored 61% from 54 tests.

About plugin

  • Plugin page: wadi-survey
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 5.9.2
  • First release: Dec 7, 2021
  • Latest release: Dec 7, 2021
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: mohammedrezq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 66 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: ▲5.18MB] [CPU: ▼269.00ms] 75% from 4 tests

Server-side resources used by Wadi Survey
It is recommended to improve the following
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.18MB on /wp-admin/admin.php?page=single_survey)
PageMemory (MB)CPU Time (ms)
Home /8.66 ▲5.1586.87 ▲36.29
Dashboard /wp-admin8.57 ▲5.1671.85 ▼9.64
Posts /wp-admin/edit.php8.86 ▲5.2270.51 ▲33.13
Add New Post /wp-admin/post-new.php12.19 ▲5.23124.16 ▼1,129.98
Media Library /wp-admin/upload.php8.49 ▲5.1958.83 ▲30.49
Single Poll Submissions /wp-admin/admin.php?page=single_poll8.5355.65
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.7587.71
Single Survey Submissions /wp-admin/admin.php?page=single_survey8.5356.41

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 663 new files
Database: 2 new tables, 4 new options
New tables
wp_wadi_poll_submissions
wp_wadi_survey_submissions
New WordPress options
fs_gdpr
fs_accounts
fs_debug_mode
fs_active_plugins

Browser metrics Passed 4 tests

Wadi Survey: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,294 ▲55021.08 ▲5.149.61 ▲3.742.31 ▲0.39
Dashboard /wp-admin3,300 ▲44210.64 ▲4.47203.56 ▲63.26209.85 ▲44.26
Posts /wp-admin/edit.php3,113 ▲4197.59 ▲4.35112.89 ▲18.76210.03 ▲42.25
Add New Post /wp-admin/post-new.php1,863 ▲20217.42 ▲1.37515.03 ▲77.75176.68 ▲19.17
Media Library /wp-admin/upload.php1,922 ▲2217.97 ▲2.39145.02 ▲0.68210.05 ▲23.20
Single Poll Submissions /wp-admin/admin.php?page=single_poll1,4147.67108.4353.77
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,8707.5198.49114.77
Single Survey Submissions /wp-admin/admin.php?page=single_survey1,4127.52105.4647.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wadi-survey/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 4 options
    • fs_active_plugins
    • fs_debug_mode
    • fs_gdpr
    • fs_accounts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=single_poll
    • > Notice in wp-content/plugins/wadi-survey/includes/single-submissions-poll.php+14
    Undefined index: poll_id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=single_survey
    • > Warning in wp-content/plugins/wadi-survey/includes/single-submissions-survey.php+174
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2699)
    • > GET request to /wp-admin/admin.php?page=single_survey
    • > Notice in wp-content/plugins/wadi-survey/includes/single-submissions-survey.php+14
    Undefined index: survey_id

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
    • > /wp-content/plugins/wadi-survey/freemius/templates/ajax-loader.php
  • 125× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/core/Container/Comment_Meta_Container.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/templates/Container/common/options-page.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Theme_Options_Container' not found in wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/core/Container/Network_Container.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Level_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/core/Field/Checkbox_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/core/Container/Condition/Blog_ID_Condition.php:8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wadi-survey/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/core/Field/Predefined_Options_Field.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wadi-survey/includes/class-wadi-survey-enqueue.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/wadi-survey/includes/vendor/htmlburger/carbon-fields/core/Container/Post_Meta_Container.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: poll, survey, wadi survey, survey plugin for wordpress, poll plugin for wordpress...

wadi-survey/wadi-survey.php 77% from 13 tests

The entry point to "Wadi Survey" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "5.2")
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.0" instead of "7.2")
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected81,553 lines of code in 579 files:
LanguageFilesBlank linesComment linesLines of code
PHP27110,30623,20542,648
JSON60018,876
JavaScript1915,3158,59513,770
Sass56412282,305
PO File268191,0202,202
CSS263251,1551,684
Markdown324068

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity29.24
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces23
Interfaces5
Traits0
Classes172
▷ Abstract classes137.56%
▷ Concrete classes15992.44%
▷ Final classes10.63%
Methods2,079
▷ Static methods27813.37%
▷ Public methods1,56975.47%
▷ Protected methods1808.66%
▷ Private methods33015.87%
Functions210
▷ Named functions12961.43%
▷ Anonymous functions8138.57%
Constants154
▷ Global constants10668.83%
▷ Class constants4831.17%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wadi-survey.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%