78% social-media-links

Code Review | Social Media Links

WordPress plugin Social Media Links scored78%from 54 tests.

About plugin

  • Plugin page: social-media-links
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9
  • WordPress version: 6.3.1
  • First release: May 23, 2017
  • Latest release: Nov 17, 2017
  • Number of updates: 18
  • Update frequency: every 10.0 days
  • Top authors: wpdesigncoding (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /5,889 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Social Media Links
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.16 ▲1.62
Dashboard /wp-admin3.33 ▲0.0344.75 ▲1.35
Posts /wp-admin/edit.php3.38 ▲0.0245.97 ▲3.77
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.63 ▼14.91
Media Library /wp-admin/upload.php3.25 ▲0.0235.57 ▼1.36

Server storage [IO: ▲0.38MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 193 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
social_sorting_position
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Social Media Links
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19614.95 ▲0.214.82 ▲3.1838.28 ▼0.73
Dashboard /wp-admin2,228 ▲365.93 ▲0.98104.12 ▼7.3340.48 ▼1.25
Posts /wp-admin/edit.php2,126 ▲372.64 ▲0.6046.73 ▲12.6735.94 ▲3.79
Add New Post /wp-admin/post-new.php1,698 ▲17923.59 ▲0.57592.41 ▼58.6929.39 ▼26.22
Media Library /wp-admin/upload.php1,419 ▲285.16 ▲0.87102.34 ▲4.9343.97 ▲1.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • social_sorting_position
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/social-media-links/public/partials/social-media-public-display.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-links/admin/partials/class-social-media-admin-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-links/admin/partials/class-social-media-general-setting.php:19

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
Please take inspiration from this readme.txt

social-media-links/social-media.php 85% from 13 tests

This is the main PHP file of "Social Media Links" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("social-media-links.php" instead of "social-media.php")
  • 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 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,124 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP141874881,067
CSS26548
JavaScript24279

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity15.70
▷ Minimum class complexity1.00
▷ Maximum class complexity102.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods48
▷ Static methods2450.00%
▷ Public methods4287.50%
▷ Protected methods00.00%
▷ Private methods612.50%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
168 compressed PNG files occupy 0.30MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/default/64/instagram.png3.65KB3.62KB▼ 0.86%
public/images/default/64/flickr.png1.90KB1.91KB0.00%
public/images/default/64/picasa.png2.38KB2.37KB0.45%
public/images/default/32/email.png1.61KB1.59KB▼ 1.09%
public/images/default/16/deviantart.png0.81KB0.81KB0.00%