62% karrya-field-service-management-system

Code Review | Karrya Field service management system

WordPress plugin Karrya Field service management system scored62%from 54 tests.

About plugin

  • Plugin page: karrya-field-serv...
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 16, 2021
  • Latest release: May 18, 2023
  • Number of updates: 10
  • Update frequency: every 58.1 days
  • Top authors: wapnishantha (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /768 total downloads

Benchmarks

Plugin footprint 65% 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: ▲0.77MB] [CPU: ▲0.65ms] Passed 4 tests

Analyzing server-side resources used by Karrya Field service management system
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7646.21 ▲4.34
Dashboard /wp-admin4.08 ▲0.7853.87 ▲2.48
Posts /wp-admin/edit.php4.13 ▲0.7855.17 ▲1.12
Add New Post /wp-admin/post-new.php6.68 ▲0.79100.00 ▼5.35
Media Library /wp-admin/upload.php4.00 ▲0.7843.47 ▲4.38
Manage job worker /wp-admin/admin.php?page=fsms_workers3.9138.01
Setting /wp-admin/admin.php?page=fsms_settings4.0946.89
Manage stages /wp-admin/admin.php?page=fsms_stages3.9535.25
Leads /wp-admin/admin.php?page=fsms_leads3.9341.41
Manage sites /wp-admin/admin.php?page=fsms_sites3.9336.98
Manage stock /wp-admin/admin.php?page=fsms_stocks3.9340.13
Manage supplier /wp-admin/admin.php?page=fsms_suppliers3.9135.41
Manage charge type /wp-admin/admin.php?page=fsms_charge_types3.9137.43
Manage departments /wp-admin/admin.php?page=fsms_departments3.9134.19
Manage customers /wp-admin/admin.php?page=fsms_customers3.9540.04

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 99 new files
Database: 11 new tables, 6 new options
New tables
wp_fsms_customer
wp_fsms_stock
wp_fsms_payment
wp_fsms_site
wp_fsms_leads
wp_fsms_lead_log
wp_fsms_stage
wp_fsms_charge_type
wp_fsms_department
wp_fsms_message
...
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Karrya Field service management system
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,015 ▲26914.35 ▼0.037.10 ▲5.3140.16 ▼2.45
Dashboard /wp-admin2,293 ▲1054.99 ▲0.13107.99 ▼2.5878.21 ▲38.35
Posts /wp-admin/edit.php2,177 ▲882.25 ▲0.2237.49 ▼3.6735.04 ▼2.95
Add New Post /wp-admin/post-new.php1,585 ▲6623.25 ▼0.11677.06 ▲31.1238.64 ▼18.26
Media Library /wp-admin/upload.php1,475 ▲904.29 ▲0.0495.57 ▼10.3985.16 ▲36.48
Manage job worker /wp-admin/admin.php?page=fsms_workers8811.8825.9031.09
Setting /wp-admin/admin.php?page=fsms_settings3,08410.75297.21150.30
Manage stages /wp-admin/admin.php?page=fsms_stages9451.8728.5434.74
Leads /wp-admin/admin.php?page=fsms_leads9171.8427.4431.41
Manage sites /wp-admin/admin.php?page=fsms_sites9331.8727.6430.68
Manage stock /wp-admin/admin.php?page=fsms_stocks9721.8327.4731.60
Manage supplier /wp-admin/admin.php?page=fsms_suppliers8781.9225.4229.03
Manage charge type /wp-admin/admin.php?page=fsms_charge_types9291.8528.0732.52
Manage departments /wp-admin/admin.php?page=fsms_departments8971.8524.6826.54
Manage customers /wp-admin/admin.php?page=fsms_customers9491.9425.8634.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall successfully, leaving 11 tables in the database
    • wp_fsms_message
    • wp_fsms_invoice
    • wp_fsms_site
    • wp_fsms_stock
    • wp_fsms_payment
    • wp_fsms_customer
    • wp_fsms_lead_log
    • wp_fsms_leads
    • wp_fsms_stage
    • wp_fsms_charge_type
    • ...
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fsms_departments
    • > Notice in wp-content/plugins/karrya-field-service-management-system/views/departments.php+21
    Undefined variable: odir
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fsms_departments
    • > Notice in wp-content/plugins/karrya-field-service-management-system/views/departments.php+21
    Undefined variable: filters
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fsms_departments
    • > Notice in wp-content/plugins/karrya-field-service-management-system/views/departments.php+21
    Trying to access array offset on value of type null

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 output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/karrya-field-service-management-system/activate.php
    • > /wp-content/plugins/karrya-field-service-management-system/deactivate.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/karrya-field-service-management-system/controllers/leads.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/karrya-field-service-management-system/controllers/users.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/karrya-field-service-management-system/controllers/shortcodes.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/karrya-field-service-management-system/fsms_index.php:15

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

karrya-field-service-management-system/fsms_index.php 92% from 13 tests

The main PHP script in "Karrya Field service management system" version 1.4.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("karrya-field-service-management-system.php" instead of "fsms_index.php")

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin8,422 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
PHP921,5282337,702
JavaScript211014410
CSS1473253
Markdown128057

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity13.30
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes37
▷ Abstract classes00.00%
▷ Concrete classes37100.00%
▷ Final classes00.00%
Methods174
▷ Static methods6537.36%
▷ Public methods17097.70%
▷ Protected methods00.00%
▷ Private methods42.30%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png1.08KB0.23KB▼ 78.70%