73% user-sync

Code Review | User Sync - Remote User Sync

WordPress plugin User Sync - Remote User Sync scored73%from 54 tests.

About plugin

  • Plugin page: user-sync
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.3
  • WordPress version: 6.3.1
  • First release: Apr 27, 2022
  • Latest release: Aug 13, 2023
  • Number of updates: 14
  • Update frequency: every 33.9 days
  • Top authors: prashantrajkhurana (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /8,037 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼8.47ms] Passed 4 tests

This is a short check of server-side resources used by User Sync - Remote User Sync
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2034.28 ▼4.25
Dashboard /wp-admin3.34 ▼0.0144.89 ▼20.14
Posts /wp-admin/edit.php3.45 ▲0.0945.96 ▲0.96
Add New Post /wp-admin/post-new.php5.92 ▲0.0388.88 ▼10.44
Media Library /wp-admin/upload.php3.26 ▲0.0333.42 ▲1.51

Server storage [IO: ▲0.93MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 61 new files
Database: 2 new tables, 6 new options
New tables
mo_user_sync_triggers
mo_user_sync_remote_server_list
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

User Sync - Remote User Sync: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.56 ▼1.032.02 ▲0.2142.92 ▼3.41
Dashboard /wp-admin2,224 ▲365.82 ▼0.04102.84 ▼13.0274.82 ▲31.27
Posts /wp-admin/edit.php2,110 ▲241.97 ▼0.0439.04 ▲2.9535.50 ▼0.72
Add New Post /wp-admin/post-new.php1,535 ▲1618.23 ▼5.09687.44 ▲55.9762.23 ▲9.05
Media Library /wp-admin/upload.php1,406 ▲244.21 ▲0.0096.61 ▼0.4366.64 ▲27.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • mo_user_sync_triggers
    • mo_user_sync_remote_server_list
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/user-sync/Handlers/mo-user-sync-http-requests-handler.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/user-sync/Views/mo-user-sync-bulk-action-user.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-sync/mo_user_sync_remote_table.php on line 2
    • > PHP Warning
      require_once(MO_USER_SYNC_PLUGIN_DIRHandlers/EncryptionHandler.php): failed to open stream: No such file or directory in wp-content/plugins/user-sync/Core/nextCloud/NextCloudAuthorizationHandler.php on line 9
    • > PHP Warning
      require_once(MO_USER_SYNC_PLUGIN_DIRHandlers/EncryptionHandler.php): failed to open stream: No such file or directory in wp-content/plugins/user-sync/Core/nextCloud/NextCloudAuthorizationHandler.php on line 9
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/user-sync/mo_user_sync_remote_table.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/user-sync/mo-user-sync-main.php:15
    • > PHP Fatal error
      require_once(): Failed opening required 'MO_USER_SYNC_PLUGIN_DIRHandlers/EncryptionHandler.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-sync/Core/nextCloud/NextCloudAuthorizationHandler.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'MO_USER_SYNC_PLUGIN_DIRHandlers/EncryptionHandler.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-sync/Core/nextCloud/NextCloudAuthorizationHandler.php on line 9
    • > PHP Warning
      Use of undefined constant MO_USER_SYNC_PLUGIN_DIR - assumed 'MO_USER_SYNC_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-sync/Core/nextCloud/NextCloudAuthorizationHandler.php on line 9

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 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

user-sync/mo-user-sync-main.php 92% from 13 tests

The main PHP script in "User Sync - Remote User Sync" version 1.0.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("user-sync.php" instead of "mo-user-sync-main.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 plugin5,297 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
CSS4537942,668
PHP33390352,413
XML800173
JavaScript211043

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.23
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces3
Interfaces0
Traits1
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods93
▷ Static methods1819.35%
▷ Public methods8995.70%
▷ Protected methods11.08%
▷ Private methods33.23%
Functions20
▷ Named functions1995.00%
▷ Anonymous functions15.00%
Constants32
▷ Global constants26.25%
▷ Class constants3093.75%
▷ Public constants30100.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
13 PNG files occupy 0.70MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Images/miniorange.png0.44KB0.35KB▼ 18.61%
Images/tableau.png104.16KB23.61KB▼ 77.33%
Images/lock.png0.72KB0.50KB▼ 30.26%
Views/Images/smile.png17.89KB8.79KB▼ 50.86%
Images/talent-lms.png229.95KB70.37KB▼ 69.40%