84% pie-and-donut-chart

Code Review | Pie and Donut charts

WordPress plugin Pie and Donut charts scored 84% from 54 tests.

About plugin

  • Plugin page: pie-and-donut-chart
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 6, 2020
  • Latest release: Aug 6, 2020
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: varunkatyal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 489 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.19ms] Passed 4 tests

A check of server-side resources used by Pie and Donut charts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.17 ▼2.59
Dashboard /wp-admin3.33 ▲0.0348.93 ▲0.78
Posts /wp-admin/edit.php3.38 ▲0.0249.14 ▲2.51
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.71 ▼2.19
Media Library /wp-admin/upload.php3.25 ▲0.0235.86 ▼0.74

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Pie and Donut charts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲6113.66 ▼0.711.76 ▼0.2044.56 ▼4.70
Dashboard /wp-admin2,224 ▲365.81 ▼0.0799.75 ▼19.0041.75 ▼5.61
Posts /wp-admin/edit.php2,106 ▲142.02 ▲0.0034.77 ▼6.8633.73 ▼0.64
Add New Post /wp-admin/post-new.php1,548 ▲1223.17 ▲0.03660.54 ▼24.4055.12 ▼2.14
Media Library /wp-admin/upload.php1,403 ▲214.20 ▼0.0793.92 ▼8.5445.02 ▲2.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/pie-and-donut-chart/pie_shortcodes.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PieDonutChartElementor\\add_action() in wp-content/plugins/pie-and-donut-chart/plugin.php:104

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 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
7 plugin tags: donut chart, pie chart, charts, interactive charts, polar chart...

pie-and-donut-chart/main.php 85% from 13 tests

This is the main PHP file of "Pie and Donut charts" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pie-and-donut-chart.php" instead of "main.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin236 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5147168235
JavaScript1061

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.75
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods21
▷ Static methods14.76%
▷ Public methods1885.71%
▷ Protected methods29.52%
▷ Private methods14.76%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin