10% like-dislike-plus-counter

Code Review | Like dislike plus counter | Like Dislike Buttons

WordPress plugin Like dislike plus counter | Like Dislike Buttons scored10%from 54 tests.

About plugin

  • Plugin page: like-dislike-plus...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.5
  • WordPress version: 6.3.1
  • First release: Jun 22, 2018
  • Latest release: May 16, 2021
  • Number of updates: 30
  • Update frequency: every 35.3 days
  • Top authors: shanijangee007 (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

500+ active /11,495 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/like-dislike-plus-counter/index.php+41
    Undefined variable: test_db_version

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.87ms] Passed 4 tests

A check of server-side resources used by Like dislike plus counter | Like Dislike Buttons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.80 ▼2.97
Dashboard /wp-admin3.32 ▲0.0243.63 ▼7.99
Posts /wp-admin/edit.php3.38 ▲0.0244.86 ▼6.21
Add New Post /wp-admin/post-new.php5.92 ▲0.0481.16 ▼18.31
Media Library /wp-admin/upload.php3.25 ▲0.0235.47 ▲4.08

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 109 new files
Database: 1 new table, 7 new options
New tables
wp_like_dislike_btn_details
New WordPress options
db_upgraded
test_db_version
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Like dislike plus counter | Like Dislike Buttons
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /7,702 ▲4,96715.63 ▲1.257.07 ▲5.5037.22 ▼3.22
Dashboard /wp-admin6,975 ▲4,7905.42 ▲0.51153.34 ▲44.8737.52 ▼6.63
Posts /wp-admin/edit.php6,869 ▲4,7802.83 ▲0.7281.78 ▲46.0132.57 ▲1.87
Add New Post /wp-admin/post-new.php3,921 ▲2,38824.06 ▲0.77718.97 ▲36.1037.18 ▼22.67
Media Library /wp-admin/upload.php6,163 ▲4,7754.53 ▲0.34139.80 ▲30.4544.77 ▼2.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_like_dislike_btn_details
  • This plugin does not fully uninstall, leaving 7 options in the database
    • test_db_version
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/like-dislike-plus-counter/admin/func.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/like-dislike-plus-counter/admin/admin.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
The official readme.txt might help

like-dislike-plus-counter/index.php 92% from 13 tests

The primary PHP file in "Like dislike plus counter | Like Dislike Buttons" version 1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("like-dislike-plus-counter.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin18,912 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
CSS8558467,611
SVG2003,356
Sass1638373,238
LESS1638493,226
PHP311486670
JavaScript59489610
HTML18047201

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
19 PNG files occupy 0.22MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/count2/btn-like.png8.10KB4.52KB▼ 44.24%
assets/images/count13/back13.png3.05KB1.44KB▼ 52.77%
assets/images/count21/back1.png9.14KB4.94KB▼ 45.88%
admin/images/count1/imglike1.png8.26KB3.46KB▼ 58.11%
admin/images/count13/back13.png3.05KB1.44KB▼ 52.77%