77% pdf-email-on-save

Code Review | PDF Email on Save

WordPress plugin PDF Email on Save scored77%from 54 tests.

About plugin

  • Plugin page: pdf-email-on-save
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.8
  • WordPress version: 6.3.1
  • First release: May 1, 2014
  • Latest release: Jun 15, 2017
  • Number of updates: 11
  • Update frequency: every 103.7 days
  • Top authors: mjbanks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,493 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.83ms] Passed 4 tests

This is a short check of server-side resources used by PDF Email on Save
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.46 ▼7.82
Dashboard /wp-admin3.38 ▲0.0846.13 ▼0.92
Posts /wp-admin/edit.php3.50 ▲0.1449.70 ▼2.62
Add New Post /wp-admin/post-new.php5.96 ▲0.0885.36 ▼15.95
Media Library /wp-admin/upload.php3.30 ▲0.0836.52 ▲0.76
PDF Email on Save /wp-admin/options-general.php?page=pdf-email-on-save3.2732.32

Server storage [IO: ▲114.03MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • Try to limit filesystem usage to 25MB (currently using 114.03MB)
Filesystem: 804 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for PDF Email on Save
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3314.80 ▲0.151.80 ▼0.2637.28 ▼2.22
Dashboard /wp-admin2,210 ▲194.87 ▼0.09106.36 ▲5.2940.28 ▼2.72
Posts /wp-admin/edit.php2,093 ▲12.01 ▲0.0238.83 ▼1.8433.69 ▼2.68
Add New Post /wp-admin/post-new.php1,541 ▼123.27 ▲4.96596.83 ▼65.7760.70 ▲7.08
Media Library /wp-admin/upload.php1,386 ▼54.18 ▼0.1294.67 ▼3.9640.54 ▼4.34
PDF Email on Save /wp-admin/options-general.php?page=pdf-email-on-save8102.1623.8432.26

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 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
Please fix the following items
  • 61× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/example12_paging_html.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/example32_indic.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/example47_progress_bars_simple_custom.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/utils/index.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/example55_new_mPDF_v5-1_color_and_other_features.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/show_code.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/example50_new_mPDF_3_features.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/example15_headers_method_1.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/example23_orientation.php
    • > /wp-content/plugins/pdf-email-on-save/includes/mpdf/examples/example36_annotations_and_Attached_files.php
  • 4095× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Cannot assign an empty string to a string offset in wp-content/plugins/pdf-email-on-save/includes/mpdf/classes/cssmgr.php on line 1302
    • > PHP Warning
      Illegal string offset 'ID' in wp-content/plugins/pdf-email-on-save/includes/mpdf/classes/cssmgr.php on line 1355
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/pdf-email-on-save/includes/mpdf/mpdf.php on line 6387
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/pdf-email-on-save/includes/mpdf/classes/ttfontsuni.php on line 613
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/pdf-email-on-save/includes/mpdf/classes/ttfontsuni.php on line 1102
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/pdf-email-on-save/includes/mpdf/classes/ttfontsuni.php on line 1102
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/pdf-email-on-save/includes/mpdf/classes/ttfontsuni.php on line 1102
    • > PHP Warning
      Cannot assign an empty string to a string offset in wp-content/plugins/pdf-email-on-save/includes/mpdf/classes/cssmgr.php on line 1302
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/pdf-email-on-save/includes/mpdf/classes/ttfontsuni.php on line 1102
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/pdf-email-on-save/includes/mpdf/mpdf.php on line 6387

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: pdf, custom post types, email

pdf-email-on-save/pdf-email-on-save.php 92% from 13 tests

"PDF Email on Save" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 95% from 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
Good job! No executable or dangerous file extensions detected114,110 lines of code in 233 files:
LanguageFilesBlank linesComment linesLines of code
PHP21711,30310,347110,853
SVG2002,213
CSS611123744
JSON3120123
Markdown243096
PO File17833
HTML14032
XML13016

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 8,314)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 1,542)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity341.15
▷ Minimum class complexity1.00
▷ Maximum class complexity8,314.00
Average method complexity19.18
▷ Minimum method complexity1.00
▷ Maximum method complexity1,542.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes53
▷ Abstract classes00.00%
▷ Concrete classes53100.00%
▷ Final classes00.00%
Methods991
▷ Static methods767.67%
▷ Public methods92893.64%
▷ Protected methods484.84%
▷ Private methods151.51%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants400
▷ Global constants7518.75%
▷ Class constants32581.25%
▷ Public constants325100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 0.76MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/mpdf/examples/tiger2.png145.75KB47.19KB▼ 67.63%
includes/mpdf/examples/alpha.png85.40KB33.26KB▼ 61.05%
assets/screenshot-1.png92.00KB43.21KB▼ 53.04%
includes/mpdf/examples/img3.png1.06KB0.20KB▼ 80.86%
includes/mpdf/examples/img1.png0.98KB0.14KB▼ 86.10%