94% cio-gravity-forms-add-on

Code Review | Customer.io Gravity Forms Add-on

WordPress plugin Customer.io Gravity Forms Add-on scored 94% from 54 tests.

About plugin

  • Plugin page: cio-gravity-forms...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8.1
  • WordPress version: 5.9.2
  • First release: Aug 24, 2017
  • Latest release: Aug 24, 2017
  • Number of updates: 6
  • Update frequency: every 0.7 days
  • Top authors: smartcat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 919 total downloads

Benchmarks

Plugin footprint Passed 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.01MB] [CPU: ▼298.42ms] Passed 4 tests

An overview of server-side resources used by Customer.io Gravity Forms Add-on
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0256.35 ▲4.48
Dashboard /wp-admin3.42 ▲0.0132.23 ▼0.67
Posts /wp-admin/edit.php3.66 ▲0.0136.38 ▲0.92
Add New Post /wp-admin/post-new.php6.89 ▼0.0894.03 ▼1,192.77
Media Library /wp-admin/upload.php3.31 ▲0.0124.59 ▼1.14

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 14 new files
Database: 1 new table, no new options
New tables
wp_cio_events

Browser metrics Passed 4 tests

Customer.io Gravity Forms Add-on: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,784 ▲4015.77 ▲0.136.07 ▼2.282.06 ▼0.22
Dashboard /wp-admin2,909 ▲556.15 ▼0.04117.35 ▼22.89155.37 ▼5.84
Posts /wp-admin/edit.php2,715 ▲273.37 ▲0.0064.28 ▲1.28140.06 ▲0.20
Add New Post /wp-admin/post-new.php1,771 ▲6016.92 ▼4.40417.32 ▼24.81163.41 ▲1.34
Media Library /wp-admin/upload.php1,719 ▲185.52 ▲0.00137.29 ▼10.23188.42 ▲1.09

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cio\\add_action() in wp-content/plugins/cio-gravity-forms-add-on/includes/gravity-forms.php:89
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cio\\add_action() in wp-content/plugins/cio-gravity-forms-add-on/includes/manage-events.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'cio\\ListTable' not found in wp-content/plugins/cio-gravity-forms-add-on/includes/EventsTable.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cio\\add_action() in wp-content/plugins/cio-gravity-forms-add-on/includes/admin-settings.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (Mapping fields from Gravity Form to Customer.io)
You can take inspiration from this readme.txt

cio-gravity-forms-add-on/customer-io.php 92% from 13 tests

The main file in "Customer.io Gravity Forms Add-on" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cio-gravity-forms-add-on.php" instead of "customer-io.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,624 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP117265801,577
CSS111037
JavaScript16010

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity33.00
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces2
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods3358.93%
▷ Protected methods2137.50%
▷ Private methods23.57%
Functions31
▷ Named functions3096.77%
▷ Anonymous functions13.23%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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
No PNG images were found in this plugin