87% social-network-user-detection

Code Review | Social Media User Detection

WordPress plugin Social Media User Detection scored 87% from 54 tests.

About plugin

  • Plugin page: social-network-us...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.3.1
  • WordPress version: 5.8.1
  • First release: Feb 22, 2012
  • Latest release: Feb 24, 2012
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: croakingtoad (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 4,421 total downloads

Benchmarks

Plugin footprint Passed 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: ▼146.91ms] Passed 4 tests

A check of server-side resources used by Social Media User Detection
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.74 ▲0.0229.05 ▲9.96
Dashboard /wp-admin3.07 ▲0.0148.28 ▼1.82
Posts /wp-admin/edit.php3.12 ▲0.0145.05 ▼0.37
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.49 ▼577.62
Media Library /wp-admin/upload.php3.01 ▲0.0130.92 ▼7.84
User Detection /wp-admin/options-general.php?page=adapt_smud2.9628.86

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Social Media User Detection
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,764 ▲16816.06 ▲0.4812.22 ▲0.3648.46 ▼10.41
Dashboard /wp-admin2,975 ▲415.91 ▼0.07150.48 ▲0.2899.60 ▼11.63
Posts /wp-admin/edit.php2,744 ▲52.71 ▼0.0071.90 ▼12.6382.11 ▼9.57
Add New Post /wp-admin/post-new.php1,686 ▲7118.69 ▼2.80396.31 ▲84.20102.82 ▼2.03
Media Library /wp-admin/upload.php1,812 ▲55.01 ▼0.01172.56 ▲9.82115.73 ▲0.13
User Detection /wp-admin/options-general.php?page=adapt_smud1,2192.1154.40102.88

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

Smoke tests 50% 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
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=adapt_smud
    • > Notice in wp-content/plugins/social-network-user-detection/social-media-user-detection.php+143
    Trying to access array offset on value of type bool

SRP 50% 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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-network-user-detection/social-media-user-detection.php:47

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Visitors Overview showing segmentation by social media network), #2 (Operating System overview showing segmentation by social media network), #3 (Bounce rate showing segmentation by social media network)
  • Plugin Name: You should set the name of your plugin on the first line ( === social-network-user-detection === )
The official readme.txt might help

social-network-user-detection/social-media-user-detection.php 85% from 13 tests

The main PHP script in "Social Media User Detection" version 1.0.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 147 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("social-network-user-detection.php" instead of "social-media-user-detection.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin192 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23224192

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png7.39KB3.48KB▼ 52.95%
assets/adapt-partners-logo.png13.38KB5.16KB▼ 61.44%
screenshot-2.png15.20KB5.41KB▼ 64.38%
screenshot-1.png7.60KB3.65KB▼ 51.93%