78% flexible-pdf

Code Review | Flexible PDF

WordPress plugin Flexible PDF scored78%from 54 tests.

About plugin

  • Plugin page: flexible-pdf
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.8
  • WordPress version: 6.3.1
  • First release: Aug 6, 2017
  • Latest release: Mar 17, 2018
  • Number of updates: 10
  • Update frequency: every 22.3 days
  • Top authors: dyszczo (70%)kursorA (40%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,177 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.09MB] [CPU: ▼32.57ms] Passed 4 tests

This is a short check of server-side resources used by Flexible PDF
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▼0.0034.50 ▼9.11
Dashboard /wp-admin3.33 ▲0.0342.57 ▼13.09
Posts /wp-admin/edit.php3.45 ▼0.4045.37 ▼32.76
Add New Post /wp-admin/post-new.php5.91 ▲0.0281.81 ▼75.30
Media Library /wp-admin/upload.php3.26 ▲0.0232.20 ▼1.13

Server storage [IO: ▲41.30MB] [DB: ▲0.07MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • Total filesystem usage should be limited to 25MB (currently using 41.30MB)
Filesystem: 373 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Flexible PDF: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.41 ▼0.081.77 ▼0.2338.81 ▼8.06
Dashboard /wp-admin2,192 ▲155.54 ▼0.0786.71 ▼2.5443.72 ▲2.35
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0239.20 ▼32.0035.10 ▼13.57
Add New Post /wp-admin/post-new.php1,526 ▼023.19 ▲0.07643.61 ▼33.1151.57 ▼12.81
Media Library /wp-admin/upload.php1,403 ▲34.16 ▼0.0695.69 ▼2.4442.81 ▼1.63

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/compress.php
  • 42× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/config_fonts-distr-without-OTL.php:16
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/graph.php on line 27
    • > PHP Warning
      opendir(_MPDF_PATHgraph_cache): failed to open dir: No such file or directory in wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/graph.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/flexible-pdf/vendor/setasign/fpdi/fpdi_bridge.php:23
    • > PHP Notice
      Undefined index: opname in wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/includes/out.php on line 11
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_bar.php): failed to open stream: No such file or directory in wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/graph.php on line 30
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/includes/CJKdata.php:18
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_pie3d.php): failed to open stream: No such file or directory in wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/graph.php on line 29
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/flexible-pdf/vendor/mpdf/mpdf/graph.php on line 31
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/flexible-pdf/vendor/setasign/fpdi/fpdi_bridge.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: pdf, html to pdf

flexible-pdf/flexible-pdf.php Passed 13 tests

The main PHP file in "Flexible PDF" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
52 characters long description:
This plugin adds PDF creation functions to Wordpress

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected77,567 lines of code in 152 files:
LanguageFilesBlank linesComment linesLines of code
PHP1327,3489,79476,362
CSS97338552
PO File2112224275
JSON3120176
Markdown243096
JavaScript2181374
XML13016
YAML14016

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 8,314)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 1,542)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity373.35
▷ Minimum class complexity1.00
▷ Maximum class complexity8,314.00
Average method complexity18.65
▷ Minimum method complexity1.00
▷ Maximum method complexity1,542.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes48
▷ Abstract classes00.00%
▷ Concrete classes48100.00%
▷ Final classes00.00%
Methods1,013
▷ Static methods727.11%
▷ Public methods95994.67%
▷ Protected methods484.74%
▷ Private methods60.59%
Functions29
▷ Named functions2896.55%
▷ Anonymous functions13.45%
Constants378
▷ Global constants5314.02%
▷ Class constants32585.98%
▷ Public constants325100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin