74% master-pdf-viewer

Code Review | Master PDF Viewer

WordPress plugin Master PDF Viewer scored74%from 54 tests.

About plugin

  • Plugin page: master-pdf-viewer
  • Plugin version: 0.1.0
  • PHP compatiblity: 6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Jan 21, 2023
  • Latest release: Jan 21, 2023
  • Number of updates: 7
  • Update frequency: every 2.4 days
  • Top authors: Robiulawal40 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /455 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.16MB] [CPU: ▼48.12ms] Passed 4 tests

Analyzing server-side resources used by Master PDF Viewer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.81 ▼0.6513.25 ▼30.70
Dashboard /wp-admin2.85 ▼0.4518.05 ▼34.65
Posts /wp-admin/edit.php2.85 ▼0.5017.59 ▼34.72
Add New Post /wp-admin/post-new.php2.85 ▼3.0318.42 ▼92.41
Media Library /wp-admin/upload.php2.85 ▼0.3815.81 ▼22.41

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 209 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Master PDF Viewer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8615.08 ▲0.70103.69 ▲101.7946.57 ▼1.82
Dashboard /wp-admin2,206 ▲215.86 ▼0.02114.29 ▲9.5641.17 ▲0.99
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.1335.25 ▼5.6933.27 ▼6.05
Add New Post /wp-admin/post-new.php6,354 ▲4,82127.81 ▲4.61824.95 ▲140.2756.03 ▼1.87
Media Library /wp-admin/upload.php1,385 ▼34.16 ▼0.0294.23 ▼21.5343.02 ▼4.72

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function WP_Block_Type_Registry::register was called incorrectly. Block type "pdf-viewer/mpv-pdf-viewer" is already registered. Please see Debugging in WordPress for more information. (This message was added in version 5.0.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/master-pdf-viewer/functions.php:78
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_block_wrapper_attributes() in wp-content/plugins/master-pdf-viewer/build/render.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 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
1 plugin tags: block

master-pdf-viewer/master-pdf-viewer.php 85% from 13 tests

"Master PDF Viewer" version 0.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Domain Path: The domain path must begin with a forward slash character ("/mpv")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("mpv")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected110,826 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71,082624107,217
CSS4405672,699
HTML14817369
SVG5000291
PHP42735131
JSON200119

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods8
▷ Static methods112.50%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
pdf-js/web/images/shadow.png0.26KB0.35KB0.00%