84% advanced-notifications

Code Review | Advanced Notifications

WordPress plugin Advanced Notifications scored84%from 54 tests.

About plugin

  • Plugin page: advanced-notifica...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 3, 2021
  • Latest release: Jan 16, 2023
  • Number of updates: 23
  • Update frequency: every 19.1 days
  • Top authors: yehi (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /1,530 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: ▲1.05MB] [CPU: ▲9.20ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Notifications
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.33 ▲0.8654.79 ▲4.95
Dashboard /wp-admin4.45 ▲1.1465.68 ▲14.11
Posts /wp-admin/edit.php4.49 ▲1.1368.89 ▲12.72
Add New Post /wp-admin/post-new.php6.97 ▲1.08105.52 ▲5.01
Media Library /wp-admin/upload.php4.37 ▲1.1355.19 ▲20.21
Settings /wp-admin/edit.php?post_type=a_notifications&page=an_settings4.3759.37

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 139 new files
Database: no new tables, 10 new options
New WordPress options
eis_interfaces_default
eis_version
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
eis_register_interfaces
widget_theysaidso_widget
widget_recent-comments
eis_interfaces_shortcode

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Notifications
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲12114.73 ▲0.331.94 ▲0.0545.45 ▲2.21
Dashboard /wp-admin2,262 ▲885.65 ▼0.1191.20 ▲0.0738.73 ▼3.92
Posts /wp-admin/edit.php2,164 ▲612.02 ▼0.0243.15 ▲3.8035.22 ▲0.01
Add New Post /wp-admin/post-new.php6,278 ▲4,74321.02 ▲2.68890.01 ▲246.7574.45 ▲6.79
Media Library /wp-admin/upload.php1,462 ▲624.24 ▲0.0298.94 ▼2.1543.08 ▲0.63
Settings /wp-admin/edit.php?post_type=a_notifications&page=an_settings1,1783.5849.8632.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_recent-posts
    • eis_version
    • theysaidso_admin_options
    • db_upgraded
    • eis_interfaces_shortcode
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • eis_interfaces_default
    • eis_register_interfaces

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 18× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/easy-interface-settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function eis_interface_tabs_options_print() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/templates/meta-box/default/eis-theme.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/includes/eis-templates.php:93
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/includes/an-interface-api.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/autoload.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/includes/an-cpt.php:160
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/advanced-notifications/includes/an-single.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/includes/an-functions.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/includes/eis-admin-functions.php:82
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/includes/eis-functions.php:233

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Display notifications on the site), #2 (The list of alerts), #3 (Edit the contents of an alert), #4 (Alert Notice settings, will soon be more options), #5 (Options for displaying alerts on a specific page)
You can take inspiration from this readme.txt

advanced-notifications/advanced-notifications.php Passed 13 tests

The main file in "Advanced Notifications" v. 1.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
74 characters long description:
Advanced Notifications allows you to create beautiful custom notifications

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected8,902 lines of code in 122 files:
LanguageFilesBlank linesComment linesLines of code
PHP181331,0683,261
CSS14134643,122
JavaScript902621512,519

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity70.20
▷ Minimum class complexity1.00
▷ Maximum class complexity204.00
Average method complexity6.73
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods61
▷ Static methods00.00%
▷ Public methods61100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions107
▷ Named functions10497.20%
▷ Anonymous functions32.80%
Constants9
▷ Global constants9100.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
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/top-right.png0.70KB0.36KB▼ 48.19%
assets/images/bottom-left.png0.61KB0.28KB▼ 53.44%
assets/images/bottom-right.png0.61KB0.28KB▼ 53.99%
assets/images/top-left.png0.71KB0.37KB▼ 48.43%