79% cf-civicrm

Code Review | Caldera Forms CiviCRM

WordPress plugin Caldera Forms CiviCRM scored79%from 54 tests.

About plugin

  • Plugin page: cf-civicrm
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2.4
  • WordPress version: 6.3.1
  • First release: Jun 25, 2019
  • Latest release: Nov 8, 2019
  • Number of updates: 5
  • Update frequency: every 31.4 days
  • Top authors: mecachisenros (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /3,915 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.59ms] Passed 4 tests

Server-side resources used by Caldera Forms CiviCRM
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0044.09 ▲2.47
Dashboard /wp-admin3.31 ▲0.0049.73 ▼4.30
Posts /wp-admin/edit.php3.36 ▲0.0047.42 ▼2.54
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.36 ▼7.15
Media Library /wp-admin/upload.php3.23 ▲0.0040.04 ▼0.36

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 100 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Caldera Forms CiviCRM
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.26 ▼0.111.70 ▼0.0243.88 ▲3.53
Dashboard /wp-admin2,204 ▲275.66 ▲0.0186.19 ▼4.9540.73 ▼7.00
Posts /wp-admin/edit.php2,107 ▲72.01 ▲0.0136.81 ▼1.1336.36 ▼0.26
Add New Post /wp-admin/post-new.php1,556 ▲3023.16 ▲5.64622.61 ▼65.5266.84 ▲12.98
Media Library /wp-admin/upload.php1,409 ▲64.19 ▼0.01109.05 ▲1.5045.57 ▼0.90

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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 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
The following issues need your attention
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cf-civicrm/fields/civicrm_country/preview.php
    • > /wp-content/plugins/cf-civicrm/fields/discount/preview.php
    • > /wp-content/plugins/cf-civicrm/fields/civicrm_premium/preview.php
    • > /wp-content/plugins/cf-civicrm/panels/civicrm.php
    • > /wp-content/plugins/cf-civicrm/fields/civicrm_contact_reference/preview.php
    • > /wp-content/plugins/cf-civicrm/fields/civicrm_state/preview.php
    • > /wp-content/plugins/cf-civicrm/templates/thank-you.php
    • > /wp-content/plugins/cf-civicrm/processors/dummy/dummy_meta.php
  • 55× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/cf-civicrm/fields/civicrm_premium/field.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cf-civicrm/cf-civicrm.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function caldera_forms_civicrm() in wp-content/plugins/cf-civicrm/fields/civicrm_state/field.php:2
    • > PHP Notice
      Undefined variable: field_before in wp-content/plugins/cf-civicrm/fields/civicrm_premium/field.php on line 7
    • > PHP Notice
      Undefined variable: field_before in wp-content/plugins/cf-civicrm/fields/discount/field.php on line 3
    • > PHP Notice
      Undefined variable: wrapper_before in wp-content/plugins/cf-civicrm/fields/civicrm_premium/field.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function caldera_forms_civicrm() in wp-content/plugins/cf-civicrm/fields/civicrm_state/config.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/cf-civicrm/fields/civicrm_contact_reference/field.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cf-civicrm/form-templates/civicrm-organisation-contact.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cf-civicrm/fields/civicrm_premium/field.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: caldera, integration, forms, civicrm

cf-civicrm/cf-civicrm.php Passed 13 tests

The principal PHP file in "Caldera Forms CiviCRM" v. 1.0.5 is loaded by WordPress automatically on each request
38 characters long description:
CiviCRM integration for Caldera Forms.

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
Good job! No executable or dangerous file extensions detected14,853 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
PHP862,5204,3799,811
JavaScript71,1902864,582
CSS2570428
Markdown114032

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity25.83
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes41
▷ Abstract classes00.00%
▷ Concrete classes41100.00%
▷ Final classes00.00%
Methods305
▷ Static methods10.33%
▷ Public methods29697.05%
▷ Protected methods10.33%
▷ Private methods82.62%
Functions76
▷ Named functions11.32%
▷ Anonymous functions7598.68%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin