10% before-and-after

Code Review | Before And After: Lead Capture Forms For Wordpress

WordPress plugin Before And After: Lead Capture Forms For Wordpress scored10%from 54 tests.

About plugin

  • Plugin page: before-and-after
  • Plugin version: 3.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.8
  • WordPress version: 6.3.1
  • First release: Aug 2, 2013
  • Latest release: Jul 30, 2021
  • Number of updates: 74
  • Update frequency: every 39.5 days
  • Top authors: richardgabriel (59.46%)ghuger (41.89%)

Code review

54 tests

User reviews

22 reviews

Install metrics

1,000+ active /51,542 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/before-and-after/include/ba.settings.page.class.php+326
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▼1.71MB] [CPU: ▼53.26ms] Passed 4 tests

An overview of server-side resources used by Before And After: Lead Capture Forms For Wordpress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.29 ▼1.177.34 ▼35.53
Dashboard /wp-admin2.31 ▼1.046.50 ▼52.78
Posts /wp-admin/edit.php2.31 ▼1.057.31 ▼39.85
Add New Post /wp-admin/post-new.php2.31 ▼3.586.89 ▼84.86
Media Library /wp-admin/upload.php2.31 ▼0.926.32 ▼26.03
Error /wp-admin/admin.php?page=before_and_after_pro_error_page2.318.17
Upgrade To Pro /wp-admin/admin.php?page=before-and-after-upgrade-to-pro2.318.29
Add New Goal /wp-admin/post-new.php?post_type=b_a_goal2.316.47
About Plugin /wp-admin/admin.php?page=before-and-after-settings_aloha2.317.07
Privacy Notice /wp-admin/admin.php?page=before_and_after_pro_privacy_notice2.317.47
Forms /wp-admin/edit.php?post_type=b_a_form2.318.04
Conversions /wp-admin/admin.php?page=b_a_conversions2.317.07
Settings /wp-admin/admin.php?page=before-and-after-settings2.318.24
Help & Troubleshooting /wp-admin/admin.php?page=b_a_help_and_troubleshooting2.316.75
All Goals /wp-admin/edit.php?post_type=b_a_goal2.317.93

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 140 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_before_after_goal_widget
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Before And After: Lead Capture Forms For Wordpress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,125 ▲39014.14 ▼0.156.06 ▲3.8829.90 ▼20.66
Dashboard /wp-admin2,360 ▲1725.34 ▲0.47110.21 ▲6.5840.48 ▼2.70
Posts /wp-admin/edit.php2,249 ▲1602.48 ▲0.4743.19 ▼1.2837.88 ▲0.41
Add New Post /wp-admin/post-new.php6,388 ▲4,85522.65 ▼0.74885.02 ▲195.4842.41 ▼10.66
Media Library /wp-admin/upload.php1,545 ▲1574.72 ▲0.4694.43 ▼14.6945.85 ▲0.59
Error /wp-admin/admin.php?page=before_and_after_pro_error_page9302.2628.1524.26
Upgrade To Pro /wp-admin/admin.php?page=before-and-after-upgrade-to-pro1,1972.4230.9485.75
Add New Goal /wp-admin/post-new.php?post_type=b_a_goal2,1933.0155.1136.08
About Plugin /wp-admin/admin.php?page=before-and-after-settings_aloha1,0642.2832.3742.16
Privacy Notice /wp-admin/admin.php?page=before_and_after_pro_privacy_notice9382.2827.8623.96
Forms /wp-admin/edit.php?post_type=b_a_form2,1362.3539.8231.80
Conversions /wp-admin/admin.php?page=b_a_conversions3,8272.4234.1945.45
Settings /wp-admin/admin.php?page=before-and-after-settings1,7447.17140.8242.23
Help & Troubleshooting /wp-admin/admin.php?page=b_a_help_and_troubleshooting1,0042.1932.8627.91
All Goals /wp-admin/edit.php?post_type=b_a_goal2,1482.3934.8832.89

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/before-and-after/include/ba.settings.page.class.php+326
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_before_after_goal_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=b_a_goal
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/before-and-after/include/ba.settings.page.class.php+326
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
    • > GET request to /wp-admin/admin.php?page=before-and-after-settings
    • > User deprecated in wp-includes/functions.php+5828
    Hook media_buttons_context is deprecated since version 3.5.0! Use media_buttons instead.

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 13× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/text-field.php
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/image-field.php
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/select-field.php
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/heading-field.php
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/phone-field.php
    • > /wp-content/plugins/before-and-after/include/page.help.php
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/html-field.php
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/checkbox-field.php
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/radio-field.php
    • > /wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/date-field.php
  • 166× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/email-field.php on line 2
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/before-and-after/include/Before_And_After_Update_Notices.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/radio-field.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/checkbox-field.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/date-field.php on line 5
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/phone-field.php on line 7
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/date-field.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/textarea-field.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/before-and-after/blocks/goal.php:50
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/before-and-after/include/lib/GP_Custom_Forms/templates/fields/checkbox-field.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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 is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
Please take inspiration from this readme.txt

before-and-after/before-and-after.php 92% from 13 tests

The main file in "Before And After: Lead Capture Forms For Wordpress" v. 3.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 351 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin22,893 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
PHP461,5993,0249,598
PO File171,4491,9934,842
CSS13313754,236
JavaScript143153381,763
HTML26001,130
SVG100685
JSON500358
Markdown1580281

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity34.42
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes33
▷ Abstract classes00.00%
▷ Concrete classes33100.00%
▷ Final classes00.00%
Methods454
▷ Static methods51.10%
▷ Public methods41992.29%
▷ Protected methods235.07%
▷ Private methods122.64%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants114.29%
▷ Class constants685.71%
▷ Public constants6100.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
11 PNG files occupy 0.39MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/upgrade-conversions.png143.72KB55.03KB▼ 61.71%
assets/img/flags.png86.41KB26.26KB▼ 69.61%
assets/img/upgrade/conversion-list.png35.72KB22.97KB▼ 35.68%
assets/img/upgrade/hubspot-settings.png25.80KB15.11KB▼ 41.46%
assets/img/upgrade/conversion-details-1.png27.88KB15.16KB▼ 45.64%