90% javascript-notifier

Code Review | JavaScript Notifier

WordPress plugin JavaScript Notifier scored90%from 54 tests.

About plugin

  • Plugin page: javascript-notifier
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.3
  • WordPress version: 6.3.1
  • First release: May 26, 2018
  • Latest release: Aug 12, 2023
  • Number of updates: 31
  • Update frequency: every 61.4 days
  • Top authors: freemp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /984 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.19ms] Passed 4 tests

A check of server-side resources used by JavaScript Notifier
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0133.21 ▼16.02
Dashboard /wp-admin3.32 ▲0.0244.07 ▼5.05
Posts /wp-admin/edit.php3.37 ▲0.0139.81 ▼5.80
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.92 ▼9.90
Media Library /wp-admin/upload.php3.24 ▲0.0133.83 ▲3.08
JavaScript Notifier /wp-admin/options-general.php?page=javascript-notifier-settings3.2126.31

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
javascript_notifier_settings

Browser metrics Passed 4 tests

Checking browser requirements for JavaScript Notifier
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲11413.47 ▼0.911.72 ▼0.1037.12 ▼9.46
Dashboard /wp-admin2,229 ▲415.17 ▼0.71119.58 ▲5.3340.79 ▼6.80
Posts /wp-admin/edit.php2,093 ▲42.32 ▲0.2833.97 ▼1.6532.11 ▼4.13
Add New Post /wp-admin/post-new.php1,536 ▲323.32 ▲0.11609.06 ▼41.7135.00 ▼23.03
Media Library /wp-admin/upload.php1,415 ▲304.36 ▲0.16119.99 ▲9.0246.82 ▼3.48
JavaScript Notifier /wp-admin/options-general.php?page=javascript-notifier-settings1,1002.2554.6932.06

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: warning, disabled, javascript, alert, notification...

javascript-notifier/javascript-notifier.php Passed 13 tests

"JavaScript Notifier" version 1.2.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
100 characters long description:
Notify visitors of your website if 1st-party JavaScript is disabled. Block entire site, if required.

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
Everything looks great! No dangerous files found in this plugin165 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP41315132
CSS10023
XML1007
JavaScript1003

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions112.50%
▷ Anonymous functions787.50%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png20.58KB10.94KB▼ 46.84%
screenshot-2.png14.73KB9.45KB▼ 35.87%
screenshot-1.png13.64KB21.27KB0.00%