78% printfriendly

Code Review | Print, PDF, Email by PrintFriendly

WordPress plugin Print, PDF, Email by PrintFriendly scored78%from 54 tests.

About plugin

  • Plugin page: printfriendly
  • Plugin version: 5.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: May 1, 2009
  • Latest release: Oct 19, 2023
  • Number of updates: 273
  • Update frequency: every 19.4 days
  • Top authors: printfriendly (97.8%)joostdevalk (2.56%)

Code review

54 tests

User reviews

233 reviews

Install metrics

30,000+ active /2,080,286 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼2.22ms] Passed 4 tests

This is a short check of server-side resources used by Print, PDF, Email by PrintFriendly
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2241.50 ▲1.59
Dashboard /wp-admin3.54 ▲0.2351.86 ▼9.19
Posts /wp-admin/edit.php3.66 ▲0.2949.69 ▲3.46
Add New Post /wp-admin/post-new.php6.12 ▲0.2394.59 ▼0.45
Media Library /wp-admin/upload.php3.46 ▲0.2334.37 ▼0.81
Print Friendly & PDF /wp-admin/options-general.php?page=printfriendly3.8035.47

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
printfriendly_option
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Print, PDF, Email by PrintFriendly
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲11113.35 ▼1.027.73 ▲5.6742.47 ▼2.66
Dashboard /wp-admin2,199 ▲195.62 ▲0.0781.88 ▼8.3342.55 ▲4.97
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0139.86 ▼0.2138.26 ▼3.08
Add New Post /wp-admin/post-new.php1,539 ▲1118.36 ▼4.69609.92 ▲3.1766.30 ▲6.50
Media Library /wp-admin/upload.php1,398 ▲14.28 ▲0.0797.09 ▼7.6541.18 ▼3.71
Print Friendly & PDF /wp-admin/options-general.php?page=printfriendly2,6455.29110.68146.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=printfriendly
    • > Notice in wp-content/plugins/printfriendly/views/tabs.php+84
    Undefined index: pf_algo_css_content
    • > GET request to /wp-admin/options-general.php?page=printfriendly
    • > Notice in wp-content/plugins/printfriendly/views/tabs.php+286
    Undefined index: content_position_css

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
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/printfriendly/views/tabs.php:4
    • > PHP Warning
      Use of undefined constant PRINTFRIENDLY_BASEURL - assumed 'PRINTFRIENDLY_BASEURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/printfriendly/views/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/printfriendly/views/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/printfriendly/pf.php:106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/printfriendly/views/pro.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: email, print plugin, woocommerce print, print, pdf plugin...

printfriendly/pf.php 92% from 13 tests

"Print, PDF, Email by PrintFriendly" version 5.5.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("printfriendly.php" instead of "pf.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,594 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP53104501,863
JavaScript47624418
CSS3667308
JSON1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity228.00
▷ Minimum class complexity228.00
▷ Maximum class complexity228.00
Average method complexity5.28
▷ Minimum method complexity1.00
▷ Maximum method complexity74.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods53
▷ Static methods00.00%
▷ Public methods5094.34%
▷ Protected methods00.00%
▷ Private methods35.66%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/pf-icon.png1.26KB0.87KB▼ 31.35%