10% wp-easy-poll

Code Review | WP EASY POLL

WordPress plugin WP EASY POLL scored10%from 54 tests.

About plugin

  • Plugin page: wp-easy-poll
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 10, 2014
  • Latest release: Oct 19, 2014
  • Number of updates: 26
  • Update frequency: every 0.4 days
  • Top authors: peacehunter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,904 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/wp-easy-poll/widget_poll.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; poll_widget has a deprecated constructor

Server metrics [RAM: ▼1.88MB] [CPU: ▼62.19ms] Passed 4 tests

This is a short check of server-side resources used by WP EASY POLL
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.354.82 ▼37.21
Dashboard /wp-admin2.13 ▼1.186.51 ▼54.81
Posts /wp-admin/edit.php2.13 ▼1.236.20 ▼53.64
Add New Post /wp-admin/post-new.php2.13 ▼3.766.11 ▼103.10
Media Library /wp-admin/upload.php2.13 ▼1.105.60 ▼27.26
Poll details /wp-admin/admin.php?page=wp-easy-poll/poll_admin.php/show_poll2.136.09
Add poll /wp-admin/admin.php?page=wp-easy-poll2.136.71
Publish poll /wp-admin/admin.php?page=wp-easy-poll/poll_admin.php/includes2.135.42

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 28 new files
Database: 3 new tables, 7 new options
New tables
wp_poll_answer_result
wp_poll_question
wp_poll_answer
New WordPress options
theysaidso_admin_options
widget_poll_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WP EASY POLL
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.35 ▼0.362.06 ▲0.3741.29 ▼1.67
Dashboard /wp-admin2,226 ▲495.61 ▼0.0891.98 ▲1.1641.67 ▲6.26
Posts /wp-admin/edit.php2,134 ▲341.98 ▼0.1340.38 ▲1.6435.06 ▼0.18
Add New Post /wp-admin/post-new.php1,561 ▲3523.06 ▲0.01669.02 ▼50.4057.87 ▼0.64
Media Library /wp-admin/upload.php1,428 ▲314.20 ▼0.1599.54 ▼10.0641.64 ▼5.45
Poll details /wp-admin/admin.php?page=wp-easy-poll/poll_admin.php/show_poll8292.0324.5326.53
Add poll /wp-admin/admin.php?page=wp-easy-poll9112.0025.8125.01
Publish poll /wp-admin/admin.php?page=wp-easy-poll/poll_admin.php/includes7972.0324.4526.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-easy-poll/widget_poll.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; poll_widget has a deprecated constructor
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_poll_answer_result
    • wp_poll_question
    • wp_poll_answer
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_poll_widget
    • db_upgraded

Smoke tests 25% 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/admin.php?page=wp-easy-poll/poll_admin.php/includes
    • > Deprecated in wp-content/plugins/wp-easy-poll/widget_poll.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; poll_widget has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-easy-poll/poll_admin.php/includes
    • > Deprecated in wp-content/plugins/wp-easy-poll/widget_poll.php+240
    Function create_function() is deprecated
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-easy-poll/poll_admin.php/includes
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in poll_widget is deprecated since version 4.3.0! Use __construct() instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-easy-poll/poll_admin.php/includes
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.

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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-easy-poll/display_widget_form.php
    • > /wp-content/plugins/wp-easy-poll/display_page_form.php
    • > /wp-content/plugins/wp-easy-poll/wp_menu.php
  • 28× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-easy-poll/show_poll/backend_show_poll_result.php on line 4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-easy-poll/includes/show_poll.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-easy-poll/includes/show_poll.php:7
    • > PHP Notice
      Undefined variable: question in wp-content/plugins/wp-easy-poll/display_widget_form.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-easy-poll/frontend_poll_process.php:2
    • > PHP Notice
      Undefined variable: random_number in wp-content/plugins/wp-easy-poll/display_widget_form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_sql() in wp-content/plugins/wp-easy-poll/includes/del_poll.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-easy-poll/show_poll/backend_show_poll_result.php:8
    • > PHP Notice
      Undefined variable: ques in wp-content/plugins/wp-easy-poll/display_page_form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-easy-poll/tiny_mce_button.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
You can take inspiration from this readme.txt

wp-easy-poll/poll_admin.php 92% from 13 tests

The principal PHP file in "WP EASY POLL" v. 1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-easy-poll.php" instead of "poll_admin.php")

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
Everything looks great! No dangerous files found in this plugin1,724 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP17827801,608
CSS126679
JavaScript28437

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity50.00
▷ Minimum class complexity50.00
▷ Maximum class complexity50.00
Average method complexity13.25
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.09MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tick.png5.83KB1.82KB▼ 68.78%
voting_poll.png39.29KB16.12KB▼ 58.98%
includes/voting_poll.png39.29KB16.12KB▼ 58.98%
bar2.png2.77KB0.10KB▼ 96.36%
bar.png2.79KB0.13KB▼ 95.39%