10% plainmail

Code Review | Wordpress Plain Mail

WordPress plugin Wordpress Plain Mail scored10%from 54 tests.

About plugin

  • Plugin page: plainmail
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.6.1
  • WordPress version: 6.3.1
  • First release: Sep 14, 2013
  • Latest release: Sep 17, 2013
  • Number of updates: 7
  • Update frequency: every 0.6 days
  • Top authors: kennethrapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /869 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/plainmail/PlainmailInstall.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; PlainmailInstall has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼51.19ms] Passed 4 tests

Analyzing server-side resources used by Wordpress Plain Mail
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.68 ▼30.86
Dashboard /wp-admin2.18 ▼1.176.33 ▼54.11
Posts /wp-admin/edit.php2.18 ▼1.185.98 ▼38.57
Add New Post /wp-admin/post-new.php2.18 ▼3.716.16 ▼81.22
Media Library /wp-admin/upload.php2.18 ▼1.056.22 ▼29.79
Plainmail /wp-admin/options-general.php?page=plainmail2.186.07

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: 2 new tables, 7 new options
New tables
wp_plainmail_headers
wp_plainmail_recipients
New WordPress options
widget_recent-posts
PLAINMAIL_INSTALLED
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Wordpress Plain Mail: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲4914.35 ▼0.001.90 ▲0.1843.01 ▼3.37
Dashboard /wp-admin2,204 ▲245.63 ▲0.0082.62 ▼9.0038.79 ▼7.00
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0133.42 ▼5.1234.12 ▲1.22
Add New Post /wp-admin/post-new.php1,541 ▲1524.29 ▲0.56650.47 ▼57.6067.58 ▲14.74
Media Library /wp-admin/upload.php1,406 ▲64.17 ▼0.00105.20 ▲2.3045.82 ▲0.97
Plainmail /wp-admin/options-general.php?page=plainmail7962.0326.5334.01

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
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the css_plainmail handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=plainmail
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the css_plainmail handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=plainmail
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the css_plainmail handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=plainmail
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=plainmail
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/plainmail/plainmail.php on line 14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/plainmail/plainmail.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/plainmail/plainmail.php on line 14

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
1 plugin tags: email

plainmail/plainmail.php Passed 13 tests

The main file in "Wordpress Plain Mail" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
34 characters long description:
Plaintext email form for Wordpress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected582 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP620263560
CSS15022

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity14.00
▷ Minimum class complexity3.00
▷ Maximum class complexity41.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods2596.15%
▷ Protected methods00.00%
▷ Private methods13.85%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There were not PNG files found in your plugin