89% nf-submission-limit-cookie

Code Review | Ninja Forms - Submission Limit Cookie

WordPress plugin Ninja Forms - Submission Limit Cookie scored89%from 54 tests.

About plugin

  • Plugin page: nf-submission-lim...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.8.1
  • WordPress version: 6.3.1
  • First release: Aug 10, 2017
  • Latest release: Aug 10, 2017
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: haet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,606 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.09ms] Passed 4 tests

A check of server-side resources used by Ninja Forms - Submission Limit Cookie
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.61 ▼4.14
Dashboard /wp-admin3.33 ▼0.0247.45 ▼6.90
Posts /wp-admin/edit.php3.38 ▲0.0248.37 ▼1.64
Add New Post /wp-admin/post-new.php5.91 ▲0.0294.15 ▼11.67
Media Library /wp-admin/upload.php3.25 ▲0.0234.68 ▲0.66

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Ninja Forms - Submission Limit Cookie
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.45 ▲0.071.80 ▼0.2345.78 ▲4.14
Dashboard /wp-admin2,206 ▲185.86 ▼0.04108.54 ▲4.1543.11 ▲5.18
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0339.49 ▼2.0934.02 ▼1.28
Add New Post /wp-admin/post-new.php1,544 ▲1418.27 ▲0.24609.91 ▼23.2359.00 ▲3.60
Media Library /wp-admin/upload.php1,388 ▲34.19 ▲0.0397.09 ▼34.0141.33 ▼8.20

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Integrates with NinjaForms restriction settings) image not found
The official readme.txt is a good inspiration

nf-submission-limit-cookie/ninja-forms-submission-limit-cookie.php 85% from 13 tests

The main PHP file in "Ninja Forms - Submission Limit Cookie" ver. 3.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("nf-submission-limit-cookie.php" instead of "ninja-forms-submission-limit-cookie.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin126 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24197126

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods9
▷ Static methods333.33%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.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 images were found in this plugin