72% custom-social-icon

Code Review | Custom Social Icons

WordPress plugin Custom Social Icons scored72%from 54 tests.

About plugin

  • Plugin page: custom-social-icon
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3+
  • WordPress version: 6.3.1
  • First release: Sep 17, 2015
  • Latest release: Apr 16, 2018
  • Number of updates: 11
  • Update frequency: every 85.6 days
  • Top authors: vrajesh.dave (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,297 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.03MB] [CPU: ▼1.12ms] Passed 4 tests

A check of server-side resources used by Custom Social Icons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.36 ▼3.11
Dashboard /wp-admin3.36 ▲0.0548.67 ▲2.13
Posts /wp-admin/edit.php3.47 ▲0.1151.72 ▲6.07
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.83 ▼7.35
Media Library /wp-admin/upload.php3.26 ▲0.0337.58 ▲3.86
Custom Social Icons /wp-admin/options-general.php?page=CSI_template3.2631.14

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Custom Social Icons
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲20214.73 ▲0.191.70 ▼0.0938.50 ▼6.33
Dashboard /wp-admin2,357 ▲1696.39 ▲1.48117.51 ▼0.0040.34 ▼7.89
Posts /wp-admin/edit.php2,260 ▲1713.31 ▲1.2955.21 ▲17.1234.32 ▼1.83
Add New Post /wp-admin/post-new.php1,524 ▼917.70 ▼5.28673.63 ▲45.4539.80 ▼14.76
Media Library /wp-admin/upload.php1,396 ▲114.18 ▼0.0889.43 ▼10.1445.87 ▲1.47
Custom Social Icons /wp-admin/options-general.php?page=CSI_template7071.7310.9521.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=CSI_template
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/custom-social-icon/templates/settings.php on line 5 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/custom-social-icon/templates/settings.php(5): do_settings_fields()
    #1 wp-content/plugins/custom-social-icon/custom_social_icon.php(140): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): CSI->CSI_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/custom-social-icon/custom_social_icon.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/custom-social-icon/templates/settings.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
These attributes need to be fixed:
  • Tested up to: Version not formatted correctly
The official readme.txt might help

custom-social-icon/custom_social_icon.php 92% from 13 tests

The primary PHP file in "Custom Social Icons" version 1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-social-icon.php" instead of "custom_social_icon.php")

Code Analysis Passed 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 detected291 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP24615166
JavaScript22028105
CSS22020

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods777.78%
▷ Protected methods222.22%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add.png1.00KB1.35KB0.00%
images/no_image.png3.07KB1.66KB▼ 45.75%
images/remove.png1.23KB1.43KB0.00%