84% wc-api-custom-meta

Code Review | WC API Custom Meta

WordPress plugin WC API Custom Meta scored84%from 54 tests.

About plugin

  • Plugin page: wc-api-custom-meta
  • Plugin version: 0.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.7.5
  • WordPress version: 6.3.1
  • First release: Feb 26, 2016
  • Latest release: May 31, 2017
  • Number of updates: 9
  • Update frequency: every 51.1 days
  • Top authors: judgej (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,561 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.66ms] Passed 4 tests

A check of server-side resources used by WC API Custom Meta
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0440.58 ▲0.66
Dashboard /wp-admin3.33 ▲0.0349.34 ▲0.81
Posts /wp-admin/edit.php3.38 ▲0.0343.26 ▼5.69
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.87 ▼14.19
Media Library /wp-admin/upload.php3.25 ▲0.0237.33 ▲0.57

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

Input-output and database impact 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_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WC API Custom Meta
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4314.74 ▲0.151.95 ▲0.1744.67 ▼6.60
Dashboard /wp-admin2,206 ▲184.86 ▼0.14114.76 ▲11.1042.54 ▲0.43
Posts /wp-admin/edit.php2,086 ▼32.05 ▲0.0533.43 ▼8.2733.54 ▼1.39
Add New Post /wp-admin/post-new.php1,533 ▼023.14 ▲0.10694.78 ▲42.7056.90 ▲7.87
Media Library /wp-admin/upload.php1,388 ▼34.23 ▲0.0195.10 ▼3.4641.40 ▼2.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-api-custom-meta/wc-api-custom-meta.php:75

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
2 plugin tags: api, woocommerce

wc-api-custom-meta/wc-api-custom-meta.php Passed 13 tests

"WC API Custom Meta" version 0.7.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
64 characters long description:
Allows access to custom meta fields on products through the API.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin194 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12754117
Markdown117077

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods4100.00%
▷ Public methods4100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected