84% gift-ribbon

Code Review | Gift Ribbon

WordPress plugin Gift Ribbon scored84%from 54 tests.

About plugin

  • Plugin page: gift-ribbon
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5
  • WordPress version: 6.3.1
  • First release: Mar 17, 2013
  • Latest release: Mar 17, 2013
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: iteamweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,239 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.32ms] Passed 4 tests

This is a short check of server-side resources used by Gift Ribbon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.63 ▼1.39
Dashboard /wp-admin3.32 ▲0.0146.19 ▼5.44
Posts /wp-admin/edit.php3.37 ▲0.0150.53 ▼5.38
Add New Post /wp-admin/post-new.php5.90 ▲0.0193.34 ▼0.37
Media Library /wp-admin/upload.php3.24 ▲0.0133.77 ▼1.08

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Gift Ribbon
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.59 ▼0.701.84 ▼0.0741.84 ▼1.43
Dashboard /wp-admin2,225 ▲375.12 ▼0.77102.63 ▲2.3638.98 ▼1.36
Posts /wp-admin/edit.php2,102 ▲132.04 ▲0.0039.54 ▼4.5534.90 ▼6.59
Add New Post /wp-admin/post-new.php1,556 ▲2318.32 ▼0.02655.45 ▼8.4657.98 ▼0.74
Media Library /wp-admin/upload.php1,404 ▲164.17 ▼0.0496.63 ▼1.9742.04 ▼4.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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 items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gift-ribbon/ribbon.php:67

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 94% from 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
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt is a good inspiration

gift-ribbon/ribbon.php 92% from 13 tests

"Gift Ribbon" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gift-ribbon.php" instead of "ribbon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected54 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1131054

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.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
gift-ribbon.png33.72KB14.04KB▼ 58.35%