78% mailgun

Code Review |

WordPress plugin scored78%from 54 tests.

About plugin

  • Plugin page: mailgun
  • Plugin version: 1.9.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 21, 2012
  • Latest release: Jun 20, 2023
  • Number of updates: 165
  • Update frequency: every 24.0 days
  • Top authors: Mailgun (60.61%)omykhailenko (36.36%)sivel (4.24%)

Code review

54 tests

User reviews

45 reviews

Install metrics

90,000+ active /1,648,012 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.60ms] 75% from 4 tests

Server-side resources used by
Please fix the following
  • CPU: The total CPU usage must kept under 500.00ms (currently 711.50ms on /wp-admin/options-general.php?page=mailgun-lists)
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.56 ▼5.98
Dashboard /wp-admin3.34 ▲0.0447.14 ▼4.56
Posts /wp-admin/edit.php3.46 ▲0.1046.68 ▼2.38
Add New Post /wp-admin/post-new.php5.92 ▲0.0484.99 ▼9.48
Media Library /wp-admin/upload.php3.27 ▲0.0437.24 ▲1.09
Mailgun Lists /wp-admin/options-general.php?page=mailgun-lists3.28711.50
Mailgun /wp-admin/options-general.php?page=mailgun3.4533.69

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

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

Browser metrics Passed 4 tests

Checking browser requirements for
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.61 ▼0.501.71 ▼0.7343.82 ▲0.36
Dashboard /wp-admin2,231 ▲434.86 ▼0.95113.51 ▼2.0141.19 ▼4.21
Posts /wp-admin/edit.php2,114 ▲462.02 ▲0.0141.52 ▲5.7735.80 ▼0.30
Add New Post /wp-admin/post-new.php1,560 ▲4018.51 ▼4.78590.79 ▼90.2857.29 ▲0.59
Media Library /wp-admin/upload.php1,413 ▲254.20 ▼0.0397.62 ▼5.6942.72 ▼2.23
Mailgun Lists /wp-admin/options-general.php?page=mailgun-lists8252.0225.0025.40
Mailgun /wp-admin/options-general.php?page=mailgun1,2452.0824.9738.81

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_list_widget
    • widget_recent-comments
    • mailgun
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Mailgun' not found in wp-content/plugins/mailgun/includes/admin.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mailgun/mailgun.php:74
    • > PHP Fatal error
      Uncaught Error: Class 'Mailgun' not found in wp-content/plugins/mailgun/includes/options-page.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mailgun/includes/wp-mail-api.php:63
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailgun/includes/widget.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Mailgun' not found in wp-content/plugins/mailgun/includes/lists-page.php:22

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mailgun
    • > Network (severe)
    wp-content/plugins/mailgun/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #3 (Administration option to View Available Lists for subscription), #4 (Setting up a Subscription Widget), #5 (Using a Subscription Code), #6 (Subscription Form Seen By Site Visitors)
You can look at the official readme.txt

mailgun/mailgun.php 92% from 13 tests

The primary PHP file in "" version 1.9.5 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("/languages/.")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected3,005 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP83076461,739
PO File5237255830
Markdown21620436

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity45.00
▷ Minimum class complexity9.00
▷ Maximum class complexity65.00
Average method complexity5.55
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods13.45%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions1694.12%
▷ Anonymous functions15.88%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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