57% pubydoc-data-tables-and-charts

Code Review | PubyDoc - Data Tables and Charts

WordPress plugin PubyDoc - Data Tables and Charts scored 57% from 54 tests.

About plugin

  • Plugin page: pubydoc-data-tabl...
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 17, 2022
  • Latest release: Sep 13, 2023
  • Number of updates: 44
  • Update frequency: every 13.8 days
  • Top authors: pubydoc (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 2,522 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▲3.61ms] Passed 4 tests

This is a short check of server-side resources used by PubyDoc - Data Tables and Charts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2446.06 ▲0.02
Dashboard /wp-admin3.53 ▲0.2354.18 ▼5.41
Posts /wp-admin/edit.php3.64 ▲0.2967.35 ▲13.00
Add New Post /wp-admin/post-new.php6.11 ▲0.23109.20 ▲11.62
Media Library /wp-admin/upload.php3.45 ▲0.2346.59 ▲8.21
Add Table /wp-admin/admin.php?page=pyt-tables&tab=tables-new3.6364.07
All Tables /wp-admin/admin.php?page=pyt-tables&tab=tables3.5556.04
Settings /wp-admin/admin.php?page=pyt-tables&tab=settings3.5551.10
Diagrams /wp-admin/admin.php?page=pyt-tables&tab=diagrams3.8759.22

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

Filesystem and database footprint
It is recommended to fix the following issues
  • Try to limit filesystem usage to 25MB (currently using 44.24MB)
Filesystem: 1,180 new files
Database: 3 new tables, 10 new options
New tables
wp_pyt_modules
wp_pyt_tables
wp_pyt_diagrams
New WordPress options
wp_pyt_db_version
pyt_plugin_activation_errors
widget_theysaidso_widget
widget_recent-comments
db_upgraded
wp_pyt_db_installed
theysaidso_admin_options
pyt_plug_was_used
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for PubyDoc - Data Tables and Charts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲3614.65 ▼0.131.72 ▼0.2440.28 ▼1.16
Dashboard /wp-admin2,245 ▲394.87 ▲0.08102.37 ▼14.7037.29 ▼7.62
Posts /wp-admin/edit.php2,125 ▲332.01 ▲0.0239.66 ▲4.7732.78 ▼0.51
Add New Post /wp-admin/post-new.php1,563 ▲4423.27 ▲0.09630.63 ▼16.5554.97 ▲8.32
Media Library /wp-admin/upload.php1,421 ▲334.22 ▲0.10113.51 ▲4.4243.00 ▼2.33
Add Table /wp-admin/admin.php?page=pyt-tables&tab=tables-new1,7274.2173.59108.43
All Tables /wp-admin/admin.php?page=pyt-tables&tab=tables1,5964.68112.2942.04
Settings /wp-admin/admin.php?page=pyt-tables&tab=settings1,2313.9164.5938.37
Diagrams /wp-admin/admin.php?page=pyt-tables&tab=diagrams3,05011.91277.25110.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_pyt_tables
    • wp_pyt_diagrams
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • pyt_plug_was_used
    • pyt_plugin_activation_errors
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Almost there! Just fix the following items
  • 84× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/example_028.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/example_011.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/example_038.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/barcodes/example_2d_qrcode_png.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/example_019.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/barcodes/example_2d_pdf417_svg.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/example_040.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/example_013.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/example_046.php
    • > /wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/barcodes/example_2d_pdf417_png.php
  • 241× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader' not found in wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/PhpOffice/PhpSpreadsheet/Reader/Xml.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'ModelPyt' not found in wp-content/plugins/pubydoc-data-tables-and-charts/modules/tables/models/cells.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ViewPyt' not found in wp-content/plugins/pubydoc-data-tables-and-charts/modules/tables/views/tables.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\BaseParserClass' not found in wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/PhpOffice/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bcadd() in wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/tcpdf_barcodes_1d.php:2080
    • > PHP Fatal error
      Uncaught Error: Interface 'PhpOffice\\PhpSpreadsheet\\RichText\\ITextElement' not found in wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/PhpOffice/PhpSpreadsheet/RichText/TextElement.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'BaseObjectPyt' not found in wp-content/plugins/pubydoc-data-tables-and-charts/classes/view.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Distributions\\GammaBase' not found in wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/PhpOffice/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\BaseParserClass' not found in wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/PhpOffice/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\WriterPart' not found in wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/PhpOffice/PhpSpreadsheet/Writer/Xlsx/Drawing.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: spreadsheet, excell, table builder, data table, charts...

pubydoc-data-tables-and-charts/publish-your-table.php 77% from 13 tests

The primary PHP file in "PubyDoc - Data Tables and Charts" version 2.0.5 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pubydoc-data-tables-and-charts.php" instead of "publish-your-table.php")

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
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/pubydoc-data-tables-and-charts/common/lib/TCPDF/examples/data/cert/tcpdf.crt
158,005 lines of code in 910 files:
LanguageFilesBlank linesComment linesLines of code
PHP78919,49356,658136,482
JavaScript6283045111,961
SVG4114,553
CSS421851453,987
Markdown72960753
JSON300196
XML315273

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 4,391)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity35.31
▷ Minimum class complexity1.00
▷ Maximum class complexity4,391.00
Average method complexity4.35
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces71
Interfaces10
Traits0
Classes532
▷ Abstract classes336.20%
▷ Concrete classes49993.80%
▷ Final classes20.40%
Methods5,548
▷ Static methods1,69730.59%
▷ Public methods4,17375.22%
▷ Protected methods4798.63%
▷ Private methods89616.15%
Functions48
▷ Named functions1735.42%
▷ Anonymous functions3164.58%
Constants1,196
▷ Global constants18415.38%
▷ Class constants1,01284.62%
▷ Public constants95894.66%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
67 compressed PNG files occupy 0.66MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
common/lib/TCPDF/examples/images/alpha.png23.33KB30.34KB0.00%
common/lib/colorpicker/images/custom_submit.png0.97KB0.99KB0.00%
modules/tables/assets/css/images/calendar.png0.48KB0.45KB▼ 4.52%
common/lib/colorpicker/images/custom_rgb_r.png0.99KB0.74KB▼ 25.34%
common/css/images/license.png0.70KB0.54KB▼ 23.78%