66% likebtn-like-button

Code Review | Like Button Rating ♥ LikeBtn

WordPress plugin Like Button Rating ♥ LikeBtn scored66%from 54 tests.

About plugin

  • Plugin page: likebtn-like-button
  • Plugin version: 2.6.50
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.4
  • WordPress version: 6.3.1
  • First release: May 27, 2013
  • Latest release: Oct 26, 2023
  • Number of updates: 1,621
  • Update frequency: every 2.4 days
  • Top authors: likebtn (100%)

Code review

54 tests

User reviews

258 reviews

Install metrics

6,000+ active /429,207 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲2.51MB] [CPU: ▼102.35ms] Passed 4 tests

Server-side resources used by Like Button Rating ♥ LikeBtn
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.94 ▲2.4763.75 ▲29.03
Dashboard /wp-admin5.87 ▲2.4456.42 ▼456.49
Posts /wp-admin/edit.php5.99 ▲2.6357.22 ▲7.38
Add New Post /wp-admin/post-new.php8.47 ▲2.57110.73 ▲18.94
Media Library /wp-admin/upload.php5.79 ▲2.5657.86 ▲20.76
Reports /wp-admin/admin.php?page=likebtn_reports5.7643.17
Settings /wp-admin/admin.php?page=likebtn_settings6.22288.74
Votes /wp-admin/admin.php?page=likebtn_votes5.8544.49
Help /wp-admin/admin.php?page=likebtn_help5.7641.96
Widgets /wp-admin/admin.php?page=likebtn_widget5.7662.56
Statistics /wp-admin/admin.php?page=likebtn_statistics5.8544.94
Buttons /wp-admin/admin.php?page=likebtn_buttons5.8455.13

Server storage [IO: ▲1.96MB] [DB: ▲0.05MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 156 new files
Database: 2 new tables, 917 new options
New tables
wp_likebtn_vote
wp_likebtn_item
New WordPress options
likebtn_settings_group_identifier_page_likebtn_list
likebtn_settings_item_date_attachment
likebtn_settings_loader_image_page_likebtn_list
likebtn_notify_enabled
likebtn_settings_counter_padding_post
likebtn_settings_btn_size_page
likebtn_voting_author_post
likebtn_bp_hide_sitewide_post_likebtn_list
likebtn_settings_lang_attachment
likebtn_allow_forums_comment
...

Browser metrics Passed 4 tests

An overview of browser requirements for Like Button Rating ♥ LikeBtn
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲13813.66 ▼0.9116.74 ▲14.8146.36 ▲7.58
Dashboard /wp-admin2,258 ▲785.72 ▲0.0889.57 ▲4.9385.99 ▲47.67
Posts /wp-admin/edit.php2,250 ▲1472.13 ▲0.1135.50 ▼4.3232.94 ▼4.84
Add New Post /wp-admin/post-new.php1,577 ▲3823.55 ▲5.61600.86 ▼21.9956.45 ▼8.70
Media Library /wp-admin/upload.php1,463 ▲604.18 ▼0.0496.93 ▼3.7880.40 ▲33.91
Reports /wp-admin/admin.php?page=likebtn_reports1,1083.2775.1847.01
Settings /wp-admin/admin.php?page=likebtn_settings1,8932.3039.6567.11
Votes /wp-admin/admin.php?page=likebtn_votes2,7482.5633.3229.45
Help /wp-admin/admin.php?page=likebtn_help1,51510.21245.1960.11
Widgets /wp-admin/admin.php?page=likebtn_widget9652.3227.3730.72
Statistics /wp-admin/admin.php?page=likebtn_statistics1,3772.1329.6325.50
Buttons /wp-admin/admin.php?page=likebtn_buttons9,8276.44247.65128.31

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_likebtnlikebuttonmostlikedwidget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_likebtnlikebuttonmostlikedbyuserwidget
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=likebtn_votes
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/likebtn-like-button/templates/most-liked-widget.php
    • > /wp-content/plugins/likebtn-like-button/templates/um-liked-content.php
    • > /wp-content/plugins/likebtn-like-button/templates/like-box.php
    • > /wp-content/plugins/likebtn-like-button/templates/liked-by-user-widget.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/likebtn-like-button/includes/buddypress.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function likebtn_strip_html() in wp-content/plugins/likebtn-like-button/templates/admin_mail.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _likebtn_is_bbp_active() in wp-content/plugins/likebtn-like-button/includes/bbpress.php:71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/likebtn-like-button/includes/meta_columns.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/likebtn-like-button/includes/likebtn_like_button_most_liked_widget.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/likebtn-like-button/includes/um.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/likebtn-like-button/likebtn_like_button.php:177

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=likebtn_settings
    • > Network (severe)
    wp-content/plugins/likebtn-like-button/public/css/jquery/jquery-ui/jquery-ui.css?ver=2.6.50 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=likebtn_settings
    • > Network (severe)
    wp-content/plugins/likebtn-like-button/public/js/jquery/jquery-ui/jquery-ui.js?ver=2.6.50 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=likebtn_settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/likebtn-like-button/public/js/jquery/jquery.ui.durationPicker.js?ver=2.6.50 1:4 Uncaught TypeError: $.widget is not a function
    • > GET request to /wp-admin/admin.php?page=likebtn_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: cntr.durationPicker is not a function" "TypeError: cntr.durationPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/likebtn-like-button/public/js/admin.js?ver=2.6.50:2294:14)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=likebtn_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: cntr.durationPicker is not a function
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=likebtn_buttons
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=likebtn_buttons
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=likebtn_buttons
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clear is deprecated since version 5.5.0! Use wp.i18n instead.
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=likebtn_buttons
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clearAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

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
Attributes that require attention:
  • Tags: Too many tags (54 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

likebtn-like-button/likebtn_like_button.php 85% from 13 tests

The primary PHP file in "Like Button Rating ♥ LikeBtn" version 2.6.50 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 150 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("likebtn-like-button.php" instead of "likebtn_like_button.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected24,505 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
PHP221,7951,17312,675
PO File42,4823,2295,686
JavaScript544875553,485
CSS7531682,659

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.43
Average class complexity60.83
▷ Minimum class complexity1.00
▷ Maximum class complexity158.00
Average method complexity6.36
▷ Minimum method complexity1.00
▷ Maximum method complexity90.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods67
▷ Static methods11.49%
▷ Public methods67100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions261
▷ Named functions261100.00%
▷ Anonymous functions00.00%
Constants122
▷ Global constants11291.80%
▷ Class constants108.20%
▷ Public constants10100.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
51 PNG files occupy 0.25MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/popup_position/top.png1.89KB0.69KB▼ 63.33%
public/img/jquery/jquery-ui/ui-icons_ffffff_256x240.png6.33KB4.18KB▼ 33.99%
public/img/jquery/jquery-ui/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
public/img/thumb/dislike.png1.38KB0.54KB▼ 60.44%
public/img/jquery/jquery-ui/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%