84% wp-admin-notification

Code Review | WP Admin Notification

WordPress plugin WP Admin Notification scored84%from 54 tests.

About plugin

  • Plugin page: wp-admin-notifica...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1
  • WordPress version: 6.3.1
  • First release: Feb 11, 2015
  • Latest release: Feb 11, 2015
  • Number of updates: 3
  • Update frequency: every 4.7 days
  • Top authors: horike (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,007 total downloads

Benchmarks

Plugin footprint 83% 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.06MB] [CPU: ▼8.35ms] Passed 4 tests

A check of server-side resources used by WP Admin Notification
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0634.40 ▼11.11
Dashboard /wp-admin3.36 ▲0.0644.68 ▼4.08
Posts /wp-admin/edit.php3.41 ▲0.0646.51 ▲2.37
Add New Post /wp-admin/post-new.php5.96 ▲0.0780.45 ▼16.41
Media Library /wp-admin/upload.php3.28 ▲0.0531.95 ▼1.80
Add New /wp-admin/post-new.php?post_type=notification3.3945.00
Notification /wp-admin/edit.php?post_type=notification3.3242.02

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Admin Notification
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲7413.32 ▼1.061.60 ▼0.4238.00 ▼7.98
Dashboard /wp-admin2,248 ▲604.88 ▲0.02103.14 ▼13.1439.84 ▼2.12
Posts /wp-admin/edit.php2,134 ▲452.23 ▲0.2341.50 ▲3.3735.01 ▲0.14
Add New Post /wp-admin/post-new.php1,550 ▲3623.29 ▲5.77586.94 ▼31.3565.04 ▲14.59
Media Library /wp-admin/upload.php1,424 ▲364.31 ▲0.1599.00 ▲0.8741.80 ▼0.38
Add New /wp-admin/post-new.php?post_type=notification2,2467.75187.8864.33
Notification /wp-admin/edit.php?post_type=notification1,0922.1732.0431.03

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

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

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-admin-notification/wp-admin-notification.php:32

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 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Editing Message.), #2 (Show Message.), #3 (Show checking user)
The official readme.txt might help

wp-admin-notification/wp-admin-notification.php Passed 13 tests

The principal PHP file in "WP Admin Notification" v. 1.0 is loaded by WordPress automatically on each request
31 characters long description:
Show message from administrator

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin236 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP14920176
PO File181327
JavaScript11020
Markdown17013

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.45MB with 0.25MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png267.62KB92.28KB▼ 65.52%
screenshot-2.png104.15KB35.02KB▼ 66.38%
screenshot-3.png89.75KB30.36KB▼ 66.17%
img/check.png1.01KB0.76KB▼ 24.71%