84% print-page

Code Review | Print Page block - Print the entire page or Section.

WordPress plugin Print Page block - Print the entire page or Section. scored84%from 54 tests.

About plugin

  • Plugin page: print-page
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 27, 2021
  • Latest release: Oct 3, 2023
  • Number of updates: 27
  • Update frequency: every 26.2 days
  • Top authors: charlescormier (88.89%)abuhayat (14.81%)

Code review

54 tests

User reviews

5 reviews

Install metrics

800+ active /6,410 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.02MB] [CPU: ▼1.28ms] Passed 4 tests

Server-side resources used by Print Page block - Print the entire page or Section.
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.92 ▼5.98
Dashboard /wp-admin3.32 ▲0.0247.02 ▲1.62
Posts /wp-admin/edit.php3.38 ▲0.0252.01 ▲2.64
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.13 ▲0.61
Media Library /wp-admin/upload.php3.25 ▲0.0232.54 ▼1.37

Server storage [IO: ▲0.44MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Print Page block - Print the entire page or Section.: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.30 ▼1.441.51 ▼0.2537.18 ▼9.99
Dashboard /wp-admin2,206 ▲185.79 ▼0.11100.46 ▼6.2838.15 ▼6.44
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0139.60 ▼1.1735.56 ▲1.20
Add New Post /wp-admin/post-new.php6,252 ▲4,73319.83 ▼3.67851.94 ▲201.1057.67 ▼0.53
Media Library /wp-admin/upload.php1,388 ▼04.22 ▼0.03102.90 ▲7.6440.61 ▼0.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant PPB_PLUGIN_VERSION - assumed 'PPB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/print-page/dist/script.asset.php on line 4
    • > PHP Warning
      Use of undefined constant PPB_PLUGIN_VERSION - assumed 'PPB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/print-page/dist/editor.asset.php on line 4

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 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Requires at least: Invalid version format
You can take inspiration from this readme.txt

print-page/plugin.php 92% from 13 tests

This is the main PHP file of "Print Page block - Print the entire page or Section." version 1.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("print-page.php" instead of "plugin.php")

Code Analysis Passed 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 detected245 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JSON30099
PO File1284974
PHP4171568
CSS2022
JavaScript2022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin