10% rhj4-notifications

Code Review | RHJ4 Notifications

WordPress plugin RHJ4 Notifications scored 10% from 54 tests.

About plugin

  • Plugin page: rhj4-notifications
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 5.8.1
  • First release: Sep 20, 2014
  • Latest release: Sep 23, 2014
  • Number of updates: 5
  • Update frequency: every 3.6 days
  • Top authors: rhj4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 543 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method RHJ4Notifications::activate() should not be called statically

Server metrics [RAM: ▼0.62MB] [CPU: ▼167.87ms] Passed 4 tests

A check of server-side resources used by RHJ4 Notifications
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.1345.03 ▲12.26
Dashboard /wp-admin3.03 ▼0.0321.97 ▼21.52
Posts /wp-admin/edit.php3.03 ▼0.0825.29 ▼12.38
Add New Post /wp-admin/post-new.php3.03 ▼2.4024.28 ▼630.94
Media Library /wp-admin/upload.php3.03 ▲0.0325.00 ▼6.63
RHJ4 Notifications /wp-admin/options-general.php?page=rhj4_notifications3.0324.79

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 49 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for RHJ4 Notifications
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,845 ▲24916.54 ▲1.0313.29 ▲5.1654.82 ▲2.58
Dashboard /wp-admin2,986 ▲556.11 ▲0.20137.85 ▼7.97124.92 ▲3.83
Posts /wp-admin/edit.php2,758 ▲192.73 ▲0.0370.21 ▲6.0291.81 ▼7.36
Add New Post /wp-admin/post-new.php2,080 ▲47615.90 ▼2.95374.76 ▼19.14109.22 ▼2.83
Media Library /wp-admin/upload.php1,825 ▲185.14 ▲0.11167.49 ▲17.50125.55 ▲4.57
RHJ4 Notifications /wp-admin/options-general.php?page=rhj4_notifications1,1322.3956.8579.73

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/rhj4-notifications/rhj4_notification_settings.php+59
    Trying to access array offset on value of type bool

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rhj4_notifications
    • > Notice in wp-content/plugins/rhj4-notifications/rhj4_notification_settings.php+233
    Trying to access array offset on value of type bool

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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/rhj4-notifications/include/short_demo.php
    • > /wp-content/plugins/rhj4-notifications/include/long_demo.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rhj4-notifications/rhj4_notifications.php:1182
    • > PHP Fatal error
      Uncaught Error: Class 'RHJ4Notifications' not found in wp-content/plugins/rhj4-notifications/include/demo.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Notifications_Demo.png), #2 (This is the second screen shot)
The official readme.txt might help

rhj4-notifications/rhj4_notifications.php 92% from 13 tests

The main PHP script in "RHJ4 Notifications" version 1.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("rhj4-notifications.php" instead of "rhj4_notifications.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected2,801 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP82513741,225
JavaScript6168385936
CSS26646378
HTML115438250
SQL151412

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity59.50
▷ Minimum class complexity11.00
▷ Maximum class complexity108.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods51
▷ Static methods11.96%
▷ Public methods4996.08%
▷ Protected methods00.00%
▷ Private methods23.92%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants00.00%
▷ Class constants17100.00%
▷ Public constants17100.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
26 PNG files occupy 0.27MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Reminder-DateTime-32x32.png3.00KB1.79KB▼ 40.45%
images/Reminder-16x16.png0.61KB0.61KB0.00%
images/Information-32x32.png1.95KB1.67KB▼ 14.13%
images/Tip-32x32.png1.45KB1.51KB0.00%
assets/Notifications_Demo.png124.04KB42.56KB▼ 65.69%