68% curbon

Code Review | CURBON

WordPress plugin CURBONscored 68% from 54 tests.

About plugin

  • Plugin page: curbon
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 8, 2022
  • Latest release: May 5, 2023
  • Number of updates: 10
  • Update frequency: every 17.8 days
  • Top authors: curbon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 391 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.33ms] Passed 4 tests

An overview of server-side resources used by CURBON
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.13 ▼8.83
Dashboard /wp-admin3.31 ▲0.0045.64 ▼2.88
Posts /wp-admin/edit.php3.36 ▲0.0046.75 ▲0.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.43 ▲9.92
Media Library /wp-admin/upload.php3.23 ▲0.0034.31 ▲2.21

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 104 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by CURBON
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.35 ▼1.261.64 ▼0.1542.02 ▼7.16
Dashboard /wp-admin2,206 ▲154.85 ▼0.12107.44 ▼12.6542.60 ▼6.49
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0138.81 ▼2.3134.01 ▲1.80
Add New Post /wp-admin/post-new.php1,533 ▲323.39 ▲5.14645.81 ▲26.7249.38 ▲1.38
Media Library /wp-admin/upload.php1,385 ▼34.30 ▲0.1395.41 ▼2.6440.13 ▲0.27

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/curbon/curbon-constant.php+18
    Use of undefined constant CURBON_PLUGIN_FILE - assumed 'CURBON_PLUGIN_FILE' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/curbon/curbon.php
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: active_step in wp-content/plugins/curbon/includes/admin/views/curbon-onboarding.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/curbon/includes/admin/views/admin-dashboard-page.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/curbon/includes/admin/views/curbon-settings.php:103
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/curbon/curbon-constant.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/curbon/includes/woo/avada-functions-override.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/curbon/includes/admin/views/onboarding/onboarding-step-1.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/curbon/includes/admin/views/dashboard.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/curbon/includes/class-curbon-webhook-calls.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/curbon/includes/admin/views/curbon-look-and-feel.php:77
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/curbon/includes/admin/views/onboarding/onboarding-step-2.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === CURBON=== )
The official readme.txt is a good inspiration

curbon/curbon.php Passed 13 tests

The primary PHP file in "CURBON" version 1.0.0 is used by WordPress to initiate all plugin functionality
39 characters long description:
Ecommerce carbon offsetting made simple

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin10,569 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,7221,2046,586
CSS3543973,132
SVG2502637
JavaScript2399198
Markdown21016

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity20.89
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods75
▷ Static methods00.00%
▷ Public methods75100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants20
▷ Global constants20100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
29 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/carbon-offset-thumbnail.png15.39KB16.49KB0.00%
assets/images/Rectangle-1396-300x173.png2.08KB2.20KB0.00%
assets/images/bars-yellow-300x163.png0.59KB0.60KB0.00%
assets/images/Ellipse-246.png0.27KB0.28KB0.00%
assets/images/bars-purple-324x213.png0.64KB0.63KB▼ 1.52%