83% save-as-pdf-by-pdfcrowd

Code Review | Save as PDF plugin by Pdfcrowd

WordPress plugin Save as PDF plugin by Pdfcrowd scored83%from 54 tests.

About plugin

  • Plugin page: save-as-pdf-by-pd...
  • Plugin version: 3.2.0
  • PHP compatiblity: 5.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 6, 2019
  • Latest release: Nov 9, 2023
  • Number of updates: 79
  • Update frequency: every 19.3 days
  • Top authors: pdfcrowd (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

1,000+ active /41,854 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 gracefully, with no errors

Server metrics [RAM: ▲0.48MB] [CPU: ▼5.28ms] Passed 4 tests

This is a short check of server-side resources used by Save as PDF plugin by Pdfcrowd
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5141.84 ▼0.30
Dashboard /wp-admin3.83 ▲0.4847.42 ▼14.65
Posts /wp-admin/edit.php3.89 ▲0.5250.33 ▲7.08
Add New Post /wp-admin/post-new.php6.37 ▲0.4896.49 ▼9.56
Media Library /wp-admin/upload.php3.69 ▲0.4638.22 ▲3.39
Save as PDF /wp-admin/options-general.php?page=save-as-pdf-pdfcrowd4.2140.08

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Save as PDF plugin by Pdfcrowd
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲18413.62 ▼0.728.78 ▲7.0247.64 ▲3.93
Dashboard /wp-admin2,224 ▲475.82 ▲0.2195.33 ▼1.9542.64 ▲7.40
Posts /wp-admin/edit.php2,113 ▲132.30 ▲0.3140.39 ▲0.6736.72 ▲1.18
Add New Post /wp-admin/post-new.php1,553 ▲2723.27 ▲0.32608.60 ▲1.8734.68 ▼19.88
Media Library /wp-admin/upload.php1,430 ▲304.32 ▲0.1297.38 ▲0.0444.60 ▲2.31
Save as PDF /wp-admin/options-general.php?page=save-as-pdf-pdfcrowd8,8383.17102.2055.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 take a closer look at the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/save-as-pdf-by-pdfcrowd/admin/partials/save-as-pdf-pdfcrowd-admin-display.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/save-as-pdf-by-pdfcrowd/admin/partials/appearance.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/save-as-pdf-by-pdfcrowd/admin/partials/license-settings.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/save-as-pdf-by-pdfcrowd/admin/partials/behavior.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/save-as-pdf-by-pdfcrowd/admin/partials/wizard.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/save-as-pdf-by-pdfcrowd/admin/partials/appearance.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/save-as-pdf-by-pdfcrowd/admin/partials/mode.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

save-as-pdf-by-pdfcrowd/save-as-pdf-pdfcrowd.php 85% from 13 tests

The entry point to "Save as PDF plugin by Pdfcrowd" version 3.2.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("save-as-pdf-by-pdfcrowd.php" instead of "save-as-pdf-pdfcrowd.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin8,588 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP175826367,924
CSS41410660
JavaScript4004

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 381)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity97.71
▷ Minimum class complexity1.00
▷ Maximum class complexity392.00
Average method complexity9.88
▷ Minimum method complexity1.00
▷ Maximum method complexity381.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods76
▷ Static methods3242.11%
▷ Public methods3850.00%
▷ Protected methods00.00%
▷ Private methods3850.00%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin