74% woocommerce-api-lockdown

Code Review | WooCommerce API Lockdown

WordPress plugin WooCommerce API Lockdown scored74%from 54 tests.

About plugin

  • Plugin page: woocommerce-api-l...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-3.81
  • WordPress version: 6.3.1
  • First release: Feb 20, 2014
  • Latest release: Feb 21, 2014
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: jtwiest (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,276 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.96MB] [CPU: ▼52.19ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce API Lockdown
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.17 ▼35.94
Dashboard /wp-admin2.05 ▼1.265.81 ▼46.75
Posts /wp-admin/edit.php2.05 ▼1.318.48 ▼37.56
Add New Post /wp-admin/post-new.php2.05 ▼3.846.25 ▼88.50
Media Library /wp-admin/upload.php2.05 ▼1.185.92 ▼26.33

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce API Lockdown
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.251.88 ▲0.0445.41 ▼0.84
Dashboard /wp-admin2,200 ▲155.79 ▲0.93104.99 ▼11.4337.72 ▼8.93
Posts /wp-admin/edit.php2,092 ▲62.00 ▼0.0238.29 ▲4.1534.46 ▼3.58
Add New Post /wp-admin/post-new.php1,535 ▲223.38 ▲0.26658.05 ▼5.0254.90 ▼0.07
Media Library /wp-admin/upload.php1,391 ▲34.20 ▼0.0494.65 ▼3.4845.55 ▲1.85
API Lockdown /wp-admin/api-lockdown.php260.440.0615.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function WP_User_Query::query was called incorrectly. User queries should not be run before the plugins_loaded hook. Please see Debugging in WordPress for more information. (This message was added in version 6.1.1.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/api-lockdown.php
    • > Network (severe)
    wp-admin/api-lockdown.php - Failed to load resource: the server responded with a status of 404 (Not Found)

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
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (screenshot-1.png)
The official readme.txt might help

woocommerce-api-lockdown/api-lockdown.php 92% from 13 tests

This is the main PHP file of "WooCommerce API Lockdown" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-api-lockdown.php" instead of "api-lockdown.php")

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
There were no executable files found in this plugin249 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP18571249

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity47.00
▷ Minimum class complexity47.00
▷ Maximum class complexity47.00
Average method complexity6.11
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png33.65KB10.50KB▼ 68.81%