57% print-my-blog

Code Review | Print My Blog - Print, PDF, & eBook Converter WordPress Plugin

WordPress plugin Print My Blog - Print, PDF, & eBook Converter WordPress Plugin scored57%from 54 tests.

About plugin

  • Plugin page: print-my-blog
  • Plugin version: 3.26.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 1, 2018
  • Latest release: Nov 21, 2023
  • Number of updates: 276
  • Update frequency: every 6.7 days
  • Top authors: mnelson4 (100%)

Code review

54 tests

User reviews

92 reviews

Install metrics

5,000+ active /301,845 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲5.62MB] [CPU: ▲39.95ms] 75% from 4 tests

This is a short check of server-side resources used by Print My Blog - Print, PDF, & eBook Converter WordPress Plugin
The following require your attention
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.62MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.05 ▲5.5875.50 ▲36.33
Dashboard /wp-admin9.07 ▲5.7292.58 ▲30.89
Posts /wp-admin/edit.php9.07 ▲5.7194.93 ▲45.54
Add New Post /wp-admin/post-new.php11.38 ▲5.49145.96 ▲47.05
Media Library /wp-admin/upload.php9.07 ▲5.8390.28 ▲57.40
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.0780.39

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 705 new files
Database: 2 new tables, 11 new options
New tables
wp_pmb_project_sections
wp_pmb_external_resources
New WordPress options
widget_theysaidso_widget
fs_active_plugins
widget_recent-comments
pmb_version_history
theysaidso_admin_options
fs_debug_mode
fs_accounts
can_compress_scripts
widget_recent-posts
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by Print My Blog - Print, PDF, & eBook Converter WordPress Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲11714.71 ▲0.311.61 ▼0.1730.03 ▼14.05
Dashboard /wp-admin2,252 ▲755.65 ▲0.02100.58 ▲7.2146.88 ▲0.48
Posts /wp-admin/edit.php2,175 ▲722.08 ▲0.0538.92 ▼3.8836.33 ▼0.81
Add New Post /wp-admin/post-new.php6,312 ▲4,78621.37 ▼1.73971.35 ▲363.5171.39 ▲14.44
Media Library /wp-admin/upload.php1,464 ▲734.20 ▲0.04110.13 ▲11.9250.23 ▲8.96
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1222.1828.0926.29

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/print-my-blog/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie tables detected upon uninstall: 2 tables
    • wp_pmb_project_sections
    • wp_pmb_external_resources
  • The uninstall procedure has failed, leaving 11 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • pmb_previous_version
    • widget_recent-posts
    • fs_active_plugins
    • pmb_version_history
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • fs_debug_mode
    • ...

Smoke tests 50% 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 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
Almost there! Just fix the following items
  • 12× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/print-my-blog/designs/epub/classic/templates/back_matter.php
    • > /wp-content/plugins/print-my-blog/designs/word/classic/templates/front_matter.php
    • > /wp-content/plugins/print-my-blog/designs/pdf/print/classic/templates/main.php
    • > /wp-content/plugins/print-my-blog/src/Twine/admin/news/DashboardNews.php
    • > /wp-content/plugins/print-my-blog/designs/epub/classic/templates/front_matter.php
    • > /wp-content/plugins/print-my-blog/designs/word/classic/templates/main.php
    • > /wp-content/plugins/print-my-blog/templates/partials/select_designs.php
    • > /wp-content/plugins/print-my-blog/designs/pdf/print/classic/templates/back_matter.php
    • > /wp-content/plugins/print-my-blog/designs/word/classic/templates/back_matter.php
    • > /wp-content/plugins/print-my-blog/designs/pdf/print/classic/templates/front_matter.php
  • 299× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PMB_DESIGNS_DIR - assumed 'PMB_DESIGNS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/print-my-blog/designs/pdf/digital/classic/templates/front_matter_article.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'PMB_DESIGNS_DIRpdf/print/classic/templates/front_matter_article.php' (include_path='.:/usr/share/php') in wp-content/plugins/print-my-blog/designs/pdf/digital/classic/templates/front_matter_article.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/print-my-blog/templates/partials/pro_print_page_window.php:6
    • > PHP Warning
      Use of undefined constant PMB_DESIGNS_DIR - assumed 'PMB_DESIGNS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/print-my-blog/designs/pdf/digital/classic/templates/back_matter.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Twine\\system\\Context' not found in wp-content/plugins/print-my-blog/src/PrintMyBlog/system/Context.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/print-my-blog/designs/pdf/print/classic/descriptions/edit.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Twine\\forms\\strategies\\validation\\ValidationBase' not found in wp-content/plugins/print-my-blog/src/Twine/forms/strategies/validation/RequiredValidation.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PrintMyBlog\\services\\generators\\HtmlBaseGenerator' not found in wp-content/plugins/print-my-blog/src/PrintMyBlog/services/generators/PdfGenerator.php:21
    • > PHP Fatal error
      require(): Failed opening required 'PMB_DESIGNS_DIRpdf/print/classic/templates/part.php' (include_path='.:/usr/share/php') in wp-content/plugins/print-my-blog/designs/pdf/digital/classic/templates/part.php on line 3
    • > PHP Warning
      require(PMB_DESIGNS_DIRpdf/print/classic/templates/partials/comments.php): failed to open stream: No such file or directory in wp-content/plugins/print-my-blog/designs/pdf/digital/classic/templates/partials/comments.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: pdf, print button, ebook, print, backup

print-my-blog/printmyblog.php 85% from 13 tests

The entry point to "Print My Blog - Print, PDF, & eBook Converter WordPress Plugin" version 3.26.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("print-my-blog.php" instead of "printmyblog.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.6" instead of "4.7")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin68,988 lines of code in 601 files:
LanguageFilesBlank linesComment linesLines of code
PHP44711,05827,76455,390
JavaScript981,5671,4508,553
CSS514224374,291
SVG330671
XML13482
JSON1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity24.64
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces43
Interfaces0
Traits0
Classes250
▷ Abstract classes2610.40%
▷ Concrete classes22489.60%
▷ Final classes00.00%
Methods2,517
▷ Static methods2279.02%
▷ Public methods1,88875.01%
▷ Protected methods2419.57%
▷ Private methods38815.42%
Functions214
▷ Named functions15471.96%
▷ Anonymous functions6028.04%
Constants271
▷ Global constants14252.40%
▷ Class constants12947.60%
▷ Public constants129100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/styles/libs/jquery-ui/images/ui-icons_454545_256x240.png6.92KB4.18KB▼ 39.61%
assets/styles/libs/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png0.32KB0.15KB▼ 53.40%
assets/styles/libs/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
assets/styles/libs/jquery-ui/images/ui-icons_cd0a0a_256x240.png4.51KB4.18KB▼ 7.28%
assets/styles/libs/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.15KB▼ 61.54%