78% gsy-export-posts-to-pdf

Code Review | GSY Export Posts to PDF

WordPress plugin GSY Export Posts to PDF scored 78% from 54 tests.

About plugin

  • Plugin page: gsy-export-posts-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Sep 10, 2014
  • Latest release: Sep 10, 2014
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: georgi.s.yankov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,168 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.68ms] Passed 4 tests

This is a short check of server-side resources used by GSY Export Posts to PDF
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.50 ▼5.14
Dashboard /wp-admin3.32 ▲0.0251.96 ▲0.24
Posts /wp-admin/edit.php3.37 ▲0.0253.38 ▲2.97
Add New Post /wp-admin/post-new.php5.90 ▲0.0292.12 ▼0.77
Media Library /wp-admin/upload.php3.24 ▲0.0238.01 ▼5.06
Export Posts to PDF /wp-admin/options-general.php?page=gsy-export-posts-to-pdf3.2131.36

Server storage [IO: ▲27.25MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • The filesystem usage should be lower than 25MB (currently using 27.25MB)
Filesystem: 169 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

GSY Export Posts to PDF: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲4013.23 ▼1.174.73 ▲2.7445.19 ▲2.25
Dashboard /wp-admin2,204 ▼25.94 ▲1.10101.92 ▼9.8339.67 ▼3.49
Posts /wp-admin/edit.php2,093 ▲11.97 ▼0.0841.12 ▲3.3941.58 ▲7.80
Add New Post /wp-admin/post-new.php1,545 ▲1118.23 ▼5.06710.05 ▲19.6657.22 ▼0.82
Media Library /wp-admin/upload.php1,383 ▼84.23 ▲0.0197.60 ▼10.6842.30 ▼4.93
Export Posts to PDF /wp-admin/options-general.php?page=gsy-export-posts-to-pdf8102.0327.0127.34

Uninstaller [IO: ✅] [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
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

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
Good news, no errors were detected

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
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/utils/index.php
    • > /wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/compress.php
  • 48× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > 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/gsy-export-posts-to-pdf/libraries/mpdf/graph.php on line 32
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/config.php:5
    • > PHP Fatal error
      'break' not in the 'loop' or 'switch' context in wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/classes/svg.php on line 2311
    • > 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/gsy-export-posts-to-pdf/libraries/mpdf/graph.php on line 25
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_regstat.php): failed to open stream: No such file or directory in wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/graph.php on line 28
    • > PHP Notice
      Undefined index: dest in wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/includes/out.php on line 8
    • > PHP Warning
      include_once(): Failed opening '_JPGRAPH_PATHjpgraph_radar.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/graph.php on line 32
    • > PHP Warning
      Use of undefined constant _MPDF_PATH - assumed '_MPDF_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/classes/ttfontsuni_analysis.php on line 3
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_radar.php): failed to open stream: No such file or directory in wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/graph.php on line 32
    • > PHP Warning
      opendir(_MPDF_PATHgraph_cache): failed to open dir: No such file or directory in wp-content/plugins/gsy-export-posts-to-pdf/libraries/mpdf/graph.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: pdf, gsy, export, posts

gsy-export-posts-to-pdf/gsy-export-posts-to-pdf.php Passed 13 tests

"GSY Export Posts to PDF" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
20 characters long description:
Export posts to pdf.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin65,130 lines of code in 90 files:
LanguageFilesBlank linesComment linesLines of code
PHP855,1715,32464,977
CSS4111994
PO File1212259

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 10,031)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 1,527)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity509.54
▷ Minimum class complexity4.00
▷ Maximum class complexity10,031.00
Average method complexity21.92
▷ Minimum method complexity1.00
▷ Maximum method complexity1,527.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods632
▷ Static methods00.00%
▷ Public methods61196.68%
▷ Protected methods213.32%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants47
▷ Global constants47100.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