73% wp-cool-poll

Code Review | WP Cool Poll

WordPress plugin WP Cool Poll scored 73% from 54 tests.

About plugin

  • Plugin page: wp-cool-poll
  • Plugin version: 1.3
  • PHP compatiblity: 7.1.23+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-5.3.2
  • WordPress version: 5.8.1
  • First release: Apr 9, 2020
  • Latest release: Apr 15, 2020
  • Number of updates: 5
  • Update frequency: every 1.2 days
  • Top authors: martinfiala200 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 231 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼143.48ms] Passed 4 tests

Server-side resources used by WP Cool Poll
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.2429.27 ▲6.49
Dashboard /wp-admin3.19 ▲0.1344.50 ▼4.86
Posts /wp-admin/edit.php3.30 ▲0.1947.73 ▲0.48
Add New Post /wp-admin/post-new.php5.55 ▲0.1195.55 ▼570.09
Media Library /wp-admin/upload.php3.13 ▲0.1338.07 ▲0.56

Server storage [IO: ▲0.09MB] [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: 22 new files
Database: 3 new tables, 1 new option
New tables
wp_cool_poll_votes
wp_cool_poll_q
wp_cool_poll_a
New WordPress options
widget_cool_wid

Browser metrics Passed 4 tests

Checking browser requirements for WP Cool Poll
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,727 ▲15515.81 ▲0.1610.55 ▼0.1055.37 ▲4.69
Dashboard /wp-admin2,995 ▲615.86 ▼0.06153.75 ▼32.26127.37 ▲10.16
Posts /wp-admin/edit.php2,761 ▲252.68 ▲0.0064.91 ▼5.8094.43 ▼5.63
Add New Post /wp-admin/post-new.php1,698 ▲11718.71 ▲4.31369.18 ▼14.91120.14 ▲4.52
Media Library /wp-admin/upload.php1,832 ▲225.04 ▲0.03156.20 ▼6.21131.25 ▼2.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • wp_cool_poll_votes
    • wp_cool_poll_q
    • wp_cool_poll_a
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_cool_wid

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/wp-cool-poll/poll_edit.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-cool-poll/poll_add.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-cool-poll/cool-poll.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/wp-cool-poll/poll_search.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-cool-poll/poll_edit.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Example of poll in a widget) image required
You can take inspiration from this readme.txt

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

The main PHP file in "WP Cool Poll" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
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
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-cool-poll.php" instead of "cool-poll.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,069 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP521545880
PO File26770172
JavaScript12017

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity17.25
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods27
▷ Static methods725.93%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
imgs/progress-grey.png0.66KB0.46KB▼ 30.96%
imgs/progress-violet.png1.01KB0.93KB▼ 8.66%
imgs/progress-yellow.png0.83KB0.57KB▼ 31.02%
imgs/progress-green.png1.03KB0.74KB▼ 28.05%
imgs/progress-orange.png1.09KB1.43KB0.00%