84% resize-wp-mail-attachments

Code Review | Resize WP_Mail Attachments

WordPress plugin Resize WP_Mail Attachments scored84%from 54 tests.

About plugin

  • Plugin page: resize-wp-mail-at...
  • Plugin version: 1.2
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 9, 2019
  • Latest release: Jun 23, 2022
  • Number of updates: 4
  • Update frequency: every 292.8 days
  • Top authors: Patabugen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /454 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼5.69ms] Passed 4 tests

Server-side resources used by Resize WP_Mail Attachments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.85 ▲1.81
Dashboard /wp-admin3.32 ▲0.0146.22 ▲0.85
Posts /wp-admin/edit.php3.37 ▲0.0143.01 ▼7.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.24 ▼16.18
Media Library /wp-admin/upload.php3.25 ▲0.0133.55 ▼0.35

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Resize WP_Mail Attachments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.261.68 ▲0.0346.03 ▲3.52
Dashboard /wp-admin2,192 ▲125.52 ▼0.0883.05 ▼2.5238.37 ▼5.75
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0636.34 ▼5.2932.24 ▼4.45
Add New Post /wp-admin/post-new.php1,526 ▼323.41 ▲0.28635.44 ▼13.2349.33 ▼0.75
Media Library /wp-admin/upload.php1,403 ▼04.20 ▼0.0597.68 ▼1.7342.48 ▼1.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/resize-wp-mail-attachments/resize-wp-mail-attachments.php:115

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Requires at least: Invalid plugin version format
The official readme.txt is a good inspiration

resize-wp-mail-attachments/resize-wp-mail-attachments.php Passed 13 tests

The main file in "Resize WP_Mail Attachments" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
131 characters long description:
Resizes image attachments being sent to fit within the PostMark 10mb limit. Should actually work with any wp_mail() implementation.

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
Everything looks great! No dangerous files found in this plugin54 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP195254

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin