10% wp-social-icon

Code Review | WP SocialIcon

WordPress plugin WP SocialIcon scored 10% from 54 tests.

About plugin

  • Plugin page: wp-social-icon
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.8
  • WordPress version: 5.8.1
  • First release: Sep 9, 2013
  • Latest release: Jan 8, 2014
  • Number of updates: 23
  • Update frequency: every 5.3 days
  • Top authors: Florent73 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,319 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > User deprecated in wp-includes/functions.php+5495
    get_bloginfo was called with an argument that is deprecated since version 2.2.0! The siteurl option is deprecated for the family of bloginfo() functions. Use the url option instead.

Server metrics [RAM: ▼1.83MB] [CPU: ▼192.24ms] Passed 4 tests

This is a short check of server-side resources used by WP SocialIcon
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.80 ▼0.927.53 ▼16.23
Dashboard /wp-admin1.82 ▼1.2412.22 ▼39.32
Posts /wp-admin/edit.php1.82 ▼1.305.52 ▼50.29
Add New Post /wp-admin/post-new.php1.82 ▼3.615.62 ▼644.69
Media Library /wp-admin/upload.php1.82 ▼1.185.50 ▼34.67
WP Social Icon /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php1.828.60

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 3 new options
New WordPress options
wp_socialicon_settings
wp_socialicon_style
wp_socialicon_version

Browser metrics Passed 4 tests

A check of browser resources used by WP SocialIcon
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,689 ▲5215.79 ▲0.2113.07 ▲2.5255.15 ▲5.12
Dashboard /wp-admin2,972 ▲386.11 ▲0.17150.80 ▼25.93125.87 ▼4.53
Posts /wp-admin/edit.php2,744 ▲52.72 ▼0.0065.72 ▼11.3293.81 ▲0.63
Add New Post /wp-admin/post-new.php1,597 ▼1818.75 ▼2.62419.98 ▲75.08118.81 ▼41.55
Media Library /wp-admin/upload.php1,815 ▲85.02 ▼0.01181.87 ▲6.15132.83 ▼1.95
WP Social Icon /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php1,6112.4759.9778.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5495
    get_bloginfo was called with an argument that is deprecated since version 2.2.0! The siteurl option is deprecated for the family of bloginfo() functions. Use the url option instead.
  • Zombie WordPress options were found after uninstall: 1 option
    • wp_socialicon_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > User deprecated in wp-includes/functions.php+5495
    get_bloginfo was called with an argument that is deprecated since version 2.2.0! The siteurl option is deprecated for the family of bloginfo() functions. Use the url option instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+4
    Undefined index: action
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+37
    Undefined index: wpsi_initcss
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+77
    Undefined index: url_facebook
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+81
    Undefined index: url_twitter
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+85
    Undefined index: url_googleplus
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+89
    Undefined index: url_pinterest
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+93
    Undefined index: url_flickr
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+151
    Undefined index: enable_img
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon.php+118
    Undefined variable: pathURL
    • > GET request to /wp-admin/options-general.php?page=wp-social-icon/wp-socialicon.php
    • > Notice in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php+159
    Undefined index: disable_m

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php:12
    • > PHP Notice
      Undefined index: action in wp-content/plugins/wp-social-icon/wp-socialicon-admin.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/wp-social-icon/uninstall.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-social-icon/wp-socialicon.php:23

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Vue générale / Generale view), #2 (Vue du choix de modèle / Models selection view), #3 (Vue des icônes sur votre page / View icons on your page)
You can look at the official readme.txt

wp-social-icon/wp-socialicon.php 85% from 13 tests

The principal PHP file in "WP SocialIcon" v. 1.4 is loaded by WordPress automatically on each request
Please take the time 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
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-social-icon.php" instead of "wp-socialicon.php")

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
Success! There were no dangerous files found in this plugin455 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP35539342
PO File12316888
JavaScript12325

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
38 PNG files occupy 0.21MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/5/facebook.png3.93KB2.80KB▼ 28.94%
images/7/flickr.png1.74KB0.60KB▼ 65.79%
images/2/flickr.png4.08KB2.25KB▼ 44.79%
images/4/flickr.png2.25KB2.02KB▼ 9.96%
images/6/flickr.png2.03KB1.77KB▼ 12.52%