62% connect-sociallymap

Code Review | Sociallymap Connect

WordPress plugin Sociallymap Connect scored 62% from 54 tests.

About plugin

  • Plugin page: connect-sociallymap
  • Plugin version: 3.0.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.1
  • WordPress version: 5.8.1
  • First release: Jan 26, 2016
  • Latest release: Jul 5, 2021
  • Number of updates: 85
  • Update frequency: every 23.4 days
  • Top authors: sociallymap (62.35%)jeanbaptistedu13 (38.82%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 2,713 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼124.05ms] Passed 4 tests

An overview of server-side resources used by Sociallymap Connect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.32 ▲0.4847.08 ▲16.46
Dashboard /wp-admin3.46 ▲0.4067.52 ▲25.83
Posts /wp-admin/edit.php3.50 ▲0.3959.40 ▲5.15
Add New Post /wp-admin/post-new.php5.75 ▲0.32105.55 ▼529.64
Media Library /wp-admin/upload.php3.34 ▲0.3345.72 ▲11.83
Editer lien /wp-admin/admin.php?page=sociallymap-entity-edit3.4938.42
Documentation /wp-admin/admin.php?page=sociallymap-documentation3.4941.00
Add entity /wp-admin/admin.php?page=sociallymap-entity-add3.6043.90
Logs /wp-admin/admin.php?page=sociallymap-logsManager3.3843.78
Supprimer lien /wp-admin/admin.php?page=sociallymap-entity-delete3.4941.65
Diagnostic /wp-admin/admin.php?page=sociallymap-diagnostic3.4944.49
My entities /wp-admin/admin.php?page=sociallymap-entity-list3.4940.67

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 91 new files
Database: 4 new tables, 1 new option
New tables
wp_smc_message_published
wp_smc_entities
wp_smc_entities_categories
wp_smc_logs
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Sociallymap Connect: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,941 ▲30416.30 ▲0.3716.21 ▲5.4544.86 ▼9.43
Dashboard /wp-admin3,018 ▲846.00 ▼0.01142.12 ▼12.21132.05 ▲29.32
Posts /wp-admin/edit.php2,811 ▲722.72 ▲0.0087.04 ▲17.6790.41 ▲4.94
Add New Post /wp-admin/post-new.php1,652 ▼3121.34 ▲2.61298.22 ▼142.33104.68 ▼5.42
Media Library /wp-admin/upload.php1,802 ▼55.07 ▲0.02152.85 ▼20.24138.10 ▲21.06
Editer lien /wp-admin/admin.php?page=sociallymap-entity-edit9222.1336.5450.31
Documentation /wp-admin/admin.php?page=sociallymap-documentation1,2932.1059.7871.57
Add entity /wp-admin/admin.php?page=sociallymap-entity-add1,5272.1159.0564.63
Logs /wp-admin/admin.php?page=sociallymap-logsManager1,3112.1062.9780.14
Supprimer lien /wp-admin/admin.php?page=sociallymap-entity-delete1,8362.9169.9066.14
Diagnostic /wp-admin/admin.php?page=sociallymap-diagnostic1,2712.1254.2064.57
My entities /wp-admin/admin.php?page=sociallymap-entity-list1,1532.0951.4265.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_smc_logs
    • wp_smc_message_published
    • wp_smc_entities
    • wp_smc_entities_categories
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sociallymap-entity-delete
    • > Notice in wp-content/plugins/connect-sociallymap/Controllers/PluginController.php+444
    Undefined index: id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sociallymap-entity-delete
    • > Notice in wp-content/plugins/connect-sociallymap/Models/EntityRepository.php+69
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=sociallymap-entity-edit
    • > Error in wp-content/plugins/connect-sociallymap/Models/Entity.php+184
    Uncaught TypeError: Argument 1 passed to SociallymapConnect\Models\Entity::createFromObject() must be an instance of stdClass, null given, called in wp-content/plugins/connect-sociallymap/Models/EntityRepository.php on line 308 and defined in wp-content/plugins/connect-sociallymap/Models/Entity.php:184
    Stack trace:
    #0 wp-content/plugins/connect-sociallymap/Models/EntityRepository.php(308): SociallymapConnect\Models\Entity::createFromObject()
    #1 wp-content/plugins/connect-sociallymap/Controllers/PluginController.php(487): SociallymapConnect\Models\EntityRepository->findOneById()
    #2 [internal function]: SociallymapConnect\Controllers\PluginController->entityEdit()
    #3 wp-content/plugins/connect-sociallymap/Controllers/BaseController.php(21): call_user_func_array()
    #4 wp-content/plugins/connect-sociallymap/SociallymapConnectPlugin.php(139): SociallymapConnect\Controllers\BaseController::forward()
    #5 /
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sociallymap-entity-delete
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sociallymap-entity-delete
    • > Notice in wp-content/plugins/connect-sociallymap/Controllers/PluginController.php+447
    Trying to access array offset on value of type null

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
The following issues need your attention
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/connect-sociallymap/views/partial/video.php
    • > /wp-content/plugins/connect-sociallymap/views/partial/image.php
    • > /wp-content/plugins/connect-sociallymap/views/documentation_en.php
    • > /wp-content/plugins/connect-sociallymap/views/menu.php
    • > /wp-content/plugins/connect-sociallymap/views/documentation_fr.php
  • 64× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SociallymapConnect\\Enums\\SmartEnum' not found in wp-content/plugins/connect-sociallymap/Configs/SupportedPlugin/YoastConfig.php:7
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/connect-sociallymap/views/partial/pagination.php on line 18
    • > PHP Warning
      require_once(wp-content/plugins/connect-sociallymap/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/connect-sociallymap/tests/Bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/connect-sociallymap/views/partial/readmore.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'SociallymapConnect\\Enums\\SmartEnum' not found in wp-content/plugins/connect-sociallymap/Enums/Media.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'SociallymapConnect\\Includes\\BaseRequesterDriver' not found in wp-content/plugins/connect-sociallymap/tests/Mocks/RequesterMockDriver.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/connect-sociallymap/views/diagnostic.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Error' not found in wp-content/plugins/connect-sociallymap/Includes/Errors/BasePluginError.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/connect-sociallymap/views/partial/imageCredit.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/connect-sociallymap/SociallymapConnectPlugin.php:632

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Options d'une entité), #2 (Exemple d'article publié)
Please take inspiration from this readme.txt

connect-sociallymap/sociallymap.php 92% from 13 tests

Analyzing the main PHP file in "Sociallymap Connect" version 3.0.10
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("connect-sociallymap.php" instead of "sociallymap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin4,625 lines of code in 84 files:
LanguageFilesBlank linesComment linesLines of code
PHP759108293,873
PO File2171199400
CSS2380230
JSON20046
JavaScript116541
XML10019
SVG11016

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.70
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces18
Interfaces0
Traits0
Classes56
▷ Abstract classes23.57%
▷ Concrete classes5496.43%
▷ Final classes00.00%
Methods232
▷ Static methods4720.26%
▷ Public methods19985.78%
▷ Protected methods104.31%
▷ Private methods239.91%
Functions9
▷ Named functions111.11%
▷ Anonymous functions888.89%
Constants54
▷ Global constants00.00%
▷ Class constants54100.00%
▷ Public constants54100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.75MB with 0.30MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png74.38KB21.92KB▼ 70.53%
screenshot-2.png687.83KB240.53KB▼ 65.03%
assets/modalw/cross.png0.47KB0.59KB0.00%
assets/images/icon.png0.38KB0.29KB▼ 23.85%