61% wp-voting-contest

Code Review | WP Voting Contest Lite

WordPress plugin WP Voting Contest Lite scored61%from 54 tests.

About plugin

  • Plugin page: wp-voting-contest
  • Plugin version: 5.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 14, 2018
  • Latest release: Nov 17, 2023
  • Number of updates: 65
  • Update frequency: every 30.5 days
  • Top authors: mvincik (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

600+ active /23,253 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.31MB] [CPU: ▼2.14ms] Passed 4 tests

Server-side resources used by WP Voting Contest Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.52 ▲1.0651.61 ▲13.24
Dashboard /wp-admin4.32 ▲1.0159.83 ▲11.41
Posts /wp-admin/edit.php4.35 ▲0.9961.43 ▲14.24
Add New Post /wp-admin/post-new.php4.12 ▼1.7747.48 ▼47.45
Media Library /wp-admin/upload.php4.24 ▲1.0151.42 ▲16.18
Voting Logs /wp-admin/admin.php?page=wpvc_votinglogs4.1646.46
Settings /wp-admin/admin.php?page=wpvc_settings4.1646.08
/wp-admin/index.php?page=votes-setup4.0439.24
Overview /wp-admin/admin.php?page=contestants4.1645.52
Upgrade to PRO /wp-admin/admin.php?page=wpvc_upgrade4.1646.17
Custom Fields /wp-admin/admin.php?page=wpvc_custom_fields4.1645.59
Contestants /wp-admin/edit.php?post_type=contestants4.2753.43
Migrate Voting /wp-admin/admin.php?page=wpvc_migration4.1643.43
Contest Category /wp-admin/admin.php?page=wpvc_category4.1644.52
Add Contestant /wp-admin/post-new.php?post_type=contestants4.4764.20

Server storage [IO: ▲7.08MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 63 new files
Database: 4 new tables, 7 new options
New tables
wp_votes_custom_registeration_contestant
wp_votes_post_contestant_track
wp_votes_custom_field_contestant
wp_votes_tbl
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
wpvc_votes_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Voting Contest Lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,063 ▲30123.01 ▲8.7545.41 ▲43.7142.34 ▼1.82
Dashboard /wp-admin2,272 ▲9810.09 ▲4.52147.81 ▲44.8156.10 ▲10.41
Posts /wp-admin/edit.php2,189 ▲897.69 ▲5.7377.52 ▲38.4549.55 ▲10.84
Add New Post /wp-admin/post-new.php1,586 ▲6026.18 ▲3.03794.37 ▲60.4056.78 ▲5.52
Media Library /wp-admin/upload.php1,483 ▲868.71 ▲4.53143.90 ▲43.0150.96 ▲6.41
Voting Logs /wp-admin/admin.php?page=wpvc_votinglogs9228.45129.3462.33
Settings /wp-admin/admin.php?page=wpvc_settings1,0177.95111.8550.05
/wp-admin/index.php?page=votes-setup280.410.084.11
Overview /wp-admin/admin.php?page=contestants1,3149.39138.5552.28
Upgrade to PRO /wp-admin/admin.php?page=wpvc_upgrade1,0458.59145.9651.60
Custom Fields /wp-admin/admin.php?page=wpvc_custom_fields1,2198.24109.6755.62
Contestants /wp-admin/edit.php?post_type=contestants1,2817.95108.5053.32
Migrate Voting /wp-admin/admin.php?page=wpvc_migration9898.17123.5944.66
Contest Category /wp-admin/admin.php?page=wpvc_category9929.69140.7941.48
Add Contestant /wp-admin/post-new.php?post_type=contestants2,35110.92266.8185.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_votes_custom_field_contestant
    • wp_votes_custom_registeration_contestant
    • wp_votes_post_contestant_track
    • wp_votes_tbl
  • The uninstall procedure has failed, leaving 7 options in the database
    • wpvc_votes_settings
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-voting-contest/wpvc_email/emailbutton.php
    • > /wp-content/plugins/wp-voting-contest/wpvc_email/email.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WPVC_VOTES_ABSPATH - assumed 'WPVC_VOTES_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-voting-contest/configuration/config.php on line 6
    • > PHP Warning
      Use of undefined constant WPVC_VOTES_ABSPATH - assumed 'WPVC_VOTES_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-voting-contest/configuration/config.php on line 7
    • > PHP Warning
      Use of undefined constant WPVC_VOTES_SL_PLUGIN_URL - assumed 'WPVC_VOTES_SL_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-voting-contest/configuration/config.php on line 13
    • > PHP Warning
      Use of undefined constant WPVC_VOTES_SL_PLUGIN_URL - assumed 'WPVC_VOTES_SL_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-voting-contest/configuration/config.php on line 11
    • > PHP Warning
      Use of undefined constant WPVC_VOTES_ABSPATH - assumed 'WPVC_VOTES_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-voting-contest/configuration/config.php on line 8
    • > PHP Warning
      Use of undefined constant WPVC_VOTES_SL_PLUGIN_URL - assumed 'WPVC_VOTES_SL_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-voting-contest/configuration/config.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-voting-contest/configuration/helper.php:12
    • > PHP Warning
      Use of undefined constant WPVC_VOTES_ABSPATH - assumed 'WPVC_VOTES_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-voting-contest/configuration/config.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-voting-contest/wpvc_views/frontend/wpvc_contestants_single_view.php:2
    • > PHP Warning
      Use of undefined constant WPVC_VOTES_ABSPATH - assumed 'WPVC_VOTES_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-voting-contest/configuration/config.php on line 10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/index.php?page=votes-setup
    • > Network (severe)
    wp-admin/index.php?page=votes-setup - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=wpvc_upgrade
    • > Network (severe)
    index.php/wp-content/plugins/wp-voting-contest/assets/images/photo_contest_01.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=contestants
    • > Console-api (severe) in unknown
    /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0 9:53544 TypeError: Cannot read properties of null (reading 'value')at l.componentDidMount (/wp-content/plugins/wp-voting-contest/wpvc_views/build/admin.js?ver=5.3:1:266616)at Jr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80714)at Zr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80489)at Gr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80023)at /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:91526at xl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:92039)at fl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:85808)at Nn (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:32474)at pl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:86103)at /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:99392
    • > GET request to /wp-admin/post-new.php?post_type=contestants
    • > Javascript (severe) in unknown
    /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0 9:32518 Uncaught TypeError: Cannot read properties of null (reading 'value')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Grid View of the Image Contest with vote button, vote count and Social media links.), #2 (List View of the Image Contest with vote button, vote count and Social media links.), #3 (Single Contestant View of the Image Contest with vote button, vote count and Social media links.)
You can look at the official readme.txt

wp-voting-contest/ow_votes.php 85% from 13 tests

"WP Voting Contest Lite" version 5.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 208 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-voting-contest.php" instead of "ow_votes.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected9,948 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP338051,5157,559
CSS471231,039
JSON100802
SVG100520
JavaScript57228

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity29.70
▷ Minimum class complexity1.00
▷ Maximum class complexity158.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes33
▷ Abstract classes412.12%
▷ Concrete classes2987.88%
▷ Final classes00.00%
Methods303
▷ Static methods11036.30%
▷ Public methods26988.78%
▷ Protected methods00.00%
▷ Private methods3411.22%
Functions29
▷ Named functions2793.10%
▷ Anonymous functions26.90%
Constants65
▷ Global constants5787.69%
▷ Class constants812.31%
▷ Public constants8100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 1.90MB with 0.70MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/google_sign.png1.40KB1.10KB▼ 21.35%
assets/images/fb_sign_in.png0.55KB0.38KB▼ 31.31%
assets/images/img_not_available.png38.09KB24.62KB▼ 35.38%
screenshot-1.png992.78KB272.54KB▼ 72.55%
assets/images/twitter_sign_in.png0.86KB0.65KB▼ 24.18%