78% product-display-for-magento

Code Review | Product Display for Magento

WordPress plugin Product Display for Magento scored78%from 54 tests.

About plugin

  • Plugin page: product-display-f...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.8
  • WordPress version: 6.3.1
  • First release: Jul 20, 2017
  • Latest release: Apr 9, 2018
  • Number of updates: 8
  • Update frequency: every 32.9 days
  • Top authors: scottcwilson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /993 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▲0.51ms] Passed 4 tests

Analyzing server-side resources used by Product Display for Magento
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.78 ▼1.51
Dashboard /wp-admin3.34 ▲0.0447.67 ▼0.05
Posts /wp-admin/edit.php3.39 ▲0.0448.13 ▲1.19
Add New Post /wp-admin/post-new.php5.92 ▲0.04100.59 ▲5.45
Media Library /wp-admin/upload.php3.26 ▲0.0436.37 ▲2.40
Product Display for Magento /wp-admin/options-general.php?page=mage_product_display_3.2130.51

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Display for Magento
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.26 ▼1.301.80 ▲0.1543.67 ▲0.02
Dashboard /wp-admin2,215 ▲275.85 ▼0.0696.31 ▼8.7537.73 ▼4.82
Posts /wp-admin/edit.php2,095 ▲62.05 ▲0.0439.14 ▼1.6434.47 ▼0.67
Add New Post /wp-admin/post-new.php1,542 ▲2318.47 ▼4.83615.79 ▼70.9353.25 ▲1.49
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.0097.16 ▼14.3541.61 ▼3.37
Product Display for Magento /wp-admin/options-general.php?page=mage_product_display_8122.0522.8924.93

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mage_product_display_
    • > Notice in wp-content/plugins/product-display-for-magento/product_display_for_magento.php+240
    Trying to access array offset on value of type bool

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-display-for-magento/product_display_for_magento.php:145

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
1 plugin tags: magento

product-display-for-magento/product_display_for_magento.php 77% from 13 tests

"Product Display for Magento" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("product-display-for-magento.php" instead of "product_display_for_magento.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected201 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15928191
CSS10510

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin