73% rotativa

Code Review | Rotativa.HQ PDF Generator

WordPress plugin Rotativa.HQ PDF Generator scored73%from 54 tests.

About plugin

  • Plugin page: rotativa
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.0.3
  • WordPress version: 6.3.1
  • First release: Apr 29, 2018
  • Latest release: Feb 20, 2019
  • Number of updates: 14
  • Update frequency: every 21.9 days
  • Top authors: rotativahq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /881 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.15MB] [CPU: ▼14.21ms] Passed 4 tests

A check of server-side resources used by Rotativa.HQ PDF Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.81 ▼5.78
Dashboard /wp-admin3.34 ▲0.0456.67 ▼4.92
Posts /wp-admin/edit.php3.39 ▲0.0449.99 ▼8.01
Add New Post /wp-admin/post-new.php5.17 ▼0.7167.80 ▼38.13
Media Library /wp-admin/upload.php3.27 ▲0.0440.65 ▲4.10
Rotativa /wp-admin/tools.php?page=rotativa3.2633.47

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

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

Browser metrics Passed 4 tests

Rotativa.HQ PDF Generator: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,922 ▲17613.97 ▼0.416.84 ▲4.9142.56 ▼0.88
Dashboard /wp-admin2,236 ▲455.12 ▲0.21103.09 ▲2.6941.17 ▼1.79
Posts /wp-admin/edit.php2,124 ▲352.49 ▲0.4540.89 ▲3.2933.00 ▼0.61
Add New Post /wp-admin/post-new.php1,540 ▲923.47 ▲5.15668.66 ▲19.3236.56 ▼26.90
Media Library /wp-admin/upload.php1,418 ▲274.47 ▲0.2898.78 ▼5.5943.40 ▼4.02
Rotativa /wp-admin/tools.php?page=rotativa1,4102.6053.4027.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=rotativa
    • > Notice in wp-content/plugins/rotativa/admin/class-rotativa-admin.php+579
    Undefined index: options

SRP 0% 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× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/rotativa/public/partials/rotativa-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/rotativa/admin/partials/rotativa-admin-display.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: html, cloud, pdf

rotativa/rotativa.php Passed 13 tests

The main PHP script in "Rotativa.HQ PDF Generator" version 1.2.4 is automatically included on every request by WordPress
66 characters long description:
Convert HTML to PDF in the cloud in a extremely easy and fast way.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin2,531 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS325441,538
PHP12386622808
JavaScript4470158
JSON10027

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.29
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods42
▷ Static methods24.76%
▷ Public methods3788.10%
▷ Protected methods00.00%
▷ Private methods511.90%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin