78% contact-form-to-any-api

Code Review | Contact Form to Any API

WordPress plugin Contact Form to Any API scored78%from 54 tests.

About plugin

  • Plugin page: contact-form-to-a...
  • Plugin version: 1.1.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 7, 2022
  • Latest release: Nov 29, 2023
  • Number of updates: 32
  • Update frequency: every 15.9 days
  • Top authors: itpathsolutions (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /17,857 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

This is a short check of server-side resources used by Contact Form to Any API
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.93 ▼6.39
Dashboard /wp-admin3.31 ▼0.0444.63 ▼15.96
Posts /wp-admin/edit.php3.36 ▲0.0049.30 ▲3.64
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.17 ▼7.96
Media Library /wp-admin/upload.php3.23 ▲0.0032.48 ▼2.35

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Contact Form to Any API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.34 ▲0.001.59 ▼0.1436.20 ▼6.35
Dashboard /wp-admin2,195 ▲185.62 ▼0.0493.61 ▲4.5744.47 ▲3.87
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0639.22 ▲0.5535.72 ▼1.90
Add New Post /wp-admin/post-new.php1,529 ▼1523.37 ▼1.77585.00 ▼21.8751.78 ▼18.70
Media Library /wp-admin/upload.php1,400 ▼34.18 ▲0.0296.69 ▼7.1441.34 ▼4.82

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/contact-form-to-any-api/public/partials/cf7-to-any-api-public-display.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Cf7_To_Any_Api' not found in wp-content/plugins/contact-form-to-any-api/admin/partials/cf7-to-any-api-admin-entries.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/contact-form-to-any-api/admin/partials/cf7-to-any-api-admin-display-docs.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Cf7_To_Any_Api' not found in wp-content/plugins/contact-form-to-any-api/admin/partials/cf7-to-any-api-admin-display.php:15
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/contact-form-to-any-api/includes/class-cf7-to-any-api-log-list-table.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-form-to-any-api/includes/class-cf7-to-any-api-log-list-table.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-to-any-api/includes/class-cf7-to-any-api-log-list-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/contact-form-to-any-api/admin/partials/cf7-to-any-api-feedback.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: lead, contact form, contact form 7, pro, rest api...

contact-form-to-any-api/cf7-to-any-api.php 92% from 13 tests

"Contact Form to Any API" version 1.1.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-form-to-any-api.php" instead of "cf7-to-any-api.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,905 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP162626711,438
CSS21512342
JavaScript21556125

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.12
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods64
▷ Static methods1828.12%
▷ Public methods5992.19%
▷ Protected methods00.00%
▷ Private methods57.81%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.30MB with 0.19MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/entries.png105.54KB40.57KB▼ 61.56%
admin/images/rating.png93.92KB30.87KB▼ 67.13%
admin/images/logs.png106.62KB44.29KB▼ 58.46%