67% dyapress

Code Review | DyaPress ERP/CRM

WordPress plugin DyaPress ERP/CRM scored67%from 54 tests.

About plugin

  • Plugin page: dyapress
  • Plugin version: 18.0.2.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Apr 18, 2019
  • Latest release: Oct 13, 2023
  • Number of updates: 121
  • Update frequency: every 13.6 days
  • Top authors: aytechnet (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /9,391 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.37MB] [CPU: ▼0.14ms] Passed 4 tests

Analyzing server-side resources used by DyaPress ERP/CRM
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.11 ▲0.75
Dashboard /wp-admin9.80 ▲6.50138.95 ▲88.54
Posts /wp-admin/edit.php3.85 ▲0.5048.16 ▼2.50
Add New Post /wp-admin/post-new.php6.37 ▲0.4886.92 ▼2.96
Media Library /wp-admin/upload.php3.71 ▲0.4941.88 ▲4.17

Server storage [IO: ▲207.13MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please fix the following
  • Total filesystem usage must be limited to 25MB (currently using 207.13MB)
Filesystem: 14,459 new files
Database: no new tables, 7 new options
New WordPress options
dyapress_options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for DyaPress ERP/CRM
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1414.28 ▼0.351.71 ▼0.2443.52 ▲0.82
Dashboard /wp-admin2,194 ▲175.52 ▼0.1381.83 ▼2.1475.35 ▲33.06
Posts /wp-admin/edit.php2,111 ▲81.96 ▼0.0336.78 ▼0.9235.75 ▲2.71
Add New Post /wp-admin/post-new.php1,566 ▲4018.18 ▼5.36712.64 ▲27.8057.81 ▲3.36
Media Library /wp-admin/upload.php1,408 ▲84.20 ▲0.0392.63 ▼7.2463.20 ▲17.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2256× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/dyapress/core/boxes/box_accountancy_last_manual_entries.php
    • > /wp-content/plugins/dyapress/asset/admin/setup.php
    • > /wp-content/plugins/dyapress/product/stock/stocktransfer/stocktransfer_note.php
    • > /wp-content/plugins/dyapress/hrm/lib/hrm_skilldet.lib.php
    • > /wp-content/plugins/dyapress/ecm/dir_add_card.php
    • > /wp-content/plugins/dyapress/core/bookmarks_page.php
    • > /wp-content/plugins/dyapress/fourn/class/fournisseur.commande.dispatch.class.php
    • > /wp-content/plugins/dyapress/societe/class/api_thirdparties.class.php
    • > /wp-content/plugins/dyapress/asset/model/card.php
    • > /wp-content/plugins/dyapress/fourn/commande/note.php
  • 1385× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/dyapress/includes/webklex/php-imap/vendor/symfony/polyfill-mbstring/bootstrap80.php on line 15
    • > PHP Fatal error
      Uncaught Error: Interface 'Swift_Mime_ContentEncoder' not found in wp-content/plugins/dyapress/includes/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Illuminate\\Contracts\\Support\\ValidatedData' not found in wp-content/plugins/dyapress/includes/webklex/php-imap/vendor/illuminate/support/ValidatedInput.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'OAuth\\Common\\Storage\\Exception\\StorageException' not found in wp-content/plugins/dyapress/includes/OAuth/Common/Storage/Exception/AuthorizationStateNotFoundException.php:8
    • > PHP Warning
      Use of undefined constant DB_PASSWORD - assumed 'DB_PASSWORD' (this will throw an Error in a future version of PHP) in wp-content/plugins/dyapress/dyapress-init.php on line 79
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/dyapress/includes/stripe/stripe-php/lib/Service/SubscriptionService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/dyapress/includes/stripe/stripe-php/lib/TestHelpers/TestClock.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Sabre\\CalDAV\\Backend\\AbstractBackend' not found in wp-content/plugins/dyapress/includes/sabre/sabre/dav/lib/CalDAV/Backend/SimplePDO.php:36
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/dyapress/includes/tecnickcom/tcpdf/tcpdf.php on line 4834
    • > PHP Fatal error
      Uncaught Error: Interface 'PhpOffice\\PhpSpreadsheet\\RichText\\ITextElement' not found in wp-content/plugins/dyapress/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration 93% 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
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === dyapress === )
You can take inspiration from this readme.txt

dyapress/dyapress.php 92% from 13 tests

The main PHP script in "DyaPress ERP/CRM" version 18.0.2.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/dyapress/includes/stripe/stripe-php/data/ca-certificates.crt
      • wp-content/plugins/dyapress/includes/tecnickcom/tcpdf/examples/data/cert/tcpdf.crt
1,646,750 lines of code in 6,447 files:
LanguageFilesBlank linesComment linesLines of code
PHP4,265203,582389,9731,035,375
JavaScript84242,98441,987382,645
JSON452066,857
SQL8125,12221,77758,695
YAML1342625,268
SVG19443218,418
CSS784,70370918,055
XML85016,418
Markdown1073,965011,789
Sass19507344,745
LESS18504554,698
HTML32224281,920
TypeScript25741,259
Blade71826261
Python262103223
AsciiDoc2784122
Bourne Shell1002

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,386)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity34.09
▷ Minimum class complexity1.00
▷ Maximum class complexity4,386.00
Average method complexity5.61
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces260
Interfaces284
Traits57
Classes2,307
▷ Abstract classes1757.59%
▷ Concrete classes2,13292.41%
▷ Final classes100.47%
Methods20,565
▷ Static methods2,09210.17%
▷ Public methods17,77786.44%
▷ Protected methods1,7018.27%
▷ Private methods1,0875.29%
Functions1,877
▷ Named functions1,42175.71%
▷ Anonymous functions45624.29%
Constants4,338
▷ Global constants1,17627.11%
▷ Class constants3,16272.89%
▷ Public constants3,16099.94%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1011 compressed PNG files occupy 2.54MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
theme/eldy/img/object_phoning.png0.33KB0.39KB0.00%
theme/md/img/object_dir.png0.10KB0.14KB0.00%
theme/eldy/img/object_holiday.png0.73KB0.88KB0.00%
theme/md/img/object_intervention.png0.26KB0.58KB0.00%
theme/common/flags/en.png0.29KB0.29KB0.00%