61% sortd

Code Review | SORTD

WordPress plugin SORTD scored61%from 54 tests.

About plugin

  • Plugin page: sortd
  • Plugin version: 3.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 2, 2021
  • Latest release: Nov 28, 2023
  • Number of updates: 119
  • Update frequency: every 6.4 days
  • Top authors: sortd (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

80+ active /6,509 total downloads

Benchmarks

Plugin footprint 64% 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: ▲1.31MB] [CPU: ▲327.97ms] 50% from 4 tests

A check of server-side resources used by SORTD
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 701.56ms on /wp-admin/admin.php?page=sortd_credential_settings)
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 327.97ms on /wp-admin/admin.php?page=sortd-settings)
PageMemory (MB)CPU Time (ms)
Home /4.95 ▲1.49690.34 ▲648.79
Dashboard /wp-admin4.82 ▲1.4756.46 ▼9.58
Posts /wp-admin/edit.php4.82 ▲1.46733.81 ▲682.68
Add New Post /wp-admin/post-new.php6.72 ▲0.82748.27 ▲652.86
Media Library /wp-admin/upload.php4.75 ▲1.5151.63 ▲19.82
Credentials /wp-admin/admin.php?page=sortd_credential_settings4.73701.56
Get Started /wp-admin/admin.php?page=sortd-settings4.7448.03

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 275 new files
Database: no new tables, 12 new options
New WordPress options
theysaidso_admin_options
sortd_is_paid
sortd__services
db_upgraded
can_compress_scripts
widget_theysaidso_widget
sortd_author_sync_success_
sortd_project_details
sortd_activated
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for SORTD
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,978 ▲23113.37 ▼0.977.89 ▲6.1137.94 ▼8.21
Dashboard /wp-admin2,271 ▲965.61 ▼0.1193.33 ▼11.3680.29 ▲36.11
Posts /wp-admin/edit.php2,260 ▲1572.52 ▲0.5642.43 ▲0.1853.47 ▲15.53
Add New Post /wp-admin/post-new.php1,770 ▲24422.85 ▼0.80702.52 ▲88.6123.30 ▼26.19
Media Library /wp-admin/upload.php1,476 ▲764.14 ▼0.04100.03 ▲2.5880.92 ▲39.77
Credentials /wp-admin/admin.php?page=sortd_credential_settings1,0741.8530.8358.08
Get Started /wp-admin/admin.php?page=sortd-settings1,5872.0730.1095.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/sortd/includes/class-sortd-helpers.php+594
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 12 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • sortd__services
    • sortd_project_details
    • sortd_is_paid
    • widget_recent-posts
    • sortd_activated
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sortd_credential_settings
    • > Notice in wp-content/plugins/sortd/admin/class-sortd-utils.php+118
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sortd/public/partials/sortd-public-display.php
    • > /wp-content/plugins/sortd/public/partials/plugin-name-public-display.php
    • > /wp-content/plugins/sortd/admin/partials/sortd-header.php
    • > /wp-content/plugins/sortd/admin/partials/sortd-footer.php
  • 52× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: view_data in wp-content/plugins/sortd/admin/partials/config/field-details.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_data() in wp-content/plugins/sortd/admin/partials/config/display-form.php:14
    • > PHP Notice
      Trying to get property 'size' of non-object in wp-content/plugins/sortd/admin/partials/config/field-render-fileupload.php on line 28
    • > PHP Notice
      Undefined variable: field_details in wp-content/plugins/sortd/admin/partials/config/field-render-fileupload.php on line 23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sortd/admin/partials/config/field-details.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_data() in wp-content/plugins/sortd/admin/partials/sortd-templates.php:23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sortd/admin/partials/config/field-details.php on line 16
    • > PHP Notice
      Undefined variable: view_data in wp-content/plugins/sortd/admin/partials/config/field-details.php on line 16
    • > PHP Warning
      require_once(/var/www/html/wordpress/wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/sortd/admin/all_sync.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'Sortd_Helper' not found in wp-content/plugins/sortd/admin/partials/config/field-details.php:71

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: Please add descriptions for these screenshots #5, #6 in sortd/assets to your readme.txt
Please take inspiration from this readme.txt

sortd/sortd.php Passed 13 tests

The main PHP file in "SORTD" ver. 3.0.1 adds more information about the plugin and also serves as the entry point for this plugin
91 characters long description:
SORTD helps to create a feature-rich native experience of your brand on PWA, Android & iOS.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin86,406 lines of code in 192 files:
LanguageFilesBlank linesComment linesLines of code
CSS176,18548647,903
PHP816,5682,88918,214
JavaScript885,7841,62316,020
Sass1402,835
JSON1001,408
SVG40126

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 120)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity72.95
▷ Minimum class complexity1.00
▷ Maximum class complexity373.00
Average method complexity5.88
▷ Minimum method complexity1.00
▷ Maximum method complexity120.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods296
▷ Static methods5819.59%
▷ Public methods28194.93%
▷ Protected methods00.00%
▷ Private methods155.07%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
46 PNG files occupy 2.93MB with 0.70MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/sortdlogo.png0.34KB0.32KB▼ 6.53%
admin/css/facebook.png2.38KB1.32KB▼ 44.36%
admin/css/check.png0.48KB0.46KB▼ 3.46%
admin/css/ticksuccess.png3.00KB3.00KB0.10%
admin/css/blue.png0.80KB0.29KB▼ 64.48%