84% mailgun-subscriptions

Code Review | Mailgun Subscriptions

WordPress plugin Mailgun Subscriptions scored84%from 54 tests.

About plugin

  • Plugin page: mailgun-subscript...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.8
  • WordPress version: 6.3.1
  • First release: Sep 21, 2014
  • Latest release: Jul 26, 2017
  • Number of updates: 9
  • Update frequency: every 121.1 days
  • Top authors: jbrinley (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /2,401 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.37MB] [CPU: ▼1.57ms] Passed 4 tests

A check of server-side resources used by Mailgun Subscriptions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4043.72 ▼3.53
Dashboard /wp-admin3.70 ▲0.4050.33 ▲1.37
Posts /wp-admin/edit.php3.75 ▲0.4050.56 ▲6.37
Add New Post /wp-admin/post-new.php6.22 ▲0.3490.68 ▼9.73
Media Library /wp-admin/upload.php3.56 ▲0.3343.10 ▲5.61
Mailgun Lists /wp-admin/options-general.php?page=mailgun_subscriptions3.62485.94

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 38 new files
Database: no new tables, 8 new options
New WordPress options
mailgun_account_management_page
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_mailgun-subscriptions
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Mailgun Subscriptions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.38 ▼0.071.95 ▲0.0844.58 ▼0.79
Dashboard /wp-admin2,199 ▲195.65 ▼0.0887.46 ▼7.7138.50 ▲0.52
Posts /wp-admin/edit.php2,104 ▲12.05 ▲0.0235.13 ▼6.8237.12 ▼1.52
Add New Post /wp-admin/post-new.php1,529 ▼417.49 ▼5.65676.62 ▲56.5358.36 ▲0.81
Media Library /wp-admin/upload.php1,407 ▲44.20 ▲0.0199.77 ▼2.0445.46 ▲0.25
Mailgun Lists /wp-admin/options-general.php?page=mailgun_subscriptions7912.0623.6030.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_mailgun-subscriptions
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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 errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Mailgun_Subscriptions\\Confirmation' not found in wp-content/plugins/mailgun-subscriptions/Mailgun_Subscriptions/Null_Confirmation.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailgun-subscriptions/Mailgun_Subscriptions/Widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mailgun-subscriptions/mailgun-subscriptions.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: mailing lists, subscriptions, email, widget

mailgun-subscriptions/mailgun-subscriptions.php Passed 13 tests

The entry point to "Mailgun Subscriptions" version 1.2.0 is a PHP file that has certain tags in its header comment area
59 characters long description:
A widget for visitors to subscribe to Mailgun mailing lists

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected2,783 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP294482762,474
PO File14951185
Markdown147057
CSS16048
JSON20019

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity12.26
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes23
▷ Abstract classes14.35%
▷ Concrete classes2295.65%
▷ Final classes00.00%
Methods249
▷ Static methods156.02%
▷ Public methods14859.44%
▷ Protected methods5722.89%
▷ Private methods4417.67%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants15.56%
▷ Class constants1794.44%
▷ Public constants17100.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
No PNG images were found in this plugin