68% ninja-charts

Code Review | Ninja Charts- WordPress Charts and Graphs Plugin

WordPress plugin Ninja Charts- WordPress Charts and Graphs Plugin scored68%from 54 tests.

About plugin

  • Plugin page: ninja-charts
  • Plugin version: 3.2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.4-6.3
  • WordPress version: 6.3.1
  • First release: Jul 8, 2020
  • Latest release: Sep 25, 2023
  • Number of updates: 12
  • Update frequency: every 97.9 days
  • Top authors: csesumonpro (58.33%)adreastrian (50%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /33,926 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲1.32MB] [CPU: ▲6.16ms] Passed 4 tests

An overview of server-side resources used by Ninja Charts- WordPress Charts and Graphs Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.78 ▲1.3247.79 ▲8.19
Dashboard /wp-admin4.62 ▲1.3258.40 ▲13.36
Posts /wp-admin/edit.php4.68 ▲1.3252.21 ▼1.25
Add New Post /wp-admin/post-new.php8.32 ▲2.43101.85 ▲8.02
Media Library /wp-admin/upload.php4.55 ▲1.3243.65 ▲9.67
Charts /wp-admin/admin.php?page=ninja-charts4.5537.54

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 229 new files
Database: 1 new table, 6 new options
New tables
wp_ninja_charts
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Ninja Charts- WordPress Charts and Graphs Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲12113.27 ▼1.114.49 ▲2.8443.21 ▼5.56
Dashboard /wp-admin2,262 ▲774.87 ▼0.20115.02 ▲13.9642.78 ▼1.25
Posts /wp-admin/edit.php2,149 ▲602.02 ▼0.0336.12 ▼12.7134.80 ▼1.78
Add New Post /wp-admin/post-new.php6,440 ▲4,90628.19 ▲5.14863.90 ▲223.8853.02 ▲1.84
Media Library /wp-admin/upload.php1,444 ▲564.17 ▼0.08106.29 ▲10.8645.92 ▲2.21
Get help /wp-admin/admin.php?page=ninja-charts#/support1,2145.67230.6239.21
Add Chart /wp-admin/admin.php?page=ninja-charts#/add-chart1,4197.38213.9942.20
Charts /wp-admin/admin.php?page=ninja-charts1,1636.1562.5334.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_ninja_charts
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ninja-charts/app/Views/admin/menu.php
  • 77× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'NinjaCharts\\Framework\\Foundation\\ContextualBindingBuilderContract' not found in wp-content/plugins/ninja-charts/vendor/wpfluent/framework/src/WPFluent/Foundation/ContextualBindingBuilder.php:5
    • > PHP Fatal error
      Uncaught Error: Call to a member function withPolicy() on null in wp-content/plugins/ninja-charts/app/Http/Routes/api.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'NinjaCharts\\Framework\\Foundation\\ContainerContract' not found in wp-content/plugins/ninja-charts/vendor/wpfluent/framework/src/WPFluent/Foundation/Container.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'NinjaCharts\\Framework\\Database\\Orm\\Relations\\HasOneOrMany' not found in wp-content/plugins/ninja-charts/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Relations/HasOne.php:7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get() on null in wp-content/plugins/ninja-charts/boot/globals.php:11
    • > PHP Fatal error
      Trait 'NinjaCharts\\Framework\\Support\\MacroableTrait' not found in wp-content/plugins/ninja-charts/vendor/wpfluent/framework/src/WPFluent/Support/Str.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'NinjaCharts\\Framework\\Database\\Orm\\Relations\\Relation' not found in wp-content/plugins/ninja-charts/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Relations/HasOneOrMany.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'NinjaCharts\\Framework\\Database\\Orm\\Relations\\Relation' not found in wp-content/plugins/ninja-charts/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Relations/BelongsTo.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'NinjaCharts\\Framework\\Database\\BaseGrammar' not found in wp-content/plugins/ninja-charts/vendor/wpfluent/framework/src/WPFluent/Database/Query/Grammar.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'NinjaCharts\\Framework\\Foundation\\Policy' not found in wp-content/plugins/ninja-charts/app/Http/Policies/UserPolicy.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: There are too many tags (36 tag instead of maximum 10)
Please take inspiration from this readme.txt

ninja-charts/plugin.php 92% from 13 tests

The entry point to "Ninja Charts- WordPress Charts and Graphs Plugin" version 3.2.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ninja-charts.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin29,370 lines of code in 187 files:
LanguageFilesBlank linesComment linesLines of code
PHP1654,20310,62416,876
JavaScript122,4272,32612,303
JSON400185
CSS4004
Markdown1001
SVG1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.11
▷ Minimum class complexity1.00
▷ Maximum class complexity187.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces30
Interfaces16
Traits14
Classes111
▷ Abstract classes109.01%
▷ Concrete classes10190.99%
▷ Final classes00.00%
Methods1,668
▷ Static methods20812.47%
▷ Public methods1,33680.10%
▷ Protected methods32419.42%
▷ Private methods80.48%
Functions112
▷ Named functions108.93%
▷ Anonymous functions10291.07%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/chartjs_combo_chart.png4.89KB2.56KB▼ 47.70%
assets/images/fluent-crm-logo.png3.27KB1.64KB▼ 49.76%
assets/images/google_combo_chart.png13.56KB4.25KB▼ 68.66%
assets/images/icon_small.png5.91KB3.68KB▼ 37.70%
assets/images/bug.png1.92KB1.04KB▼ 45.72%