10% wp-postvoting

Code Review | WP PostVoting

WordPress plugin WP PostVoting scored10%from 54 tests.

About plugin

  • Plugin page: wp-postvoting
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Feb 21, 2014
  • Latest release: Nov 15, 2023
  • Number of updates: 17
  • Update frequency: every 209.1 days
  • Top authors: moviehour (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10+ active /4,702 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-postvoting/wp_postvoting.php+260
    Methods with the same name as their class will not be constructors in a future version of PHP; wppvTopVotedWidget has a deprecated constructor

Server metrics [RAM: ▼1.72MB] [CPU: ▼49.78ms] Passed 4 tests

A check of server-side resources used by WP PostVoting
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.29 ▼1.187.97 ▼30.68
Dashboard /wp-admin2.30 ▼1.0410.50 ▼49.95
Posts /wp-admin/edit.php2.30 ▼1.0610.58 ▼33.73
Add New Post /wp-admin/post-new.php2.30 ▼3.599.84 ▼84.76
Media Library /wp-admin/upload.php2.30 ▼0.938.72 ▼25.31
WP PostVoting /wp-admin/options-general.php?page=wp-postvoting/admin_setup.php2.3011.22

Server storage [IO: ▲0.08MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

WP PostVoting: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.21 ▼0.181.55 ▼0.0438.27 ▼6.84
Dashboard /wp-admin2,192 ▲235.53 ▼0.1892.29 ▼9.5242.43 ▲2.71
Posts /wp-admin/edit.php2,136 ▲391.98 ▼0.0338.64 ▲2.3342.98 ▲8.08
Add New Post /wp-admin/post-new.php1,531 ▲523.29 ▲0.26670.23 ▲51.1652.41 ▼0.84
Media Library /wp-admin/upload.php1,409 ▲154.17 ▲0.0294.69 ▼4.2539.84 ▼1.37
WP PostVoting /wp-admin/options-general.php?page=wp-postvoting/admin_setup.php1,0262.0227.1336.35

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 50% 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
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wppvTopVotedWidget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_wppvtopvotedwidget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wp-postvoting/admin_setup.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wppvTopVotedWidget is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% 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
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-postvoting/admin_setup.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-postvoting/wp_postvoting.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-postvoting/admin-setup.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (WP PostVoting configurations.), #2 (Lists of all voted posts.), #3 (WP PostVoting widget settings.), #4 (WP PostVoting widget displaying.), #5 (Display WP PostVoting at front end.)
The official readme.txt might help

wp-postvoting/wp_postvoting.php 92% from 13 tests

The entry point to "WP PostVoting" version 1.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-postvoting.php" instead of "wp_postvoting.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin827 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP34320714
CSS32381
JavaScript10032

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
6 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png5.87KB5.82KB▼ 0.73%
screenshot-2.png11.13KB7.76KB▼ 30.33%
images/thumbs-up.png1.74KB1.43KB▼ 18.16%
screenshot-4.png5.22KB5.16KB▼ 1.03%
screenshot-3.png4.30KB4.25KB▼ 1.27%