68% add-ribbon

Code Review | Add Ribbon Shortcode

WordPress plugin Add Ribbon Shortcode scored 68% from 54 tests.

About plugin

  • Plugin page: add-ribbon
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 5.9.2
  • First release: Jul 8, 2015
  • Latest release: Jul 8, 2015
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: sherkspear (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,658 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.21MB] [CPU: ▼331.42ms] Passed 4 tests

A check of server-side resources used by Add Ribbon Shortcode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0554.94 ▲3.84
Dashboard /wp-admin3.11 ▼0.2918.00 ▼14.04
Posts /wp-admin/edit.php3.11 ▼0.5318.36 ▼17.20
Add New Post /wp-admin/post-new.php3.11 ▼3.8617.13 ▼1,286.61
Media Library /wp-admin/upload.php3.11 ▼0.1817.01 ▼7.84
Add Ribbon /wp-admin/tools.php?page=add_ribbon_info3.1318.43

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

A check of browser resources used by Add Ribbon Shortcode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,770 ▲1616.27 ▲0.626.63 ▲0.362.34 ▼0.15
Dashboard /wp-admin2,894 ▲336.14 ▼0.02119.95 ▼17.79154.78 ▼2.72
Posts /wp-admin/edit.php2,693 ▲53.23 ▼0.0164.44 ▲0.30142.37 ▼4.64
Add New Post /wp-admin/post-new.php1,720 ▼5321.83 ▲0.61449.35 ▼30.28160.94 ▲0.14
Media Library /wp-admin/upload.php1,706 ▲85.53 ▲0.00158.78 ▲8.47190.86 ▲1.60
Add Ribbon /wp-admin/tools.php?page=add_ribbon_info1,2111.9937.97100.07

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
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options were found after uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/tools.php?page=add_ribbon_info
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/tools.php?page=add_ribbon_info
    • > Error in wp-content/plugins/add-ribbon/templates/add_ribbon_dashboard.php+112
    Uncaught Error: Class 'SherkCPTDisplays' not found in wp-content/plugins/add-ribbon/templates/add_ribbon_dashboard.php:112
    Stack trace:
    #0 wp-content/plugins/add-ribbon/includes/AddRibbonMenu.php(25): include()
    #1 wp-includes/class-wp-hook.php(307): AddRibbonMenu->add_ribbon_menu_page()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/tools.php(40): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

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
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/add-ribbon/includes/AddRibbonShortcode.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'SherkCPTDisplays' not found in wp-content/plugins/add-ribbon/templates/add_ribbon_dashboard.php:112
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-ribbon/includes/AddRibbonCssJsScripts.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-ribbon/includes/AddRibbonMenu.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/add-ribbon/includes/AddRibbonShortcode.php:16

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)
There were no browser issues found

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
4 plugin tags: ribbon, shortcode, ribbon generator, cssportal ribbon

add-ribbon/add_ribbon.php 85% from 13 tests

"Add Ribbon Shortcode" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 244 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("add-ribbon.php" instead of "add_ribbon.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
No dangerous file extensions were detected336 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP58883223
CSS1189113

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.05
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods10
▷ Static methods220.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png49.81KB14.78KB▼ 70.33%
assets/images/controls.png2.74KB1.42KB▼ 48.29%