83% async-social-sharing

Code Review | Async Social Sharing

WordPress plugin Async Social Sharing scored83%from 54 tests.

About plugin

  • Plugin page: async-social-sharing
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9.1
  • WordPress version: 6.3.1
  • First release: May 1, 2012
  • Latest release: Jun 25, 2014
  • Number of updates: 32
  • Update frequency: every 24.7 days
  • Top authors: rachelbaker (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

400+ active /49,526 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.59ms] Passed 4 tests

A check of server-side resources used by Async Social Sharing
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.28 ▼4.23
Dashboard /wp-admin3.34 ▲0.0454.33 ▲0.54
Posts /wp-admin/edit.php3.39 ▲0.0351.58 ▼5.04
Add New Post /wp-admin/post-new.php5.92 ▲0.0395.36 ▼18.44
Media Library /wp-admin/upload.php3.26 ▲0.0336.29 ▼2.63
Async Sharing Options /wp-admin/options-general.php?page=async-social-sharing/async-share.php3.2638.60

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Async Social Sharing: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲14113.57 ▼0.808.98 ▲5.6741.07 ▼2.67
Dashboard /wp-admin2,213 ▲225.90 ▲1.06100.45 ▼12.3039.97 ▼4.93
Posts /wp-admin/edit.php2,093 ▲12.00 ▲0.0040.80 ▼3.0334.92 ▼3.78
Add New Post /wp-admin/post-new.php1,545 ▲1118.33 ▼4.71649.35 ▼14.4256.79 ▲3.75
Media Library /wp-admin/upload.php1,395 ▲74.15 ▼0.0396.39 ▼14.2044.14 ▼1.98
Async Sharing Options /wp-admin/options-general.php?page=async-social-sharing/async-share.php9362.1924.4925.53

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 has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/async-social-sharing/views/admin-view.php:12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/async-social-sharing/views/output-view.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/async-social-sharing/includes/admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/async-social-sharing/async-share.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Social Sharing widgets are loaded under posts), #2 (Plugin Options page allows you to specify the social sharing widgets to load), #3 (Scripts now load in asynchronous fashion after the page load completes)
  • Plugin Name: You should set the name of your plugin on the first line ( === async-social-sharing === )
The official readme.txt is a good inspiration

async-social-sharing/async-share.php 85% from 13 tests

The entry point to "Async Social Sharing" version 1.8.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 224 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("async-social-sharing.php" instead of "async-share.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected873 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS243412
PHP583134317
Markdown1850107
JavaScript132837

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.35
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods214.29%
▷ Public methods1178.57%
▷ Protected methods17.14%
▷ Private methods214.29%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
7 PNG files occupy 0.42MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/async-social-example.png9.48KB3.69KB▼ 61.08%
screenshot-2.png222.43KB60.10KB▼ 72.98%
assets/images/async-icon.png1.55KB0.61KB▼ 60.78%
async-social-sharing-performance.png61.85KB20.69KB▼ 66.55%
screenshot-3.png61.85KB20.69KB▼ 66.55%