73% superfast-mailgun-newsletter

Code Review | Superfast Mailgun for the Newsletter plugin

WordPress plugin Superfast Mailgun for the Newsletter plugin scored73%from 54 tests.

About plugin

  • Plugin page: superfast-mailgun...
  • Plugin version: 1.2.5
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Jul 8, 2020
  • Latest release: Aug 15, 2023
  • Number of updates: 25
  • Update frequency: every 45.6 days
  • Top authors: franciscus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /784 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲5.34MB] [CPU: ▲22.65ms] 75% from 4 tests

An overview of server-side resources used by Superfast Mailgun for the Newsletter plugin
Please take the time to fix the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.34MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.21 ▲5.7565.57 ▲22.68
Dashboard /wp-admin9.23 ▲5.9380.21 ▲27.71
Posts /wp-admin/edit.php9.23 ▲5.8772.80 ▲21.53
Add New Post /wp-admin/post-new.php9.71 ▲3.82121.62 ▲18.69
Media Library /wp-admin/upload.php9.23 ▲6.0070.28 ▲35.48
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2378.11

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 181 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
fs_active_plugins
fs_accounts
widget_recent-comments
fs_debug_mode
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Superfast Mailgun for the Newsletter plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.24 ▼1.434.47 ▲2.4331.56 ▼13.02
Dashboard /wp-admin2,224 ▲455.89 ▲0.08103.67 ▲1.6140.31 ▼8.60
Posts /wp-admin/edit.php2,107 ▲152.02 ▼0.0435.98 ▼3.6837.11 ▼0.03
Add New Post /wp-admin/post-new.php1,519 ▼1422.98 ▼0.04619.66 ▼50.7069.83 ▲2.75
Media Library /wp-admin/upload.php1,400 ▲94.24 ▲0.02101.56 ▲2.5943.91 ▼6.35
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0712.0828.4629.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/superfast-mailgun-newsletter/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • fs_accounts
    • db_upgraded
    • fs_active_plugins
    • widget_recent-comments
    • widget_recent-posts
    • fs_debug_mode
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'NewsletterMailer' not found in wp-content/plugins/superfast-mailgun-newsletter/mailer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'NewsletterMailer' not found in wp-content/plugins/superfast-mailgun-newsletter/mailer.php: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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: mailgun, add-on, newsletter

superfast-mailgun-newsletter/sfmailgun.php 92% from 13 tests

"Superfast Mailgun for the Newsletter plugin" version 1.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("superfast-mailgun-newsletter.php" instead of "sfmailgun.php")

Code Analysis 97% from 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 plugin34,127 lines of code in 137 files:
LanguageFilesBlank linesComment linesLines of code
PHP1218,09817,36033,920
JavaScript33459194
CSS130013

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity91.08
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes50
▷ Abstract classes24.00%
▷ Concrete classes4896.00%
▷ Final classes00.00%
Methods1,285
▷ Static methods19715.33%
▷ Public methods89569.65%
▷ Protected methods171.32%
▷ Private methods37329.03%
Functions102
▷ Named functions9997.06%
▷ Anonymous functions32.94%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%