67% email-form-under-post

Code Review | Mandrill WP - Email Form Under Post

WordPress plugin Mandrill WP - Email Form Under Post scored67%from 54 tests.

About plugin

  • Plugin page: email-form-under-...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 14, 2015
  • Latest release: Apr 8, 2016
  • Number of updates: 82
  • Update frequency: every 4.8 days
  • Top authors: khubbaib (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active /7,436 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼0.91ms] Passed 4 tests

Analyzing server-side resources used by Mandrill WP - Email Form Under Post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1543.47 ▲0.63
Dashboard /wp-admin3.44 ▲0.1458.17 ▲7.79
Posts /wp-admin/edit.php3.50 ▲0.1452.65 ▲0.62
Add New Post /wp-admin/post-new.php6.05 ▲0.1689.98 ▼7.51
Media Library /wp-admin/upload.php3.37 ▲0.1440.89 ▲2.62
Settings /wp-admin/admin.php?page=post-email-settings3.4837.50
Dashboard /wp-admin/admin.php?page=post-email-dashboard3.4435.60

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: 1 new table, 13 new options
New tables
wp_postmails
New WordPress options
post_email_success
db_upgraded
widget_recent-posts
post_email_api_need
post_button_text
can_compress_scripts
post_email_error
recovery_mode_email_last_sent
theysaidso_admin_options
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for Mandrill WP - Email Form Under Post
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,981 ▲22015.18 ▲0.8321.15 ▲19.5043.55 ▼4.14
Dashboard /wp-admin2,268 ▲915.31 ▼0.3498.33 ▲7.6056.64 ▲14.35
Posts /wp-admin/edit.php2,155 ▲762.39 ▲0.3645.23 ▲8.9636.60 ▼1.89
Add New Post /wp-admin/post-new.php1,594 ▲6624.20 ▲0.91718.92 ▲53.3040.59 ▼18.55
Media Library /wp-admin/upload.php1,468 ▲684.96 ▲0.63100.58 ▼2.7689.88 ▲43.39
Settings /wp-admin/admin.php?page=post-email-settings1,2332.2624.2034.02
Dashboard /wp-admin/admin.php?page=post-email-dashboard8421.6514.9524.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_postmails
  • The uninstall procedure has failed, leaving 13 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • post_email_error
    • post_email_template
    • can_compress_scripts
    • theysaidso_admin_options
    • post_email_api_need
    • post_email_success
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=post-email-settings
    • > Error in wp-content/plugins/email-form-under-post/src/Mandrill.php+62
    Uncaught Mandrill_Error: You must provide a Mandrill API key in wp-content/plugins/email-form-under-post/src/Mandrill.php:62
    Stack trace:
    #0 wp-content/plugins/email-form-under-post/classes/post_main.php(807): Mandrill->__construct()
    #1 wp-content/plugins/email-form-under-post/plugin-pages/post-email-settings.php(351): Post_Main->post_email_templates()
    #2 wp-content/plugins/email-form-under-post/classes/post_main.php(551): require_once('/var/www/wordpr...')
    #3 wp-includes/class-wp-hook.php(310): Post_Main::post_email_plugin_settings_page()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=post-email-dashboard
    • > Error in wp-content/plugins/email-form-under-post/src/Mandrill.php+62
    Uncaught Mandrill_Error: You must provide a Mandrill API key in wp-content/plugins/email-form-under-post/src/Mandrill.php:62
    Stack trace:
    #0 wp-content/plugins/email-form-under-post/classes/post_main.php(762): Mandrill->__construct()
    #1 wp-content/plugins/email-form-under-post/plugin-pages/post-email-dashboard.php(277): Post_Main->post_email_epxort()
    #2 wp-content/plugins/email-form-under-post/classes/post_main.php(563): require_once('/var/www/wordpr...')
    #3 wp-includes/class-wp-hook.php(310): Post_Main::post_email_plugin_dashboard_page()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=post-email-dashboard
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/email-form-under-post/js/post-email-admin.js?ver=1.0.5:18:22)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=post-email-dashboard
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: mandrill, email, mandrill-template, post, mandrill-export...

email-form-under-post/postemail-wordpress.php 69% from 13 tests

The principal PHP file in "Mandrill WP - Email Form Under Post" v. 1.0.5 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("lang")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("email-form-under-post.php" instead of "postemail-wordpress.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: Prefix the domain path with a forward slash character ("/lang")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected10,352 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
CSS590783,986
JavaScript57322373,150
PHP225312,1722,192
SVG200794
HTML2182139
PO File1368091

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes00.00%
▷ Concrete classes49100.00%
▷ Final classes00.00%
Methods144
▷ Static methods64.17%
▷ Public methods144100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/chosen-sprite.png0.72KB0.65KB▼ 10.38%
images/post_img_large.png1.52KB1.32KB▼ 13.30%
images/post-email.png0.69KB0.67KB▼ 2.82%