84% cbd-calculator

Code Review | CBD Calculator

WordPress plugin CBD Calculator scored84%from 54 tests.

About plugin

  • Plugin page: cbd-calculator
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 5, 2020
  • Latest release: Apr 1, 2020
  • Number of updates: 4
  • Update frequency: every 14.5 days
  • Top authors: johannacbd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /849 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.14ms] Passed 4 tests

Analyzing server-side resources used by CBD Calculator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.75 ▼2.28
Dashboard /wp-admin3.32 ▲0.0243.43 ▼4.66
Posts /wp-admin/edit.php3.37 ▲0.0242.34 ▼4.73
Add New Post /wp-admin/post-new.php5.90 ▲0.0279.48 ▼16.90
Media Library /wp-admin/upload.php3.25 ▲0.0232.87 ▼0.82
CBD settings /wp-admin/options-general.php?page=cbd-setting3.2133.47

Server storage [IO: ▲0.04MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by CBD Calculator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.38 ▲0.031.81 ▲0.3037.38 ▼0.26
Dashboard /wp-admin2,199 ▲225.53 ▼0.1582.18 ▼4.8239.18 ▼6.71
Posts /wp-admin/edit.php2,104 ▲71.97 ▼0.0133.65 ▼4.0232.31 ▼2.62
Add New Post /wp-admin/post-new.php1,540 ▲1418.37 ▼4.54646.38 ▼37.0865.60 ▲13.87
Media Library /wp-admin/upload.php1,401 ▼24.15 ▼0.0394.93 ▲0.7440.75 ▲0.31
CBD settings /wp-admin/options-general.php?page=cbd-setting8592.0023.8432.15

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

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
Even though no errors were found, 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 fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cbd-calculator/include/settings.php:167
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cbd-calculator/include/email.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cbd-calculator/include/shortcode.php:100

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: shortcode, cbd calculator, converter, cbd converter, calculator...

cbd-calculator/cbd-calcultor.php 85% from 13 tests

This is the main PHP file of "CBD Calculator" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 163 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cbd-calculator.php" instead of "cbd-calcultor.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
Good job! No executable or dangerous file extensions detected809 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP57453637
JavaScript1333139
CSS18033

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG images were found in this plugin