62% wp-easy-poll-afo

Code Review | WP Easy Poll

WordPress plugin WP Easy Poll scored62%from 54 tests.

About plugin

  • Plugin page: wp-easy-poll-afo
  • Plugin version: 2.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-5.9.3
  • WordPress version: 6.3.1
  • First release: Feb 14, 2015
  • Latest release: May 14, 2022
  • Number of updates: 56
  • Update frequency: every 47.3 days
  • Top authors: avi.megladon (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /12,433 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼4.30ms] Passed 4 tests

An overview of server-side resources used by WP Easy Poll
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2444.60 ▲6.86
Dashboard /wp-admin3.60 ▲0.2544.93 ▼11.81
Posts /wp-admin/edit.php3.65 ▲0.2948.91 ▲0.76
Add New Post /wp-admin/post-new.php6.14 ▲0.2587.07 ▼9.14
Media Library /wp-admin/upload.php3.46 ▲0.2336.94 ▲2.99
Poll Settings /wp-admin/admin.php?page=easy_poll_afo3.4435.63
Polls /wp-admin/admin.php?page=easy_polls3.4133.44

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 50 new files
Database: 3 new tables, 7 new options
New tables
wp_easy_poll_a
wp_easy_poll_q
wp_easy_poll_votes
New WordPress options
theysaidso_admin_options
widget_poll_wid
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

WP Easy Poll: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,978 ▲20713.99 ▼0.028.45 ▲6.5741.49 ▲0.26
Dashboard /wp-admin2,249 ▲615.11 ▼0.77111.59 ▲5.9439.16 ▼2.94
Posts /wp-admin/edit.php2,121 ▲322.36 ▲0.3848.57 ▲10.1036.21 ▲4.66
Add New Post /wp-admin/post-new.php1,553 ▲3423.35 ▼0.08674.25 ▲16.6440.37 ▼20.19
Media Library /wp-admin/upload.php1,437 ▲494.34 ▲0.16101.33 ▲4.0246.86 ▲2.15
Poll Settings /wp-admin/admin.php?page=easy_poll_afo1,1251.9938.9332.61
Polls /wp-admin/admin.php?page=easy_polls9091.9227.3025.41

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_easy_poll_votes
    • wp_easy_poll_q
    • wp_easy_poll_a
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_poll_wid
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=easy_polls
    • > Warning in wp-content/plugins/wp-easy-poll-afo/functions.php+6
    session_start(): Cannot start session when headers already sent
    • > GET request to /wp-admin/admin.php?page=easy_polls
    • > Notice in wp-content/plugins/wp-easy-poll-afo/includes/class-poll.php+290
    Undefined index: paged
    • > GET request to /wp-admin/admin.php?page=easy_polls
    • > Notice in wp-content/plugins/wp-easy-poll-afo/view/admin/poll-search.php+6
    Undefined index: p_ques

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-easy-poll-afo/view/admin/pro-add.php
  • 14× 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 wp_nonce_field() in wp-content/plugins/wp-easy-poll-afo/view/admin/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-easy-poll-afo/view/admin/donate.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-easy-poll-afo/view/admin/shortcodes.php:4
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wp-easy-poll-afo/wp-easy-poll.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/wp-easy-poll-afo/wp-easy-poll.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-easy-poll-afo/view/admin/help.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-easy-poll-afo/view/admin/poll-edit.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-easy-poll-afo/view/admin/poll-report.php:1
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/wp-easy-poll-afo/wp-easy-poll.php on line 25
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-easy-poll-afo/wp-easy-poll.php on line 25

User-side errors Passed 1 test

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

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
10 plugin tags: user poll, poll, wp poll, user vote, vote...

wp-easy-poll-afo/wp-easy-poll.php 85% from 13 tests

The entry point to "WP Easy Poll" version 2.2.9 is a PHP file that has certain tags in its header comment area
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 ("wp-easy-poll-afo.php" instead of "wp-easy-poll.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 162 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin3,970 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript42072871,821
PHP22192321,506
CSS36950579
PO File131064

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods80
▷ Static methods45.00%
▷ Public methods80100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
17 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
images/edit.png0.54KB0.60KB0.00%
assets/css/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
assets/css/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%
images/delete.png0.56KB0.53KB▼ 6.09%