94% a-dashboard-notice

Code Review | A Dashboard Notice

WordPress plugin A Dashboard Notice scored 94% from 54 tests.

About plugin

  • Plugin page: a-dashboard-notice
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.7
  • WordPress version: 5.9.2
  • First release: May 12, 2014
  • Latest release: Dec 21, 2016
  • Number of updates: 9
  • Update frequency: every 106.1 days
  • Top authors: dlh (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,099 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼307.12ms] Passed 4 tests

A check of server-side resources used by A Dashboard Notice
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0152.67 ▲2.89
Dashboard /wp-admin3.45 ▲0.0335.05 ▲1.05
Posts /wp-admin/edit.php3.68 ▲0.0343.18 ▲6.74
Add New Post /wp-admin/post-new.php6.92 ▼0.05105.27 ▼1,229.46
Media Library /wp-admin/upload.php3.33 ▲0.0225.33 ▼2.96
A Dashboard Notice /wp-admin/options-general.php?page=a_dashboard_notice3.3022.82

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by A Dashboard Notice
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲4615.90 ▲0.206.12 ▲0.092.37 ▲0.22
Dashboard /wp-admin2,897 ▲396.06 ▼0.26118.75 ▼14.91152.22 ▼9.34
Posts /wp-admin/edit.php2,696 ▲23.24 ▲0.0063.75 ▼0.94138.61 ▼4.70
Add New Post /wp-admin/post-new.php1,663 ▲217.34 ▲1.75406.09 ▼29.78155.42 ▼5.64
Media Library /wp-admin/upload.php1,703 ▲55.50 ▲0.01135.58 ▼5.14183.05 ▼8.70
A Dashboard Notice /wp-admin/options-general.php?page=a_dashboard_notice1,0072.4152.30113.05

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/a-dashboard-notice/lib/class-adn-settings.php:135
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/a-dashboard-notice/lib/notice.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/a-dashboard-notice/a-dashboard-notice.php:26

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 issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: dashboard

a-dashboard-notice/a-dashboard-notice.php Passed 13 tests

The main PHP file in "A Dashboard Notice" ver. 0.2.0 adds more information about the plugin and also serves as the entry point for this plugin
57 characters long description:
Display a notice in the WordPress Dashboard to all users.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin133 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33235133

PHP code Passed 2 tests

Analyzing 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.33
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods880.00%
▷ Protected methods220.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin