84% gravity-forms-custom-post-types

Code Review | Gravity Forms + Custom Post Types

WordPress plugin Gravity Forms + Custom Post Types scored84%from 54 tests.

About plugin

  • Plugin page: gravity-forms-cus...
  • Plugin version: 3.1.29
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.2
  • WordPress version: 6.3.1
  • First release: Feb 21, 2011
  • Latest release: Oct 11, 2022
  • Number of updates: 67
  • Update frequency: every 63.5 days
  • Top authors: spivurno (59.7%)bradvin (22.39%)claygriffiths (20.9%)

Code review

54 tests

User reviews

46 reviews

Install metrics

20,000+ active /473,190 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: ▼5.55ms] Passed 4 tests

Server-side resources used by Gravity Forms + Custom Post Types
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.43 ▼5.98
Dashboard /wp-admin3.31 ▲0.0147.60 ▼6.29
Posts /wp-admin/edit.php3.36 ▲0.0051.58 ▲0.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.23 ▼5.92
Media Library /wp-admin/upload.php3.23 ▲0.0036.40 ▼4.02

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gravity Forms + Custom Post Types
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4214.38 ▲0.161.72 ▼0.0240.34 ▼6.70
Dashboard /wp-admin2,209 ▲295.54 ▼0.3183.20 ▼10.3342.29 ▼3.79
Posts /wp-admin/edit.php2,115 ▲152.03 ▲0.0239.34 ▼1.9637.59 ▼0.87
Add New Post /wp-admin/post-new.php1,559 ▲3323.19 ▲5.69644.96 ▼56.3747.17 ▼7.42
Media Library /wp-admin/upload.php1,417 ▲144.22 ▼0.0598.31 ▼11.1346.46 ▲3.03

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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 fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gravity-forms-custom-post-types/gfcptaddon.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GFCPTAddonBase' not found in wp-content/plugins/gravity-forms-custom-post-types/gfcptaddon_1-5.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Frontend: Example of mapping to a custom post type and multiple taxonomies), #2 (Frontend: Example of hierarchical taxonomy support), #3 (Setting: Mapping to a custom post type), #4 (Setting: Mapping a field to a custom taxonomy), #5 (Setting: Assigning generated post to selected parent post), #6 (Frontend: Example of Single Line Text field with Enhanced UI enabled), #7 (Setting: Mapping a Single Line Text field to a taxonomy (and enabling Enhanced UI))
You can look at the official readme.txt

gravity-forms-custom-post-types/gfcptaddon.php 92% from 13 tests

Analyzing the main PHP file in "Gravity Forms + Custom Post Types" version 3.1.29
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gravity-forms-custom-post-types.php" instead of "gfcptaddon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,354 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP3232183738
CSS23469308
JavaScript455148308

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity33.00
▷ Minimum class complexity9.00
▷ Maximum class complexity73.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods52
▷ Static methods815.38%
▷ Public methods4790.38%
▷ Protected methods23.85%
▷ Private methods35.77%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
20 PNG files occupy 0.40MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png51.85KB19.82KB▼ 61.78%
screenshot-5.png75.63KB31.22KB▼ 58.72%
css/custom/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
css/custom/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
css/custom/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%