83% woocommerce-social-media-share-buttons

Code Review | Woocommerce Social Media Share Buttons

WordPress plugin Woocommerce Social Media Share Buttons scored 83% from 54 tests.

About plugin

  • Plugin page: woocommerce-socia...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4.2
  • WordPress version: 6.3.1
  • First release: Jun 6, 2015
  • Latest release: Feb 11, 2016
  • Number of updates: 80
  • Update frequency: every 3.1 days
  • Top authors: toastiestudio (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

5,000+ active / 115,504 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Woocommerce Social Media Share Buttons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1839.46 ▼7.26
Dashboard /wp-admin3.47 ▲0.1748.42 ▲1.18
Posts /wp-admin/edit.php3.52 ▲0.1750.13 ▼1.62
Add New Post /wp-admin/post-new.php6.07 ▲0.1986.33 ▼23.08
Media Library /wp-admin/upload.php3.40 ▲0.1739.68 ▲4.27

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 19 new options
New WordPress options
toastie_smsb_opengraph
toastie_smsb_gp
widget_recent-posts
widget_theysaidso_widget
toastie_smsb_vk
db_upgraded
theysaidso_admin_options
toastie_smsb_format
toastie_smsb_fb
toastie_smsb_pi
...

Browser metrics Passed 4 tests

Checking browser requirements for Woocommerce Social Media Share Buttons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,014 ▲25717.43 ▲3.2224.27 ▲22.2344.64 ▼5.62
Dashboard /wp-admin2,285 ▲1037.18 ▲1.31149.22 ▲40.8475.63 ▲25.69
Posts /wp-admin/edit.php2,177 ▲854.20 ▲2.1989.55 ▲46.9334.30 ▼4.31
Add New Post /wp-admin/post-new.php1,541 ▲623.14 ▼0.35684.21 ▲42.0959.40 ▲1.92
Media Library /wp-admin/upload.php1,461 ▲736.41 ▲2.21135.61 ▲37.8270.64 ▲28.41

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 19 options in the database
    • toastie_smsb_fb
    • toastie_smsb_opengraph
    • widget_theysaidso_widget
    • toastie_smsb_tu
    • toastie_smsb_pi
    • toastie_smsb_em
    • widget_recent-comments
    • toastie_smsb_email
    • toastie_smsb_tw
    • can_compress_scripts
    • ...

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)
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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/woocommerce-social-media-share-buttons/index.php:64

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% 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: You are using too many tags: 15 tag instead of maximum 10
The official readme.txt is a good inspiration

woocommerce-social-media-share-buttons/index.php 85% from 13 tests

The principal PHP file in "Woocommerce Social Media Share Buttons" v. 1.3.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 155 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-social-media-share-buttons.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 plugin770 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP14934529
PO File266140198
JavaScript192643

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/yithqv_buttons/facebook.png1.98KB1.48KB▼ 25.36%
img/vk-share-button-big.png3.16KB1.65KB▼ 47.73%
img/yithqv_buttons/linkedin.png2.14KB1.80KB▼ 16.07%
img/smsb_formatoptions.png8.19KB3.27KB▼ 60.01%
img/yithqv_buttons/vkontakte.png1.91KB1.50KB▼ 21.26%