78% facebook-button-plugin

Code Review | BestWebSoft's Like & Share - Posts, Pages and Widget Social Extension plugin for WordPress

WordPress plugin BestWebSoft's Like & Share - Posts, Pages and Widget Social Extension plugin for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: facebook-button-p...
  • Plugin version: 2.74
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Jun 7, 2011
  • Latest release: Nov 27, 2023
  • Number of updates: 125
  • Update frequency: every 36.5 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

71 reviews

Install metrics

8,000+ active /1,261,471 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.88MB] [CPU: ▲4.52ms] Passed 4 tests

A check of server-side resources used by BestWebSoft's Like & Share - Posts, Pages and Widget Social Extension plugin for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.33 ▲0.8656.74 ▲20.73
Dashboard /wp-admin4.22 ▲0.9155.94 ▲11.43
Posts /wp-admin/edit.php4.27 ▲0.9152.19 ▲2.58
Add New Post /wp-admin/post-new.php6.76 ▲0.8790.38 ▼4.91
Media Library /wp-admin/upload.php4.08 ▲0.8542.22 ▲8.96

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 145 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
fcbkbttn_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
bstwbsftwppdtplgns_options
can_compress_scripts

Browser metrics Passed 4 tests

BestWebSoft's Like & Share - Posts, Pages and Widget Social Extension plugin for WordPress: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲16614.15 ▼0.1240.34 ▲38.5238.33 ▼5.81
Dashboard /wp-admin2,237 ▲575.62 ▼0.0096.48 ▼2.0042.63 ▲3.60
Posts /wp-admin/edit.php2,205 ▲1022.19 ▲0.1634.51 ▼9.0930.35 ▼5.54
Add New Post /wp-admin/post-new.php1,624 ▲9523.07 ▼0.19670.37 ▲0.6665.81 ▲2.44
Media Library /wp-admin/upload.php1,448 ▲454.25 ▼0.0299.77 ▲2.7642.82 ▼0.21
Settings /wp-admin/facebook-button-plugin.php260.410.1214.75
Statistics /wp-admin/facebook-button-statistics.php260.410.105.98
BWS Panel /wp-admin/facebook-button-plugin.php?page=fcbkbttn-bws-panel260.410.086.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/facebook-button-plugin/bws_menu/product_list.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/facebook-button-plugin/facebook-button-plugin.php:1095
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/facebook-button-plugin/bws_menu/class-bws-settings.php:1452
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/facebook-button-plugin/includes/class-fcbkbttn-settings.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/facebook-button-plugin.php
    • > Network (severe)
    wp-admin/facebook-button-plugin.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/facebook-button-statistics.php
    • > Network (severe)
    wp-admin/facebook-button-statistics.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/facebook-button-plugin.php?page=fcbkbttn-bws-panel
    • > Network (severe)
    wp-admin/facebook-button-plugin.php?page=fcbkbttn-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (Displaying buttons for Facebook before your post.), #2 (Displaying buttons for Facebook in your post via the shortcode.), #3 (Plugin settings page.)
You can look at the official readme.txt

facebook-button-plugin/facebook-button-plugin.php Passed 13 tests

The main PHP script in "BestWebSoft's Like & Share - Posts, Pages and Widget Social Extension plugin for WordPress" version 2.74 is automatically included on every request by WordPress
83 characters long description:
Add Facebook Like, Share and Profile buttons to WordPress posts, pages and widgets.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected28,530 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PO File216,90012,00716,683
PHP95027135,692
CSS91622545,410
JavaScript734110595
SVG400150

PHP code Passed 2 tests

Analyzing 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.57
Average class complexity98.33
▷ Minimum class complexity21.00
▷ Maximum class complexity210.00
Average method complexity11.81
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods2177.78%
▷ Protected methods00.00%
▷ Private methods622.22%
Functions73
▷ Named functions73100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
66 PNG files occupy 3.31MB with 1.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/css/jquery-ui-styles/1.12.1/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
bws_menu/icons/themes/opening.png213.43KB97.23KB▼ 54.45%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_flat_75_ffffff_40x100.png0.25KB0.11KB▼ 55.38%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%