83% pdf-image-generator

Code Review | PDF Image Generator

WordPress plugin PDF Image Generator scored83%from 54 tests.

About plugin

  • Plugin page: pdf-image-generator
  • Plugin version: 1.5.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.4
  • WordPress version: 6.3.1
  • First release: Jan 14, 2015
  • Latest release: Apr 25, 2017
  • Number of updates: 208
  • Update frequency: every 4.0 days
  • Top authors: fishpie (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

10,000+ active /122,594 total downloads

Benchmarks

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

An overview of server-side resources used by PDF Image Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.52 ▼2.66
Dashboard /wp-admin3.31 ▼0.0461.18 ▼4.55
Posts /wp-admin/edit.php3.36 ▲0.0051.32 ▲5.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.45 ▼9.10
Media Library /wp-admin/upload.php3.23 ▲0.0037.29 ▲2.07

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for PDF Image Generator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.22 ▼1.091.70 ▼0.0239.50 ▼5.06
Dashboard /wp-admin2,224 ▲235.86 ▼0.06103.60 ▼7.3243.64 ▲0.52
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0235.59 ▼0.5833.23 ▲1.85
Add New Post /wp-admin/post-new.php1,545 ▲1423.38 ▲0.12670.91 ▲11.0752.00 ▲4.08
Media Library /wp-admin/upload.php1,400 ▼34.38 ▲0.1896.49 ▼14.3543.36 ▼1.51

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% 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 50% 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/pdf-image-generator/pdf-image-generator.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (No setup, just upload a PDF file and insert it into the editor.), #2 (An inserted PDF image is editable (align, sizes, etc...) just like an ordinary image file.), #3 (You can set PDF as Featured Image and use functions for PDF in the same way as an image file.), #4 (You can control default settings and generate thumbnails of already-uploaded PDFs in the plugin page.)
Please take inspiration from this readme.txt

pdf-image-generator/pdf-image-generator.php 85% from 13 tests

"PDF Image Generator" version 1.5.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Description: Please keep the plugin description shorter than 140 characters (currently 175 characters long)

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
There were no executable files found in this plugin828 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP28516828

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.72
Average class complexity235.00
▷ Minimum class complexity235.00
▷ Maximum class complexity235.00
Average method complexity11.17
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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