67% social-linkz

Code Review | Social Linkz

WordPress plugin Social Linkz scored67%from 54 tests.

About plugin

  • Plugin page: social-linkz
  • Plugin version: %s by %s', 'SL_frame...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 9, 2011
  • Latest release: Jun 29, 2023
  • Number of updates: 79
  • Update frequency: every 55.4 days
  • Top authors: sedLex (96.2%)kaizencoders (5.06%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /48,860 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼13.41ms] Passed 4 tests

Analyzing server-side resources used by Social Linkz
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.20 ▼1.14
Dashboard /wp-admin3.31 ▼0.0446.12 ▼23.36
Posts /wp-admin/edit.php3.36 ▲0.0042.46 ▼5.10
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.58 ▼24.02
Media Library /wp-admin/upload.php3.23 ▲0.0034.07 ▲3.17

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 220 new files
Database: 1 new table, 6 new options
New tables
wp_pluginSL_sociallinkz
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Social Linkz
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.22 ▼0.131.73 ▲0.0744.45 ▼0.32
Dashboard /wp-admin2,198 ▲215.56 ▲0.0695.30 ▼12.3744.74 ▼3.79
Posts /wp-admin/edit.php2,100 ▲32.01 ▼0.0236.80 ▲1.1835.22 ▼0.59
Add New Post /wp-admin/post-new.php1,531 ▲523.13 ▲0.04640.11 ▲38.9448.66 ▼4.92
Media Library /wp-admin/upload.php1,403 ▼04.22 ▲0.0395.58 ▲0.8741.83 ▲1.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method sociallinkz::uninstall_removedata() should not be called statically
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/social-linkz/core.class.php
    • > /wp-content/plugins/social-linkz/core.php
    • > /wp-content/plugins/social-linkz/social-linkz.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'core.php' (include_path='.:/usr/share/php') in wp-content/plugins/social-linkz/core/templates/my-plugin.php on line 18
    • > PHP Warning
      require_once(core.php): failed to open stream: No such file or directory in wp-content/plugins/social-linkz/core/templates/my-plugin.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

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
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The configuration page of the plugin), #2 (The buttons)
You can look at the official readme.txt

social-linkz/core.class.php 85% from 13 tests

The primary PHP file in "Social Linkz" version %s by %s', 'SL_frame... is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("social-linkz.php" instead of "core.class.php")
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "%s by %s', 'SL_frame...")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin21,963 lines of code in 92 files:
LanguageFilesBlank linesComment linesLines of code
PO File504,732010,518
PHP201,7462,3299,962
JavaScript7220253836
CSS119714532
Markdown120084
JSON10029
INI2002

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 137)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity46.74
▷ Minimum class complexity1.00
▷ Maximum class complexity340.00
Average method complexity6.35
▷ Minimum method complexity1.00
▷ Maximum method complexity137.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes12.86%
▷ Concrete classes3497.14%
▷ Final classes00.00%
Methods299
▷ Static methods9632.11%
▷ Public methods29498.33%
▷ Protected methods31.00%
▷ Private methods20.67%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants35
▷ Global constants35100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
58 PNG files occupy 0.52MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/img/progressbar.png1.43KB1.25KB▼ 12.96%
img/arrow.png1.20KB0.12KB▼ 89.94%
core/img/tab_trad.png0.90KB1.08KB0.00%
core/img/tab_doc.png0.82KB0.84KB0.00%
img/lnk_twitter_hosted.png7.81KB1.35KB▼ 82.68%