67% poll-wp

Code Review | TS Poll - Best Poll Plugin for WordPress

WordPress plugin TS Poll - Best Poll Plugin for WordPress scored67%from 54 tests.

About plugin

  • Plugin page: poll-wp
  • Plugin version: 2.2.1
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 17, 2016
  • Latest release: Oct 16, 2023
  • Number of updates: 260
  • Update frequency: every 9.6 days
  • Top authors: totalsoft (100%)

Code review

54 tests

User reviews

209 reviews

Install metrics

6,000+ active /314,757 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.10MB] [CPU: ▲4.29ms] 75% from 4 tests

Server-side resources used by TS Poll - Best Poll Plugin for WordPress
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 969.25ms on /wp-admin/admin.php?page=ts-poll-add-ons)
PageMemory (MB)CPU Time (ms)
Home /4.59 ▲1.1345.67 ▲0.53
Dashboard /wp-admin4.44 ▲1.1454.41 ▲0.33
Posts /wp-admin/edit.php4.49 ▲1.1358.70 ▲9.51
Add New Post /wp-admin/post-new.php6.97 ▲1.09101.10 ▲6.77
Media Library /wp-admin/upload.php4.29 ▲1.0646.90 ▲12.59
All Polls /wp-admin/admin.php?page=ts-poll4.2747.66
Add Poll /wp-admin/admin.php?page=ts-poll-builder4.9650.33
Add-Ons /wp-admin/admin.php?page=ts-poll-add-ons4.38969.25
Pro Features /wp-admin/admin.php?page=ts-poll-pro4.2737.70

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 128 new files
Database: 2 new tables, 7 new options
New tables
wp_ts_poll_questions
wp_ts_poll_answers
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_ts_poll_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by TS Poll - Best Poll Plugin for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,147 ▲36113.61 ▼0.7410.52 ▲8.3437.72 ▼5.06
Dashboard /wp-admin2,421 ▲2415.77 ▲0.1997.35 ▼5.2179.39 ▲36.00
Posts /wp-admin/edit.php2,176 ▲762.30 ▲0.2938.61 ▲1.5337.09 ▼0.13
Add New Post /wp-admin/post-new.php1,590 ▲6223.35 ▲0.06650.43 ▼62.7536.91 ▼24.79
Media Library /wp-admin/upload.php1,452 ▲524.14 ▼0.03105.89 ▲3.1563.07 ▲20.48
All Polls /wp-admin/admin.php?page=ts-poll1,1951.6633.4151.44
Add Poll /wp-admin/admin.php?page=ts-poll-builder1,8184.5771.7890.05
Add-Ons /wp-admin/admin.php?page=ts-poll-add-ons1,7642.0124.88104.56
Pro Features /wp-admin/admin.php?page=ts-poll-pro1,3831.9923.1065.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_ts_poll_answers
    • wp_ts_poll_questions
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_ts_poll_widget
    • can_compress_scripts

Smoke tests 50% 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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ts-poll
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
The following issues need your attention
  • 64× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/poll-wp/public/css/tsp-content-css.php on line 2
    • > PHP Notice
      Undefined variable: ts_poll_question_params in wp-content/plugins/poll-wp/public/partials/tsp-footer-display.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/poll-wp/public/theme_partials/tsp-image-video.php:351
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/poll-wp/public/js/tsp-content-js.php on line 728
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/poll-wp/public/theme_partials/tsp-standard.php:882
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/poll-wp/public/partials/tsp-header-display.php:59
    • > PHP Notice
      Undefined variable: ts_poll_question_params in wp-content/plugins/poll-wp/public/js/tsp-content-js-edit.php on line 375
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/poll-wp/public/js/tsp-content-js.php on line 732
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/poll-wp/public/js/tsp-content-js-edit.php on line 452
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/poll-wp/public/js/tsp-content-js.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: image poll, wordpress poll, poll plugin, builder poll, video poll...

poll-wp/index.php 85% from 13 tests

The primary PHP file in "TS Poll - Best Poll Plugin for WordPress" version 2.2.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 168 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("poll-wp.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin31,223 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP2917674412,928
CSS141,9791268,906
JavaScript129981,0287,012
PO File48601,1411,884
SVG1200493

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity36.36
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity5.02
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods97
▷ Static methods99.28%
▷ Public methods9193.81%
▷ Protected methods00.00%
▷ Private methods66.19%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
38 PNG files occupy 1.83MB with 1.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/JSON.png51.11KB9.11KB▼ 82.18%
admin/img/PDF.png187.15KB19.18KB▼ 89.75%
admin/img/tsp_standard_poll.png7.35KB6.21KB▼ 15.59%
admin/img/radial.png111.54KB41.01KB▼ 63.23%
admin/img/ts_poll_logo_sm.png2.06KB1.27KB▼ 38.27%