10% pro-polls

Code Review | Pro Polls

WordPress plugin Pro Polls scored10%from 54 tests.

About plugin

  • Plugin page: pro-polls
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.8
  • WordPress version: 6.3.1
  • First release: Nov 9, 2017
  • Latest release: Nov 9, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: amitjoshi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /764 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/pro-polls/pro-polls.php+63
    Undefined variable: deps

Server metrics [RAM: ▼1.79MB] [CPU: ▼47.78ms] Passed 4 tests

A check of server-side resources used by Pro Polls
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.276.57 ▼35.67
Dashboard /wp-admin2.21 ▼1.0911.02 ▼37.99
Posts /wp-admin/edit.php2.21 ▼1.148.37 ▼36.97
Add New Post /wp-admin/post-new.php2.21 ▼3.677.43 ▼80.48
Media Library /wp-admin/upload.php2.21 ▼1.026.58 ▼27.46
/wp-admin/edit.php?post_type=pro-poll&page=pro-polls-results2.217.15
Add New Poll /wp-admin/post-new.php?post_type=pro-poll2.216.66
/wp-admin/edit.php?post_type=pro-poll&page=pro-polls-questions2.217.96
All Polls /wp-admin/edit.php?post_type=pro-poll2.218.05

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 13 new files
Database: 1 new table, 7 new options
New tables
wp_pro_polls_results
New WordPress options
widget_recent-posts
can_compress_scripts
pro_polls_db_version
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pro Polls
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10114.44 ▲0.241.77 ▲0.0244.04 ▼4.64
Dashboard /wp-admin2,242 ▲514.85 ▼1.0397.05 ▼19.5238.50 ▼4.76
Posts /wp-admin/edit.php2,125 ▲362.01 ▲0.0240.46 ▲1.8636.00 ▲2.30
Add New Post /wp-admin/post-new.php1,569 ▲4918.20 ▼5.22582.49 ▼93.7966.49 ▲14.61
Media Library /wp-admin/upload.php1,415 ▲274.22 ▲0.0199.58 ▼6.7343.23 ▲2.13
/wp-admin/edit.php?post_type=pro-poll&page=pro-polls-results6911.356.7117.79
Add New Poll /wp-admin/post-new.php?post_type=pro-poll1,4582.5050.2348.37
/wp-admin/edit.php?post_type=pro-poll&page=pro-polls-questions6911.146.7013.40
All Polls /wp-admin/edit.php?post_type=pro-poll1,1101.9333.1828.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/pro-polls/pro-polls.php+63
    Undefined variable: deps
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_pro_polls_results
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • pro_polls_db_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pro-poll
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/pro-polls/pro-polls.php+63
    Undefined variable: deps
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pro-poll
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/pro-polls/pro-polls.php+63
    Undefined variable: ver
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pro-poll
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/pro-polls/pro-polls.php+63
    Undefined variable: media
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pro-poll
    • > POST request to /wp-admin/admin-ajax.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the pro_polls_styles handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pro-poll&page=pro-polls-questions
    • > Notice in wp-content/plugins/pro-polls/pro-polls-admin-html.php+21
    Undefined index: poll_id

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/pro-polls/classes/classes_list_questions.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/pro-polls/classes/classes_results.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/pro-polls/pro-polls.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Polls Listing), #2 (Adding questions to polls), #3 (Polls on the front end)
The official readme.txt might help

pro-polls/pro-polls.php Passed 13 tests

The main file in "Pro Polls" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
21 characters long description:
Multi Question Polls.

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin935 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7197172896
CSS11039

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity12.00
▷ Minimum class complexity4.00
▷ Maximum class complexity18.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.27MB with 0.15MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png40.13KB19.28KB▼ 51.96%
screenshot-1.png33.99KB17.59KB▼ 48.25%
screenshot-2.png39.09KB18.98KB▼ 51.45%
screenshot-4.png161.43KB44.21KB▼ 72.61%