84% primail

Code Review | Primail

WordPress plugin Primail scored84%from 54 tests.

About plugin

  • Plugin page: primail
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.1-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 9, 2022
  • Latest release: Oct 9, 2022
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: comminski (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /154 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.17MB] [CPU: ▼8.62ms] Passed 4 tests

Analyzing server-side resources used by Primail
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1740.19 ▼2.92
Dashboard /wp-admin3.49 ▲0.1453.50 ▼15.78
Posts /wp-admin/edit.php3.60 ▲0.2450.79 ▼1.12
Add New Post /wp-admin/post-new.php6.07 ▲0.1888.06 ▼14.65
Media Library /wp-admin/upload.php3.41 ▲0.1840.95 ▲3.10
Primail /wp-admin/options-general.php?page=primail-settings3.3833.78

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 11 new options
New WordPress options
primail_default_from_email
can_compress_scripts
primail_api_debug_enabled
primail_default_from_name
widget_recent-posts
theysaidso_admin_options
primail_api_test_key
widget_theysaidso_widget
db_upgraded
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Primail
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.18 ▼0.171.82 ▲0.1244.76 ▼0.77
Dashboard /wp-admin2,210 ▲305.64 ▼0.0486.83 ▼5.0639.80 ▼3.42
Posts /wp-admin/edit.php2,118 ▲212.04 ▲0.1038.89 ▲2.8439.46 ▲0.51
Add New Post /wp-admin/post-new.php1,535 ▲723.61 ▲0.28642.19 ▼2.4952.08 ▼8.70
Media Library /wp-admin/upload.php1,415 ▲154.17 ▲0.02103.17 ▼1.1843.74 ▼4.36
Primail /wp-admin/options-general.php?page=primail-settings9702.1623.2228.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 11 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • primail_default_from_email
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • primail_default_from_name
    • primail_api_test_key
    • primail_api_key
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Primail_Options\\add_filter() in wp-content/plugins/primail/core/options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Primail_Settings\\add_action() in wp-content/plugins/primail/core/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/primail/primail.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Contributors: Plugin contributors not specified
Please take inspiration from this readme.txt

primail/primail.php 92% from 13 tests

The main PHP file in "Primail" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("5.6" instead of "5.5.1")

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 plugin858 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5169257821
CSS18037

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods430.77%
▷ Protected methods17.69%
▷ Private methods861.54%
Functions32
▷ Named functions3196.88%
▷ Anonymous functions13.12%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin