68% add-ribbon

Code Review | Add Ribbon Shortcode

WordPress plugin Add Ribbon Shortcode scored68%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: 6.3.1
  • 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

30+ active /1,878 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.95MB] [CPU: ▼33.43ms] Passed 4 tests

An overview of server-side resources used by Add Ribbon Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.30 ▼4.63
Dashboard /wp-admin2.99 ▼0.3121.89 ▼23.97
Posts /wp-admin/edit.php2.99 ▼0.3621.29 ▼26.72
Add New Post /wp-admin/post-new.php2.99 ▼2.8922.69 ▼70.98
Media Library /wp-admin/upload.php2.99 ▼0.2321.80 ▼12.05
Add Ribbon /wp-admin/tools.php?page=add_ribbon_info3.0023.24

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Add Ribbon Shortcode
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.20 ▼1.461.66 ▼0.5939.25 ▼9.72
Dashboard /wp-admin2,210 ▲224.84 ▼0.17100.25 ▼0.1538.79 ▼2.53
Posts /wp-admin/edit.php2,093 ▲42.03 ▲0.0237.00 ▼5.9133.99 ▼1.80
Add New Post /wp-admin/post-new.php1,536 ▲1623.15 ▲2.24688.83 ▲58.7754.84 ▲3.50
Media Library /wp-admin/upload.php1,395 ▲44.20 ▼0.0197.91 ▼5.7241.17 ▼3.04
Add Ribbon /wp-admin/tools.php?page=add_ribbon_info9281.146.5718.89

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric 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: 7 options
    • recovery_mode_email_last_sent
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric 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(310): AddRibbonMenu->add_ribbon_menu_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 5× PHP files trigger server errors when accessed directly:
    • > 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: Call to undefined function add_shortcode() in wp-content/plugins/add-ribbon/includes/AddRibbonShortcode.php:16
    • > 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: 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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: ribbon generator, shortcode, ribbon, cssportal ribbon

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

The principal PHP file in "Add Ribbon Shortcode" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("add-ribbon.php" instead of "add_ribbon.php")
  • Description: The description should be shorter than 140 characters (currently 244 characters long)

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
Everything looks great! No dangerous files found in this plugin336 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP58883223
CSS1189113

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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

PNG files should be compressed to save space and 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/controls.png2.74KB1.42KB▼ 48.29%
assets/images/logo.png49.81KB14.78KB▼ 70.33%