89% social-media-icon

Code Review | Social Media Icon

WordPress plugin Social Media Icon scored89%from 54 tests.

About plugin

  • Plugin page: social-media-icon
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.8
  • WordPress version: 6.3.1
  • First release: Mar 14, 2017
  • Latest release: Sep 2, 2021
  • Number of updates: 24
  • Update frequency: every 68.0 days
  • Top authors: webdzier (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,406 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.09ms] Passed 4 tests

A check of server-side resources used by Social Media Icon
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0544.03 ▲4.97
Dashboard /wp-admin3.42 ▲0.1153.84 ▲1.73
Posts /wp-admin/edit.php3.52 ▲0.1750.25 ▼2.01
Add New Post /wp-admin/post-new.php6.01 ▲0.1288.71 ▼15.57
Media Library /wp-admin/upload.php3.34 ▲0.1138.30 ▼0.50
All Icon groups /wp-admin/edit.php?post_type=socialmedia_cpt3.3839.51
Add New Icon group /wp-admin/post-new.php?post_type=socialmedia_cpt3.4156.82

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 72 new files
Database: no new tables, 8 new options
New WordPress options
widget_socialmedia_widget_id
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
socialmedia_Default_Setting
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Social Media Icon
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7014.30 ▼0.431.91 ▲0.2343.94 ▼1.70
Dashboard /wp-admin2,232 ▲615.55 ▼0.1098.33 ▲10.3372.98 ▲27.33
Posts /wp-admin/edit.php2,215 ▲1152.05 ▲0.0834.86 ▼6.3836.83 ▼3.87
Add New Post /wp-admin/post-new.php1,569 ▲4322.99 ▼0.58654.46 ▼41.9762.63 ▲5.60
Media Library /wp-admin/upload.php1,441 ▲444.18 ▼0.04101.27 ▲0.2564.89 ▲19.39
All Icon groups /wp-admin/edit.php?post_type=socialmedia_cpt1,1502.1734.5639.69
Add New Icon group /wp-admin/post-new.php?post_type=socialmedia_cpt2,7042.7757.78131.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_socialmedia_widget_id
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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 SRP test was a success

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 93% 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
Attributes that need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

social-media-icon/social-media-icon.php 92% from 13 tests

The main file in "Social Media Icon" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin6,409 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
CSS7141372,561
Sass1319221,158
LESS1319311,149
PHP1822488912
SVG100504
JavaScript1420125

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity4.83
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
11 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/SocialMedia_cpt_icon.png0.25KB0.20KB▼ 20.95%
images/button_sets/social_model_9.png1.55KB1.50KB▼ 2.84%
images/button_sets/social_model_6.png2.90KB2.84KB▼ 1.79%
images/button_sets/social_model_5.png1.03KB1.00KB▼ 3.59%
images/button_sets/button_sets.png2.15KB2.10KB▼ 2.18%