84% ngp-forms

Code Review | NGP Forms

WordPress plugin NGP Forms scored84%from 54 tests.

About plugin

  • Plugin page: ngp-forms
  • Plugin version: 1.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.8.1
  • WordPress version: 6.3.1
  • First release: Jun 7, 2013
  • Latest release: May 2, 2018
  • Number of updates: 24
  • Update frequency: every 74.6 days
  • Top authors: signalfade (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,177 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▲1.04ms] Passed 4 tests

Server-side resources used by NGP Forms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0347.32 ▲3.00
Dashboard /wp-admin3.34 ▲0.0455.09 ▼3.57
Posts /wp-admin/edit.php3.39 ▲0.0457.85 ▲7.05
Add New Post /wp-admin/post-new.php5.92 ▲0.0398.44 ▲0.32
Media Library /wp-admin/upload.php3.27 ▲0.0441.47 ▲4.39

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for NGP Forms
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.72 ▲0.161.60 ▼1.1543.36 ▲0.45
Dashboard /wp-admin2,195 ▲245.64 ▼0.0394.24 ▼10.8837.26 ▼9.23
Posts /wp-admin/edit.php2,100 ▲32.02 ▼0.0142.72 ▲4.6635.36 ▼0.30
Add New Post /wp-admin/post-new.php1,526 ▼223.08 ▼0.06666.42 ▼38.8770.57 ▲17.09
Media Library /wp-admin/upload.php1,400 ▲34.24 ▲0.1098.65 ▼11.6045.46 ▼4.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ngp-forms/ngp-donation-frontend.php:94
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ngp-forms/ngp-donation-frontend.php:94
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ngp-forms/ngp-signup-frontend.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'NGPSignupFrontend' not found in wp-content/plugins/ngp-forms/ngp-new-wave-frontend.php:576
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ngp-forms/ngp-volunteer-frontend.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: signup, fundraising, voter action network, politics, fec...

ngp-forms/ngp-forms.php Passed 13 tests

"NGP Forms" version 1.2.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
64 characters long description:
Integrate NGP donation, volunteer, & signup forms with your site

Code Analysis 97% from 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 plugin2,916 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP82676922,916

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 123)
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity107.86
▷ Minimum class complexity19.00
▷ Maximum class complexity203.00
Average method complexity14.59
▷ Minimum method complexity1.00
▷ Maximum method complexity123.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods52
▷ Static methods00.00%
▷ Public methods52100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions1995.00%
▷ Anonymous functions15.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
credit-card-logos-amex.png10.28KB3.69KB▼ 64.14%
credit-card-logos.png8.36KB3.49KB▼ 58.26%