10% wp-like-button

Code Review | WP Like Button

WordPress plugin WP Like Button scored10%from 54 tests.

About plugin

  • Plugin page: wp-like-button
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 19, 2015
  • Latest release: Aug 15, 2023
  • Number of updates: 86
  • Update frequency: every 36.4 days
  • Top authors: amirk27 (100%)

Code review

54 tests

User reviews

46 reviews

Install metrics

4,000+ active /249,875 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/wp-like-button/crudlab-fb-like-button.php+186
    Undefined variable: user_id

Server metrics [RAM: ▲0.17MB] [CPU: ▲1.76ms] Passed 4 tests

This is a short check of server-side resources used by WP Like Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1748.09 ▲7.19
Dashboard /wp-admin3.47 ▲0.1755.95 ▼2.70
Posts /wp-admin/edit.php3.59 ▲0.2354.76 ▲3.27
Add New Post /wp-admin/post-new.php6.06 ▲0.17102.00 ▼0.72
Media Library /wp-admin/upload.php3.40 ▲0.1746.59 ▲9.34

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: 1 new table, 8 new options
New tables
wp_fblb
New WordPress options
wpfblike_db_version
crudlab_fblb_install
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WP Like Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.04 ▼0.3141.14 ▲39.2046.03 ▲0.07
Dashboard /wp-admin2,201 ▲245.58 ▲0.0185.68 ▼9.9772.47 ▲25.76
Posts /wp-admin/edit.php2,124 ▲241.98 ▼0.0439.36 ▲2.9534.42 ▼2.58
Add New Post /wp-admin/post-new.php1,695 ▲16921.91 ▼1.87691.41 ▼21.0552.17 ▼8.68
Media Library /wp-admin/upload.php1,412 ▲124.20 ▲0.02105.98 ▼3.9870.73 ▲25.81

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • wpfblike_db_version
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • crudlab_fblb_install
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-like-button/crudlab-fb-like-button.php:8

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt might help

wp-like-button/crudlab-fb-like-button.php 92% from 13 tests

This is the main PHP file of "WP Like Button" version 1.7.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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-like-button.php" instead of "crudlab-fb-like-button.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,811 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS344591,613
PHP358161,026
JavaScript2276172

PHP code Passed 2 tests

This is a very shot 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.49
Average class complexity62.00
▷ Minimum class complexity37.00
▷ Maximum class complexity87.00
Average method complexity4.94
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2580.65%
▷ Protected methods00.00%
▷ Private methods619.35%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ico1.png3.53KB0.63KB▼ 82.20%
images/off - Copy.png3.74KB1.14KB▼ 69.52%
images/off.png3.75KB1.07KB▼ 71.38%
images/help.png4.56KB1.57KB▼ 65.61%
images/ico.png3.11KB0.67KB▼ 78.53%