10% wpnotify-notifications-for-woocommerce

Code Review | WPNotify - Notifications for WooCommerce

WordPress plugin WPNotify - Notifications for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: wpnotify-notifica...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5
  • WordPress version: 6.3.1
  • First release: Dec 3, 2020
  • Latest release: Dec 6, 2020
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: woonotify (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /786 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'woonotify_activate' not found or invalid function name

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

Server-side resources used by WPNotify - Notifications for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0241.79 ▲4.40
Dashboard /wp-admin3.33 ▼0.0248.00 ▼10.60
Posts /wp-admin/edit.php3.38 ▲0.0243.31 ▼2.59
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.48 ▼13.75
Media Library /wp-admin/upload.php3.25 ▲0.0237.09 ▲5.91

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WPNotify - Notifications for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,971 ▲21013.83 ▼0.5410.09 ▲8.3752.93 ▲11.46
Dashboard /wp-admin2,243 ▲695.62 ▼0.0394.71 ▲7.4745.89 ▲1.49
Posts /wp-admin/edit.php2,145 ▲452.00 ▼0.0236.42 ▼3.3837.44 ▼1.56
Add New Post /wp-admin/post-new.php1,639 ▲10322.58 ▲4.38665.59 ▲45.6139.97 ▼21.56
Media Library /wp-admin/upload.php1,448 ▲454.21 ▲0.00112.83 ▲11.8052.73 ▲5.02

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wpnotify-notifications-for-woocommerce/admin/pages/settings.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WOONOTIFY_DB' not found in wp-content/plugins/wpnotify-notifications-for-woocommerce/include/classes/woonotify_notify.php:13
    • > PHP Warning
      include_once(): Failed opening 'WOONOTIFY_DIR/include/classes/woonotify_db.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wpnotify-notifications-for-woocommerce/include/classes/woonotify_notify.php on line 3
    • > PHP Warning
      Use of undefined constant WOONOTIFY_DIR - assumed 'WOONOTIFY_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpnotify-notifications-for-woocommerce/include/classes/woonotify_notify.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpnotify-notifications-for-woocommerce/woonotify.php:30
    • > PHP Warning
      include_once(WOONOTIFY_DIR/include/classes/woonotify_format.php): failed to open stream: No such file or directory in wp-content/plugins/wpnotify-notifications-for-woocommerce/include/classes/woonotify_notify.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wpnotify-notifications-for-woocommerce/admin/woonotify-admin.php:4
    • > PHP Warning
      include_once(): Failed opening 'WOONOTIFY_DIR/include/classes/woonotify_format.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wpnotify-notifications-for-woocommerce/include/classes/woonotify_notify.php on line 4
    • > PHP Warning
      include_once(WOONOTIFY_DIR/include/classes/woonotify_db.php): failed to open stream: No such file or directory in wp-content/plugins/wpnotify-notifications-for-woocommerce/include/classes/woonotify_notify.php on line 3
    • > PHP Warning
      Use of undefined constant WOONOTIFY_DIR - assumed 'WOONOTIFY_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpnotify-notifications-for-woocommerce/include/classes/woonotify_notify.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Donate link: Invalid url: "- https://WooNotify.xyz"
You can take inspiration from this readme.txt

wpnotify-notifications-for-woocommerce/woonotify.php 92% from 13 tests

Analyzing the main PHP file in "WPNotify - Notifications for WooCommerce" version 1.0.0
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wpnotify-notifications-for-woocommerce.php" instead of "woonotify.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected3,452 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2153261,451
CSS364923
PHP8228165832
JSON100245
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.20
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods24
▷ Static methods14.17%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
4 PNG files occupy 0.26MB with 0.19MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/ssl.png19.69KB3.38KB▼ 82.83%
admin/assets/img/flags2x.png170.28KB68.04KB▼ 60.04%
admin/assets/img/flags.png69.20KB23.42KB▼ 66.16%
admin/assets/img/icon.png4.52KB0.41KB▼ 90.88%