94% gravity-forms-constant-contact

Code Review | Gravity Forms Constant Contact

WordPress plugin Gravity Forms Constant Contact scored 94% from 54 tests.

About plugin

  • Plugin page: gravity-forms-con...
  • Plugin version: 3.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 5.8.1
  • First release: Sep 1, 2010
  • Latest release: Mar 16, 2021
  • Number of updates: 51
  • Update frequency: every 75.5 days
  • Top authors: katzwebdesign (96.08%)stevehenty (5.88%)

Code review

54 tests

User reviews

14 reviews

Install metrics

9,000+ active / 92,805 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

Server-side resources used by Gravity Forms Constant Contact
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0132.48 ▼2.59
Dashboard /wp-admin3.06 ▲0.0148.08 ▲1.43
Posts /wp-admin/edit.php3.12 ▲0.0143.95 ▼3.42
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.73 ▼554.58
Media Library /wp-admin/upload.php3.01 ▲0.0033.16 ▼2.29

Server storage [IO: ▲1.35MB] [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: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Gravity Forms Constant Contact
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲12116.34 ▲0.609.70 ▲1.3348.49 ▼1.31
Dashboard /wp-admin2,967 ▲366.14 ▼0.03159.28 ▼10.50111.42 ▲5.76
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0167.36 ▲4.2392.07 ▲4.29
Add New Post /wp-admin/post-new.php1,604 ▼7918.84 ▲0.17407.17 ▲12.58105.52 ▼8.06
Media Library /wp-admin/upload.php1,810 ▲35.04 ▲0.02169.00 ▲14.65114.60 ▼3.39

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/gravity-forms-constant-contact/class-gf-constant-contact.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gravity-forms-constant-contact/constantcontact.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'CC_Utility' not found in wp-content/plugins/gravity-forms-constant-contact/api/class.cc_gf_superclass.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/gravity-forms-constant-contact/gravityview-info.php:67

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: gravity forms, mailing list, newsletter, gravity, forms...

gravity-forms-constant-contact/constantcontact.php 92% from 13 tests

This is the main PHP file of "Gravity Forms Constant Contact" version 3.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("gravity-forms-constant-contact.php" instead of "constantcontact.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,749 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP54376081,594
PO File15254155

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity34.86
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods70
▷ Static methods34.29%
▷ Public methods6592.86%
▷ Protected methods22.86%
▷ Private methods34.29%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 1.18MB with 0.87MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png337.14KB89.41KB▼ 73.48%
images/ctct_logo_600x90.png52.25KB13.56KB▼ 74.04%
screenshot-2.png479.80KB136.15KB▼ 71.62%
screenshot-4.png212.68KB53.87KB▼ 74.67%
screenshot-3.png125.47KB34.82KB▼ 72.25%