83% custom-dashboard-page

Code Review | Custom Dashboard Page

WordPress plugin Custom Dashboard Page scored83%from 54 tests.

About plugin

  • Plugin page: custom-dashboard-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.0.0
  • WordPress version: 6.3.1
  • First release: Jul 27, 2015
  • Latest release: Sep 25, 2022
  • Number of updates: 11
  • Update frequency: every 237.9 days
  • Top authors: raficsedu (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /10,436 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.03MB] [CPU: ▼12.83ms] Passed 4 tests

This is a short check of server-side resources used by Custom Dashboard Page
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.40 ▼1.23
Dashboard /wp-admin3.20 ▼0.1434.57 ▼28.90
Posts /wp-admin/edit.php3.37 ▲0.0149.15 ▼3.94
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.05 ▼17.24
Media Library /wp-admin/upload.php3.24 ▲0.0136.24 ▲0.11
Custom Dashboard /wp-admin/index.php?page=custom-dashboard3.2132.74

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Custom Dashboard Page
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,408 ▼1,35312.91 ▼1.442.13 ▲0.1345.65 ▲3.05
Dashboard /wp-admin783 ▼1,3942.05 ▼3.5432.28 ▼61.5930.49 ▼12.23
Posts /wp-admin/edit.php2,116 ▲161.97 ▼0.0637.74 ▲0.5134.01 ▼2.84
Add New Post /wp-admin/post-new.php1,692 ▲16621.78 ▼1.54700.48 ▲51.6339.44 ▼16.48
Media Library /wp-admin/upload.php1,416 ▲164.17 ▲0.02102.54 ▲8.3247.49 ▲5.41
Custom Dashboard /wp-admin/index.php?page=custom-dashboard7831.9924.8527.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/custom-dashboard-page/cdpp_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/custom-dashboard-page/custom_dashboard.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/custom-dashboard-page/sweet-custom-dashboard.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Preview a custom WordPress dashboard), #2 (Admin Settings to select a page)
You can take inspiration from this readme.txt

custom-dashboard-page/sweet-custom-dashboard.php 85% from 13 tests

The primary PHP file in "Custom Dashboard Page" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("custom-dashboard-page.php" instead of "sweet-custom-dashboard.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected95 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3253195

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin