83% amcharts-charts-and-maps

Code Review | amCharts: Charts and Maps

WordPress plugin amCharts: Charts and Maps scored83%from 54 tests.

About plugin

  • Plugin page: amcharts-charts-a...
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.0.1
  • WordPress version: 6.3.1
  • First release: Feb 28, 2014
  • Latest release: Aug 9, 2022
  • Number of updates: 59
  • Update frequency: every 52.3 days
  • Top authors: martynasma (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

3,000+ active /79,089 total downloads


Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.36MB] [CPU: ▼1.60ms] Passed 4 tests

A check of server-side resources used by amCharts: Charts and Maps
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2546.14 ▼1.09
Dashboard /wp-admin3.69 ▲0.3854.37 ▲4.50
Posts /wp-admin/edit.php3.80 ▲0.4550.02 ▲3.14
Add New Post /wp-admin/post-new.php6.27 ▲0.3987.63 ▼12.93
Media Library /wp-admin/upload.php3.65 ▲0.4343.85 ▲7.73
Add New /wp-admin/post-new.php?post_type=amchart3.8853.96
Charts & Maps /wp-admin/options-general.php?page=amcharts3.8581.55
Charts & Maps /wp-admin/edit.php?post_type=amchart3.7039.79

Server storage [IO: ▲0.86MB] [DB: ▲0.11MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 131 new files
Database: no new tables, 8 new options
New WordPress options

Browser metrics 75% from 4 tests

amCharts: Charts and Maps: an overview of browser usage
Please improve the following
  • Nodes: Limit the number of DOM nodes under 25,000 (currently 55,186 on /wp-admin/options-general.php?page=amcharts)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲4014.38 ▲0.082.00 ▼0.0743.86 ▼1.04
Dashboard /wp-admin2,232 ▲555.59 ▼0.0498.34 ▲10.7643.63 ▲0.91
Posts /wp-admin/edit.php2,134 ▲341.99 ▼0.0338.39 ▲2.9033.26 ▼0.41
Add New Post /wp-admin/post-new.php1,554 ▲2817.68 ▲0.08684.36 ▲4.9454.16 ▼5.63
Media Library /wp-admin/upload.php1,434 ▲344.25 ▲0.05105.47 ▲7.9644.23 ▼1.55
Add New /wp-admin/post-new.php?post_type=amchart4,5424.66115.2482.35
Charts & Maps /wp-admin/options-general.php?page=amcharts55,1865.20276.41310.32
Charts & Maps /wp-admin/edit.php?post_type=amchart1,3003.2746.2032.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • amcharts_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function amcharts_split_libs() in wp-content/plugins/amcharts-charts-and-maps/includes/preview.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/amcharts-charts-and-maps/amcharts.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amcharts-charts-and-maps/includes/editing.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amcharts-charts-and-maps/includes/settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amcharts-charts-and-maps/includes/setup.php:6

User-side errors Passed 1 test

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


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: charts, ammap, maps, amcharts, javascript charts...

amcharts-charts-and-maps/amcharts.php 85% from 13 tests

The entry point to "amCharts: Charts and Maps" version 1.4.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("amcharts-charts-and-maps.php" instead of "amcharts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin13,860 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PO File1122143358

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions50100.00%
▷ Anonymous functions00.00%
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/jquery-ui/css/smoothness/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
lib/jquery-ui/css/smoothness/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
lib/jquery-ui/css/smoothness/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
lib/jquery-ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
images/icon_charts2.png1.27KB0.69KB▼ 45.59%