72% popup-notification-news-alert

Code Review | Toast Popup Notification News Alert

WordPress plugin Toast Popup Notification News Alert scored72%from 54 tests.

About plugin

  • Plugin page: popup-notificatio...
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Feb 27, 2020
  • Latest release: Aug 14, 2023
  • Number of updates: 17
  • Update frequency: every 74.4 days
  • Top authors: apsaraaruna (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,094 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.50MB] [CPU: ▼19.63ms] Passed 4 tests

Analyzing server-side resources used by Toast Popup Notification News Alert
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1944.14 ▲0.80
Dashboard /wp-admin3.51 ▲0.1648.33 ▼13.90
Posts /wp-admin/edit.php3.62 ▲0.2647.60 ▼1.79
Add New Post /wp-admin/post-new.php3.35 ▼2.5436.25 ▼63.63
Media Library /wp-admin/upload.php3.43 ▲0.2038.30 ▲2.08
Options /wp-admin/admin.php?page=popup_alert_options3.3729.66
Alerts /wp-admin/edit.php?post_type=popup_msg3.4837.29

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 36 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
popup_alert_display_options
popup_alert_input_examples
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
popup_alert_social_options

Browser metrics Passed 4 tests

Checking browser requirements for Toast Popup Notification News Alert
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲19914.00 ▼0.445.42 ▲3.6942.42 ▲3.75
Dashboard /wp-admin2,233 ▲455.85 ▲0.0094.44 ▼7.7281.61 ▲40.85
Posts /wp-admin/edit.php2,119 ▲302.00 ▼0.0034.90 ▼2.8432.01 ▼4.59
Add New Post /wp-admin/post-new.php1,695 ▲16222.23 ▼0.89742.22 ▲34.7751.73 ▼10.27
Media Library /wp-admin/upload.php1,412 ▲244.22 ▲0.0398.83 ▼3.9377.74 ▲31.95
Options /wp-admin/admin.php?page=popup_alert_options9262.0725.5928.89
Alerts /wp-admin/edit.php?post_type=popup_msg1,1272.0631.9729.07

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • db_upgraded
    • popup_alert_display_options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • popup_alert_input_examples
    • popup_alert_social_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=popup_alert_options
    • > Notice in wp-content/plugins/popup-notification-news-alert/admin/class-popup-alert-plugin-settings.php+475
    Undefined index: popup_type
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=popup_alert_options
    • > Notice in wp-content/plugins/popup-notification-news-alert/admin/class-popup-alert-plugin-settings.php+504
    Undefined index: popup_potision

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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/popup-notification-news-alert/public/partials/popup-alert-plugin-public-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_custom() in wp-content/plugins/popup-notification-news-alert/admin/partials/popup-alert-plugin-meta-box.templ.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/popup-notification-news-alert/admin/partials/nelio-nice-title-meta-box.templ.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/popup-notification-news-alert/admin/partials/popup-alert-plugin-admin-display.php:21

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
10 plugin tags: news alert, alert, popup, toast message, news notification...

popup-notification-news-alert/popup-alert-plugin.php 85% from 13 tests

"Toast Popup Notification News Alert" version 1.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("popup-notification-news-alert.php" instead of "popup-alert-plugin.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected874 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP17357833784
PO File1222560
JavaScript4106322
CSS4086
Markdown1002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods62
▷ Static methods34.84%
▷ Public methods5690.32%
▷ Protected methods00.00%
▷ Private methods69.68%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon.png2.79KB1.06KB▼ 61.90%