52% pdf-poster

Code Review | PDF Poster - PDF Embedder Plugin for WordPress

WordPress plugin PDF Poster - PDF Embedder Plugin for WordPress scored52%from 54 tests.

About plugin

  • Plugin page: pdf-poster
  • Plugin version: 2.1.16
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 30, 2016
  • Latest release: Nov 28, 2023
  • Number of updates: 179
  • Update frequency: every 14.3 days
  • Top authors: abuhayat (59.78%)shehabulislam (40.78%)

Code review

54 tests

User reviews

136 reviews

Install metrics

20,000+ active /338,334 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲5.52MB] [CPU: ▲42.20ms] 75% from 4 tests

Analyzing server-side resources used by PDF Poster - PDF Embedder Plugin for WordPress
It is recommended to improve the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.52MB on /wp-admin/admin.php?page=pdf-poster-pricing-manual)
PageMemory (MB)CPU Time (ms)
Home /8.95 ▲5.4977.24 ▲38.24
Dashboard /wp-admin8.97 ▲5.6787.89 ▲40.15
Posts /wp-admin/edit.php8.97 ▲5.61102.99 ▲55.11
Add New Post /wp-admin/post-new.php11.20 ▲5.31147.92 ▲42.09
Media Library /wp-admin/upload.php8.97 ▲5.7482.87 ▲48.30
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9773.99
Upgrade /wp-admin/admin.php?page=pdf-poster-pricing-manual8.9770.19

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 827 new files
Database: 1 new table, 12 new options
New tables
wp_pdfposter_presets
New WordPress options
fs_accounts
pdfp_import
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
pdfposter_presets_database_version
widget_theysaidso_widget
fs_active_plugins
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for PDF Poster - PDF Embedder Plugin for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲13314.16 ▼0.181.60 ▼0.1133.01 ▼12.32
Dashboard /wp-admin2,287 ▲1095.68 ▲0.02109.28 ▼3.50111.84 ▲72.41
Posts /wp-admin/edit.php2,214 ▲1142.59 ▲0.6341.06 ▲0.3168.59 ▲32.15
Add New Post /wp-admin/post-new.php6,308 ▲4,77720.14 ▼2.621,001.06 ▲399.7355.11 ▲7.27
Media Library /wp-admin/upload.php1,500 ▲1034.90 ▲0.74114.00 ▲13.9687.49 ▲43.77
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0622.1431.0844.75
Upgrade /wp-admin/admin.php?page=pdf-poster-pricing-manual1,8454.19138.6589.61

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/pdf-poster/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_pdfposter_presets
  • Zombie WordPress options detected upon uninstall: 12 options
    • widget_recent-comments
    • fs_accounts
    • widget_recent-posts
    • widget_theysaidso_widget
    • pdfposter_presets_database_version
    • pdfp_import
    • db_upgraded
    • theysaidso_admin_options
    • fs_debug_mode
    • fs_active_plugins
    • ...

Smoke tests 25% 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
Please fix the following items
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/pdf-poster/pdfjs-new/web/viewer.php
    • > /wp-content/plugins/pdf-poster/pdfjs-new/web/viewer-old.php
    • > /wp-content/plugins/pdf-poster/pdfjs-new/raw/raw.php
    • > /wp-content/plugins/pdf-poster/pdfjs-new/web/pviewer.php
  • 27× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined index: print in wp-content/plugins/pdf-poster/pdfjs-new/web/viewer-old.php on line 167
    • > PHP Notice
      Undefined index: nobaki in wp-content/plugins/pdf-poster/pdfjs-new/web/pviewer.php on line 240
    • > PHP Notice
      Undefined index: download in wp-content/plugins/pdf-poster/pdfjs-new/web/viewer-old.php on line 105
    • > PHP Notice
      Undefined index: nobaki in wp-content/plugins/pdf-poster/pdfjs-new/web/viewer.php on line 249
    • > PHP Notice
      Undefined index: print in wp-content/plugins/pdf-poster/pdfjs-new/web/viewer-old.php on line 101
    • > PHP Notice
      Undefined index: nobaki in wp-content/plugins/pdf-poster/pdfjs-new/web/viewer.php on line 146
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Sdk' not found in wp-content/plugins/pdf-poster/inc/Api/AWSS3.php:24
    • > PHP Notice
      Undefined index: print in wp-content/plugins/pdf-poster/pdfjs-new/web/viewer-old.php on line 110
    • > PHP Notice
      Undefined index: side in wp-content/plugins/pdf-poster/pdfjs-new/web/pviewer.php on line 208
    • > PHP Notice
      Undefined index: download in wp-content/plugins/pdf-poster/pdfjs-new/web/viewer-old.php on line 110

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pdf-poster-pricing-manual
    • > Security (severe) in unknown
    https://js.freemius.com/vendors/nojquery.ba-postmessage.min.js?v=180 11 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://carefulspace.s4-tastewp.com') does not match the recipient window's origin ('').

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: pdf, embed pdf, google, pdf embedder, pdf plugin...

pdf-poster/pdf-poster.php 92% from 13 tests

The entry point to "PDF Poster - PDF Embedder Plugin for WordPress" version 2.1.16 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin165,689 lines of code in 356 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2314,4221,57692,646
PHP25412,22219,32452,584
CSS236795546,973
PO File213,3023,8856,725
Sass1697035,674
HTML49246865
SVG1100152
JSON40070

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity42.78
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.77
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces13
Interfaces1
Traits0
Classes151
▷ Abstract classes42.65%
▷ Concrete classes14797.35%
▷ Final classes00.00%
Methods1,715
▷ Static methods32018.66%
▷ Public methods1,30876.27%
▷ Protected methods170.99%
▷ Private methods39022.74%
Functions144
▷ Named functions13493.06%
▷ Anonymous functions106.94%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
93 compressed PNG files occupy 0.17MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
pdfjs-new/web/images/toolbarButton-sidebarToggle-rtl@2x.png0.34KB0.57KB0.00%
pdfjs-new/web/images/treeitem-collapsed@2x.png0.15KB0.20KB0.00%
pdfjs-new/web/images/toolbarButton-zoomOut.png0.09KB0.12KB0.00%
img/buynow.png22.06KB9.81KB▼ 55.52%
pdfjs-new/web/images/toolbarButton-viewAttachments@2x.png0.84KB1.56KB0.00%