84% pdf2post

Code Review | PDF 2 Post

WordPress plugin PDF 2 Post scored 84% from 54 tests.

About plugin

  • Plugin page: pdf2post
  • Plugin version: 2.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Feb 20, 2017
  • Latest release: Jul 7, 2020
  • Number of updates: 54
  • Update frequency: every 22.8 days
  • Top authors: munger41 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 9,149 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.42ms] Passed 4 tests

This is a short check of server-side resources used by PDF 2 Post
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.74 ▼3.50
Dashboard /wp-admin3.32 ▲0.0143.62 ▼5.00
Posts /wp-admin/edit.php3.37 ▲0.0149.81 ▼0.77
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.46 ▼23.80
Media Library /wp-admin/upload.php3.24 ▲0.0134.98 ▼1.38
New Post from PDF /wp-admin/edit.php?post_type=page&page=new-post-from-pdf3.1844.31
New Post from PDF /wp-admin/edit.php?post_type=article&page=new-post-from-pdf3.1842.05
New Post from PDF /wp-admin/edit.php?page=new-post-from-pdf3.1839.93

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
pdf2txt_executable
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF 2 Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10013.21 ▼1.431.88 ▲0.2640.24 ▼0.14
Dashboard /wp-admin2,214 ▲234.78 ▼1.09106.42 ▲5.8339.70 ▼2.95
Posts /wp-admin/edit.php2,097 ▲81.97 ▼0.0438.62 ▼2.8135.44 ▼1.03
Add New Post /wp-admin/post-new.php1,539 ▲523.18 ▲0.08668.24 ▲63.8349.62 ▼7.44
Media Library /wp-admin/upload.php1,399 ▲174.17 ▼0.0598.91 ▲0.2144.32 ▲1.09
New Post from PDF /wp-admin/edit.php?post_type=page&page=new-post-from-pdf1,0012.0526.2458.34
New Post from PDF /wp-admin/edit.php?post_type=article&page=new-post-from-pdf1,0222.0122.0436.41
New Post from PDF /wp-admin/edit.php?page=new-post-from-pdf1,0012.0525.4637.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • pdf2txt_executable
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?page=new-post-from-pdf
    • > Notice in wp-content/plugins/pdf2post/pdf2post.php+317
    Undefined variable: basePdf2txtCmd

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 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

pdf2post/pdf2post.php Passed 13 tests

The main file in "PDF 2 Post" v. 2.4.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
123 characters long description:
Bulk convert PDF documents to posts (imports all text and images - and attach images automatically to newly created posts).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin804 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1109175697
Python2253081
CSS10026

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity91.00
▷ Minimum class complexity91.00
▷ Maximum class complexity91.00
Average method complexity6.62
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.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

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected