88% dw-notifications

Code Review | DW Notifications

WordPress plugin DW Notifications scored 88% from 54 tests.

About plugin

  • Plugin page: dw-notifications
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 5.9.2
  • First release: Jun 13, 2018
  • Latest release: May 16, 2019
  • Number of updates: 17
  • Update frequency: every 19.8 days
  • Top authors: designwall (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active / 2,620 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼289.72ms] Passed 4 tests

Analyzing server-side resources used by DW Notifications
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.2659.67 ▼3.40
Dashboard /wp-admin3.62 ▲0.2141.89 ▲1.67
Posts /wp-admin/edit.php3.84 ▲0.2045.73 ▲2.74
Add New Post /wp-admin/post-new.php7.17 ▲0.18110.10 ▼1,159.88
Media Library /wp-admin/upload.php3.56 ▲0.2734.31 ▲7.10
All Notifications /wp-admin/edit.php?post_type=dw-notification3.6129.87
Add New /wp-admin/post-new.php?post_type=dw-notification3.8447.91
Settings /wp-admin/edit.php?post_type=dw-notification&page=dw-notification-settings3.4725.69

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for DW Notifications
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,969 ▲22516.62 ▲1.069.64 ▲2.842.62 ▲0.09
Dashboard /wp-admin2,938 ▲836.16 ▼0.03120.09 ▼20.70155.33 ▼7.44
Posts /wp-admin/edit.php2,734 ▲433.25 ▲0.0163.53 ▼0.88138.47 ▼3.76
Add New Post /wp-admin/post-new.php1,700 ▲3918.12 ▲1.25398.35 ▼17.43149.11 ▼4.38
Media Library /wp-admin/upload.php1,745 ▲505.55 ▲0.03146.03 ▲2.94184.67 ▼1.61
All Notifications /wp-admin/edit.php?post_type=dw-notification1,4343.1858.30112.24
Add New /wp-admin/post-new.php?post_type=dw-notification3,13010.07195.15226.88
Settings /wp-admin/edit.php?post_type=dw-notification&page=dw-notification-settings1,0182.4753.96130.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/dw-notifications/templates/default/notification-popup.php
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/dw-notifications/templates/default/notification-alert.php:10
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/dw-notifications/templates/default/notification-item.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/dw-notifications/templates/default/notification-item.php:4
    • > PHP Notice
      Undefined variable: notification in wp-content/plugins/dw-notifications/templates/default/notification-popup-item.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dw-notifications/libs/custom-list-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/dw-notifications/libs/custom-list-table.php on line 4
    • > PHP Notice
      Undefined variable: notification in wp-content/plugins/dw-notifications/templates/default/notification-item.php on line 2
    • > PHP Notice
      Trying to get property 'post_date' of non-object in wp-content/plugins/dw-notifications/templates/default/notification-item.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/dw-notifications/templates/default/notification-list.php:8
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/dw-notifications/templates/default/notification-alert.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: Please take inspiration from this readme.txt

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

"DW Notifications" version 1.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
57 characters long description:
A WordPress plugin developed by DesignWall.com to nofity.

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 plugin2,724 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP20328991,377
JavaScript313736745
CSS2149436
PO File26367166

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity13.64
▷ Minimum class complexity2.00
▷ Maximum class complexity51.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods86
▷ Static methods11.16%
▷ Public methods86100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/switch.png0.53KB0.64KB0.00%
(invalid) assets/images/image_default.png1.49KB0.00KB▼ 100.00%