10% wp-vote

Code Review | WP Vote Lite

WordPress plugin WP Vote Lite scored 10% from 54 tests.

About plugin

  • Plugin page: wp-vote
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9.6
  • WordPress version: 5.8.1
  • First release: Aug 5, 2016
  • Latest release: Jun 28, 2018
  • Number of updates: 19
  • Update frequency: every 45.8 days
  • Top authors: pbearne (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,968 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/wp-vote/wp-vote.php+61
    require_once(admin/class-import-logger.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼0.00MB] [CPU: ▼166.76ms] Passed 4 tests

Server-side resources used by WP Vote Lite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1237.25 ▲16.03
Dashboard /wp-admin3.06 ▲0.0047.30 ▲2.37
Posts /wp-admin/edit.php3.11 ▲0.0045.50 ▲10.04
Add New Post /wp-admin/post-new.php5.42 ▼0.0288.69 ▼680.99
Media Library /wp-admin/upload.php3.00 ▲0.0034.75 ▲1.54

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 376 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Vote Lite
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.88 ▲0.189.72 ▲1.0348.10 ▲1.23
Dashboard /wp-admin2,970 ▲365.95 ▼0.05146.60 ▼19.15105.98 ▼9.32
Posts /wp-admin/edit.php2,736 ▼32.72 ▲0.0061.86 ▼5.1277.62 ▼11.47
Add New Post /wp-admin/post-new.php1,676 ▼2,01118.91 ▲3.77375.51 ▼60.21107.64 ▼7.06
Media Library /wp-admin/upload.php1,807 ▼05.04 ▼0.00139.04 ▼5.76113.30 ▲3.60

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-vote/admin/partials/wp-vote-admin-display.php
    • > /wp-content/plugins/wp-vote/public/partials/wp-vote-public-display.php
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-vote/third-party/cmb/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-vote/third-party/cmb/bootstrap.php:12
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-vote/third-party/cmb/tests/bootstrap.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'WPMU_PLUGIN_DIR/cmb2/init.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-vote/third-party/cmb2-attached-posts/example-field-setup.php on line 9
    • > PHP Warning
      require_once(WPMU_PLUGIN_DIR/cmb2/init.php): failed to open stream: No such file or directory in wp-content/plugins/wp-vote/third-party/cmb2-attached-posts/example-field-setup.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-vote/third-party/cmb/example-functions.php:68
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-vote/third-party/cmb/tests/cmb-tests-base.php:10
    • > PHP Warning
      Use of undefined constant WPMU_PLUGIN_DIR - assumed 'WPMU_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-vote/third-party/cmb2-attached-posts/example-field-setup.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WP_Vote\\plugin_dir_path() in wp-content/plugins/wp-vote/includes/class-settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-vote/third-party/cmb/init.php:119

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-vote === )
You can look at the official readme.txt

wp-vote/wp-vote.php Passed 13 tests

The main file in "WP Vote Lite" v. 1.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
46 characters long description:
Manages voting on your site via email invites.

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
Everything looks great! No dangerous files found in this plugin93,160 lines of code in 218 files:
LanguageFilesBlank linesComment linesLines of code
XML20047,741
PO File11912,73116,32929,151
PHP602,9434,1798,731
CSS71,0861,0854,217
JavaScript73453741,323
Sass11168231,116
Markdown51860511
YAML290152
JSON400147
Bourne Shell119771

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity22.45
▷ Minimum class complexity1.00
▷ Maximum class complexity136.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces2
Interfaces3
Traits0
Classes46
▷ Abstract classes48.70%
▷ Concrete classes4291.30%
▷ Final classes00.00%
Methods573
▷ Static methods22038.39%
▷ Public methods52791.97%
▷ Protected methods132.27%
▷ Private methods335.76%
Functions32
▷ Named functions2990.62%
▷ Anonymous functions39.38%
Constants22
▷ Global constants627.27%
▷ Class constants1672.73%
▷ Public constants16100.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
15 PNG files occupy 0.21MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
third-party/cmb/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
third-party/cmb/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
third-party/cmb/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
third-party/cmb/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
third-party/cmb/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%