78% rest-interface-for-wpforms

Code Review | REST Interface for WPForms

WordPress plugin REST Interface for WPForms scored78%from 54 tests.

About plugin

  • Plugin page: rest-interface-fo...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-5.3.2
  • WordPress version: 6.3.1
  • First release: Apr 1, 2020
  • Latest release: Apr 2, 2020
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: brandynl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /667 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼6.32ms] Passed 4 tests

An overview of server-side resources used by REST Interface for WPForms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.76 ▼3.58
Dashboard /wp-admin3.31 ▼0.0449.87 ▼14.75
Posts /wp-admin/edit.php3.36 ▲0.0054.41 ▲2.47
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.33 ▼6.43
Media Library /wp-admin/upload.php3.23 ▲0.0036.04 ▼0.53
REST Interface /wp-admin/admin.php?page=rest-interface-for-wpforms3.0026.95

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for REST Interface for WPForms
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.23 ▼0.401.89 ▼0.0444.05 ▲0.91
Dashboard /wp-admin2,192 ▲155.57 ▼0.0582.31 ▼19.7541.97 ▼2.85
Posts /wp-admin/edit.php2,097 ▼31.96 ▼0.0139.56 ▲2.7538.39 ▲1.11
Add New Post /wp-admin/post-new.php1,526 ▼017.77 ▲0.08651.68 ▼17.9856.88 ▼4.97
Media Library /wp-admin/upload.php1,397 ▼64.21 ▲0.00104.13 ▼2.0245.29 ▼0.72
REST Interface /wp-admin/admin.php?page=rest-interface-for-wpforms280.440.114.06

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
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpforms() in wp-content/plugins/rest-interface-for-wpforms/admin/partials/rest-interface-for-wpforms-admin-display.php:33

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=rest-interface-for-wpforms
    • > Network (severe)
    wp-admin/admin.php?page=rest-interface-for-wpforms - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (The admin interface view)
The official readme.txt is a good inspiration

rest-interface-for-wpforms/rest-interface-for-wpforms.php Passed 13 tests

This is the main PHP file of "REST Interface for WPForms" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
113 characters long description:
A GUI to Post WPforms form entry data to an endpoint of your choice on a per-form basis without writing any code.

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
Everything looks great! No dangerous files found in this plugin1,403 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS1091,102
PHP1194511298
JavaScript12273

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity2.14
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.30
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods25
▷ Static methods312.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
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
1 PNG file occupies 0.09MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png95.94KB25.96KB▼ 72.95%