77% mygdex-prime-for-woocommerce

Code Review | myGDEX Prime for WooCommerce

WordPress plugin myGDEX Prime for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: mygdex-prime-for-...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 17, 2021
  • Latest release: Mar 30, 2023
  • Number of updates: 12
  • Update frequency: every 62.3 days
  • Top authors: gdexpress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /992 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.16MB] [CPU: ▼10.81ms] Passed 4 tests

A check of server-side resources used by myGDEX Prime for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.44 ▲1.93
Dashboard /wp-admin3.34 ▲0.0351.91 ▼9.91
Posts /wp-admin/edit.php3.39 ▲0.0352.46 ▲1.60
Add New Post /wp-admin/post-new.php5.16 ▼0.7264.26 ▼36.87
Media Library /wp-admin/upload.php3.26 ▲0.0338.97 ▲3.90

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 32 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by myGDEX Prime for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲17714.04 ▲0.078.66 ▲7.0943.72 ▲1.71
Dashboard /wp-admin2,249 ▲466.08 ▲0.17116.04 ▲11.6444.69 ▼3.44
Posts /wp-admin/edit.php2,126 ▲262.30 ▲0.2736.25 ▲1.6034.56 ▼4.80
Add New Post /wp-admin/post-new.php45 ▼1,5000.44 ▼22.840.11 ▼640.839.17 ▼41.69
Media Library /wp-admin/upload.php1,425 ▲284.43 ▲0.19123.98 ▲22.4648.52 ▲0.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mygdex-prime-for-woocommerce/public/partials/gdex-prime-public-display.php
    • > /wp-content/plugins/mygdex-prime-for-woocommerce/admin/partials/gdex-prime-admin-display.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/mygdex-prime-for-woocommerce/admin/partials/admin-notice.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_order() in wp-content/plugins/mygdex-prime-for-woocommerce/admin/partials/shipment-order-meta-box.php:5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mygdex-prime-for-woocommerce/admin/partials/admin-notice.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mygdex-prime-for-woocommerce/admin/partials/admin-notice.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/mygdex-prime-for-woocommerce/includes/woocommerce/class-gdex-prime-shipping-method.php:3
    • > PHP Notice
      Undefined variable: notice in wp-content/plugins/mygdex-prime-for-woocommerce/admin/partials/admin-notice.php on line 1
    • > PHP Notice
      Undefined variable: notice in wp-content/plugins/mygdex-prime-for-woocommerce/admin/partials/admin-notice.php on line 2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

mygdex-prime-for-woocommerce/gdex-prime.php 77% from 13 tests

Analyzing the main PHP file in "myGDEX Prime for WooCommerce" version 1.0.4
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mygdex-prime-for-woocommerce.php" instead of "gdex-prime.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "4.0.0")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected929 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP21265785855
JavaScript3183268
CSS2146

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity3.92
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.59
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods59
▷ Static methods23.39%
▷ Public methods5084.75%
▷ Protected methods46.78%
▷ Private methods58.47%
Functions26
▷ Named functions2596.15%
▷ Anonymous functions13.85%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin