73% activedemand

Code Review | ActiveDEMAND

WordPress plugin ActiveDEMAND scored73%from 54 tests.

About plugin

  • Plugin page: activedemand
  • Plugin version: 0.2.40
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2015
  • Latest release: Aug 2, 2023
  • Number of updates: 373
  • Update frequency: every 8.2 days
  • Top authors: Poniard (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /29,845 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▲550.01ms] 50% from 4 tests

An overview of server-side resources used by ActiveDEMAND
Please have a look at the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 793.32ms on /wp-admin/options-general.php?page=activedemand_options)
  • Extra CPU: Try to keep extra CPU usage under 200.00ms (currently 550.01ms on /wp-admin/options-general.php?page=activedemand_options)
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0946.43 ▲3.83
Dashboard /wp-admin3.45 ▲0.15874.61 ▲820.61
Posts /wp-admin/edit.php3.50 ▲0.15835.01 ▲781.98
Add New Post /wp-admin/post-new.php5.83 ▼0.05796.20 ▲697.87
Media Library /wp-admin/upload.php3.31 ▲0.08753.35 ▲716.36
ActiveDEMAND /wp-admin/options-general.php?page=activedemand_options3.29793.32

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 28 new files
Database: 4 new tables, 8 new options
New tables
wp_cart_product
wp_cart
wp_activedemand_access_rule
wp_activedemand_access
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
run_only_once_indexes
widget_recent-posts
activedemand_version

Browser metrics Passed 4 tests

An overview of browser requirements for ActiveDEMAND
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲10113.86 ▼0.779.44 ▲7.3642.43 ▲2.32
Dashboard /wp-admin2,211 ▲315.73 ▲0.0787.35 ▼2.1241.53 ▲2.94
Posts /wp-admin/edit.php2,119 ▲162.17 ▲0.2133.65 ▼6.5837.00 ▼0.73
Add New Post /wp-admin/post-new.php6,271 ▲4,74318.99 ▼4.06921.40 ▲227.6240.41 ▼10.71
Media Library /wp-admin/upload.php1,419 ▲194.25 ▲0.06103.19 ▼0.3142.87 ▼2.01
ActiveDEMAND /wp-admin/options-general.php?page=activedemand_options9231.7526.0028.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_activedemand_access_rule
    • wp_cart_product
    • wp_cart
    • wp_activedemand_access
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • activedemand_version
    • db_upgraded
    • theysaidso_admin_options
    • run_only_once_indexes
    • can_compress_scripts
    • widget_recent-comments

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
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\get_option() in wp-content/plugins/activedemand/partials/tinymce-editor.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\add_action() in wp-content/plugins/activedemand/linked-forms.php:664
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\activedemand_api_url() in wp-content/plugins/activedemand/landing-pages.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\plugin_dir_path() in wp-content/plugins/activedemand/ActiveDEMAND.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ActiveDemand\\add_shortcode() in wp-content/plugins/activedemand/class-SCCollector.php:124

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: A description for screenshot #5 is missing in activedemand/assets to your readme.txt
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

activedemand/ActiveDEMAND.php 85% from 13 tests

Analyzing the main PHP file in "ActiveDEMAND" version 0.2.40
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 187 characters long)
  • Main file name: Even though not officially enforced, the main 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
Everything looks great! No dangerous files found in this plugin3,327 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP65571773,042
JavaScript114022283
CSS2072

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity86.50
▷ Minimum class complexity10.00
▷ Maximum class complexity163.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods934.62%
▷ Public methods2492.31%
▷ Protected methods00.00%
▷ Private methods27.69%
Functions83
▷ Named functions7691.57%
▷ Anonymous functions78.43%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/icons/favicon.png3.34KB2.27KB▼ 32.03%
images/ActiveDEMAND-Transparent.png12.38KB5.41KB▼ 56.34%
images/favicon (1).png3.34KB2.27KB▼ 32.03%
images/ActiveDEMAND-Transparent (1).png12.38KB5.41KB▼ 56.34%
images/Screenshot2.png22.25KB8.14KB▼ 63.41%