73% wp-admin-notification-center

Code Review | Hide admin notices - Admin Notification Center

WordPress plugin Hide admin notices - Admin Notification Center scored73%from 54 tests.

About plugin

  • Plugin page: wp-admin-notifica...
  • Plugin version: 3.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 8, 2020
  • Latest release: Nov 12, 2023
  • Number of updates: 33
  • Update frequency: every 39.8 days
  • Top authors: roumi (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

2,000+ active /16,929 total downloads

Benchmarks

Plugin footprint 65% from 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.11MB] [CPU: ▼7.54ms] Passed 4 tests

An overview of server-side resources used by Hide admin notices - Admin Notification Center
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.72 ▼8.35
Dashboard /wp-admin3.44 ▲0.0946.87 ▼14.94
Posts /wp-admin/edit.php3.55 ▲0.1950.51 ▲4.09
Add New Post /wp-admin/post-new.php6.04 ▲0.1592.08 ▼6.58
Media Library /wp-admin/upload.php3.36 ▲0.1334.94 ▼0.29
Hide Admin Notice /wp-admin/admin.php?page=wp-admin-notification-center3.3432.45
Notice Listing /wp-admin/admin.php?page=notice-listing3.3834.10

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 52 new files
Database: 1 new table, 8 new options
New tables
wp_wanc_notice
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
wanc_version
db_upgraded
widget_recent-comments
wanc_display_settings

Browser metrics Passed 4 tests

Hide admin notices - Admin Notification Center: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲12614.32 ▼0.021.60 ▼0.2842.15 ▼1.91
Dashboard /wp-admin2,278 ▲1045.70 ▲0.1994.30 ▼7.9175.92 ▲31.16
Posts /wp-admin/edit.php2,186 ▲861.96 ▼0.0738.10 ▲1.7335.25 ▲0.25
Add New Post /wp-admin/post-new.php1,595 ▲6523.32 ▲0.35663.90 ▼16.7937.89 ▼18.09
Media Library /wp-admin/upload.php1,477 ▲744.17 ▼0.05101.12 ▼5.2871.80 ▲28.20
Hide Admin Notice /wp-admin/admin.php?page=wp-admin-notification-center1,1322.0428.4235.83
Notice Listing /wp-admin/admin.php?page=notice-listing1,1452.0426.1236.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_wanc_notice
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • db_upgraded
    • wanc_version
    • widget_recent-posts
    • widget_theysaidso_widget
    • wanc_display_settings
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-admin-notification-center/src/views/notification_center.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-admin-notification-center/src/Views/notice/listing.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-admin-notification-center/src/Views/notification_center.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-admin-notification-center/index.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-admin-notification-center/src/Views/settings.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/wp-admin-notification-center/vendor/psr/container/src/NotFoundExceptionInterface.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WANC\\Repository' not found in wp-content/plugins/wp-admin-notification-center/src/Repositories/NoticeRepository.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-admin-notification-center/src/views/options.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/wp-admin-notification-center/src/Services/NoticeListingService.php:8

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 errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: Please take inspiration from this readme.txt

wp-admin-notification-center/index.php 77% from 13 tests

The principal PHP file in "Hide admin notices - Admin Notification Center" v. 3.0.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-admin-notification-center.php" instead of "index.php")
  • Domain Path: The domain path folder does not exist ("/languages")

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
Everything looks great! No dangerous files found in this plugin1,916 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP363714841,588
JavaScript22217142
JSON300105
CSS39064
SVG10014
Markdown1203

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.80
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces9
Interfaces3
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods111
▷ Static methods2825.23%
▷ Public methods10594.59%
▷ Protected methods21.80%
▷ Private methods43.60%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
No PNG images were found in this plugin