78% mag-products-integration

Code Review | WP Storefront - Magento 2 Product Showcase

WordPress plugin WP Storefront - Magento 2 Product Showcase scored78%from 54 tests.

About plugin

  • Plugin page: mag-products-inte...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0
  • WordPress version: 6.3.1
  • First release: Nov 19, 2015
  • Latest release: Jun 24, 2022
  • Number of updates: 83
  • Update frequency: every 29.0 days
  • Top authors: santerref (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /10,041 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.21MB] [CPU: ▼3.23ms] Passed 4 tests

A check of server-side resources used by WP Storefront - Magento 2 Product Showcase
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2047.17 ▲5.91
Dashboard /wp-admin3.52 ▲0.2252.90 ▲0.87
Posts /wp-admin/edit.php3.64 ▲0.2851.52 ▼5.67
Add New Post /wp-admin/post-new.php6.10 ▲0.2294.58 ▼14.04
Media Library /wp-admin/upload.php3.45 ▲0.2243.27 ▲8.44

Server storage [IO: ▲0.11MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

WP Storefront - Magento 2 Product Showcase: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9313.64 ▼0.751.78 ▼0.0245.22 ▼3.08
Dashboard /wp-admin2,253 ▲504.85 ▼0.20119.01 ▲13.6144.52 ▲4.59
Posts /wp-admin/edit.php2,138 ▲592.01 ▼0.0239.64 ▲1.3437.93 ▲0.13
Add New Post /wp-admin/post-new.php1,567 ▲1923.25 ▲0.10657.99 ▼0.9859.74 ▲3.75
Media Library /wp-admin/upload.php1,439 ▲484.24 ▼0.01115.61 ▲11.7651.59 ▲8.80

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/mag-products-integration/wp-storefront.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mag-products-integration/templates/product.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WpStoreFront\\stores\\Store_Abstract' not found in wp-content/plugins/mag-products-integration/includes/stores/class-store-magento2.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/mag-products-integration/templates/product.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/mag-products-integration/templates/products.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'WpStoreFront\\stores\\Store_Interface' not found in wp-content/plugins/mag-products-integration/includes/stores/class-store-abstract.php:18
    • > PHP Notice
      Undefined variable: wp_storefront in wp-content/plugins/mag-products-integration/templates/product.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
Please take inspiration from this readme.txt

mag-products-integration/wp-storefront.php 85% from 13 tests

Analyzing the main PHP file in "WP Storefront - Magento 2 Product Showcase" version 2.0.1
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mag-products-integration.php" instead of "wp-storefront.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,157 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP162407781,148
SVG1005
JavaScript3003
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes11
▷ Abstract classes19.09%
▷ Concrete classes1090.91%
▷ Final classes00.00%
Methods83
▷ Static methods89.64%
▷ Public methods6983.13%
▷ Protected methods1416.87%
▷ Private methods00.00%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin