84% wp-print-friendly

Code Review | WP Print Friendly

WordPress plugin WP Print Friendly scored84%from 54 tests.

About plugin

  • Plugin page: wp-print-friendly
  • Plugin version: 0.6.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.0
  • WordPress version: 6.3.1
  • First release: May 20, 2011
  • Latest release: Jun 26, 2022
  • Number of updates: 69
  • Update frequency: every 59.8 days
  • Top authors: ethitter (98.55%)stevenkword (2.9%)

Code review

54 tests

User reviews

2 reviews

Install metrics

800+ active /42,585 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼0.12ms] Passed 4 tests

Server-side resources used by WP Print Friendly
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1543.56 ▲1.03
Dashboard /wp-admin3.46 ▲0.1554.77 ▲1.00
Posts /wp-admin/edit.php3.57 ▲0.2149.87 ▲0.85
Add New Post /wp-admin/post-new.php6.04 ▲0.1598.38 ▼3.35
Media Library /wp-admin/upload.php3.38 ▲0.1537.22 ▲1.28
WP Print Friendly /wp-admin/options-general.php?page=wp_print_friendly3.3432.02

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WP Print Friendly
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.15 ▼1.251.73 ▼0.0344.14 ▼0.97
Dashboard /wp-admin2,233 ▲455.86 ▼0.04111.56 ▲9.9547.66 ▲2.87
Posts /wp-admin/edit.php2,116 ▲301.99 ▲0.0135.81 ▼1.3038.80 ▲7.12
Add New Post /wp-admin/post-new.php1,559 ▲2622.97 ▼0.31659.59 ▼16.9655.94 ▲3.00
Media Library /wp-admin/upload.php1,412 ▲244.35 ▲0.15104.73 ▲3.2747.46 ▲2.38
WP Print Friendly /wp-admin/options-general.php?page=wp_print_friendly1,0272.0725.4037.68

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/wp-print-friendly/wp-print-friendly.php:87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_title() in wp-content/plugins/wp-print-friendly/default-template.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: printer, template, printable, print

wp-print-friendly/wp-print-friendly.php Passed 13 tests

This is the main PHP file of "WP Print Friendly" version 0.6.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
127 characters long description:
Extends WordPress' template system to support printer-friendly templates. Works with permalink structures to support nice URLs.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin599 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2157352599

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity144.00
▷ Minimum class complexity144.00
▷ Maximum class complexity144.00
Average method complexity6.50
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods13.85%
▷ Public methods2492.31%
▷ Protected methods00.00%
▷ Private methods27.69%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected