84% simple-drm

Code Review | SimpleDRM

WordPress plugin SimpleDRM scored 84% from 54 tests.

About plugin

  • Plugin page: simple-drm
  • Plugin version: 1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.1
  • WordPress version: 6.3.1
  • First release: May 9, 2021
  • Latest release: Oct 5, 2021
  • Number of updates: 15
  • Update frequency: every 17.8 days
  • Top authors: javieralonsoperez (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 510 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.51ms] 75% from 4 tests

Analyzing server-side resources used by SimpleDRM
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 5,604.47ms on /wp-admin/options-general.php?page=simpleDRM_options_page)
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.34 ▼3.91
Dashboard /wp-admin3.33 ▲0.0345.65 ▼8.28
Posts /wp-admin/edit.php3.38 ▲0.0351.16 ▲0.65
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.72 ▼13.14
Media Library /wp-admin/upload.php3.25 ▲0.0234.97 ▼0.71
SimpleDRM /wp-admin/options-general.php?page=simpleDRM_options_page3.235,604.47

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

SimpleDRM: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.28 ▼1.303.84 ▲1.9835.87 ▼9.48
Dashboard /wp-admin2,210 ▲225.84 ▲0.97109.32 ▼1.5241.95 ▼0.18
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0138.56 ▲5.0435.42 ▲0.75
Add New Post /wp-admin/post-new.php1,538 ▲2423.34 ▲5.80682.43 ▲0.8065.49 ▲13.58
Media Library /wp-admin/upload.php1,392 ▲104.19 ▼0.0191.99 ▼2.6241.08 ▼0.24
SimpleDRM /wp-admin/options-general.php?page=simpleDRM_options_page7692.0324.1626.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/simple-drm/simple-drm.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: woocommerce plugin, ebook reader, copyright, drm, media distribution

simple-drm/simple-drm.php Passed 13 tests

"SimpleDRM" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
116 characters long description:
DRM protection for downloadable goods (ebooks, videos...) sold by Woocommerce sites, based on the apps by Paradimage

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
Everything looks great! No dangerous files found in this plugin477 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2154137352
PO File23232125

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity62.00
▷ Minimum class complexity62.00
▷ Maximum class complexity62.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1372.22%
▷ Protected methods00.00%
▷ Private methods527.78%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin