83% modern-polls

Code Review | Modern Polls

WordPress plugin Modern Polls scored83%from 54 tests.

About plugin

  • Plugin page: modern-polls
  • Plugin version: 1.0.10
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7.2
  • WordPress version: 6.3.1
  • First release: Nov 11, 2018
  • Latest release: Jun 13, 2021
  • Number of updates: 35
  • Update frequency: every 27.0 days
  • Top authors: felixtz (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active /5,686 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▲0.01ms] Passed 4 tests

A check of server-side resources used by Modern Polls
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4945.00 ▲3.90
Dashboard /wp-admin3.79 ▲0.4950.37 ▼1.03
Posts /wp-admin/edit.php3.84 ▲0.4959.19 ▲9.21
Add New Post /wp-admin/post-new.php6.31 ▲0.4384.92 ▼12.04
Media Library /wp-admin/upload.php3.65 ▲0.4245.41 ▲10.58
All Polls /wp-admin/admin.php?page=modern-polls3.6436.22
Settings /wp-admin/admin.php?page=modern-polls.settings3.6436.22
Create /wp-admin/admin.php?page=modern-polls.create3.6937.86
Help /wp-admin/admin.php?page=modern-polls.help3.6233.58
Templates /wp-admin/admin.php?page=modern-polls.templates3.6335.23

Server storage [IO: ▲1.43MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 97 new files
Database: 5 new tables, 6 new options
New tables
wp_mp_pollinfos
wp_mp_polls
wp_mp_locklist
wp_mp_settings
wp_mp_templates
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Modern Polls
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,993 ▲23214.56 ▲0.3414.42 ▲12.7043.90 ▲2.67
Dashboard /wp-admin2,252 ▲495.82 ▲0.92105.01 ▼0.6565.78 ▲22.09
Posts /wp-admin/edit.php2,137 ▲342.02 ▲0.0137.14 ▼5.7735.17 ▼2.71
Add New Post /wp-admin/post-new.php1,557 ▲1217.56 ▼5.50706.28 ▲25.7255.91 ▲6.96
Media Library /wp-admin/upload.php1,434 ▲314.13 ▼0.11112.57 ▲12.9652.02 ▲5.60
All Polls /wp-admin/admin.php?page=modern-polls9111.8429.4630.41
Settings /wp-admin/admin.php?page=modern-polls.settings9781.8627.7931.42
Create /wp-admin/admin.php?page=modern-polls.create3,4945.53105.6869.47
Help /wp-admin/admin.php?page=modern-polls.help8151.8624.9423.98
Templates /wp-admin/admin.php?page=modern-polls.templates8691.9226.2134.34

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/modern-polls/resources/views/info.php:16
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/modern-polls/resources/views/settings.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/modern-polls/resources/views/templates.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FelixTzWPModernPolls\\Models\\Model' not found in wp-content/plugins/modern-polls/app/Models/Polls.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/modern-polls/resources/views/edit.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/modern-polls/modern-polls.php:547
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/modern-polls/resources/views/created.php:16
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/modern-polls/resources/views/settings.php on line 15
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/modern-polls/resources/views/settings.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/modern-polls/resources/views/create.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Screenshot #4 (Result Examples) image not found
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

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

The entry point to "Modern Polls" version 1.0.10 is a PHP file that has certain tags in its header comment area
63 characters long description:
Modern AJAX Polls, easy to use with different or your own Theme

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin8,626 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
JSON4003,640
PHP314984542,764
Sass820901,055
JavaScript86549541
HTML8610245
PO File19610209
CSS92853151
SVG12021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity14.41
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods124
▷ Static methods86.45%
▷ Public methods12399.19%
▷ Protected methods00.00%
▷ Private methods10.81%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.64MB with 0.44MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png43.86KB20.47KB▼ 53.34%
resources/assets/images/icon-128x128.png4.61KB1.37KB▼ 70.24%
resources/assets/images/icon-16x16.png2.94KB0.41KB▼ 85.97%
resources/views/templates/default/preview.png44.95KB13.06KB▼ 70.95%
resources/views/templates/basic/preview.png124.95KB51.21KB▼ 59.02%