84% download-monitor-restrict-content-integration

Code Review | Download Monitor & Restrict Content integration

WordPress plugin Download Monitor & Restrict Content integration scored84%from 54 tests.

About plugin

  • Plugin page: download-monitor-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Oct 18, 2022
  • Latest release: Aug 9, 2023
  • Number of updates: 6
  • Update frequency: every 49.7 days
  • Top authors: raldea89 (83.33%)giucu91 (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /986 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.08ms] Passed 4 tests

Server-side resources used by Download Monitor & Restrict Content integration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0736.49 ▼4.29
Dashboard /wp-admin3.37 ▲0.0647.68 ▼2.11
Posts /wp-admin/edit.php3.42 ▲0.0650.07 ▲3.06
Add New Post /wp-admin/post-new.php5.95 ▲0.0697.08 ▲0.64
Media Library /wp-admin/upload.php3.29 ▲0.0635.65 ▼2.56

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Download Monitor & Restrict Content integration
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.32 ▼0.861.67 ▼0.1641.25 ▼11.57
Dashboard /wp-admin2,206 ▲215.88 ▲0.88106.18 ▼9.9438.03 ▼9.14
Posts /wp-admin/edit.php2,092 ▲62.13 ▲0.0738.48 ▲1.3335.79 ▲4.14
Add New Post /wp-admin/post-new.php1,542 ▲2318.36 ▼4.53616.33 ▼41.3454.12 ▼6.46
Media Library /wp-admin/upload.php1,388 ▲34.19 ▲0.0393.19 ▼6.1941.79 ▼3.02

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/download-monitor-restrict-content-integration/dlm-aam-restrict-content-pro.php:37

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

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

download-monitor-restrict-content-integration/dlm-aam-restrict-content-pro.php 92% from 13 tests

"Download Monitor & Restrict Content integration" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("download-monitor-restrict-content-integration.php" instead of "dlm-aam-restrict-content-pro.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
No dangerous file extensions were detected213 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP275127211
Markdown1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.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
There were not PNG files found in your plugin