83% leaf-crm

Code Review | Leaf CRM

WordPress plugin Leaf CRM scored83%from 54 tests.

About plugin

  • Plugin page: leaf-crm
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 12, 2023
  • Latest release: Aug 2, 2023
  • Number of updates: 7
  • Update frequency: every 10.9 days
  • Top authors: leafcrm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /137 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼6.39ms] Passed 4 tests

Analyzing server-side resources used by Leaf CRM
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1444.71 ▼1.66
Dashboard /wp-admin3.47 ▲0.1752.16 ▼0.73
Posts /wp-admin/edit.php3.59 ▲0.2353.06 ▼15.67
Add New Post /wp-admin/post-new.php6.08 ▲0.1995.90 ▼7.49
Media Library /wp-admin/upload.php3.40 ▲0.1741.77 ▲2.47

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Leaf CRM
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲9514.80 ▲0.522.01 ▲0.0543.55 ▲3.12
Dashboard /wp-admin2,265 ▲855.83 ▲0.2994.83 ▲6.6330.44 ▼16.44
Posts /wp-admin/edit.php2,171 ▲712.29 ▲0.3240.14 ▼4.3332.04 ▼5.04
Add New Post /wp-admin/post-new.php1,704 ▲17622.81 ▼0.24639.21 ▼54.1759.35 ▼23.13
Media Library /wp-admin/upload.php1,535 ▲1354.43 ▲0.24100.98 ▼6.3040.42 ▼4.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/leaf-crm/includes/contact-forms/class-leaf-crm-ninja-form.php
    • > /wp-content/plugins/leaf-crm/admin/partials/leaf-crm-admin-display.php
    • > /wp-content/plugins/leaf-crm/includes/contact-forms/class-leaf-crm-forminator-form.php
    • > /wp-content/plugins/leaf-crm/includes/class-leaf-crm-api.php
    • > /wp-content/plugins/leaf-crm/includes/contact-forms/class-leaf-crm-cf7.php
    • > /wp-content/plugins/leaf-crm/includes/contact-forms/class-leaf-crm-wpforms.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4 in leaf-crm/assets to your readme.txt
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

leaf-crm/leaf-crm.php 92% from 13 tests

"Leaf CRM" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 155 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,690 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP18209590889
CSS38210665
SVG20075
PO File1141856
JavaScript32395

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity5.43
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods53
▷ Static methods1426.42%
▷ Public methods3667.92%
▷ Protected methods00.00%
▷ Private methods1732.08%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants15
▷ Global constants16.67%
▷ Class constants1493.33%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/wordpress-leaf-integration.png25.03KB10.73KB▼ 57.13%
admin/img/contact-forms/ninjaforms.png4.62KB3.78KB▼ 18.04%
admin/img/contact-forms/forminator.png4.90KB2.20KB▼ 55.15%