56% surveyfunnel-lite

Code Review | SurveyFunnel - Survey Plugin for WordPress

WordPress plugin SurveyFunnel - Survey Plugin for WordPress scored56%from 54 tests.

About plugin

  • Plugin page: surveyfunnel-lite
  • Plugin version: 1.1.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 3, 2021
  • Latest release: Nov 9, 2022
  • Number of updates: 15
  • Update frequency: every 28.8 days
  • Top authors: WPEka Club (86.67%)smritichaturvedi (20%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,902 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.36MB] [CPU: ▼1.54ms] Passed 4 tests

Server-side resources used by SurveyFunnel - Survey Plugin for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3952.69 ▲12.46
Dashboard /wp-admin3.69 ▲0.3449.82 ▼7.98
Posts /wp-admin/edit.php3.75 ▲0.3851.97 ▲2.33
Add New Post /wp-admin/post-new.php6.30 ▲0.4187.23 ▼5.78
Media Library /wp-admin/upload.php3.55 ▲0.3239.60 ▲5.28
Dashboard /wp-admin/admin.php?page=surveyfunnel-lite-dashboard3.6036.96
Help /wp-admin/admin.php?page=surveyfunnel-lite-help3.5234.77
/wp-admin/index.php?page=surveyfunnel-lite3.4730.72

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 205 new files
Database: 1 new table, 7 new options
New tables
wp_srf_entries
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
srf-lite-background-update

Browser metrics Passed 4 tests

An overview of browser requirements for SurveyFunnel - Survey Plugin for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲12613.84 ▼0.529.03 ▲7.2643.22 ▼2.72
Dashboard /wp-admin2,219 ▲455.54 ▲0.0382.88 ▼6.9383.58 ▲40.65
Posts /wp-admin/edit.php2,139 ▲392.01 ▲0.0235.37 ▼0.3732.88 ▼4.02
Add New Post /wp-admin/post-new.php6,230 ▲4,70419.36 ▼3.70892.51 ▲233.8843.41 ▼3.90
Media Library /wp-admin/upload.php1,442 ▲394.20 ▲0.0699.30 ▲3.6882.80 ▲39.58
Dashboard /wp-admin/admin.php?page=surveyfunnel-lite-dashboard1,0781.9931.2151.88
Help /wp-admin/admin.php?page=surveyfunnel-lite-help8861.9430.5535.38
/wp-admin/index.php?page=surveyfunnel-lite1842.8577.0010.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_srf_entries
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • srf-lite-background-update
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 0% 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)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=surveyfunnel-lite
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/surveyfunnel-lite/admin/class-surveyfunnel-lite-admin.php+580
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/index.php?page=surveyfunnel-lite
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/surveyfunnel-lite/admin/class-surveyfunnel-lite-admin.php+469
    Trying to get property 'post_status' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/surveyfunnel-lite/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php
    • > /wp-content/plugins/surveyfunnel-lite/public/partials/wp-survey-funnel-public-display.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/surveyfunnel-lite/admin/views/admin-display-dashboard-page.php:18
    • > PHP Warning
      require_once(wp-content/plugins/surveyfunnel-lite/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in wp-content/plugins/surveyfunnel-lite/vendor/autoload.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/surveyfunnel-lite/vendor/composer/autoload_real.php' (include_path='.:/usr/share/php') in wp-content/plugins/surveyfunnel-lite/vendor/autoload.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=surveyfunnel-lite-help
    • > Network (severe)
    wp-content/plugins/surveyfunnel-lite/images/SF-logo.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/index.php?page=surveyfunnel-lite
    • > Console-api (severe) in unknown
    /wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003 157:82260 TypeError: Cannot read properties of null (reading 'answersHighlightBoxColor')at /wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:191:16072at Il (/wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:158:104085)at t.unstable_runWithPriority (/wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:191:3768)at $a (/wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:158:44735)at Hl (/wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:158:103548)at vl (/wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:158:95076)at /wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:158:44958at t.unstable_runWithPriority (/wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:191:3768)at $a (/wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:158:44735)at qa (/wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003:158:44903)
    • > GET request to /wp-admin/index.php?page=surveyfunnel-lite
    • > Javascript (severe) in unknown
    /wp-content/plugins/surveyfunnel-lite/dist/index.bundle.js?ver=1698007003 190:12188 Uncaught TypeError: Cannot read properties of null (reading 'metaInfo')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 25 tag instead of maximum 10
The official readme.txt might help

surveyfunnel-lite/surveyfunnel-lite.php 92% from 13 tests

"SurveyFunnel - Survey Plugin for WordPress" version 1.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin18,635 lines of code in 114 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript705622006,261
JSON4005,562
Sass723643,096
PHP174341,6962,493
CSS912115861
Markdown51420327
XML10020
YAML11015

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity33.50
▷ Minimum class complexity1.00
▷ Maximum class complexity139.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods112
▷ Static methods2522.32%
▷ Public methods10492.86%
▷ Protected methods21.79%
▷ Private methods65.36%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants218.18%
▷ Class constants981.82%
▷ Public constants9100.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
73 PNG files occupy 0.15MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/Components/Reports/ReportImages/nodata.png11.03KB4.82KB▼ 56.27%
src/Components/Build/BuildImages/Organisation.png0.29KB0.30KB0.00%
admin/admin-images/dashboard-images/build.png1.19KB0.57KB▼ 52.14%
admin/admin-images/dashboard-images/Share.png1.11KB0.35KB▼ 68.08%
src/Components/Build/BuildImages/tablet.png0.83KB0.83KB0.00%