78% package-update-server-for-woocommerce

Code Review | Package Update Server for WooCommerce

WordPress plugin Package Update Server for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: package-update-se...
  • Plugin version: 1.0.12
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 23, 2018
  • Latest release: Feb 15, 2019
  • Number of updates: 16
  • Update frequency: every 5.3 days
  • Top authors: Nora0123456789 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /567 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

An overview of server-side resources used by Package Update Server for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.55 ▲0.19
Dashboard /wp-admin3.34 ▼0.0042.71 ▼22.01
Posts /wp-admin/edit.php3.45 ▲0.1043.73 ▼1.61
Add New Post /wp-admin/post-new.php5.92 ▲0.0481.15 ▼14.40
Media Library /wp-admin/upload.php3.26 ▲0.0433.17 ▼2.81

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 180 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Package Update Server for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.68 ▲0.481.66 ▼0.0341.66 ▲0.54
Dashboard /wp-admin2,195 ▲185.50 ▼0.2186.51 ▼1.1137.96 ▼5.86
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0434.05 ▲0.2732.35 ▼3.91
Add New Post /wp-admin/post-new.php1,526 ▼023.01 ▲0.08655.98 ▼38.5954.09 ▲0.10
Media Library /wp-admin/upload.php1,397 ▼64.19 ▲0.0497.18 ▼2.8041.96 ▼2.17

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/package-update-server-for-woocommerce/includes/endpoint/views/template-popup-customer-downloads.php
    • > /wp-content/plugins/package-update-server-for-woocommerce/includes/admin/views/template-updates.php
    • > /wp-content/plugins/package-update-server-for-woocommerce/templates/admin-page/header/template-admin-menu-page-tabs.php
    • > /wp-content/plugins/package-update-server-for-woocommerce/includes/admin/views/template-popup-customer-downloads.php
    • > /wp-content/plugins/package-update-server-for-woocommerce/templates/admin-page/notice/template-updates.php
  • 59× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/package-update-server-for-woocommerce/templates/admin-page/parts/guide.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/package-update-server-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/functional/EcdsaTokenTest.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/package-update-server-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/Signer/Rsa/Sha512Test.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/package-update-server-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/Claim/EqualsToTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/package-update-server-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/Signer/Rsa/Sha384Test.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/package-update-server-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/Parsing/DecoderTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Lcobucci\\JWT\\Signer\\Rsa' not found in wp-content/plugins/package-update-server-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/src/Signer/Rsa/Sha512.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Lcobucci\\JWT\\Signer\\BaseSigner' not found in wp-content/plugins/package-update-server-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/src/Signer/Rsa.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/package-update-server-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/TokenTest.php:21
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/package-update-server-for-woocommerce/includes/admin/views/template-shop-order-jwt.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: Please describe screenshot #3 in package-update-server-for-woocommerce/assets to your readme.txt
  • Screenshots: Screenshot #4 (NPUSWC Client: Generated admin page located in "Dashboard" -> "Token Validator: Name of Package") image missing
The official readme.txt is a good inspiration

package-update-server-for-woocommerce/package-update-server-for-woocommerce.php 92% from 13 tests

"Package Update Server for WooCommerce" version 1.0.12's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 plugin10,706 lines of code in 155 files:
LanguageFilesBlank linesComment linesLines of code
PHP1393,5868,7869,668
PO File1197345355
JavaScript6150156277
JSON200114
Markdown1470102
CSS311391
YAML23068
XML12031

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity9.28
▷ Minimum class complexity1.00
▷ Maximum class complexity142.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces9
Interfaces6
Traits1
Classes102
▷ Abstract classes98.82%
▷ Concrete classes9391.18%
▷ Final classes22.15%
Methods807
▷ Static methods415.08%
▷ Public methods69185.63%
▷ Protected methods9111.28%
▷ Private methods253.10%
Functions52
▷ Named functions4994.23%
▷ Anonymous functions35.77%
Constants20
▷ Global constants420.00%
▷ Class constants1680.00%
▷ Public constants16100.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
2 PNG files occupy 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/npuswc-client-dashboard-subpage.png28.40KB8.55KB▼ 69.89%
assets/img/npuswc-client-setting.png46.51KB13.36KB▼ 71.28%