58% dukapress

Code Review | DukaPress

WordPress plugin DukaPress scored58%from 54 tests.

About plugin

  • Plugin page: dukapress
  • Plugin version: 3.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 22, 2010
  • Latest release: Aug 19, 2019
  • Number of updates: 360
  • Update frequency: every 10.2 days
  • Top authors: rixeo (58.61%)moshthepitt (35.28%)parshwa (6.67%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /54,921 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.18MB] [CPU: ▼24.20ms] Passed 4 tests

A check of server-side resources used by DukaPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.14 ▲1.6833.66 ▼9.96
Dashboard /wp-admin5.21 ▲1.8735.10 ▼26.68
Posts /wp-admin/edit.php5.21 ▲1.8535.72 ▼10.56
Add New Post /wp-admin/post-new.php5.21 ▼0.6836.94 ▼49.61
Media Library /wp-admin/upload.php5.21 ▲1.9835.63 ▲3.38
Product Tags /wp-admin/edit-tags.php?taxonomy=duka_tag&post_type=duka5.2132.67
Product Categories /wp-admin/edit-tags.php?taxonomy=duka_category&post_type=duka5.2133.22
Variations /wp-admin/edit-tags.php?taxonomy=duka_variation&post_type=duka5.2132.10
Store Settings /wp-admin/edit.php?post_type=duka&page=dukapress5.2130.48
Orders /wp-admin/edit.php?post_type=duka_order5.2132.34
Create New /wp-admin/post-new.php?post_type=duka5.2131.75
Documentation /wp-admin/edit.php?post_type=duka&page=documentation5.2137.55
Products /wp-admin/edit.php?post_type=duka5.2136.51

Server storage [IO: ▲1.49MB] [DB: ▲0.01MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • Illegal file modification detected: 2 files (0.00KB) outside of "wp-content/plugins/dukapress/" and "wp-content/uploads/"
    • (new file) wp-content/dukapress/pdf/index.php
    • (new file) wp-content/dukapress/index.php
Filesystem: 221 new files
Database: no new tables, 16 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
dpsc_gateway_removed_plugins
widget_dukapress_checkout_widget
dukapess_flush_rewrite
widget_dukapress_shopping_cart_widget
widget_recent-comments
dpsc_gateway_plugins
widget_recent-posts
widget_dukapress_products_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for DukaPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,999 ▲25314.21 ▼0.0910.57 ▲8.7741.69 ▼1.51
Dashboard /wp-admin2,250 ▲625.85 ▲0.98113.51 ▼2.1486.90 ▲41.94
Posts /wp-admin/edit.php2,151 ▲621.99 ▼0.0737.39 ▼1.3333.40 ▼1.27
Add New Post /wp-admin/post-new.php1,567 ▲5317.94 ▲0.41690.44 ▲30.4770.78 ▲13.28
Media Library /wp-admin/upload.php1,447 ▲624.22 ▲0.0093.97 ▼4.5060.66 ▲15.94
Product Tags /wp-admin/edit-tags.php?taxonomy=duka_tag&post_type=duka1,2932.1429.1930.73
Product Categories /wp-admin/edit-tags.php?taxonomy=duka_category&post_type=duka1,3242.1426.2229.55
Variations /wp-admin/edit-tags.php?taxonomy=duka_variation&post_type=duka1,2422.1526.1529.84
Store Settings /wp-admin/edit.php?post_type=duka&page=dukapress4,6872.2136.2359.90
Orders /wp-admin/edit.php?post_type=duka_order1,1321.9431.1531.92
Create New /wp-admin/post-new.php?post_type=duka2,6817.89189.47115.28
Documentation /wp-admin/edit.php?post_type=duka&page=documentation8312.0124.9527.47
Products /wp-admin/edit.php?post_type=duka1,1531.9332.4832.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-includes/link-template.php+445
    Trying to get property 'ID' of non-object
  • Zombie WordPress options were found after uninstall: 16 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_dukapress_search_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • dukapress_settings
    • dpsc_gateway_removed_plugins
    • widget_dukapress_shopping_cart_widget
    • dp_version
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 210 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=duka
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-includes/link-template.php+409
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/edit.php?post_type=duka&page=dukapress
    • > Notice in wp-content/plugins/dukapress/dukapress/classes/dukapress-admin-pages.php+145
    Undefined index: currency_layer_key
    • > GET request to /wp-admin/post-new.php?post_type=duka
    • > Notice in wp-content/plugins/dukapress/dukapress/includes/dukapress-post_meta.php+61
    Undefined index: dukapress_noncename

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 fix the following
  • 21× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant DPSC_DUKAPRESS_LIB_DIR - assumed 'DPSC_DUKAPRESS_LIB_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/dukapress/dukapress/classes/dukapress-pdf.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dukapress/dukapress/tools/order_migrate.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DukaPress_Gateway' not found in wp-content/plugins/dukapress/dukapress/gateways/paypal.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'DukaPress_Gateway' not found in wp-content/plugins/dukapress/dukapress/gateways/2checkout.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/dukapress/dukapress/dukapress-loader.php:253
    • > PHP Fatal error
      Uncaught Error: Class 'DukaPress_Gateway' not found in wp-content/plugins/dukapress/dukapress/gateways/payza.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dukapress/dukapress/widgets/shopping_cart.php:5
    • > PHP Warning
      Use of undefined constant DPSC_DUKAPRESS_CLASSES_DIR - assumed 'DPSC_DUKAPRESS_CLASSES_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/dukapress/dukapress/dukapress-loader.php on line 116
    • > PHP Fatal error
      Uncaught Error: Class 'DukaPress_Gateway' not found in wp-content/plugins/dukapress/dukapress/gateways/pesapal.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dukapress/dukapress/widgets/products.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
The official readme.txt is a good inspiration

dukapress/dukapress.php 92% from 13 tests

The primary PHP file in "DukaPress" version 3.2.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please make sure to remedy the following
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .url - Internet Shortcut in Firefox, IE, Chrome, Safari
      • wp-content/plugins/dukapress/README.url
22,936 lines of code in 133 files:
LanguageFilesBlank linesComment linesLines of code
PHP441,3331,26811,026
JavaScript769159629,457
CSS121381681,339
PO File14697051,114

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity32.25
▷ Minimum class complexity1.00
▷ Maximum class complexity307.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes36
▷ Abstract classes00.00%
▷ Concrete classes36100.00%
▷ Final classes00.00%
Methods314
▷ Static methods8527.07%
▷ Public methods30296.18%
▷ Protected methods20.64%
▷ Private methods103.18%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants23
▷ Global constants23100.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
52 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dukapress/resources/css/images/ui-bg_flat_55_fbf9ee_40x100.png0.20KB0.08KB▼ 57.77%
dukapress/resources/colorpicker/images/custom_submit.png0.97KB0.99KB0.00%
dukapress/resources/img/dp_icon_white.png1.17KB0.51KB▼ 56.12%
dukapress/resources/colorpicker/images/colorpicker_background.png1.85KB2.14KB0.00%
dukapress/resources/css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%