67% yop-poll

Code Review | YOP Poll

WordPress plugin YOP Poll scored 67% from 54 tests.

About plugin

  • Plugin page: yop-poll
  • Plugin version: 6.5.29
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.3
  • WordPress version: 6.3.1
  • First release: Nov 14, 2012
  • Latest release: Oct 2, 2023
  • Number of updates: 301
  • Update frequency: every 13.2 days
  • Top authors: yourownprogrammer (100%)

Code review

54 tests

User reviews

444 reviews

Install metrics

20,000+ active / 1,080,770 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼0.44ms] Passed 4 tests

This is a short check of server-side resources used by YOP Poll
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0751.70 ▲11.85
Dashboard /wp-admin3.52 ▲0.2246.61 ▼4.97
Posts /wp-admin/edit.php3.57 ▲0.2252.04 ▲2.06
Add New Post /wp-admin/post-new.php6.04 ▲0.1594.67 ▼5.62
Media Library /wp-admin/upload.php3.38 ▲0.1542.45 ▲6.77
Upgrade to Pro /wp-admin/admin.php?page=yop-poll-upgrade-to-pro3.4436.26
All Polls /wp-admin/admin.php?page=yop-polls3.4334.93
Logs /wp-admin/admin.php?page=yop-poll-logs3.4135.77
Settings /wp-admin/admin.php?page=yop-poll-settings3.7433.45
Add New /wp-admin/admin.php?page=yop-poll-add-poll4.5262.40
Bans /wp-admin/admin.php?page=yop-poll-bans3.4133.78

Server storage [IO: ▲5.25MB] [DB: ▲0.24MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 357 new files
Database: 9 new tables, 9 new options
New tables
wp_yoppoll_bans
wp_yoppoll_other_answers
wp_yoppoll_elements
wp_yoppoll_subelements
wp_yoppoll_templates
wp_yoppoll_logs
wp_yoppoll_votes
wp_yoppoll_skins
wp_yoppoll_polls
New WordPress options
yop_poll_settings
theysaidso_admin_options
db_upgraded
yop_poll_version
can_compress_scripts
widget_yop_poll_widget
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for YOP Poll
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲17814.00 ▼0.2910.86 ▲9.2837.89 ▲0.86
Dashboard /wp-admin2,244 ▲535.86 ▼0.04110.52 ▼2.5473.48 ▲34.70
Posts /wp-admin/edit.php2,130 ▲412.04 ▲0.0340.31 ▲1.5036.53 ▼1.26
Add New Post /wp-admin/post-new.php1,708 ▲16624.46 ▲6.34697.31 ▲67.0164.98 ▲10.51
Media Library /wp-admin/upload.php1,426 ▲384.21 ▼0.1296.13 ▼3.8274.21 ▲28.37
Upgrade to Pro /wp-admin/admin.php?page=yop-poll-upgrade-to-pro1,4333.0244.9073.98
All Polls /wp-admin/admin.php?page=yop-polls1,3863.1050.0957.59
Logs /wp-admin/admin.php?page=yop-poll-logs1,1353.0538.4229.10
Settings /wp-admin/admin.php?page=yop-poll-settings2,0013.1142.4228.84
Add New /wp-admin/admin.php?page=yop-poll-add-poll14,8895.19263.3940.51
Bans /wp-admin/admin.php?page=yop-poll-bans1,1033.0743.0631.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall successfully, leaving 9 tables in the database
    • wp_yoppoll_templates
    • wp_yoppoll_bans
    • wp_yoppoll_elements
    • wp_yoppoll_other_answers
    • wp_yoppoll_votes
    • wp_yoppoll_logs
    • wp_yoppoll_skins
    • wp_yoppoll_subelements
    • wp_yoppoll_polls
  • This plugin does not fully uninstall, leaving 9 options in the database
    • db_upgraded
    • yop_poll_settings
    • can_compress_scripts
    • widget_recent-posts
    • yop_poll_version
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_yop_poll_widget

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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/yop-poll/admin/views/general/upgrade-short-1.php
    • > /wp-content/plugins/yop-poll/admin/views/general/upgrade-short-2.php
    • > /wp-content/plugins/yop-poll/app.php
    • > /wp-content/plugins/yop-poll/admin/views/polls/add/design-templates.php
    • > /wp-content/plugins/yop-poll/admin/views/support/view.php
  • 59× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/yop-poll/admin/views/polls/add/options-poll.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/yop-poll/admin/views/general/upgrade-long.php:63
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/yop-poll/admin/inc/ClassYOPPollWidget.php:2
    • > PHP Notice
      Trying to get property 'added_date' of non-object in wp-content/plugins/yop-poll/admin/views/polls/edit/main.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/yop-poll/admin/views/bans/view.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/yop-poll/admin/views/polls/edit/design-custom-styles.php:13
    • > PHP Warning
      include(YOP_POLL_PATHadmin/views/polls/elements-definitions.php): failed to open stream: No such file or directory in wp-content/plugins/yop-poll/admin/views/polls/add/elements.php on line 2
    • > PHP Warning
      include(YOP_POLL_PATHadmin/views/polls/elements-definitions.php): failed to open stream: No such file or directory in wp-content/plugins/yop-poll/admin/views/polls/edit/elements.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/yop-poll/admin/views/polls/add/options-results.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/yop-poll/admin/views/general/guide-2.php:15

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, but this is not an exhaustive test

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
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

yop-poll/yop_poll.php 85% from 13 tests

The principal PHP file in "YOP Poll" v. 6.5.29 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("yop-poll.php" instead of "yop_poll.php")
  • Description: The description should be shorter than 140 characters (currently 145 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin33,641 lines of code in 79 files:
LanguageFilesBlank linesComment linesLines of code
PHP7027078433,103
SVG302310
JSON200224
CSS20222
JavaScript2002

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 304)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity95.82
▷ Minimum class complexity2.00
▷ Maximum class complexity560.00
Average method complexity5.94
▷ Minimum method complexity1.00
▷ Maximum method complexity304.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods518
▷ Static methods21842.08%
▷ Public methods47090.73%
▷ Protected methods224.25%
▷ Private methods265.02%
Functions46
▷ Named functions24.35%
▷ Anonymous functions4495.65%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
220 PNG files occupy 1.96MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/skins/minimal/purple.png1.11KB1.45KB0.00%
admin/assets/images/skins/square/green@2x.png4.39KB3.10KB▼ 29.48%
public/assets/captcha/images/eye.png1.28KB1.02KB▼ 20.53%
public/assets/captcha/images/car@2x.png2.31KB1.75KB▼ 24.26%
public/assets/captcha/images/lock@2x.png2.55KB1.97KB▼ 22.93%