62% export-category-posts-pdf

Code Review | Export Category Posts (PDF)

WordPress plugin Export Category Posts (PDF) scored62%from 54 tests.

About plugin

  • Plugin page: export-category-p...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 5, 2016
  • Latest release: Mar 1, 2016
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: hojjatmr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,851 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.11ms] Passed 4 tests

Server-side resources used by Export Category Posts (PDF)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.95 ▼4.68
Dashboard /wp-admin3.34 ▲0.0344.69 ▼1.94
Posts /wp-admin/edit.php3.39 ▲0.0346.89 ▲2.06
Add New Post /wp-admin/post-new.php5.92 ▲0.0395.53 ▼3.88
Media Library /wp-admin/upload.php3.26 ▲0.0336.39 ▲3.22
Export Category Posts (PDF) /wp-admin/tools.php?page=export-pdf-category-posts3.2030.06

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

Input-output and database impact of this plugin
Please fix the following
  • Total filesystem usage must be limited to 25MB (currently using 28.37MB)
Filesystem: 367 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
category_children
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Export Category Posts (PDF)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.66 ▼0.581.86 ▼0.0540.44 ▼15.73
Dashboard /wp-admin2,210 ▲194.83 ▼1.02104.13 ▼10.5440.43 ▼3.37
Posts /wp-admin/edit.php2,093 ▲42.00 ▲0.0038.76 ▲2.3534.92 ▲0.70
Add New Post /wp-admin/post-new.php1,545 ▲1718.13 ▼0.45611.53 ▼22.2256.57 ▼2.58
Media Library /wp-admin/upload.php1,386 ▼24.22 ▲0.0196.38 ▼6.5241.11 ▼3.15
Export Category Posts (PDF) /wp-admin/tools.php?page=export-pdf-category-posts8611.9227.1129.19

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • category_children
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% 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
    • > GET request to /wp-admin/tools.php?page=export-pdf-category-posts
    • > Warning in wp-content/plugins/export-category-posts-pdf/export-category-posts-pdf.php+19
    Use of undefined constant time - assumed 'time' (this will throw an Error in a future version of PHP)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 77× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/index.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/example_022.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/example_013.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/example_014.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/barcodes/example_2d_datamatrix_png.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/example_045.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/example_049.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/example_003.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/barcodes/example_2d_datamatrix_html.php
    • > /wp-content/plugins/export-category-posts-pdf/tcpdf/examples/example_041.php
  • 179× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/export-category-posts-pdf/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/export-category-posts-pdf/tcpdf/tcpdf.php on line 17778
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/export-category-posts-pdf/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/export-category-posts-pdf/tcpdf/tcpdf.php on line 17778
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/export-category-posts-pdf/tcpdf/tcpdf.php on line 17778
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/export-category-posts-pdf/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/export-category-posts-pdf/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/export-category-posts-pdf/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/export-category-posts-pdf/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/export-category-posts-pdf/tcpdf/tcpdf.php on line 17778

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: export, pdf, rtl

export-category-posts-pdf/export-category-posts-pdf.php Passed 13 tests

The entry point to "Export Category Posts (PDF)" version 2.0 is a PHP file that has certain tags in its header comment area
54 characters long description:
Export all posts from specific category to a PDF file.

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/export-category-posts-pdf/tcpdf/examples/data/cert/tcpdf.crt
53,471 lines of code in 235 files:
LanguageFilesBlank linesComment linesLines of code
PHP2293,88517,54451,492
SVG3111,882
CSS131254
JSON10040
JavaScript1003

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 4,349)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 499)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity306.00
▷ Minimum class complexity1.00
▷ Maximum class complexity4,349.00
Average method complexity10.01
▷ Minimum method complexity1.00
▷ Maximum method complexity499.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods711
▷ Static methods10715.05%
▷ Public methods43561.18%
▷ Protected methods27638.82%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants138
▷ Global constants138100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.56MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tcpdf/examples/images/alpha.png23.33KB30.34KB0.00%
tcpdf/examples/images/logo_example.png18.96KB17.68KB▼ 6.71%
tcpdf/examples/images/image_with_alpha.png238.49KB61.71KB▼ 74.12%
tcpdf/examples/images/tcpdf_cell.png37.51KB36.62KB▼ 2.39%
tcpdf/examples/images/tcpdf_signature.png66.34KB25.47KB▼ 61.61%