68% share-this-image

Code Review | Share This Image

WordPress plugin Share This Image scored68%from 54 tests.

About plugin

  • Plugin page: share-this-image
  • Plugin version: 1.88
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 18, 2017
  • Latest release: Nov 22, 2023
  • Number of updates: 125
  • Update frequency: every 18.5 days
  • Top authors: Mihail Barinov (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

2,000+ active /97,761 total downloads

Benchmarks

Plugin footprint 65% 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: ▲5.55MB] [CPU: ▲33.22ms] 75% from 4 tests

An overview of server-side resources used by Share This Image
Please have a look at the following items
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.55MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.43 ▲5.9767.00 ▲22.76
Dashboard /wp-admin9.45 ▲6.1584.23 ▲36.77
Posts /wp-admin/edit.php9.45 ▲6.1091.82 ▲41.32
Add New Post /wp-admin/post-new.php9.87 ▲3.98124.44 ▲32.04
Media Library /wp-admin/upload.php9.45 ▲6.2278.13 ▲45.14
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.4560.95

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 230 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-comments
fs_active_plugins
theysaidso_admin_options
fs_accounts
widget_theysaidso_widget
sti_plugin_ver
widget_recent-posts
sti_settings
can_compress_scripts
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by Share This Image
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲14313.81 ▼0.2513.53 ▲11.5330.15 ▼15.32
Dashboard /wp-admin2,225 ▲455.59 ▼0.0596.38 ▲0.3245.31 ▼0.44
Posts /wp-admin/edit.php2,137 ▲372.11 ▲0.1542.44 ▲2.2237.75 ▲0.55
Add New Post /wp-admin/post-new.php1,675 ▲14923.03 ▼0.05681.72 ▲39.8761.20 ▲11.63
Media Library /wp-admin/upload.php1,436 ▲364.20 ▲0.0297.97 ▲2.6544.74 ▲2.18
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0881.6626.6627.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/share-this-image/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • fs_debug_mode
    • fs_accounts
    • sti_plugin_ver
    • fs_active_plugins
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/share-this-image/sharer.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/share-this-image/sharer.php on line 61
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/share-this-image/sharer.php on line 64
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/share-this-image/sharer.php on line 67
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/share-this-image/sharer.php on line 65
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/share-this-image/sharer.php on line 63
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/share-this-image/sharer.php on line 66
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/share-this-image/sharer.php on line 68
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/share-this-image/sharer.php on line 62

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: social buttons, twitter, facebook, sharing, image

share-this-image/share-this-image.php Passed 13 tests

"Share This Image" version 1.88's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
57 characters long description:
Allows you to share in social networks any of your images

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected39,563 lines of code in 170 files:
LanguageFilesBlank linesComment linesLines of code
PHP1399,36318,10537,012
JavaScript9376901,209
CSS18185181,125
Markdown1680214
SVG3003

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 107)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity72.87
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity107.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes70
▷ Abstract classes22.86%
▷ Concrete classes6897.14%
▷ Final classes11.47%
Methods1,418
▷ Static methods23616.64%
▷ Public methods1,00370.73%
▷ Protected methods171.20%
▷ Private methods39828.07%
Functions109
▷ Named functions109100.00%
▷ Anonymous functions00.00%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 0.22MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/feature1.png12.79KB13.41KB0.00%
assets/images/sti-button.png7.46KB3.20KB▼ 57.05%
assets/images/sti-button-flat-small.png5.45KB3.61KB▼ 33.79%
assets/images/feature10.png18.16KB18.80KB0.00%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%