77% pdf-generator-crowd-api

Code Review | PDF Generator Crowd API

WordPress plugin PDF Generator Crowd API scored77%from 54 tests.

About plugin

  • Plugin page: pdf-generator-cro...
  • Plugin version: 1.35
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.8
  • WordPress version: 6.3.1
  • First release: Sep 12, 2016
  • Latest release: Apr 13, 2017
  • Number of updates: 18
  • Update frequency: every 16.6 days
  • Top authors: wibergsweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,904 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.30MB] [CPU: ▼3.92ms] Passed 4 tests

A check of server-side resources used by PDF Generator Crowd API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2644.19 ▲3.23
Dashboard /wp-admin3.62 ▲0.3246.56 ▼5.23
Posts /wp-admin/edit.php3.74 ▲0.3845.10 ▼2.68
Add New Post /wp-admin/post-new.php6.20 ▲0.3281.24 ▼10.99
Media Library /wp-admin/upload.php3.55 ▲0.3242.84 ▲7.94
Generator PDF Crowd settings /wp-admin/options-general.php?page=crowdpdf-wp-options3.4934.10

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Generator Crowd API
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲14213.48 ▼0.898.12 ▲6.3944.09 ▲1.17
Dashboard /wp-admin2,204 ▲305.61 ▼0.0481.86 ▼25.8335.90 ▼13.08
Posts /wp-admin/edit.php2,106 ▲32.01 ▼0.0133.88 ▼1.4931.71 ▼1.26
Add New Post /wp-admin/post-new.php1,533 ▼223.20 ▲4.83682.48 ▲40.3953.60 ▼11.84
Media Library /wp-admin/upload.php1,406 ▲64.10 ▼0.12108.68 ▲12.5646.63 ▲3.75
Generator PDF Crowd settings /wp-admin/options-general.php?page=crowdpdf-wp-options1,2341.6922.0934.04

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=crowdpdf-wp-options
    • > Notice in wp-content/plugins/pdf-generator-crowd-api/core/options.php+862
    Trying to access array offset on value of type bool

SRP 50% from 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pdf-generator-crowd-api/pdfgeneratorcrowd.php

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 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
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Screenshot with the usage example.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

pdf-generator-crowd-api/pdfgeneratorcrowd.php 85% from 13 tests

"PDF Generator Crowd API" version 1.35's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("pdf-generator-crowd-api.php" instead of "pdfgeneratorcrowd.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,336 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP34141,7131,017
PO File11015311
CSS1008

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 192)
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity61.75
▷ Minimum class complexity2.00
▷ Maximum class complexity200.00
Average method complexity4.20
▷ Minimum method complexity1.00
▷ Maximum method complexity192.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods76
▷ Static methods00.00%
▷ Public methods7092.11%
▷ Protected methods00.00%
▷ Private methods67.89%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.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