83% socialn-social-notifications

Code Review | SocialN - Social Notifications

WordPress plugin SocialN - Social Notifications scored83%from 54 tests.

About plugin

  • Plugin page: socialn-social-no...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 6, 2018
  • Latest release: Sep 6, 2018
  • Number of updates: 7
  • Update frequency: every 0.4 days
  • Top authors: alfaron (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /804 total downloads

Benchmarks

Plugin footprint 83% 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.06MB] [CPU: ▼9.05ms] Passed 4 tests

A check of server-side resources used by SocialN - Social Notifications
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0739.63 ▲3.18
Dashboard /wp-admin3.37 ▲0.0344.50 ▼13.65
Posts /wp-admin/edit.php3.49 ▲0.1346.23 ▼3.31
Add New Post /wp-admin/post-new.php5.95 ▲0.0780.17 ▼22.43
Media Library /wp-admin/upload.php3.30 ▲0.0733.40 ▲4.83
SocialN /wp-admin/options-general.php?page=socialn3.2735.58

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

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

Browser metrics Passed 4 tests

SocialN - Social Notifications: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.071.77 ▲0.2141.52 ▲5.87
Dashboard /wp-admin2,199 ▲185.56 ▼0.1189.39 ▼9.3339.26 ▼2.97
Posts /wp-admin/edit.php2,104 ▲41.97 ▼0.0739.76 ▼1.5637.14 ▼0.99
Add New Post /wp-admin/post-new.php1,529 ▼323.12 ▲0.29679.75 ▲30.1257.95 ▼2.31
Media Library /wp-admin/upload.php1,401 ▲14.17 ▼0.04102.44 ▲1.3944.00 ▲0.70
SocialN /wp-admin/options-general.php?page=socialn1,1972.4653.3154.04

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/socialn-social-notifications/admin/partials/socialn-admin-display.php:26
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/socialn-social-notifications/admin/partials/socialn-admin-display.php on line 16
    • > PHP Notice
      Undefined variable: styles in wp-content/plugins/socialn-social-notifications/admin/partials/socialn-admin-display.php on line 16

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 86% 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:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can take inspiration from this readme.txt

socialn-social-notifications/socialn.php 77% from 13 tests

Analyzing the main PHP file in "SocialN - Social Notifications" version 1.0.0
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("socialn-social-notifications.php" instead of "socialn.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
There were no executable files found in this plugin10,057 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,0961,0569,369
PHP12136528348
CSS25127340

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.30
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/logo.png5.29KB3.64KB▼ 31.09%