58% dyapress-ecommerce

Code Review | DyaPress e-Commerce

WordPress plugin DyaPress e-Commerce scored58%from 54 tests.

About plugin

  • Plugin page: dyapress-ecommerce
  • Plugin version: 0.9.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.0.0
  • WordPress version: 6.3.1
  • First release: May 2, 2020
  • Latest release: May 30, 2022
  • Number of updates: 24
  • Update frequency: every 31.6 days
  • Top authors: aytechnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,132 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.49MB] [CPU: ▲372.32ms] 75% from 4 tests

A check of server-side resources used by DyaPress e-Commerce
Please fix the following
  • Extra CPU: Extra CPU usage must be kept under 200.00ms (currently 372.32ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /4.35 ▲0.89435.25 ▲381.08
Dashboard /wp-admin4.54 ▲1.24441.04 ▲384.19
Posts /wp-admin/edit.php4.54 ▲1.19442.47 ▲389.27
Add New Post /wp-admin/post-new.php4.54 ▼1.34435.29 ▲334.75
Media Library /wp-admin/upload.php4.54 ▲1.31448.53 ▲411.51

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 58 new files
Database: 1 new table, 9 new options
New tables
wp_dyapress_ecommerce_maillog
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
dyapress_premium_expire
dyapress_ecommerce_options
db_upgraded
can_compress_scripts
widget_recent-comments
dyapress_ecommerce_db_version

Browser metrics Passed 4 tests

Checking browser requirements for DyaPress e-Commerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,922 ▲16113.88 ▼0.4717.50 ▲15.3836.80 ▼8.71
Dashboard /wp-admin2,210 ▲335.69 ▲0.0687.44 ▼12.4884.72 ▲39.55
Posts /wp-admin/edit.php2,124 ▲242.23 ▲0.2032.82 ▼5.4434.37 ▼1.89
Add New Post /wp-admin/post-new.php1,705 ▲17922.53 ▼0.67667.81 ▼32.9161.25 ▼4.18
Media Library /wp-admin/upload.php1,430 ▲304.32 ▲0.21101.53 ▼14.9883.29 ▲32.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/dyapress-ecommerce/includes/class-premium.php+207
    Undefined property: stdClass::$mode
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_dyapress_ecommerce_maillog
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • dyapress_ecommerce_options
    • db_upgraded
    • dyapress_premium_expire
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
Please fix the following
  • 10× PHP files output text when accessed directly:
    • > /wp-content/plugins/dyapress-ecommerce/includes/class-admin.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/class-premium.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/class-importer.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/import/meg-invoices.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/class-download.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/class-shortcodes.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/class-myaccount.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/import/meg-customers.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/class-ecommerce.php
    • > /wp-content/plugins/dyapress-ecommerce/includes/class-ajax-handler.php
  • 39× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dyapress-ecommerce/templates/messages/user_updated.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/dyapress-ecommerce/templates/reset_password.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dyapress_ecommerce() in wp-content/plugins/dyapress-ecommerce/templates/thirdparty.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/dyapress-ecommerce/templates/mails/footer.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dyapress-ecommerce/templates/messages/password_mismatch.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dyapress-ecommerce/templates/messages/thirdparty_created.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dyapress_premium() in wp-content/plugins/dyapress-ecommerce/templates/account/invoices.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dyapress_premium() in wp-content/plugins/dyapress-ecommerce/templates/products_purchase.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dyapress_premium() in wp-content/plugins/dyapress-ecommerce/templates/account/thirdparties.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dyapress-ecommerce/templates/messages/unauthorized.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: e-commerce, ecommerce, stripe, sell, payments...

dyapress-ecommerce/dyapress-ecommerce.php Passed 13 tests

The main PHP file in "DyaPress e-Commerce" ver. 0.9.1 adds more information about the plugin and also serves as the entry point for this plugin
58 characters long description:
e-Commerce extension for DyaPress Premium Microservice API

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
No dangerous file extensions were detected8,231 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP481,6111,4126,699
PO File1316357828
JavaScript29223397
CSS22826307

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity164.90
▷ Minimum class complexity3.00
▷ Maximum class complexity772.00
Average method complexity6.36
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes220.00%
Methods305
▷ Static methods7123.28%
▷ Public methods28493.11%
▷ Protected methods00.00%
▷ Private methods216.89%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/menu-icon-active.png0.48KB0.51KB0.00%
images/menu-icon.png0.52KB0.39KB▼ 24.39%
images/powered_by_stripe.png1.42KB1.28KB▼ 9.73%