89% ninja-mail

Code Review | Ninja Mail

WordPress plugin Ninja Mail scored 89% from 54 tests.

About plugin

  • Plugin page: ninja-mail
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.6
  • WordPress version: 5.8.1
  • First release: Jun 11, 2018
  • Latest release: Apr 1, 2021
  • Number of updates: 13
  • Update frequency: every 82.9 days
  • Top authors: mrpritchett (46.15%)kstover (38.46%)jameslaws (23.08%)kbjohnson90 (15.38%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active / 20,897 total downloads

Benchmarks

Plugin footprint Passed 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.02MB] [CPU: ▼173.49ms] Passed 4 tests

Analyzing server-side resources used by Ninja Mail
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0232.40 ▼1.87
Dashboard /wp-admin3.08 ▲0.0344.72 ▼1.99
Posts /wp-admin/edit.php3.13 ▲0.0342.46 ▼1.46
Add New Post /wp-admin/post-new.php5.44 ▲0.0189.01 ▼688.63
Media Library /wp-admin/upload.php3.03 ▲0.0233.79 ▲0.29
Ninja Mail /wp-admin/admin.php?page=ninja-mail3.0427.98

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ninja Mail
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,691 ▲9515.88 ▼0.1910.22 ▼0.7247.82 ▼0.76
Dashboard /wp-admin2,980 ▲465.91 ▼0.08133.35 ▼13.12101.63 ▼9.54
Posts /wp-admin/edit.php2,752 ▲132.85 ▲0.1367.45 ▲6.1085.85 ▼2.84
Add New Post /wp-admin/post-new.php1,624 ▲12621.76 ▲2.89272.18 ▼104.28102.03 ▼5.94
Media Library /wp-admin/upload.php1,820 ▲105.03 ▼0.01161.36 ▲10.61123.93 ▲9.66
Ninja Mail /wp-admin/admin.php?page=ninja-mail1,1132.0959.6072.49

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 50% 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)
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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ninja-mail/includes/resources/views/admin-mail-log.html.php
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ninja-mail/ninja-mail.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ninja-mail/includes/resources/views/admin-settings.html.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'NinjaMail\\WordPress\\Plugin' not found in wp-content/plugins/ninja-mail/includes/plugin.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ninja-mail/includes/tests.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ninja-mail/bootstrap.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ninja-mail/includes/resources/views/admin-menu.html.php:3
    • > PHP Notice
      Undefined variable: logs in wp-content/plugins/ninja-mail/includes/resources/views/admin-mail-log.html.php on line 46
    • > PHP Notice
      Undefined variable: enabled in wp-content/plugins/ninja-mail/includes/resources/views/admin-mail-log.html.php on line 25
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/ninja-mail/includes/resources/views/admin-mail-log.html.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ninja-mail/includes/admin.php:6

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: forms, transactional, email

ninja-mail/ninja-mail.php Passed 13 tests

The main PHP file in "Ninja Mail" ver. 1.0.6 adds more information about the plugin and also serves as the entry point for this plugin
46 characters long description:
A transactional email service for Ninja Forms.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin625 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1413395611
Markdown29014

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods35
▷ Static methods1337.14%
▷ Public methods2880.00%
▷ Protected methods411.43%
▷ Private methods38.57%
Functions20
▷ Named functions420.00%
▷ Anonymous functions1680.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin