84% teamleader-form-integration

Code Review | Teamleader CRM Forms

WordPress plugin Teamleader CRM Forms scored84%from 54 tests.

About plugin

  • Plugin page: teamleader-form-i...
  • Plugin version: 2.3.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2018
  • Latest release: Jan 10, 2023
  • Number of updates: 25
  • Update frequency: every 74.5 days
  • Top authors: teamleader (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /5,963 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼4.46ms] Passed 4 tests

Server-side resources used by Teamleader CRM Forms
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1842.25 ▲0.32
Dashboard /wp-admin3.54 ▲0.2352.18 ▼0.72
Posts /wp-admin/edit.php3.59 ▲0.2347.60 ▼6.75
Add New Post /wp-admin/post-new.php6.06 ▲0.1785.82 ▼10.50
Media Library /wp-admin/upload.php3.40 ▲0.1736.48 ▲0.12
Teamleader /wp-admin/options-general.php?page=teamleader3.4538.71

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 61 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Teamleader CRM Forms
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.63 ▲0.271.73 ▼0.6543.86 ▼0.22
Dashboard /wp-admin2,202 ▲255.62 ▲0.0196.57 ▲9.3443.25 ▼2.63
Posts /wp-admin/edit.php2,104 ▲11.99 ▼0.0035.88 ▼2.6433.17 ▼1.59
Add New Post /wp-admin/post-new.php1,539 ▲1018.12 ▼4.85649.62 ▼46.8990.16 ▲34.39
Media Library /wp-admin/upload.php1,404 ▲44.22 ▲0.0098.49 ▼10.5544.96 ▼3.37
Teamleader /wp-admin/options-general.php?page=teamleader9732.3023.7049.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Teamleader\\Controllers\\AbstractController' not found in wp-content/plugins/teamleader-form-integration/src/Controllers/AjaxController.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/teamleader-form-integration/vendor/google/recaptcha/tests/ReCaptcha/ReCaptchaTest.php:29
    • > PHP Warning
      require_once(wp-content/plugins/teamleader-form-integration/vendor/google/recaptcha/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/teamleader-form-integration/vendor/google/recaptcha/examples/example-captcha.php on line 36
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/teamleader-form-integration/vendor/google/recaptcha/tests/ReCaptcha/ResponseTest.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Teamleader\\Interfaces\\DependencyInterface' not found in wp-content/plugins/teamleader-form-integration/src/Helpers/AbstractHelper.php:12
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/teamleader-form-integration/vendor/google/recaptcha/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/teamleader-form-integration/vendor/google/recaptcha/examples/example-captcha.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/teamleader-form-integration/templates/admin.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Teamleader\\Helpers\\AbstractHelper' not found in wp-content/plugins/teamleader-form-integration/src/Helpers/FieldsHelper.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/teamleader-form-integration/vendor/google/recaptcha/tests/ReCaptcha/RequestParametersTest.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/teamleader-form-integration/vendor/google/recaptcha/tests/ReCaptcha/RequestMethod/PostTest.php:31

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

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: These screenshots require images: #1 ('/assets/1._CRM_Manage_your_contacts.png'), #2 ('/assets/1._Invoicing_time_records.png'), #3 ('/assets/1._Sales_Automate_your_sales_process.png'), #4 ('/assets/2._Calendar_Manage_your_appointments.png'), #5 ('/assets/2._CRM_action_summary.png'), #6 ('/assets/2._Deals.png'), #7 ('/assets/2._Invoicing_automate_your_recurring_business.png'), #8 ('/assets/3._Calendar_Synchronise_your_calendar.png'), #9 ('/assets/3._Calendar_view.png'), #10 ('/assets/3._CRM_Simple_client_segmentation.png'), #11 ('/assets/4._Invoicing_manage_uninvoiced_time.png'), #12 ('/assets/4._Sales_manage_your_sales_team.png'), #13 ('/assets/6._Invoicing_Link_with_the_accounting.png'), #14 ('/assets/banner-1544x500.png'), #15 ('/assets/icon-256x256.png'), #16 ('/assets/icon.svg'), #17 ('/assets/Project_management_Manage_all_your_projects_project_planning.png'), #18 ('/assets/Project_management_Manage_all_your_projects_projects.png'), #19 ('/assets/project_management_plan_a_project_people.png'), #20 ('/assets/Project_management_Start_a_new_project_2.png'), #21 ('/assets/Project_management_Start_a_new_project.png'), #22 ('/assets/Stats_Invoices.png'), #23 ('/assets/Ticket_message_view.png'), #24 ('/assets/Tickets_add_ticket.png'), #25 ('/assets/Tickets_flow.png'), #26 ('/assets/Tickets_general_view.png'), #27 ('/assets/Time_tracking_follow_up_with_your_employees.png'), #28 ('/assets/Work_orders_on_the_road.png')
The official readme.txt might help

teamleader-form-integration/plugin.php 92% from 13 tests

"Teamleader CRM Forms" version 2.3.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("teamleader-form-integration.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,517 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP404121,1791,973
JavaScript271269
Markdown3330115
JSON20077
CSS39251
XML10017
YAML14015

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity5.67
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces4
Traits0
Classes26
▷ Abstract classes27.69%
▷ Concrete classes2492.31%
▷ Final classes00.00%
Methods112
▷ Static methods1412.50%
▷ Public methods10593.75%
▷ Protected methods65.36%
▷ Private methods10.89%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/image/logo.png0.37KB0.36KB▼ 1.07%