84% sharedisc

Code Review | ShareDisc

WordPress plugin ShareDisc scored 84% from 54 tests.

About plugin

  • Plugin page: sharedisc
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Jan 15, 2016
  • Latest release: Apr 14, 2016
  • Number of updates: 17
  • Update frequency: every 7.8 days
  • Top authors: theham (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 810 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.19ms] Passed 4 tests

Server-side resources used by ShareDisc
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.49 ▲4.03
Dashboard /wp-admin3.31 ▲0.0143.53 ▼2.13
Posts /wp-admin/edit.php3.36 ▲0.0143.36 ▲2.74
Add New Post /wp-admin/post-new.php5.89 ▲0.0179.78 ▼22.52
Media Library /wp-admin/upload.php3.23 ▲0.0034.28 ▲1.17

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 65 new files
Database: no new tables, 10 new options
New WordPress options
sharedisc_bitly_settings
sharedisc_styling_settings
theysaidso_admin_options
db_upgraded
sharedisc_settings
can_compress_scripts
sharedisc_message_settings
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

ShareDisc: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.68 ▼0.711.71 ▼0.0338.41 ▲0.08
Dashboard /wp-admin2,212 ▲205.86 ▲0.9894.78 ▼15.8236.02 ▼7.24
Posts /wp-admin/edit.php2,097 ▲81.98 ▼0.0335.10 ▼6.1933.99 ▼0.43
Add New Post /wp-admin/post-new.php1,539 ▲2023.50 ▲0.27648.08 ▲55.6850.12 ▼1.40
Media Library /wp-admin/upload.php1,394 ▲64.22 ▲0.0095.73 ▲0.7642.20 ▲2.88

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'ShareDisc_Sharing_Platform' not found in wp-content/plugins/sharedisc/platforms/sharedisc-platform-linkedin.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'ShareDisc_Sharing_Platform' not found in wp-content/plugins/sharedisc/platforms/sharedisc-platform-twitter.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'ShareDisc_Sharing_Platform' not found in wp-content/plugins/sharedisc/platforms/sharedisc-platform-facebook.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Your credit breakdown (purchased from Sharedisc.com) and some of the Social settings.), #2 (Social Network % discounts on offer and default sharing text.), #3 (Statistics based on shares, closures and discounts. For your R.O.I. calculations.), #4 (A complete list of all the Shares that have been logged on our system.), #5 (Callout theme settings.)
You can look at the official readme.txt

sharedisc/sharedisc.php 92% from 13 tests

"ShareDisc" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected3,842 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP162,1779382,614
JavaScript6594211776
CSS11129132452

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity26.46
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods117
▷ Static methods2420.51%
▷ Public methods11295.73%
▷ Protected methods00.00%
▷ Private methods54.27%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
21 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/sd_icon.png0.56KB0.54KB▼ 4.69%
public/images/sharediscicon-sm.png0.64KB0.73KB0.00%
admin/images/sharedisclogo.png11.33KB7.10KB▼ 37.35%
themes/sd-theme-sharedisc-base.png0.97KB0.68KB▼ 29.71%
admin/images/linkedin.png5.22KB3.39KB▼ 35.04%