78% graph-lite

Code Review | WordPress Graphs & Charts - Easy Interactive HTML5 Charts Plugin

WordPress plugin WordPress Graphs & Charts - Easy Interactive HTML5 Charts Plugin scored78%from 54 tests.

About plugin

  • Plugin page: graph-lite
  • Plugin version: 2.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.7.2
  • WordPress version: 6.3.1
  • First release: Aug 3, 2018
  • Latest release: Apr 16, 2023
  • Number of updates: 30
  • Update frequency: every 57.2 days
  • Top authors: mymizan (96.67%)wptasker (6.67%)

Code review

54 tests

User reviews

7 reviews

Install metrics

400+ active /9,563 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.82ms] Passed 4 tests

An overview of server-side resources used by WordPress Graphs & Charts - Easy Interactive HTML5 Charts Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.39 ▼0.75
Dashboard /wp-admin3.39 ▲0.0545.98 ▼13.03
Posts /wp-admin/edit.php3.47 ▲0.1246.69 ▲0.52
Add New Post /wp-admin/post-new.php5.99 ▲0.1192.10 ▼2.01
Media Library /wp-admin/upload.php3.31 ▲0.0938.71 ▲7.26

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 43 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
graphs_lite_all_data

Browser metrics Passed 4 tests

WordPress Graphs & Charts - Easy Interactive HTML5 Charts Plugin: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲19915.83 ▲1.256.41 ▲4.6939.13 ▼5.42
Dashboard /wp-admin2,264 ▲766.35 ▲0.47140.51 ▲39.0241.97 ▲0.45
Posts /wp-admin/edit.php2,150 ▲583.33 ▲1.2950.55 ▲5.2134.16 ▼4.40
Add New Post /wp-admin/post-new.php6,255 ▲4,72226.94 ▲3.94938.11 ▲263.3341.79 ▼13.12
Media Library /wp-admin/upload.php1,446 ▲555.66 ▲1.45106.51 ▲5.8344.57 ▼0.98

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • graphs_lite_all_data
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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
Everything seems fine, however this is by no means an exhaustive test

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/graph-lite/admin/partials/graphs-lite-admin-new-chart.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/graph-lite/admin/partials/graphs-lite-admin-display.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 49 tag instead of maximum 10
You can look at the official readme.txt

graph-lite/graphs-lite.php 85% from 13 tests

The primary PHP file in "WordPress Graphs & Charts - Easy Interactive HTML5 Charts Plugin" version 2.0.8 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("graph-lite.php" instead of "graphs-lite.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected17,372 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript81,7592,72213,236
Vuejs Component1014983,517
CSS44120372
PHP10135242247

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods21
▷ Static methods29.52%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/16x16.png16.57KB1.78KB▼ 89.27%
admin/images/back-arrow.png1.34KB1.47KB0.00%