61% sprout-clients

Code Review | Sprout Clients - CRM and Lead Management

WordPress plugin Sprout Clients - CRM and Lead Management scored61%from 54 tests.

About plugin

  • Plugin page: sprout-clients
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Apr 29, 2016
  • Latest release: Aug 9, 2023
  • Number of updates: 36
  • Update frequency: every 73.8 days
  • Top authors: dancameron (75%)boldgrid (16.67%)avonville1 (11.11%)wvcody (5.56%)

Code review

54 tests

User reviews

6 reviews

Install metrics

60+ active /7,579 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.78MB] [CPU: ▲6.38ms] Passed 4 tests

Analyzing server-side resources used by Sprout Clients - CRM and Lead Management
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.18 ▲0.7241.27 ▲3.80
Dashboard /wp-admin4.12 ▲0.8259.56 ▲10.34
Posts /wp-admin/edit.php4.16 ▲0.8058.94 ▲13.09
Add New Post /wp-admin/post-new.php6.67 ▲0.7899.89 ▲1.64
Media Library /wp-admin/upload.php4.04 ▲0.8146.23 ▲9.72
Leads /wp-admin/edit.php?post_type=sa_client4.1047.57
Sprout Clients /wp-admin/options-general.php?page=sprout-clients4.0440.46
Add Lead /wp-admin/post-new.php?post_type=sa_client4.2159.67
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius4.3840.05

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 305 new files
Database: no new tables, 13 new options
New WordPress options
fs_active_plugins
fs_gdpr
fs_accounts
sc_current_version
widget_recent-posts
can_compress_scripts
sc_load_client_defaults
sc_do_activation_redirect
fs_debug_mode
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by Sprout Clients - CRM and Lead Management
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲13914.60 ▲0.221.61 ▼0.4127.83 ▼17.54
Dashboard /wp-admin2,277 ▲894.90 ▼0.99107.19 ▼0.6840.46 ▲0.40
Posts /wp-admin/edit.php2,163 ▲742.01 ▼0.0540.66 ▲6.3139.71 ▲4.04
Add New Post /wp-admin/post-new.php1,573 ▲4818.47 ▼4.39596.97 ▲20.6351.41 ▼0.91
Media Library /wp-admin/upload.php1,459 ▲684.25 ▲0.0697.01 ▼0.3946.96 ▲2.07
Leads /wp-admin/edit.php?post_type=sa_client1,2312.3236.4731.66
Sprout Clients /wp-admin/options-general.php?page=sprout-clients8621.9027.2023.97
Add Lead /wp-admin/post-new.php?post_type=sa_client4,2933.3067.8763.52
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0881.7026.1426.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/sprout-clients/controllers/updates/freemius-sdk/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 13 options
    • db_upgraded
    • widget_theysaidso_widget
    • sc_do_activation_redirect
    • fs_active_plugins
    • fs_gdpr
    • fs_debug_mode
    • sc_load_client_defaults
    • widget_recent-posts
    • fs_accounts
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sprout-clients/views/messages/plaintext.php
    • > /wp-content/plugins/sprout-clients/views/messages/html.php
  • 66× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/sprout-clients/sprout-clients.php on line 16
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/sprout-clients/controllers/records/Records_Admin_Table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sprout-clients/views/admin/meta-boxes/engagements/history.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sa_form_fields() in wp-content/plugins/sprout-clients/views/admin/meta-boxes/messages/preview-modal.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SC_Post_Type' not found in wp-content/plugins/sprout-clients/models/Notification.php:10
    • > PHP Fatal error
      require(): Failed opening required 'ABSPATHwp-admin/options-head.php' (include_path='.:/usr/share/php') in wp-content/plugins/sprout-clients/views/admin/settings.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sprout-clients/controllers/history/SI_History.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sc_e() in wp-content/plugins/sprout-clients/views/admin/user/profile_fields.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'SC_Controller' not found in wp-content/plugins/sprout-clients/controllers/clients/Clients.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/sprout-clients/views/admin/meta-boxes/clients/associated-users.php:62

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sa_client
    • > Network (severe)
    wp-content/plugins/sprout-clients/resources/admin/plugins/redactor/redactor.css?ver=3.2 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sa_client
    • > Network (severe)
    wp-content/plugins/sprout-clients/resources/admin/plugins/redactor/redactor.min.js?ver=3.2 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Easy to use admin page that any WordPress user is familiar with. Modular meta boxes allows you to set your preferred layout. Need more meta? ACF is fully supported.), #2 (All types and status are filterable, even in combination with each other. Support for Advanced Posts Manager allows for saved more advanced functionality.), #3 (Updating statues of your leads needs to be easy, future automation is going to help tremendously, otherwise a couple clicks with AJAX saving is speedy.)
You can take inspiration from this readme.txt

sprout-clients/sprout-clients.php 77% from 13 tests

The main file in "Sprout Clients - CRM and Lead Management" v. 3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin48,760 lines of code in 242 files:
LanguageFilesBlank linesComment linesLines of code
PHP1688,28517,79436,987
JavaScript532,4947269,688
CSS16175761,488
HTML1351319
Markdown2720219
SVG10032
JSON10027

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity68.16
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes70
▷ Abstract classes57.14%
▷ Concrete classes6592.86%
▷ Final classes00.00%
Methods1,460
▷ Static methods41028.08%
▷ Public methods1,09474.93%
▷ Protected methods312.12%
▷ Private methods33522.95%
Functions155
▷ Named functions14996.13%
▷ Anonymous functions63.87%
Constants179
▷ Global constants10860.34%
▷ Class constants7139.66%
▷ Public constants71100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 1.01MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/admin/img/invoice.png249.38KB62.25KB▼ 75.04%
screenshot-1.png50.49KB50.51KB0.00%
resources/admin/icons/sproutapps-banner.png84.22KB22.94KB▼ 72.77%
screenshot-3.png73.80KB73.91KB0.00%
controllers/updates/freemius-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%