73% activedemand

Code Review | ActiveDEMAND

WordPress plugin ActiveDEMAND scored 73% from 54 tests.

About plugin

  • Plugin page: activedemand
  • Plugin version: 0.2.27
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.9
  • WordPress version: 5.9.2
  • First release: Mar 17, 2015
  • Latest release: Feb 22, 2022
  • Number of updates: 345
  • Update frequency: every 7.4 days
  • Top authors: Poniard (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 19,762 total downloads


Plugin footprint 64% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.17MB] [CPU: ▲256.31ms] 50% from 4 tests

A check of server-side resources used by ActiveDEMAND
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 660.40ms on /wp-admin/options-general.php?page=activedemand_options)
  • Extra CPU: The extra CPU usage must be under 200.00ms (currently 256.31ms on /wp-admin/options-general.php?page=activedemand_options)
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0662.87 ▲11.92
Dashboard /wp-admin3.49 ▲0.09821.68 ▲788.80
Posts /wp-admin/edit.php3.73 ▲0.09938.50 ▲903.24
Add New Post /wp-admin/post-new.php6.04 ▼0.93791.45 ▼484.85
Media Library /wp-admin/upload.php3.45 ▲0.15734.33 ▲709.37
ActiveDEMAND /wp-admin/options-general.php?page=activedemand_options3.36660.40

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 29 new files
Database: 4 new tables, 1 new option
New tables
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for ActiveDEMAND
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,888 ▲14416.98 ▲1.039.43 ▲2.962.56 ▼0.38
Dashboard /wp-admin2,912 ▲546.56 ▲0.19120.19 ▼19.04156.15 ▼8.92
Posts /wp-admin/edit.php2,705 ▲143.46 ▲0.0264.74 ▲0.70142.05 ▼2.74
Add New Post /wp-admin/post-new.php1,735 ▼3817.22 ▼4.13439.17 ▼58.54161.34 ▼1.09
Media Library /wp-admin/upload.php1,718 ▲205.78 ▲0.08126.34 ▼14.52176.51 ▼16.10
ActiveDEMAND /wp-admin/options-general.php?page=activedemand_options1,2282.8957.00116.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_activedemand_access
    • wp_cart_product
    • wp_activedemand_access_rule
    • wp_cart
  • This plugin does not fully uninstall, leaving 1 option in the database
    • activedemand_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\plugin_dir_path() in wp-content/plugins/activedemand/ActiveDEMAND.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_page_id() in wp-content/plugins/activedemand/recover-cart.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\add_action() in wp-content/plugins/activedemand/linked-forms.php:655
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\add_shortcode() in wp-content/plugins/activedemand/class-SCCollector.php:123
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/activedemand/partials/tinymce-editor.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\add_action() in wp-content/plugins/activedemand/landing-pages.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected


Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: There are too many tags (16 tag instead of maximum 10)
  • Screenshots: Please a description for screenshot #5 in activedemand/assets to your readme.txt
Please take inspiration from this readme.txt

activedemand/ActiveDEMAND.php 85% from 13 tests

The entry point to "ActiveDEMAND" version 0.2.27 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 187 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("activedemand.php" instead of "ActiveDEMAND.php")

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 detected3,253 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity85.50
▷ Minimum class complexity10.00
▷ Maximum class complexity161.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods934.62%
▷ Public methods2492.31%
▷ Protected methods00.00%
▷ Private methods27.69%
▷ Named functions7292.31%
▷ Anonymous functions67.69%
▷ Global constants14100.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
8 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ActiveDEMAND-Transparent (1).png12.38KB5.41KB▼ 56.34%
images/favicon (1).png3.34KB2.27KB▼ 32.03%
images/Screenshot2.png22.25KB8.14KB▼ 63.41%
images/Screenshot3.png6.20KB3.82KB▼ 38.38%
images/favicon.png3.34KB2.27KB▼ 32.03%