84% product-notifier

Code Review | Product Notifier

WordPress plugin Product Notifier scored84%from 54 tests.

About plugin

  • Plugin page: product-notifier
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.9.3
  • WordPress version: 6.3.1
  • First release: May 18, 2022
  • Latest release: May 21, 2022
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: mitchbom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /280 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Product Notifier
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.48 ▲3.09
Dashboard /wp-admin3.33 ▼0.0249.04 ▼24.71
Posts /wp-admin/edit.php3.38 ▲0.0251.67 ▼4.36
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.44 ▼14.33
Media Library /wp-admin/upload.php3.25 ▲0.0234.99 ▼1.59

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Product Notifier
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.39 ▲0.042.08 ▲0.4845.13 ▲3.64
Dashboard /wp-admin2,204 ▲245.58 ▼0.0187.35 ▼4.6741.22 ▼3.10
Posts /wp-admin/edit.php2,110 ▲72.02 ▲0.0437.15 ▲0.9134.86 ▼2.16
Add New Post /wp-admin/post-new.php1,537 ▲1123.06 ▲0.03637.70 ▼44.3961.60 ▲4.76
Media Library /wp-admin/upload.php1,406 ▲64.21 ▲0.0597.27 ▼6.5246.16 ▼1.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

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)
Even though no errors were found, this is by no means an exhaustive test

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
Please take a closer look at the following
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/product-notifier/includes/class-wpn-product-frontend.php
    • > /wp-content/plugins/product-notifier/includes/class-wpn-product-options-api.php
    • > /wp-content/plugins/product-notifier/product-notifier.php
    • > /wp-content/plugins/product-notifier/includes/class-wpn-settings-tab-api.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Once plugin is activated, click checkbox to enable message notification), #2 (Go to Product Backend, type message and enable/disable button and set button text and link), #3 (Front view of single template)
The official readme.txt might help

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

The main file in "Product Notifier" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
118 characters long description:
Once click to enable/disable Notification. This plugin help you to display messages/alerts on product single template.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin359 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP49923280
CSS14079

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.00
▷ Minimum class complexity2.00
▷ Maximum class complexity10.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods14.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.61MB with 0.36MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png69.41KB34.83KB▼ 49.82%
screenshot-1.png49.42KB23.87KB▼ 51.71%
screenshot-3.png510.38KB122.27KB▼ 76.04%