78% pressmailer

Code Review | PressMailer

WordPress plugin PressMailer scored 78% from 54 tests.

About plugin

  • Plugin page: pressmailer
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.6
  • WordPress version: 5.8.1
  • First release: Nov 12, 2020
  • Latest release: Nov 27, 2020
  • Number of updates: 7
  • Update frequency: every 2.3 days
  • Top authors: roelv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 550 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
Install script ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼156.06ms] Passed 4 tests

Analyzing server-side resources used by PressMailer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.19 ▲0.4736.22 ▲14.00
Dashboard /wp-admin3.56 ▲0.5045.89 ▼0.86
Posts /wp-admin/edit.php3.61 ▲0.5047.02 ▲4.58
Add New Post /wp-admin/post-new.php4.55 ▼0.8933.60 ▼627.16
Media Library /wp-admin/upload.php3.44 ▲0.4432.71 ▼0.81
Layout /wp-admin/admin.php?page=prema_default_layout_options3.9347.92
All Emails /wp-admin/admin.php?page=pressmailer3.5536.92
Settings /wp-admin/admin.php?page=pressmailer-settings3.4331.54

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 641 new files
Database: no new tables, 2 new options
New WordPress options
prema_default_from_name
prema_default_from_address

Browser metrics Passed 4 tests

This is an overview of browser requirements for PressMailer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,901 ▲30516.35 ▲0.7011.30 ▲1.8949.81 ▲1.91
Dashboard /wp-admin3,057 ▲1266.21 ▲0.30142.12 ▲2.83112.05 ▼3.42
Posts /wp-admin/edit.php2,801 ▲652.94 ▲0.2565.57 ▼3.9189.54 ▼5.71
Add New Post /wp-admin/post-new.php1,722 ▲5020.39 ▲1.34343.29 ▼17.50122.75 ▲7.06
Media Library /wp-admin/upload.php1,872 ▲625.26 ▲0.27122.15 ▼17.40115.75 ▼4.95
Layout /wp-admin/admin.php?page=prema_default_layout_options6,64210.34277.59177.94
All Emails /wp-admin/admin.php?page=pressmailer1,4932.3761.3272.18
Settings /wp-admin/admin.php?page=pressmailer-settings1,1002.3456.2180.44

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 2 options in the database
    • prema_default_from_address
    • prema_default_from_name

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pressmailer/resources/views/admin/home.php
    • > /wp-content/plugins/pressmailer/resources/views/admin/metaboxwithvariablesbase.php
  • 156× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/pressmailer/vendor/cmb2/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PressMailer\\Email\\Capabilities\\Variables\\General\\StaticEmailVariable' not found in wp-content/plugins/pressmailer/src/Email/Capabilities/Variables/General/AdminEmailVariable.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PressMailer\\Email\\Capabilities\\AbstractCapabilityWithUrlAndLinkVariables' not found in wp-content/plugins/pressmailer/src/Email/Capabilities/PasswordResetCapability.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PressMailer\\Admin\\EmailEditor\\EmailVariable' not found in wp-content/plugins/pressmailer/src/Email/Capabilities/Variables/EmailChangeRequest/EmailChangeConfirmationLinkVariable.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/pressmailer/vendor/php-di/invoker/src/ParameterResolver/ResolverChain.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PressMailer\\Admin\\EmailEditor\\EmailVariable' not found in wp-content/plugins/pressmailer/src/Email/Capabilities/Variables/EmailChangeRequest/NewEmailVariable.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PressMailer\\Email\\AbstractEmail' not found in wp-content/plugins/pressmailer/src/Email/NewUserEmail.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Invoker\\InvokerInterface' not found in wp-content/plugins/pressmailer/vendor/php-di/invoker/src/Invoker.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Resolver\\DefinitionResolver' not found in wp-content/plugins/pressmailer/vendor/php-di/php-di/src/Definition/Resolver/DecoratorResolver.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'DI\\Definition\\Exception\\InvalidDefinition' not found in wp-content/plugins/pressmailer/vendor/php-di/php-di/src/Definition/Exception/InvalidAnnotation.php:12

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: gutenberg, email, html mail, notification, email design...

pressmailer/pressmailer.php 92% from 13 tests

"PressMailer" version 1.0.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin64,812 lines of code in 471 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP2604,7569,89817,973
JSON9004,810
CSS142511,1864,551
Markdown1867901,690
JavaScript223986241,687
Sass19306291,414
YAML5131287
XML312659
SVG10118

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 209)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity10.90
▷ Minimum class complexity1.00
▷ Maximum class complexity302.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity209.00
Code structure
Namespaces50
Interfaces21
Traits1
Classes228
▷ Abstract classes198.33%
▷ Concrete classes20991.67%
▷ Final classes20.96%
Methods1,314
▷ Static methods14110.73%
▷ Public methods1,10884.32%
▷ Protected methods13210.05%
▷ Private methods745.63%
Functions66
▷ Named functions5075.76%
▷ Anonymous functions1624.24%
Constants100
▷ Global constants1111.00%
▷ Class constants8989.00%
▷ Public constants8797.75%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
18 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/mustardBees/cmb-field-select2/screenshot-4.png3.68KB3.79KB0.00%
vendor/cmb2/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
vendor/cmb2/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
vendor/cmb2/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%