10% editionguard-for-woocommerce-ebook-sales-with-drm

Code Review | EditionGuard for WooCommerce - eBook Sales with DRM

WordPress plugin EditionGuard for WooCommerce - eBook Sales with DRM scored10%from 54 tests.

About plugin

  • Plugin page: editionguard-for-...
  • Plugin version: 3.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5.1
  • WordPress version: 6.3.1
  • First release: May 27, 2013
  • Latest release: Jun 24, 2021
  • Number of updates: 43
  • Update frequency: every 68.7 days
  • Top authors: EditionGuard (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /7,186 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/editionguard-for-woocommerce-ebook-sales-with-drm/woocommerce_editionguard.php+16
    Undefined index: woo_ed_resource_id

Server metrics [RAM: ▼1.83MB] [CPU: ▼54.69ms] Passed 4 tests

Analyzing server-side resources used by EditionGuard for WooCommerce - eBook Sales with DRM
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.295.11 ▼34.63
Dashboard /wp-admin2.19 ▼1.157.12 ▼56.03
Posts /wp-admin/edit.php2.19 ▼1.166.05 ▼40.23
Add New Post /wp-admin/post-new.php2.19 ▼3.708.06 ▼87.86
Media Library /wp-admin/upload.php2.19 ▼1.045.37 ▼30.20

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for EditionGuard for WooCommerce - eBook Sales with DRM
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.28 ▼1.114.44 ▲2.7643.46 ▲2.61
Dashboard /wp-admin2,203 ▲144.85 ▼0.06109.05 ▲3.8643.91 ▲1.42
Posts /wp-admin/edit.php2,092 ▲62.01 ▲0.0439.79 ▲4.4734.33 ▲2.30
Add New Post /wp-admin/post-new.php1,547 ▲1419.22 ▼3.75596.95 ▼27.3776.68 ▲12.10
Media Library /wp-admin/upload.php1,388 ▼04.10 ▼0.1195.41 ▼20.6239.20 ▼9.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/editionguard-for-woocommerce-ebook-sales-with-drm/woocommerce_editionguard.php+16
    Undefined index: woo_ed_resource_id
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/editionguard-for-woocommerce-ebook-sales-with-drm/woocommerce_editionguard.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (General settings page.), #2 (Downloadable product addition with EditionGuard DRM option.), #3 (Download page for a successful order.)
You can look at the official readme.txt

editionguard-for-woocommerce-ebook-sales-with-drm/woocommerce_editionguard.php 92% from 13 tests

The main file in "EditionGuard for WooCommerce - eBook Sales with DRM" v. 3.4.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("editionguard-for-woocommerce-ebook-sales-with-drm.php" instead of "woocommerce_editionguard.php")

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
There were no executable files found in this plugin674 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP311746435
JavaScript1336208
CSS12031

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity7.50
▷ Minimum class complexity5.00
▷ Maximum class complexity10.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
3 PNG files occupy 0.20MB with 0.13MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png79.38KB28.83KB▼ 63.68%
screenshot-1.png49.60KB17.15KB▼ 65.42%
screenshot-2.png71.67KB26.75KB▼ 62.67%