83% repack-for-woocommerce

Code Review | WeRePack - Reuse Packaging for WooCommerce

WordPress plugin WeRePack - Reuse Packaging for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: repack-for-woocom...
  • Plugin version: 1.4.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.2
  • WordPress version: 6.3.1
  • First release: May 9, 2020
  • Latest release: Mar 29, 2023
  • Number of updates: 31
  • Update frequency: every 34.1 days
  • Top authors: philippmuenchen (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,092 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.24MB] [CPU: ▼9.19ms] Passed 4 tests

This is a short check of server-side resources used by WeRePack - Reuse Packaging for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2546.48 ▲0.56
Dashboard /wp-admin3.61 ▲0.2648.25 ▼12.95
Posts /wp-admin/edit.php3.66 ▲0.3043.23 ▼5.99
Add New Post /wp-admin/post-new.php6.13 ▲0.2483.74 ▼16.36
Media Library /wp-admin/upload.php3.47 ▲0.2336.05 ▼1.47

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WeRePack - Reuse Packaging for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.184.89 ▲2.9038.84 ▼8.86
Dashboard /wp-admin2,200 ▲95.82 ▲0.89102.12 ▼12.6040.23 ▼1.98
Posts /wp-admin/edit.php2,089 ▲32.05 ▼0.0037.09 ▼3.8831.95 ▼3.69
Add New Post /wp-admin/post-new.php1,533 ▲421.24 ▲2.84715.83 ▲81.9155.58 ▲0.22
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0798.07 ▼5.2043.17 ▲1.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • repack_start
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • repack_counter
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Please fix the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/repack-for-woocommerce/templates/summary.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/repack-for-woocommerce/templates/telemetry-data.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/repack-for-woocommerce/admin/partials/repack-admin-settings.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 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
8 plugin tags: coupon, sustainable, shipping, reuse, consent...

repack-for-woocommerce/repack.php 69% from 13 tests

"WeRePack - Reuse Packaging for WooCommerce" version 1.4.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0.0" instead of "3.6")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Description: Keep the plugin description shorter than 140 characters (currently 177 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("repack-for-woocommerce.php" instead of "repack.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,585 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP152701,1141,184
Sass5356224
CSS1612101
JSON10040
JavaScript26336

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.33
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods70
▷ Static methods1217.14%
▷ Public methods5781.43%
▷ Protected methods34.29%
▷ Private methods1014.29%
Functions12
▷ Named functions325.00%
▷ Anonymous functions975.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.56MB with 0.19MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/werepack-teal-mini.png9.91KB6.50KB▼ 34.35%
public/images/werepack-teal.png184.16KB123.07KB▼ 33.17%
public/images/werepack-teal-square.png374.88KB245.05KB▼ 34.63%