78% foxyshop

Code Review | FoxyShop

WordPress plugin FoxyShop scored78%from 54 tests.

About plugin

  • Plugin page: foxyshop
  • Plugin version: 4.9.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 20, 2011
  • Latest release: Nov 16, 2022
  • Number of updates: 223
  • Update frequency: every 19.2 days
  • Top authors: sparkweb (78.48%)foxycart (21.97%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /33,432 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.55MB] [CPU: ▲9.98ms] Passed 4 tests

Server-side resources used by FoxyShop
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.06 ▲1.5948.22 ▲11.03
Dashboard /wp-admin4.88 ▲1.5850.86 ▲6.26
Posts /wp-admin/edit.php4.94 ▲1.5858.66 ▲9.93
Add New Post /wp-admin/post-new.php7.42 ▲1.54104.03 ▲12.68
Media Library /wp-admin/upload.php4.74 ▲1.5154.09 ▲17.17
Manage Products /wp-admin/edit.php?post_type=foxyshop_product4.8545.88
Settings /wp-admin/edit.php?post_type=foxyshop_product&page=foxyshop_settings_page4.7141.42
Tools /wp-admin/edit.php?post_type=foxyshop_product&page=foxyshop_tools4.7136.89
Product Categories /wp-admin/edit-tags.php?taxonomy=foxyshop_categories&post_type=foxyshop_product4.7442.63
Add New Product /wp-admin/post-new.php?post_type=foxyshop_product4.9460.13
/wp-admin/admin.php?page=foxyshop_setup4.7148.13
Set Category Order /wp-admin/edit.php?post_type=foxyshop_product&page=foxyshop_category_sort4.7152.86
Set Product Order /wp-admin/edit.php?post_type=foxyshop_product&page=foxyshop_custom_sort4.7240.26

Server storage [IO: ▲2.45MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 156 new files
Database: no new tables, 12 new options
New WordPress options
foxyshop_rewrite_rules
foxyshop_setup_required
widget_foxyshop-category-widget
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_foxyshop-cart-link-widget
widget_foxyshop-category-list-widget
can_compress_scripts
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by FoxyShop
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲17813.82 ▼0.538.72 ▲7.1543.48 ▲0.47
Dashboard /wp-admin2,245 ▲655.65 ▼0.1286.63 ▲1.6870.49 ▲30.28
Posts /wp-admin/edit.php2,165 ▲652.03 ▲0.0338.41 ▲3.6636.36 ▼3.61
Add New Post /wp-admin/post-new.php1,764 ▲23624.60 ▲1.76621.21 ▼40.9037.40 ▼13.81
Media Library /wp-admin/upload.php1,459 ▲564.22 ▲0.0997.59 ▼14.5183.60 ▲35.87
Manage Products /wp-admin/edit.php?post_type=foxyshop_product1,1652.0133.7731.96
Settings /wp-admin/edit.php?post_type=foxyshop_product&page=foxyshop_settings_page1,8651.9227.5665.73
Tools /wp-admin/edit.php?post_type=foxyshop_product&page=foxyshop_tools1,4052.0427.9441.67
Product Categories /wp-admin/edit-tags.php?taxonomy=foxyshop_categories&post_type=foxyshop_product1,3332.4228.3033.62
Add New Product /wp-admin/post-new.php?post_type=foxyshop_product3,2057.53194.85157.44
/wp-admin/admin.php?page=foxyshop_setup1,62811.08280.7076.98
Set Category Order /wp-admin/edit.php?post_type=foxyshop_product&page=foxyshop_category_sort8561.8026.5928.03
Set Product Order /wp-admin/edit.php?post_type=foxyshop_product&page=foxyshop_custom_sort8631.8027.3728.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/foxyshop/themefiles/foxyshop-receipt.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foxyshop/themefiles/foxyshop-checkout-template.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function foxyshop_setup_product() in wp-content/plugins/foxyshop/themefiles/foxyshop-product-loop.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/foxyshop/themefiles/foxyshop-single-product.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foxyshop/themefiles/foxyshop-receipt-template-2.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foxyshop/themefiles/foxyshop-checkout-template-2.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/foxyshop/themefiles/foxyshop-all-categories.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/foxyshop/themefiles/foxyshop-single-category.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/foxyshop/themefiles/foxyshop-search.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/foxyshop/themefiles/foxyshop-all-products.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=foxyshop_setup
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,swfobject&ver=6.3.1 1:28609 "jQuery.Deferred exception: show_downloadables is not defined" "ReferenceError: show_downloadables is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/foxyshop/js/products-admin.js?ver=1:30:2)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,swfobject&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,swfobject&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=foxyshop_setup
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,swfobject&ver=6.3.1 1:28721 Uncaught ReferenceError: show_downloadables is not defined

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Admin Settings), #2 (Product Management), #3 (Custom Product Order), #4 (Order Management), #5 (Inventory Levels)
You can look at the official readme.txt

foxyshop/foxyshop.php Passed 13 tests

The main PHP file in "FoxyShop" ver. 4.9.3 adds more information about the plugin and also serves as the entry point for this plugin
122 characters long description:
FoxyShop is a full integration for FoxyCart and WordPress, providing a robust shopping cart and inventory management tool.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected19,094 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP442,2141,16110,913
PO File31,3361,6802,952
CSS111611222,822
JavaScript123961,0342,403
Markdown1204

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity5.50
▷ Minimum class complexity3.00
▷ Maximum class complexity9.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods14
▷ Static methods214.29%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions219
▷ Named functions21698.63%
▷ Anonymous functions31.37%
Constants34
▷ Global constants34100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
61 PNG files occupy 0.15MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/prettyphoto/prettyPhoto/dark_rounded/btnPrevious.png1.41KB1.19KB▼ 15.74%
js/prettyphoto/prettyPhoto/light_square/sprite.png3.42KB2.13KB▼ 37.67%
js/prettyphoto/prettyPhoto/light_rounded/btnPrevious.png1.41KB1.19KB▼ 15.74%
js/prettyphoto/prettyPhoto/light_square/btnPrevious.png1.41KB1.19KB▼ 15.74%
images/no-photo.png6.06KB2.58KB▼ 57.40%