69% socialmark

Code Review | SocialMark - Easy Watermark/Logo on Social Media Post Link Share Preview

WordPress plugin SocialMark - Easy Watermark/Logo on Social Media Post Link Share Preview scored69%from 54 tests.

About plugin

  • Plugin page: socialmark
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 21, 2021
  • Latest release: Jun 2, 2022
  • Number of updates: 29
  • Update frequency: every 14.0 days
  • Top authors: shawon.info (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /4,320 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲4.95MB] [CPU: ▲22.34ms] Passed 4 tests

Analyzing server-side resources used by SocialMark - Easy Watermark/Logo on Social Media Post Link Share Preview
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /8.76 ▲5.3064.11 ▲22.88
Dashboard /wp-admin8.78 ▲5.4784.11 ▲28.81
Posts /wp-admin/edit.php8.78 ▲5.4276.13 ▲20.55
Add New Post /wp-admin/post-new.php9.47 ▲3.59115.52 ▲17.12
Media Library /wp-admin/upload.php8.78 ▲5.5571.85 ▲36.31
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.7878.38

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 181 new files
Database: 1 new table, 11 new options
New tables
wp_sm_images
New WordPress options
fs_active_plugins
socialmark_db_version
theysaidso_admin_options
widget_recent-comments
fs_debug_mode
widget_theysaidso_widget
fs_accounts
widget_recent-posts
can_compress_scripts
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for SocialMark - Easy Watermark/Logo on Social Media Post Link Share Preview
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,011 ▲25014.80 ▲0.051.80 ▼0.3730.27 ▼16.72
Dashboard /wp-admin2,414 ▲2206.53 ▲0.66136.71 ▲20.7543.62 ▼2.63
Posts /wp-admin/edit.php2,327 ▲2273.37 ▲1.3657.25 ▲17.0739.44 ▲4.83
Add New Post /wp-admin/post-new.php1,548 ▲323.09 ▼0.01680.93 ▲41.9941.17 ▼8.55
Media Library /wp-admin/upload.php1,460 ▲694.11 ▼0.29105.00 ▼3.7448.84 ▼1.03
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,2703.0946.7629.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/socialmark/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie tables were found after uninstall: 1 table
    • wp_sm_images
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_recent-comments
    • fs_gdpr
    • widget_recent-posts
    • socialmark_db_version
    • fs_active_plugins
    • fs_debug_mode
    • widget_theysaidso_widget
    • fs_accounts
    • theysaidso_admin_options
    • can_compress_scripts
    • ...

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Requires php: Version format is invalid
You can look at the official readme.txt

socialmark/socialmark.php Passed 13 tests

The main file in "SocialMark - Easy Watermark/Logo on Social Media Post Link Share Preview" v. 2.0.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
94 characters long description:
Easy way to add/change overlay/watermark to Facebook, Twitter, open graph post preview images.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected31,791 lines of code in 137 files:
LanguageFilesBlank linesComment linesLines of code
PHP1197,32416,11331,349
JavaScript43961273
CSS12130110
SVG20059

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity90.29
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes45
▷ Abstract classes24.44%
▷ Concrete classes4395.56%
▷ Final classes00.00%
Methods1,132
▷ Static methods17315.28%
▷ Public methods79269.96%
▷ Protected methods151.33%
▷ Private methods32528.71%
Functions121
▷ Named functions121100.00%
▷ Anonymous functions00.00%
Constants132
▷ Global constants10781.06%
▷ Class constants2518.94%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sm_icon.png32.87KB11.07KB▼ 66.31%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%