62% sellsy

Code Review | Sellsy

WordPress plugin Sellsy scored62%from 54 tests.

About plugin

  • Plugin page: sellsy
  • Plugin version: 2.3.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Jun 27, 2018
  • Latest release: Feb 15, 2023
  • Number of updates: 114
  • Update frequency: every 14.9 days
  • Top authors: sellsy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /12,717 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.90MB] [CPU: ▼38.68ms] Passed 4 tests

A check of server-side resources used by Sellsy
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.06 ▼0.4016.66 ▼25.77
Dashboard /wp-admin3.11 ▼0.1918.81 ▼29.81
Posts /wp-admin/edit.php3.11 ▼0.2420.92 ▼26.80
Add New Post /wp-admin/post-new.php3.11 ▼2.7717.79 ▼72.33
Media Library /wp-admin/upload.php3.11 ▼0.1218.66 ▼15.09
Setting /wp-admin/admin.php?page=idSousMenu33.1117.53
Sellsy /wp-admin/admin.php?page=idSellsy3.1124.21
Support ticket /wp-admin/admin.php?page=idSousMenu13.1117.96
Contact /wp-admin/admin.php?page=idSousMenu23.1119.98

Server storage [IO: ▲1.46MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 80 new files
Database: 7 new tables, 6 new options
New tables
wp_sellsy_setting
wp_sellsy_ticket
wp_sellsy_contact
wp_sellsy_contact_form
wp_sellsy_version
wp_sellsy_error
wp_sellsy_ticket_form
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Sellsy
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,926 ▲16513.99 ▼0.309.06 ▲7.4242.03 ▼1.59
Dashboard /wp-admin2,237 ▲605.78 ▲0.2081.22 ▼6.7066.62 ▲24.37
Posts /wp-admin/edit.php2,139 ▲392.11 ▲0.0933.41 ▼2.5432.17 ▼7.66
Add New Post /wp-admin/post-new.php1,562 ▲3421.17 ▼2.08742.65 ▲70.7758.58 ▼7.61
Media Library /wp-admin/upload.php1,436 ▲394.26 ▲0.11106.99 ▲12.7381.33 ▲37.92
Setting /wp-admin/admin.php?page=idSousMenu31,0982.1324.7829.68
Sellsy /wp-admin/admin.php?page=idSellsy9992.1923.9041.21
Support ticket /wp-admin/admin.php?page=idSousMenu18852.1024.7626.76
Contact /wp-admin/admin.php?page=idSousMenu28952.1025.3129.13

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idSousMenu2
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sellsy/libs/intl-tel-input/index2.php
    • > /wp-content/plugins/sellsy/view/manuel.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/sellsy/tests/ToolsControllerTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/sellsy/tests/SellsyCustomFieldsControllerTest.php:12

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 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 require attention:
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4, #5 in sellsy/assets to your readme.txt
You can take inspiration from this readme.txt

sellsy/index.php 92% from 13 tests

The main PHP script in "Sellsy" version 2.3.3 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sellsy.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin13,452 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
PHP521,5421,9569,451
JavaScript6396782,376
CSS328521,054
PO File1307582500
XML28839
JSON10024
Markdown1708

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 329)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity43.76
▷ Minimum class complexity1.00
▷ Maximum class complexity505.00
Average method complexity8.79
▷ Minimum method complexity1.00
▷ Maximum method complexity329.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes37
▷ Abstract classes00.00%
▷ Concrete classes37100.00%
▷ Final classes00.00%
Methods183
▷ Static methods2815.30%
▷ Public methods18198.91%
▷ Protected methods00.00%
▷ Private methods21.09%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants16
▷ Global constants16100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.27MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/intl-tel-input/build/img/flags.png64.41KB23.38KB▼ 63.70%
images/icones/download.png0.70KB0.79KB0.00%
images/icones/logo-big.png37.50KB7.08KB▼ 81.11%
images/icones/icone_less.png0.29KB0.39KB0.00%
images/icones/logo.png1.28KB0.52KB▼ 59.41%