77% poll-maker

Code Review | Poll Maker - Best WordPress Poll Plugin

WordPress plugin Poll Maker - Best WordPress Poll Plugin scored77%from 54 tests.

About plugin

  • Plugin page: poll-maker
  • Plugin version: 4.9.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 15, 2018
  • Latest release: Nov 28, 2023
  • Number of updates: 853
  • Update frequency: every 2.2 days
  • Top authors: ays-pro (100%)

Code review

54 tests

User reviews

63 reviews

Install metrics

5,000+ active /311,065 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▼8.07ms] Passed 4 tests

A check of server-side resources used by Poll Maker - Best WordPress Poll Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2938.03 ▼6.86
Dashboard /wp-admin3.68 ▲0.3347.41 ▼14.56
Posts /wp-admin/edit.php3.71 ▲0.3550.99 ▲4.19
Add New Post /wp-admin/post-new.php6.34 ▲0.4579.38 ▼14.99
Media Library /wp-admin/upload.php3.57 ▲0.3440.16 ▲4.12

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 206 new files
Database: 5 new tables, 10 new options
New tables
wp_ayspoll_categories
wp_ayspoll_reports
wp_ayspoll_polls
wp_ayspoll_answers
wp_ayspoll_settings
New WordPress options
ays_poll_maker_poll_creation_challange
widget_recent-posts
widget_poll_maker_ays
ays_poll_maker_first_time_activation
widget_theysaidso_widget
ays_poll_db_version
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Poll Maker - Best WordPress Poll Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,555 ▼1,19210.14 ▼4.111.64 ▼0.1924.66 ▼16.66
Dashboard /wp-admin2,261 ▲835.65 ▼0.0798.88 ▼9.7890.88 ▲46.73
Posts /wp-admin/edit.php2,184 ▲842.04 ▲0.0839.27 ▲0.9737.25 ▼0.43
Add New Post /wp-admin/post-new.php6,448 ▲4,92228.12 ▲5.01877.48 ▲243.9234.72 ▼16.36
Media Library /wp-admin/upload.php1,478 ▲784.22 ▲0.0396.33 ▼2.3776.00 ▲33.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_poll_maker_ays
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/poll-maker/public/partials/poll-maker-ays-public-display.php
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/poll-maker/admin/partials/categories/actions/poll-maker-ays-categories-actions.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/poll-maker/admin/partials/features/poll-maker-how-to-use-display.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/poll-maker/admin/partials/features/poll-maker-featured-display.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_redirect() in wp-content/plugins/poll-maker/admin/partials/results/poll-maker-ays-each-results-display.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/poll-maker/admin/partials/features/poll-maker-formfields_page-display.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/poll-maker/includes/lists/class-poll-maker-each-results-poll-list-table.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Poll_Maker_Ays_Admin' not found in wp-content/plugins/poll-maker/admin/partials/poll-maker-ays-admin-display.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/poll-maker/widgets/poll-maker-ays-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/poll-maker/admin/partials/poll-maker-ays-polls-actions.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/poll-maker/includes/lists/class-poll-maker-results-list-table.php:4

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed: The official readme.txt is a good inspiration

poll-maker/poll-maker-ays.php 85% from 13 tests

This is the main PHP file of "Poll Maker - Best WordPress Poll Plugin" version 4.9.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("poll-maker.php" instead of "poll-maker-ays.php")

Code Analysis 95% from 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
Everything looks great! No dangerous files found in this plugin53,097 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
PO File77,50210,73720,528
PHP342,0861,66919,748
JavaScript197926427,052
CSS151,3911,6525,669
SVG2364100

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,036)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 606)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity120.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1,036.00
Average method complexity7.98
▷ Minimum method complexity1.00
▷ Maximum method complexity606.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods307
▷ Static methods5116.61%
▷ Public methods29295.11%
▷ Protected methods61.95%
▷ Private methods92.93%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants888.89%
▷ Class constants111.11%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
68 PNG files occupy 1.54MB with 0.71MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/icons/icon-sccp-128x128.png1.18KB1.18KB0.00%
admin/images/themes/ClassicLight.png9.08KB3.63KB▼ 60.04%
admin/images/avatars/business_avatar.png19.09KB7.27KB▼ 61.93%
admin/images/themes/LightShape.png8.08KB3.66KB▼ 54.74%
admin/images/themes/ClassicDark.png8.36KB3.79KB▼ 54.60%