89% fny-social-media-share-buttons

Code Review | Social Media Share Buttons

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

About plugin

  • Plugin page: fny-social-media-...
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8
  • WordPress version: 5.8.1
  • First release: Dec 30, 2016
  • Latest release: Jun 13, 2018
  • Number of updates: 101
  • Update frequency: every 5.7 days
  • Top authors: fnywebit (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

100+ active / 6,260 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼148.78ms] Passed 4 tests

Analyzing server-side resources used by Social Media Share Buttons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0426.65 ▲3.86
Dashboard /wp-admin3.10 ▲0.0439.41 ▼4.11
Posts /wp-admin/edit.php3.15 ▲0.0534.69 ▼1.33
Add New Post /wp-admin/post-new.php5.46 ▲0.0275.95 ▼588.15
Media Library /wp-admin/upload.php3.05 ▲0.0425.86 ▼1.53
Products /wp-admin/admin.php?page=fny_smsb_other_products3.0121.43
All Share Buttons /wp-admin/admin.php?page=fny_share_buttons_admin3.0325.52
Add New /wp-admin/admin.php?page=fny_create_share_button3.0320.49

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 163 new files
Database: 1 new table, no new options
New tables
wp_fny_sharebuttons

Browser metrics Passed 4 tests

Social Media Share Buttons: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,705 ▲10415.62 ▼0.337.53 ▲2.6673.08 ▲3.11
Dashboard /wp-admin2,972 ▲776.13 ▼0.05113.97 ▼18.54166.38 ▼2.23
Posts /wp-admin/edit.php2,782 ▲423.24 ▲0.0261.56 ▼2.13131.51 ▼7.70
Add New Post /wp-admin/post-new.php3,723 ▼9018.73 ▼0.49404.66 ▼66.66159.31 ▼6.51
Media Library /wp-admin/upload.php1,792 ▲405.55 ▲0.02138.20 ▼7.22187.24 ▼3.68
Products /wp-admin/admin.php?page=fny_smsb_other_products1,2152.3852.95134.86
All Share Buttons /wp-admin/admin.php?page=fny_share_buttons_admin1,3112.4256.76142.23
Add New /wp-admin/admin.php?page=fny_create_share_button2,6732.6559.40131.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_fny_sharebuttons

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can take inspiration from this readme.txt

fny-social-media-share-buttons/fnysocialmediasharebuttons.php 92% from 13 tests

Analyzing the main PHP file in "Social Media Share Buttons" version 1.7
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fny-social-media-share-buttons.php" instead of "fnysocialmediasharebuttons.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected27,296 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
CSS11696413,761
SVG420405,651
Sass1845373,364
LESS1845613,340
PHP1313827548
HTML191282
JavaScript66710267
Markdown111051
JSON20032

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.50
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods562.50%
▷ Public methods787.50%
▷ Protected methods00.00%
▷ Private methods112.50%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.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
6 PNG files occupy 0.18MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/backup.png76.62KB25.31KB▼ 66.96%
public/bootstrap/assets/img/bootstrap-social.png51.39KB13.26KB▼ 74.19%
public/images/pro.PNG12.28KB5.33KB▼ 56.61%
public/images/pro_version_theme.PNG22.00KB9.91KB▼ 54.94%
public/images/gallery.png19.85KB8.35KB▼ 57.96%