84% website-carbon

Code Review | Website Carbon

WordPress plugin Website Carbon scored84%from 54 tests.

About plugin

  • Plugin page: website-carbon
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: May 12, 2020
  • Latest release: Feb 16, 2023
  • Number of updates: 13
  • Update frequency: every 77.7 days
  • Top authors: Josh Stopper (92.31%)beleaf (15.38%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /4,678 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.03ms] Passed 4 tests

A check of server-side resources used by Website Carbon
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.72 ▼2.11
Dashboard /wp-admin3.38 ▲0.0450.30 ▼12.33
Posts /wp-admin/edit.php3.49 ▲0.1450.76 ▼3.14
Add New Post /wp-admin/post-new.php5.96 ▲0.0896.80 ▲3.62
Media Library /wp-admin/upload.php3.30 ▲0.0737.16 ▲1.45
Website Carbon /wp-admin/tools.php?page=websitecarbon3.3035.24

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

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

Browser metrics Passed 4 tests

Website Carbon: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲12413.31 ▼0.971.74 ▼0.3746.90 ▼0.47
Dashboard /wp-admin2,270 ▲915.84 ▼0.01100.82 ▼13.9539.89 ▼4.82
Posts /wp-admin/edit.php2,104 ▲122.01 ▼0.0440.81 ▼2.7635.37 ▼1.17
Add New Post /wp-admin/post-new.php1,545 ▲323.31 ▲5.20685.35 ▲49.4270.27 ▲9.31
Media Library /wp-admin/upload.php1,389 ▲14.22 ▼0.08105.49 ▼3.8143.59 ▲1.03
Website Carbon /wp-admin/tools.php?page=websitecarbon8892.0423.9726.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% 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 50% 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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/website-carbon/views/dashboard-widget.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: measure, test, performance, carbon, emissions

website-carbon/websitecarbon.php 92% from 13 tests

The main PHP file in "Website Carbon" ver. 1.1.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("website-carbon.php" instead of "websitecarbon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected789 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP411447527
JavaScript12617115
Sass115078
CSS112069

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods25100.00%
▷ Public methods1352.00%
▷ Protected methods00.00%
▷ Private methods1248.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin