84% advanced-notifications

Code Review | Advanced Notifications

WordPress plugin Advanced Notifications scored 84% from 54 tests.

About plugin

  • Plugin page: advanced-notifica...
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.2-5.9
  • WordPress version: 5.9.2
  • First release: Nov 3, 2021
  • Latest release: Mar 4, 2022
  • Number of updates: 12
  • Update frequency: every 10.1 days
  • Top authors: yehi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 452 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.97MB] [CPU: ▼277.71ms] Passed 4 tests

Server-side resources used by Advanced Notifications
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.37 ▲0.8261.48 ▲15.07
Dashboard /wp-admin4.45 ▲1.0151.20 ▲17.58
Posts /wp-admin/edit.php4.73 ▲1.0654.84 ▲16.56
Add New Post /wp-admin/post-new.php7.99 ▲0.99114.76 ▼1,153.58
Media Library /wp-admin/upload.php4.40 ▲1.0740.36 ▲11.12

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 135 new files
Database: no new tables, 2 new options
New WordPress options
eis_version
eis_register_interfaces

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 /3,855 ▲10116.03 ▲0.436.94 ▲0.712.52 ▼0.31
Dashboard /wp-admin2,972 ▲1146.18 ▼0.01118.15 ▼13.79158.83 ▼3.86
Posts /wp-admin/edit.php2,773 ▲1163.25 ▲0.0262.92 ▼7.84142.58 ▼0.51
Add New Post /wp-admin/post-new.php1,780 ▲11921.65 ▲5.12428.05 ▲15.77175.79 ▲16.50
Media Library /wp-admin/upload.php1,772 ▲745.53 ▲0.00155.38 ▲13.37198.78 ▲5.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • eis_register_interfaces
    • eis_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > 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:221
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/includes/an-locations.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function eis_interfaces() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/includes/eis-page.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/interfaces/page-test.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-notifications/includes/an-designs.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function eis_interfaces() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/includes/eis-meta-box.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/includes/eis-update.php:4
    • > 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 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 add_action() in wp-content/plugins/advanced-notifications/plugins/easy-interface-settings/includes/eis-admin-functions.php:80

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that 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)
Please take inspiration from this readme.txt

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

Analyzing the main PHP file in "Advanced Notifications" version 1.0.9
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
Success! There were no dangerous files found in this plugin8,499 lines of code in 124 files:
LanguageFilesBlank linesComment linesLines of code
CSS14123603,042
PHP201321,6173,016
JavaScript902611452,441

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity64.80
▷ Minimum class complexity1.00
▷ Maximum class complexity204.00
Average method complexity7.22
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods52
▷ Static methods00.00%
▷ Public methods52100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions98
▷ Named functions9596.94%
▷ Anonymous functions33.06%
Constants9
▷ Global constants9100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/top-left.png0.71KB0.37KB▼ 48.43%
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%