10% pdftoimg-viewer

Code Review | PDFtoIMG

WordPress plugin PDFtoIMG scored10%from 54 tests.

About plugin

  • Plugin page: pdftoimg-viewer
  • Plugin version: 1.0.0
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Sep 12, 2023
  • Latest release: Sep 12, 2023
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: pitinca (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /162 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/pdftoimg-viewer/PDFtoIMG.php+65
    Undefined variable: pagenow

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.18ms] Passed 4 tests

Analyzing server-side resources used by PDFtoIMG
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.80 ▼1.90
Dashboard /wp-admin3.32 ▲0.0243.84 ▼4.51
Posts /wp-admin/edit.php3.37 ▲0.0241.47 ▼5.64
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.79 ▼16.65
Media Library /wp-admin/upload.php3.25 ▲0.0233.23 ▲0.88
File Management /wp-admin/admin.php?page=PDFtoIMG3.2231.86
File Upload /wp-admin/admin.php?page=PDFtoIMG_file_upload3.2231.41

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDFtoIMG
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,877 ▲13113.92 ▼0.4624.66 ▲22.8642.21 ▲1.28
Dashboard /wp-admin2,241 ▲565.85 ▲0.97101.28 ▼3.9779.37 ▲37.13
Posts /wp-admin/edit.php2,123 ▲341.97 ▼0.0436.31 ▼0.5331.81 ▼0.67
Add New Post /wp-admin/post-new.php1,552 ▲3223.21 ▼0.00699.47 ▲62.3250.01 ▼14.77
Media Library /wp-admin/upload.php1,416 ▲314.10 ▼0.1296.92 ▼0.2480.20 ▲37.45
File Management /wp-admin/admin.php?page=PDFtoIMG8771.9528.9044.52
File Upload /wp-admin/admin.php?page=PDFtoIMG_file_upload8541.9525.0029.48

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=PDFtoIMG_file_upload
    • > Network (severe)
    wp-content/plugins/pdf-to-img/img/PDFtoIMG_icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid URI ("https:pitinca/no-donate/")
  • Screenshots: Please add an image for screenshot #6 (screenshot-6.png)
The official readme.txt is a good inspiration

pdftoimg-viewer/PDFtoIMG.php 85% from 13 tests

"PDFtoIMG" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pdftoimg-viewer.php" instead of "PDFtoIMG.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 379 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected58,156 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript460014954,891
SVG1002,671
PHP5108120484
Markdown159084
CSS45726

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.50
▷ Minimum class complexity5.00
▷ Maximum class complexity6.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods218.18%
▷ Public methods1090.91%
▷ Protected methods19.09%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/PDFtoIMG_icon.png1.64KB0.90KB▼ 44.97%
img/PDFtoIMG_icon_logo.png3.12KB1.93KB▼ 37.97%