84% noti-activity-notification

Code Review | Noti - Activity Notification

WordPress plugin Noti - Activity Notification scored84%from 54 tests.

About plugin

  • Plugin page: noti-activity-not...
  • Plugin version: 0.1.0
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.9.0
  • WordPress version: 6.3.1
  • First release: Feb 11, 2022
  • Latest release: Mar 13, 2022
  • Number of updates: 4
  • Update frequency: every 7.5 days
  • Top authors: vasyltech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /596 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.64MB] [CPU: ▲2.95ms] Passed 4 tests

An overview of server-side resources used by Noti - Activity Notification
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5745.95 ▲10.17
Dashboard /wp-admin4.00 ▲0.6656.53 ▼2.58
Posts /wp-admin/edit.php4.05 ▲0.6951.09 ▲5.12
Add New Post /wp-admin/post-new.php6.77 ▲0.8992.81 ▲2.33
Media Library /wp-admin/upload.php3.87 ▲0.6442.71 ▲6.94

Server storage [IO: ▲0.50MB] [DB: ▲0.02MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 83 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
noti_event_type_cat_children
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
noti-version
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Noti - Activity Notification
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲11113.65 ▼0.754.55 ▲2.9743.67 ▲4.45
Dashboard /wp-admin2,260 ▲695.83 ▲0.96100.71 ▼0.0936.61 ▼7.15
Posts /wp-admin/edit.php2,146 ▲572.02 ▼0.0936.18 ▲0.7732.30 ▼3.22
Add New Post /wp-admin/post-new.php1,536 ▲323.45 ▲0.19663.53 ▼5.8950.92 ▲0.47
Media Library /wp-admin/upload.php1,449 ▲674.44 ▲0.2797.37 ▼1.1442.95 ▼1.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • noti_event_type_cat_children
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Interface 'Vectorface\\Whip\\IpRange\\IpRange' not found in wp-content/plugins/noti-activity-notification/vendor/whip/IpRange/Ipv6Range.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Vectorface\\Whip\\IpRange\\IpRange' not found in wp-content/plugins/noti-activity-notification/vendor/whip/IpRange/Ipv4Range.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Vectorface\\Whip\\Request\\RequestAdapter' not found in wp-content/plugins/noti-activity-notification/vendor/whip/Request/Psr7RequestAdapter.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/noti-activity-notification/vendor/psr-http-message/ResponseInterface.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Vectorface\\Whip\\Request\\RequestAdapter' not found in wp-content/plugins/noti-activity-notification/vendor/whip/Request/SuperglobalRequestAdapter.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/noti-activity-notification/vendor/psr-http-message/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/noti-activity-notification/vendor/psr-http-message/ServerRequestInterface.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: user activity, tracking, audit log, notifications

noti-activity-notification/noti-activity-notification.php 85% from 13 tests

The main PHP script in "Noti - Activity Notification" version 0.1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/lang/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin6,124 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,4673,7474,888
JSON2600664
JavaScript25676482
CSS18060
SQL12030

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity18.31
▷ Minimum class complexity1.00
▷ Maximum class complexity230.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces14
Interfaces9
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods337
▷ Static methods9127.00%
▷ Public methods20962.02%
▷ Protected methods10731.75%
▷ Private methods216.23%
Functions31
▷ Named functions00.00%
▷ Anonymous functions31100.00%
Constants25
▷ Global constants416.00%
▷ Class constants2184.00%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin