83% printer-friendly-wp

Code Review | Printer-Friendly WP

WordPress plugin Printer-Friendly WP scored83%from 54 tests.

About plugin

  • Plugin page: printer-friendly-wp
  • Plugin version: 0.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Aug 1, 2013
  • Latest release: Sep 4, 2013
  • Number of updates: 10
  • Update frequency: every 4.3 days
  • Top authors: royaldeer (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,411 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.66ms] Passed 4 tests

Analyzing server-side resources used by Printer-Friendly WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.12 ▼5.36
Dashboard /wp-admin3.32 ▲0.0243.02 ▲0.23
Posts /wp-admin/edit.php3.37 ▲0.0144.55 ▼1.88
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.00 ▼3.24
Media Library /wp-admin/upload.php3.24 ▲0.0132.61 ▼0.17
Printer-Friendly WP /wp-admin/options-general.php?page=print_postpage_comments3.2128.61

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 8 new options
New WordPress options
print_button_pages
widget_recent-posts
theysaidso_admin_options
print_button_posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Printer-Friendly WP
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.17 ▼1.411.76 ▲0.0237.14 ▼5.57
Dashboard /wp-admin2,213 ▲254.87 ▼0.0295.64 ▼8.4638.11 ▼6.45
Posts /wp-admin/edit.php2,093 ▲12.05 ▼0.1339.29 ▲4.3736.02 ▼2.88
Add New Post /wp-admin/post-new.php1,539 ▲2523.23 ▲5.76604.74 ▼72.6051.42 ▲0.49
Media Library /wp-admin/upload.php1,386 ▼24.22 ▲0.0498.14 ▼4.3041.22 ▼5.43
Printer-Friendly WP /wp-admin/options-general.php?page=print_postpage_comments8132.0323.2323.86

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

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 everything seems fine, this is not an exhaustive test

SRP 50% 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 items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/printer-friendly-wp/printpostpage.php:17
    • > PHP Notice
      Undefined index: arl in wp-content/plugins/printer-friendly-wp/print.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/printer-friendly-wp/print.php on line 12
    • > PHP Warning
      require_once(wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/printer-friendly-wp/print.php on line 12
    • > PHP Notice
      Undefined index: id in wp-content/plugins/printer-friendly-wp/print.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (print1.png)
The official readme.txt might help

printer-friendly-wp/printpostpage.php 85% from 13 tests

The main file in "Printer-Friendly WP" v. 0.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 251 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("printer-friendly-wp.php" instead of "printpostpage.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin126 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP34526112
CSS13014

PHP code Passed 2 tests

A brief analysis 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.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
print1.png85.54KB35.35KB▼ 58.67%
img/print.png2.05KB1.50KB▼ 26.68%