84% bct-for-gravity-forms

Code Review | BCT for Gravity Forms

WordPress plugin BCT for Gravity Forms scored 84% from 54 tests.

About plugin

  • Plugin page: bct-for-gravity-f...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 26, 2020
  • Latest release: Jun 3, 2023
  • Number of updates: 9
  • Update frequency: every 119.1 days
  • Top authors: zerozendesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 541 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.37ms] Passed 4 tests

Analyzing server-side resources used by BCT for Gravity Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.15 ▼6.43
Dashboard /wp-admin3.33 ▲0.0244.88 ▼3.93
Posts /wp-admin/edit.php3.38 ▲0.0248.14 ▲1.64
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.34 ▼8.75
Media Library /wp-admin/upload.php3.25 ▲0.0238.32 ▲2.87

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by BCT for Gravity Forms
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲17314.12 ▼0.256.03 ▲4.3142.00 ▼4.34
Dashboard /wp-admin2,205 ▲145.87 ▲0.82100.74 ▼4.4639.23 ▼1.97
Posts /wp-admin/edit.php2,091 ▲22.02 ▲0.0237.73 ▲0.8832.21 ▲1.44
Add New Post /wp-admin/post-new.php1,542 ▲718.30 ▼4.97615.53 ▼104.5148.95 ▼13.67
Media Library /wp-admin/upload.php1,387 ▼14.31 ▲0.11101.22 ▼1.8541.77 ▼1.10

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/bct-for-gravity-forms/gf-button-text-addon.php:13

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, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: gravity forms, addon, button click text

bct-for-gravity-forms/gf-button-text-addon.php 85% from 13 tests

The main file in "BCT for Gravity Forms" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("bct-for-gravity-forms.php" instead of "gf-button-text-addon.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 226 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected165 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP147884
JavaScript151681

PHP code Passed 2 tests

An short overview of 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.23
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity3.00
▷ Minimum method complexity3.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods1100.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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 files were detected