77% printable-pdf-newspaper

Code Review | Printable PDF Newspaper

WordPress plugin Printable PDF Newspaper scored77%from 54 tests.

About plugin

  • Plugin page: printable-pdf-new...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.2-6.0
  • WordPress version: 6.3.1
  • First release: Sep 25, 2019
  • Latest release: Jun 26, 2022
  • Number of updates: 27
  • Update frequency: every 37.3 days
  • Top authors: ChrisHardie (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /6,545 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.55MB] [CPU: ▲17.55ms] 75% from 4 tests

Server-side resources used by Printable PDF Newspaper
The following require your attention
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.55MB on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.16 ▼0.45
Dashboard /wp-admin11.26 ▲7.9674.54 ▲28.26
Posts /wp-admin/edit.php11.27 ▲7.9170.77 ▲21.68
Add New Post /wp-admin/post-new.php12.19 ▲6.31107.75 ▲20.72
Media Library /wp-admin/upload.php11.27 ▲8.0475.39 ▲42.88

Server storage [IO: ▲31.94MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
It is recommended to fix the following issues
  • Try to limit filesystem usage to 25MB (currently using 31.94MB)
Filesystem: 323 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Printable PDF Newspaper
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲1514.17 ▼0.341.55 ▼0.2937.41 ▼7.52
Dashboard /wp-admin2,204 ▲275.51 ▼0.0483.03 ▼5.0536.81 ▼3.59
Posts /wp-admin/edit.php2,115 ▲182.03 ▲0.0933.80 ▼3.0731.70 ▼3.04
Add New Post /wp-admin/post-new.php1,536 ▲1023.44 ▲0.53646.34 ▼38.2854.49 ▲2.50
Media Library /wp-admin/upload.php1,415 ▲214.21 ▲0.0495.24 ▼2.5141.50 ▼1.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/printable-pdf-newspaper/lib/tcpdf/tools/tcpdf_addfont.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'TCPDF' not found in wp-content/plugins/printable-pdf-newspaper/classes/class-admin-newspaper-tcpdf.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

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
6 plugin tags: newsletter, print, newspaper, journalism, news...

printable-pdf-newspaper/printable-pdf-newspaper.php Passed 13 tests

"Printable PDF Newspaper" version 1.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
45 characters long description:
Generate a Printable PDF Newspaper from Posts

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin62,926 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
PHP1061,58111,96247,885
JavaScript663,7671,08614,433
CSS4725497
Markdown121063
JSON10047
YAML1001

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 4,379)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity325.20
▷ Minimum class complexity1.00
▷ Maximum class complexity4,379.00
Average method complexity9.89
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods730
▷ Static methods11015.07%
▷ Public methods44661.10%
▷ Protected methods27838.08%
▷ Private methods60.82%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants106
▷ Global constants106100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 1.76MB with 1.26MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png1,522.31KB434.64KB▼ 71.45%
screenshot-2.png279.52KB79.78KB▼ 71.46%