83% social-media-share-buttons-gshare

Code Review | Social Media Share Buttons Plugin - Gshare

WordPress plugin Social Media Share Buttons Plugin - Gshare scored83%from 54 tests.

About plugin

  • Plugin page: social-media-shar...
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: May 19, 2020
  • Latest release: Aug 20, 2020
  • Number of updates: 10
  • Update frequency: every 9.4 days
  • Top authors: wppool (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /637 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 gracefully, with no errors

Server metrics [RAM: ▲0.38MB] [CPU: ▲0.74ms] Passed 4 tests

Analyzing server-side resources used by Social Media Share Buttons Plugin - Gshare
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4252.34 ▼3.66
Dashboard /wp-admin3.70 ▲0.4047.27 ▲1.24
Posts /wp-admin/edit.php3.76 ▲0.4050.00 ▲5.70
Add New Post /wp-admin/post-new.php6.25 ▲0.3698.12 ▲0.21
Media Library /wp-admin/upload.php3.56 ▲0.3437.20 ▲5.18

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 121 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
gshare_version
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Social Media Share Buttons Plugin - Gshare
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲11213.45 ▼0.931.80 ▼0.7541.61 ▼11.41
Dashboard /wp-admin2,264 ▲795.19 ▼0.66101.65 ▼12.3487.32 ▲48.88
Posts /wp-admin/edit.php2,164 ▲782.34 ▲0.2941.43 ▲5.7837.29 ▲3.63
Add New Post /wp-admin/post-new.php6,249 ▲4,72119.81 ▲1.52885.65 ▲242.25145.22 ▲79.63
Media Library /wp-admin/upload.php1,465 ▲774.55 ▲0.3392.45 ▼13.3385.57 ▲39.47

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • gshare_version
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× 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/social-media-share-buttons-gshare/views/template.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/social-media-share-buttons-gshare/inc/functions-settings.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 22 tag instead of maximum 10
You can look at the official readme.txt

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

Analyzing the main PHP file in "Social Media Share Buttons Plugin - Gshare" version 1.2.1
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: The required version number must match the one declared in readme.txt ("4.8" instead of "5.0")

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
Success! There were no dangerous files found in this plugin24,533 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
CSS52,7483417,613
SVG14002,931
PHP136067792,859
JSON300520
JavaScript2188535455
Markdown1610155

PHP code Passed 2 tests

A short 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.42
Average class complexity27.70
▷ Minimum class complexity3.00
▷ Maximum class complexity67.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes110.00%
Methods134
▷ Static methods53.73%
▷ Public methods9873.13%
▷ Protected methods85.97%
▷ Private methods2820.90%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
73 PNG files occupy 0.29MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/layout/theme17.png6.63KB3.20KB▼ 51.71%
assets/images/layout/theme2-sm.png2.12KB1.19KB▼ 43.72%
assets/images/layout/theme1.png2.53KB1.37KB▼ 45.90%
assets/images/icon/pocket.png1.61KB0.51KB▼ 68.06%
assets/images/icon/telegram.png0.72KB0.52KB▼ 27.35%