78% shop-extra

Code Review | ShopExtra — WooCommerce Extras

WordPress plugin ShopExtra — WooCommerce Extras scored78%from 54 tests.

About plugin

  • Plugin page: shop-extra
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Dec 4, 2022
  • Latest release: Nov 19, 2023
  • Number of updates: 8
  • Update frequency: every 43.9 days
  • Top authors: aryadhiratara (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /536 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by ShopExtra — WooCommerce Extras
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.58 ▼5.17
Dashboard /wp-admin3.32 ▲0.0244.96 ▼1.69
Posts /wp-admin/edit.php3.37 ▲0.0147.49 ▲6.58
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.53 ▲0.94
Media Library /wp-admin/upload.php3.24 ▲0.0136.14 ▲0.15
ShopExtra /wp-admin/options-general.php?page=shop-extra3.2935.59

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 69 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for ShopExtra — WooCommerce Extras
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.45 ▲0.101.72 ▲0.0236.30 ▼8.83
Dashboard /wp-admin2,199 ▲255.60 ▼0.0491.89 ▼8.3341.18 ▼2.67
Posts /wp-admin/edit.php2,104 ▲11.95 ▲0.0139.57 ▲0.2335.62 ▼2.00
Add New Post /wp-admin/post-new.php1,529 ▲423.08 ▲1.96665.05 ▲0.3754.80 ▲11.68
Media Library /wp-admin/upload.php1,401 ▼24.20 ▲0.02100.70 ▼1.9241.74 ▼3.15
ShopExtra /wp-admin/options-general.php?page=shop-extra2,2225.05108.8063.94

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% 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 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
Please fix the following items
  • 30× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/shop-extra/includes/classes/Utilities.php
    • > /wp-content/plugins/shop-extra/includes/functions/floating.php
    • > /wp-content/plugins/shop-extra/includes/classes/Messages.php
    • > /wp-content/plugins/shop-extra/includes/classes/parts/customize-elements.php
    • > /wp-content/plugins/shop-extra/view/admin/parts/index.php
    • > /wp-content/plugins/shop-extra/includes/classes/Floating.php
    • > /wp-content/plugins/shop-extra/includes/functions/loops.php
    • > /wp-content/plugins/shop-extra/includes/classes/parts/checkout.php
    • > /wp-content/plugins/shop-extra/includes/functions/cart.php
    • > /wp-content/plugins/shop-extra/includes/functions/checkout.php
  • 22× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shop-extra/view/admin/parts/partials/products/styling.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shop-extra/view/admin/parts/order-button.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shop-extra/view/admin/parts/floating.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shop-extra/view/admin/parts/partials/utilities/extras.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shop-extra/view/admin/parts/translations.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/shop-extra/view/admin/parts/partials/products/single-product-extra.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shop-extra/view/admin/parts/partials/translations/checkout.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/shop-extra/view/admin/parts/partials/products/loops-extra.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shop-extra/view/admin/parts/partials/utilities/datepicker.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/shop-extra/view/admin/parts/partials/products/cart-extra.php:4

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please a description for screenshot #5 in shop-extra/assets to your readme.txt
You can take inspiration from this readme.txt

shop-extra/plugin.php 85% from 13 tests

The main file in "ShopExtra — WooCommerce Extras" v. 1.0.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("shop-extra.php" instead of "plugin.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 220 characters long)

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
Good job! No executable or dangerous file extensions detected6,150 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP461,4743794,778
CSS2214121,099
JavaScript81544270
SVG3003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity30.00
▷ Minimum class complexity7.00
▷ Maximum class complexity101.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods136
▷ Static methods96.62%
▷ Public methods12188.97%
▷ Protected methods00.00%
▷ Private methods1511.03%
Functions28
▷ Named functions2485.71%
▷ Anonymous functions414.29%
Constants18
▷ Global constants1477.78%
▷ Class constants422.22%
▷ Public constants4100.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