78% greencharts

Code Review | Greencharts

WordPress plugin Greencharts scored78%from 54 tests.

About plugin

  • Plugin page: greencharts
  • Plugin version: 1.0.1
  • PHP compatiblity: ^7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 14, 2023
  • Latest release: Feb 14, 2023
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: mbaroncini (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /101 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.95ms] Passed 4 tests

Analyzing server-side resources used by Greencharts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.28 ▼2.86
Dashboard /wp-admin3.37 ▲0.0647.45 ▼4.85
Posts /wp-admin/edit.php3.48 ▲0.1245.40 ▼0.04
Add New Post /wp-admin/post-new.php5.95 ▲0.0694.88 ▲6.06
Media Library /wp-admin/upload.php3.29 ▲0.0636.70 ▲3.95

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Greencharts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.13 ▼1.231.62 ▼0.2138.60 ▼7.36
Dashboard /wp-admin2,209 ▲214.87 ▼0.98105.56 ▼9.4838.55 ▼5.19
Posts /wp-admin/edit.php2,086 ▼32.06 ▲0.0636.23 ▼0.0935.99 ▲1.33
Add New Post /wp-admin/post-new.php1,542 ▲2018.31 ▼4.68587.72 ▼95.3449.42 ▼1.92
Media Library /wp-admin/upload.php1,382 ▼34.23 ▲0.0295.13 ▼6.6842.05 ▼2.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/greencharts/greencharts.php
  • 9× 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/greencharts/src/includes/shortcodes.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'GREENCHARTS__PLUGIN_DIRvendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/greencharts/src/loader.php on line 4
    • > PHP Warning
      require_once(GREENCHARTS__PLUGIN_DIRvendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/greencharts/src/loader.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/greencharts/src/includes/ajax.php:8
    • > PHP Warning
      Use of undefined constant GREENCHARTS__PLUGIN_DIR - assumed 'GREENCHARTS__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/greencharts/src/loader.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/greencharts/src/includes/assets.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Cyberway_Greencharts\\Logger\\LoggerInterface' not found in wp-content/plugins/greencharts/src/autoload/Logger/AbstractLogger.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberway_Greencharts\\Api\\Api' not found in wp-content/plugins/greencharts/src/autoload/Api/Api_GlobalWarming.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberway_Greencharts\\Logger\\AbstractLogger' not found in wp-content/plugins/greencharts/src/autoload/Logger/PhpLogger.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
3 plugin tags: charts, green, chartjs

greencharts/greencharts.php 85% from 13 tests

The principal PHP file in "Greencharts" v. 1.0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "5.0")
  • Requires PHP: Required version number should use periods and dots only (ex. "7.0" instead of "^7.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin1,482 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP22260534974
TypeScript712065387
Markdown145094
Sass26022
JSON1005
JavaScript1020

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.82
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes10
▷ Abstract classes110.00%
▷ Concrete classes990.00%
▷ Final classes00.00%
Methods77
▷ Static methods1823.38%
▷ Public methods6483.12%
▷ Protected methods1012.99%
▷ Private methods33.90%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin