84% ht-social-share

Code Review | HT Social Share

WordPress plugin HT Social Share scored84%from 54 tests.

About plugin

  • Plugin page: ht-social-share
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 12, 2021
  • Latest release: Aug 8, 2023
  • Number of updates: 13
  • Update frequency: every 72.2 days
  • Top authors: htplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /803 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼1.41ms] 75% from 4 tests

Server-side resources used by HT Social Share
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,405.89ms on /wp-admin/admin.php?page=htsocial-recommendations)
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2239.34 ▲1.80
Dashboard /wp-admin3.53 ▲0.2244.49 ▼7.85
Posts /wp-admin/edit.php3.65 ▲0.2949.51 ▲4.14
Add New Post /wp-admin/post-new.php6.11 ▲0.2294.73 ▼3.72
Media Library /wp-admin/upload.php3.45 ▲0.2239.06 ▲7.23
HT Social Share /wp-admin/admin.php?page=socail-share-setting-page3.5334.70
Recommendations /wp-admin/admin.php?page=htsocial-recommendations7.731,405.89

Server storage [IO: ▲3.15MB] [DB: ▲0.67MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for HT Social Share
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲10613.29 ▼1.251.89 ▲0.1338.26 ▼6.38
Dashboard /wp-admin2,229 ▲415.79 ▲0.88101.36 ▼17.0740.89 ▼3.01
Posts /wp-admin/edit.php2,123 ▲372.05 ▲0.0638.85 ▲4.7335.78 ▲0.83
Add New Post /wp-admin/post-new.php1,549 ▲1623.37 ▲0.15643.81 ▼15.7462.37 ▲8.59
Media Library /wp-admin/upload.php1,419 ▲314.27 ▲0.0997.58 ▲2.1043.73 ▼1.31
HT Social Share /wp-admin/admin.php?page=socail-share-setting-page1,4411.7829.1047.69
Recommendations /wp-admin/admin.php?page=htsocial-recommendations2,8612.2629.4870.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

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)
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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ht-social-share/includes/class.social-share.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ht-social-share/admin/template/general-setting.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: social share plugin, social, post share, share, social share button

ht-social-share/ht-social-share.php 92% from 13 tests

The main file in "HT Social Share" v. 1.0.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin15,149 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
SVG33129,544
CSS31,64694,252
PHP51821391,192
JavaScript24525161

PHP code Passed 2 tests

A short 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.44
Average class complexity35.67
▷ Minimum class complexity10.00
▷ Maximum class complexity51.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2376.67%
▷ Protected methods00.00%
▷ Private methods723.33%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants4
▷ Global constants4100.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
27 PNG files occupy 0.14MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/extensions/whols-pro.png15.30KB7.40KB▼ 51.65%
admin/assets/images/style_6.png4.19KB4.31KB0.00%
admin/assets/images/extensions/hashbar-pro.png3.15KB3.30KB0.00%
admin/assets/images/style_2.png3.13KB3.19KB0.00%
admin/assets/images/extensions/multicurrencypro.png19.01KB9.36KB▼ 50.77%