10% public-woo-api

Code Review | Public Woo Api

WordPress plugin Public Woo Api scored10%from 54 tests.

About plugin

  • Plugin page: public-woo-api
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.9
  • WordPress version: 6.3.1
  • First release: May 27, 2019
  • Latest release: Apr 4, 2022
  • Number of updates: 19
  • Update frequency: every 55.0 days
  • Top authors: mickidum (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,470 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/public-woo-api/includes/class-public-woo-api.php+192
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.09ms] Passed 4 tests

An overview of server-side resources used by Public Woo Api
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.31 ▲2.58
Dashboard /wp-admin3.33 ▲0.0243.35 ▼0.08
Posts /wp-admin/edit.php3.38 ▲0.0245.83 ▲0.91
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.85 ▼11.67
Media Library /wp-admin/upload.php3.25 ▲0.0234.67 ▼1.52
Public Woo Options /wp-admin/tools.php?page=public_woo_api_options3.2230.06

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 108 new files
Database: no new tables, 7 new options
New WordPress options
public_woo_api_main_options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Public Woo Api: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲7013.60 ▼1.151.74 ▼0.2641.87 ▼22.44
Dashboard /wp-admin2,230 ▲425.81 ▲0.9398.91 ▼11.6338.36 ▼5.87
Posts /wp-admin/edit.php2,115 ▲262.02 ▲0.0339.34 ▲3.1336.74 ▲5.55
Add New Post /wp-admin/post-new.php1,535 ▲1523.21 ▲0.09668.39 ▲42.8667.22 ▲10.07
Media Library /wp-admin/upload.php1,409 ▲304.22 ▲0.0497.09 ▼3.6842.39 ▼2.96
Public Woo Options /wp-admin/tools.php?page=public_woo_api_options8582.1824.7630.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% 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 0% 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
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/public-woo-api/vendor/automattic/woocommerce/tests/bootstrap.php
    • > /wp-content/plugins/public-woo-api/trunk/vendor/automattic/woocommerce/tests/bootstrap.php
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/trunk/vendor/automattic/woocommerce/tests/WooCommerce/Tests/ClientTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/RequestTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/trunk/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/RequestTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/HttpClientExceptionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/trunk/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/trunk/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OptionsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/BasicAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OptionsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/public-woo-api/trunk/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/ResponseTest.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: There are too many tags (16 tag instead of maximum 10)
The official readme.txt might help

public-woo-api/public-woo-api.php Passed 13 tests

"Public Woo Api" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
102 characters long description:
Allows to fetch WooCommerce products, categories, tags, variations and reviews without authentication.

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
Everything looks great! No dangerous files found in this plugin1,919 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP345291,3391,613
Markdown1400118
JSON30090
CSS16432
XML21026
YAML26021
JavaScript13019

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.92
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes52
▷ Abstract classes00.00%
▷ Concrete classes52100.00%
▷ Final classes00.00%
Methods326
▷ Static methods103.07%
▷ Public methods27283.44%
▷ Protected methods4012.27%
▷ Private methods144.29%
Functions14
▷ Named functions1071.43%
▷ Anonymous functions428.57%
Constants14
▷ Global constants214.29%
▷ Class constants1285.71%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin