78% pdf-for-metform

Code Review | PDF For Metform

WordPress plugin PDF For Metform scored78%from 54 tests.

About plugin

  • Plugin page: pdf-for-metform
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Oct 13, 2023
  • Latest release: Oct 13, 2023
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: wpdebuglog (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /0 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.32ms] Passed 4 tests

This is a short check of server-side resources used by PDF For Metform
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0245.61 ▲5.19
Dashboard /wp-admin3.32 ▲0.0254.15 ▼1.13
Posts /wp-admin/edit.php3.44 ▲0.0852.75 ▼2.23
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.26 ▼11.56
Media Library /wp-admin/upload.php3.25 ▲0.0236.83 ▼2.35
PDF /wp-admin/admin.php?page=pdf-for-metform-page3.2131.55

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 596 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
pdf4metform
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF For Metform
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.39 ▼0.001.81 ▼0.0841.49 ▼4.30
Dashboard /wp-admin2,198 ▲215.65 ▼0.0390.88 ▼10.3236.58 ▼9.79
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0641.09 ▼0.6335.50 ▼0.75
Add New Post /wp-admin/post-new.php1,545 ▲1923.42 ▲5.88661.59 ▼55.1355.07 ▼10.83
Media Library /wp-admin/upload.php1,400 ▲34.20 ▼0.0195.15 ▼7.6546.16 ▲0.45
PDF /wp-admin/admin.php?page=pdf-for-metform-page7772.0524.0628.79

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
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • pdf4metform
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/pdf-for-metform/inc/default-template.php
  • 228× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/pdf-for-metform/vendor/mpdf/mpdf/src/Tag/TBody.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Filter\\FilterException' not found in wp-content/plugins/pdf-for-metform/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85Exception.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/pdf-for-metform/vendor/mpdf/mpdf/src/Http/Exception/NetworkException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\TypeFilter\\TypeFilter' not found in wp-content/plugins/pdf-for-metform/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/pdf-for-metform/vendor/mpdf/mpdf/src/Tag/Pre.php:5
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/pdf-for-metform/vendor/mpdf/mpdf/src/Writer/JavaScriptWriter.php on line 8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/pdf-for-metform/vendor/mpdf/mpdf/src/SizeConverter.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/pdf-for-metform/vendor/mpdf/mpdf/src/Tag/Input.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/pdf-for-metform/vendor/mpdf/mpdf/src/Http/Exception/RequestException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/pdf-for-metform/vendor/mpdf/mpdf/src/Tag/H5.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: pdf, metform

pdf-for-metform/pdf-for-metform.php Passed 13 tests

The main PHP script in "PDF For Metform" version 1.0.0 is automatically included on every request by WordPress
22 characters long description:
PDF Plugin for metform

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected79,595 lines of code in 453 files:
LanguageFilesBlank linesComment linesLines of code
PHP41411,70012,69376,476
Markdown1348101,472
JSON900777
CSS37018510
YAML9634236
XML310075
JavaScript15046
Bourne Shell1203

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 7,021)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity55.38
▷ Minimum class complexity1.00
▷ Maximum class complexity7,021.00
Average method complexity13.21
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces50
Interfaces20
Traits9
Classes298
▷ Abstract classes93.02%
▷ Concrete classes28996.98%
▷ Final classes144.84%
Methods1,538
▷ Static methods1469.49%
▷ Public methods1,33887.00%
▷ Protected methods553.58%
▷ Private methods1459.43%
Functions34
▷ Named functions514.71%
▷ Anonymous functions2985.29%
Constants429
▷ Global constants51.17%
▷ Class constants42498.83%
▷ Public constants424100.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