83% bcorp-shortcodes

Code Review | BCorp Shortcodes

WordPress plugin BCorp Shortcodes scored83%from 54 tests.

About plugin

  • Plugin page: bcorp-shortcodes
  • Plugin version: 0.23
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Jan 1, 2016
  • Latest release: Mar 22, 2016
  • Number of updates: 32
  • Update frequency: every 2.6 days
  • Top authors: BCorp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /3,807 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▲0.24ms] Passed 4 tests

Server-side resources used by BCorp Shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.12 ▼2.94
Dashboard /wp-admin3.48 ▲0.1853.50 ▼0.44
Posts /wp-admin/edit.php3.50 ▲0.1451.42 ▲0.44
Add New Post /wp-admin/post-new.php6.04 ▲0.1593.50 ▲5.19
Media Library /wp-admin/upload.php3.42 ▲0.1941.55 ▲3.90

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for BCorp Shortcodes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲7513.53 ▼0.766.78 ▲4.9039.17 ▼5.03
Dashboard /wp-admin2,221 ▲445.05 ▼0.62103.72 ▲4.9044.47 ▲2.87
Posts /wp-admin/edit.php2,134 ▲312.47 ▲0.4542.18 ▲8.1930.90 ▼4.62
Add New Post /wp-admin/post-new.php1,547 ▲1923.28 ▲0.13672.42 ▼4.4935.45 ▼15.97
Media Library /wp-admin/upload.php1,432 ▲324.61 ▲0.40100.06 ▼12.7142.15 ▼5.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/bcorp-shortcodes/bcorp_shortcodes.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Donate link: Invalid url: "TBA"
  • Tags: You are using too many tags: 22 tag instead of maximum 10
The official readme.txt might help

bcorp-shortcodes/bcorp_shortcodes.php 92% from 13 tests

The main file in "BCorp Shortcodes" v. 0.23 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("bcorp-shortcodes.php" instead of "bcorp_shortcodes.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected5,590 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP21462933,293
CSS311431812
JavaScript77024777
SVG200708

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity158.50
▷ Minimum class complexity39.00
▷ Maximum class complexity278.00
Average method complexity6.73
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods5294.55%
▷ Protected methods00.00%
▷ Private methods35.45%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected