69% rate-limiting-for-contact-form-7

Code Review | Rate limiting for Contact Form 7

WordPress plugin Rate limiting for Contact Form 7 scored69%from 54 tests.

About plugin

  • Plugin page: rate-limiting-for...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-5.9.1
  • WordPress version: 6.3.1
  • First release: Feb 13, 2022
  • Latest release: Jul 6, 2023
  • Number of updates: 4
  • Update frequency: every 127.5 days
  • Top authors: zazell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /858 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.53MB] [CPU: ▲5.34ms] Passed 4 tests

This is a short check of server-side resources used by Rate limiting for Contact Form 7
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5840.18 ▼0.28
Dashboard /wp-admin3.90 ▲0.5950.26 ▲4.62
Posts /wp-admin/edit.php3.95 ▲0.5955.56 ▲7.57
Add New Post /wp-admin/post-new.php6.41 ▲0.53102.21 ▲9.45
Media Library /wp-admin/upload.php3.66 ▲0.4344.10 ▲12.76
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.0136.30

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 182 new files
Database: 1 new table, 11 new options
New tables
wp_wpcf7rl
New WordPress options
db_upgraded
theysaidso_admin_options
fs_accounts
wpcf7rl_db_version
widget_theysaidso_widget
wpcf7rl_activated
fs_debug_mode
widget_recent-comments
can_compress_scripts
fs_active_plugins
...

Browser metrics Passed 4 tests

A check of browser resources used by Rate limiting for Contact Form 7
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲9713.19 ▼1.211.75 ▼0.0032.55 ▼9.92
Dashboard /wp-admin2,224 ▲334.86 ▼0.02110.70 ▲10.9944.56 ▼1.50
Posts /wp-admin/edit.php2,110 ▲242.05 ▲0.0740.49 ▲2.8539.71 ▲1.84
Add New Post /wp-admin/post-new.php1,532 ▲1318.60 ▼4.68606.74 ▼16.5351.01 ▼1.22
Media Library /wp-admin/upload.php1,409 ▲244.23 ▲0.00102.97 ▼0.2946.58 ▲1.18
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0781.6823.3427.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/rate-limiting-for-contact-form-7/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie tables were found after uninstall: 1 table
    • wp_wpcf7rl
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • wpcf7rl_db_version
    • fs_accounts
    • fs_active_plugins
    • db_upgraded
    • fs_debug_mode
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Admin settings screen can be found under the Contact main menu item.) image missing
The official readme.txt is a good inspiration

rate-limiting-for-contact-form-7/cf7-ratelimit.php 92% from 13 tests

This is the main PHP file of "Rate limiting for Contact Form 7" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("rate-limiting-for-contact-form-7.php" instead of "cf7-ratelimit.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected33,482 lines of code in 136 files:
LanguageFilesBlank linesComment linesLines of code
PHP1198,00717,22933,223
JavaScript33459194
PO File112552
CSS130013

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity91.37
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes49
▷ Abstract classes24.08%
▷ Concrete classes4795.92%
▷ Final classes00.00%
Methods1,268
▷ Static methods19715.54%
▷ Public methods87969.32%
▷ Protected methods171.34%
▷ Private methods37229.34%
Functions111
▷ Named functions111100.00%
▷ Anonymous functions00.00%
Constants147
▷ Global constants10068.03%
▷ Class constants4731.97%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/screenshot-1.png20.11KB8.38KB▼ 58.31%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%