78% easy-charts

Code Review | Easy Charts

WordPress plugin Easy Charts scored78%from 54 tests.

About plugin

  • Plugin page: easy-charts
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 12, 2016
  • Latest release: May 6, 2023
  • Number of updates: 27
  • Update frequency: every 99.0 days
  • Top authors: kiranpotphode (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

3,000+ active /36,785 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.24MB] [CPU: ▼4.15ms] Passed 4 tests

Server-side resources used by Easy Charts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2443.87 ▼1.37
Dashboard /wp-admin3.54 ▲0.2447.28 ▼3.91
Posts /wp-admin/edit.php3.65 ▲0.3049.59 ▲3.28
Add New Post /wp-admin/post-new.php6.15 ▲0.2790.81 ▼12.29
Media Library /wp-admin/upload.php3.46 ▲0.2439.18 ▲0.99
Add New /wp-admin/post-new.php?post_type=easy_charts3.7850.61
Charts settings /wp-admin/edit.php?post_type=easy_charts&page=easy-charts-settings3.4332.99
All Charts /wp-admin/edit.php?post_type=easy_charts3.5137.28

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 179 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Easy Charts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.25 ▲0.061.73 ▼0.1048.64 ▲4.49
Dashboard /wp-admin2,227 ▲505.53 ▼0.1888.04 ▼10.9940.89 ▼3.38
Posts /wp-admin/edit.php2,135 ▲352.02 ▲0.0434.50 ▼2.0333.44 ▼5.37
Add New Post /wp-admin/post-new.php1,619 ▲8420.80 ▲2.52751.89 ▲102.3737.48 ▼37.15
Media Library /wp-admin/upload.php1,432 ▲324.22 ▼0.0095.48 ▼20.1744.95 ▼3.22
Add New /wp-admin/post-new.php?post_type=easy_charts6,5984.70275.42120.05
Charts settings /wp-admin/edit.php?post_type=easy_charts&page=easy-charts-settings8201.9924.4025.37
All Charts /wp-admin/edit.php?post_type=easy_charts1,1021.9830.3729.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/easy-charts/public/partials/easy-charts-public-display.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/easy-charts/admin/partials/easy-charts-shortcode-metabox-display.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Easy_Charts' not found in wp-content/plugins/easy-charts/admin/partials/easy-charts-preview-metabox-display.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Easy_Charts' not found in wp-content/plugins/easy-charts/admin/partials/easy-charts-data-metabox-display.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/easy-charts/admin/partials/easy-charts-settings-page-display.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Easy_Charts' not found in wp-content/plugins/easy-charts/admin/partials/easy-charts-configuration-metabox-display.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% 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
These attributes need to be fixed:
  • Tags: Too many tags (20 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

easy-charts/easy-charts.php Passed 13 tests

The primary PHP file in "Easy Charts" version 1.2.2 is used by WordPress to initiate all plugin functionality
74 characters long description:
Build simple, reusable, customisable charts on any page or post with ease.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin77,965 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1063,2173,31773,380
CSS144193242,283
PHP163567851,521
SVG100655
Sass1150102
Markdown19024

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity14.00
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods47
▷ Static methods36.38%
▷ Public methods4085.11%
▷ Protected methods00.00%
▷ Private methods714.89%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
19 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_diagonals-thick_20_e69700_40x40.png0.41KB0.15KB▼ 62.35%
admin/css/images/ui-bg_highlight-soft_100_f9f9f9_1x100.png0.27KB0.10KB▼ 61.73%
admin/css/images/ui-icons_ff0084_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/images/ui-icons_0b54d5_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/images/ui-icons_0a82eb_256x240.png4.44KB4.17KB▼ 6.02%