10% dpd-cart

Code Review | DPD Cart Plugin

WordPress plugin DPD Cart Plugin scored10%from 54 tests.

About plugin

  • Plugin page: dpd-cart
  • Plugin version: 2.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-5.1
  • WordPress version: 6.3.1
  • First release: Oct 14, 2009
  • Latest release: Mar 1, 2019
  • Number of updates: 30
  • Update frequency: every 114.2 days
  • Top authors: DPDplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /5,560 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/dpd-cart/admin-notice.php+12
    session_start(): A session had already been started - ignoring

Server metrics [RAM: ▼1.86MB] [CPU: ▼57.68ms] Passed 4 tests

Server-side resources used by DPD Cart Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.325.82 ▼35.78
Dashboard /wp-admin2.16 ▼1.187.88 ▼58.31
Posts /wp-admin/edit.php2.16 ▼1.199.38 ▼42.30
Add New Post /wp-admin/post-new.php2.16 ▼3.728.56 ▼94.34
Media Library /wp-admin/upload.php2.16 ▼1.078.41 ▼30.42
DPD Cart Plugin /wp-admin/options-general.php?page=dpd_cart_plugin2.167.94

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for DPD Cart Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,022 ▲26114.11 ▼0.1819.76 ▲17.8840.75 ▲0.04
Dashboard /wp-admin2,212 ▲355.63 ▼0.0288.37 ▲3.0542.03 ▲0.33
Posts /wp-admin/edit.php2,120 ▲202.07 ▲0.0839.73 ▼0.7048.72 ▲9.57
Add New Post /wp-admin/post-new.php1,565 ▲2319.26 ▼3.89621.50 ▼85.8758.51 ▲3.69
Media Library /wp-admin/upload.php1,417 ▲144.27 ▲0.0798.97 ▼3.3545.22 ▼0.49
DPD Cart Plugin /wp-admin/options-general.php?page=dpd_cart_plugin8011.7527.5327.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/dpd-cart/admin-notice.php+12
    session_start(): A session had already been started - ignoring
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=dpd_cart_plugin
    • > Notice in wp-content/plugins/dpd-cart/admin-notice.php+12
    session_start(): A session had already been started - ignoring
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dpd_cart_plugin
    • > Notice in wp-content/plugins/dpd-cart/admin-notice.php+38
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dpd-cart/integrations/tinymce.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dpd-cart/setting-page.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DPDCart_ShortCode_Abstract' not found in wp-content/plugins/dpd-cart/shortcodes/dpdcart-product-page.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DPDCart_ShortCode_Abstract' not found in wp-content/plugins/dpd-cart/shortcodes/dpdcart-store.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dpd-cart/admin-notice.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dpd-cart/setting-page.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DPDCart_ShortCode_Abstract' not found in wp-content/plugins/dpd-cart/shortcodes/dpdcart-button.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dpd-cart/integrations/guttenberg.php:15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === dpd-cart === )
You can take inspiration from this readme.txt

dpd-cart/dpd-cart-plugin.php 77% from 13 tests

The main PHP file in "DPD Cart Plugin" ver. 2.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • 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
  • Description: The description should be shorter than 140 characters (currently 153 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("dpd-cart.php" instead of "dpd-cart-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,581 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33461731,654
PHP1010458818
CSS119374
Markdown15035

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.70
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes110.00%
▷ Concrete classes990.00%
▷ Final classes00.00%
Methods51
▷ Static methods00.00%
▷ Public methods3160.78%
▷ Protected methods611.76%
▷ Private methods1427.45%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/dpd-editor-icon.png1.37KB0.76KB▼ 44.33%
img/dpd.png1.56KB0.84KB▼ 46.01%