72% notifications-center

Code Review | Notifications Center

WordPress plugin Notifications Center scored72%from 54 tests.

About plugin

  • Plugin page: notifications-center
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.2.0
  • WordPress version: 6.3.1
  • First release: Aug 2, 2016
  • Latest release: Dec 4, 2019
  • Number of updates: 58
  • Update frequency: every 21.0 days
  • Top authors: Ninadjeret (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,000 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.27MB] [CPU: ▼10.26ms] Passed 4 tests

Analyzing server-side resources used by Notifications Center
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2744.39 ▲2.25
Dashboard /wp-admin3.58 ▲0.2347.86 ▼15.54
Posts /wp-admin/edit.php3.69 ▲0.3446.88 ▼4.36
Add New Post /wp-admin/post-new.php6.18 ▲0.3084.99 ▼23.39
Media Library /wp-admin/upload.php3.50 ▲0.2739.05 ▲7.25
Settings /wp-admin/edit.php?post_type=voy_notification&page=voynotif_settings3.4738.10
Email template /wp-admin/customize.php?url=http%3A%2F%2Fwp.com%2F%3Fvoynotif_template_preview_html%3Dsalted&return=http%3A%2F%2Fwp.com%2Fwp-admin%2Fwp-api.php&voynotif_template_preview_html=salted6.24174.82

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 73 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
voynotif_update_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Notifications Center
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6414.48 ▲0.101.99 ▲0.2345.01 ▲4.08
Dashboard /wp-admin2,225 ▲255.83 ▲0.02102.50 ▼5.0740.42 ▼4.04
Posts /wp-admin/edit.php2,110 ▲102.05 ▲0.0138.07 ▲0.3732.94 ▲1.14
Add New Post /wp-admin/post-new.php1,534 ▼1123.34 ▲0.02670.29 ▼20.3956.09 ▲4.01
Media Library /wp-admin/upload.php1,413 ▲164.24 ▲0.0297.97 ▼5.6447.37 ▲0.98
Settings /wp-admin/edit.php?post_type=voy_notification&page=voynotif_settings8112.0230.0124.03
Email template /wp-admin/customize.php?url=http%3A%2F%2Fwp.com%2F%3Fvoynotif_template_preview_html%3Dsalted&return=http%3A%2F%2Fwp.com%2Fwp-admin%2Fwp-api.php&voynotif_template_preview_html=salted4,56815.66417.3664.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • voynotif_update_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/notifications-center/templates/parts/header.php
    • > /wp-content/plugins/notifications-center/admin/views/tab-about.php
  • 42× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/notifications-center/templates/parts/woocommerce/order-details.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/notifications-center/core/class.logs.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'VOYNOTIF_notification_type' not found in wp-content/plugins/notifications-center/notifications/comment_reply.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/notifications-center/admin/settings.php:765
    • > PHP Fatal error
      Uncaught Error: Class 'VOYNOTIF_notification_type' not found in wp-content/plugins/notifications-center/notifications/content_future.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'VOYNOTIF_notification_type' not found in wp-content/plugins/notifications-center/notifications/user_password_changed.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function voynotif_email_background_color() in wp-content/plugins/notifications-center/templates/parts/footer.php:21
    • > PHP Notice
      Trying to get property 'button_color' of non-object in wp-content/plugins/notifications-center/templates/parts/woocommerce/order-details.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'VOYNOTIF_notification_type' not found in wp-content/plugins/notifications-center/notifications/user_login.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'VOYNOTIF_notification_type' not found in wp-content/plugins/notifications-center/notifications/user_register.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/customize.php?url=http%3A%2F%2Fwp.com%2F%3Fvoynotif_template_preview_html%3Dsalted&return=http%3A%2F%2Fwp.com%2Fwp-admin%2Fwp-api.php&voynotif_template_preview_html=salted
    • > Security (warning) in unknown
    /?voynotif_template_preview_html=salted&customize_changeset_uuid=7553736e-1665-401a-9eca-0a3fc7f887c5&customize_theme=twentytwentyone&customize_messenger_channel=preview-0 - An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #3 (Personnalize your choosen template to match your brand, your colors, etc.) image not found
You can look at the official readme.txt

notifications-center/notifications_center.php 92% from 13 tests

Analyzing the main PHP file in "Notifications Center" version 1.5.2
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("notifications-center.php" instead of "notifications_center.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
No dangerous file extensions were detected7,333 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
PHP551,6652,9415,996
CSS11664716
PO File2259326557
JavaScript218864

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.12
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes41
▷ Abstract classes00.00%
▷ Concrete classes41100.00%
▷ Final classes00.00%
Methods293
▷ Static methods186.14%
▷ Public methods28797.95%
▷ Protected methods10.34%
▷ Private methods51.71%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants666.67%
▷ Class constants333.33%
▷ Public constants3100.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
3 PNG files occupy 0.27MB with 0.19MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png66.14KB19.67KB▼ 70.25%
assets/screenshot-2.png119.21KB39.10KB▼ 67.21%
assets/screenshot-1.png94.50KB28.99KB▼ 69.32%