90% pdf-block

Code Review | PDF Block

WordPress plugin PDF Block scored 90% from 54 tests.

About plugin

  • Plugin page: pdf-block
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Jul 2, 2020
  • Latest release: Sep 1, 2021
  • Number of updates: 8
  • Update frequency: every 53.4 days
  • Top authors: henryholtgeerts (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

3,000+ active / 10,243 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.01MB] [CPU: ▼4.44ms] Passed 4 tests

An overview of server-side resources used by PDF Block
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0233.07 ▼11.62
Dashboard /wp-admin3.32 ▲0.0144.78 ▼1.38
Posts /wp-admin/edit.php3.37 ▲0.0148.13 ▲0.57
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.08 ▼4.60
Media Library /wp-admin/upload.php3.24 ▲0.0134.08 ▼0.14

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Block
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6714.48 ▲0.101.63 ▼0.4239.40 ▼6.90
Dashboard /wp-admin2,206 ▲185.85 ▼0.0694.45 ▼5.1639.61 ▼5.49
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0435.58 ▼4.7932.72 ▼2.84
Add New Post /wp-admin/post-new.php6,476 ▲4,95625.11 ▲1.90846.67 ▲183.6072.99 ▲17.61
Media Library /wp-admin/upload.php1,391 ▼04.17 ▼0.0597.44 ▲0.3642.13 ▲0.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: file, gutenberg, pdf, editor, block...

pdf-block/plugin.php 92% from 13 tests

The main PHP file in "PDF Block" ver. 1.1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("pdf-block.php" instead of "plugin.php")

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 detected391 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3953227
Sass311173
JSON20039
PHP285638
Markdown18012
CSS2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin