68% badged

Code Review | Badged

WordPress plugin Badged scored68%from 54 tests.

About plugin

  • Plugin page: badged
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.0
  • WordPress version: 6.3.1
  • First release: Dec 17, 2011
  • Latest release: Oct 11, 2014
  • Number of updates: 56
  • Update frequency: every 18.4 days
  • Top authors: kremalicious (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,161 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.89MB] [CPU: ▼54.01ms] Passed 4 tests

This is a short check of server-side resources used by Badged
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.365.85 ▼32.27
Dashboard /wp-admin2.13 ▼1.226.57 ▼57.14
Posts /wp-admin/edit.php2.13 ▼1.235.82 ▼38.48
Add New Post /wp-admin/post-new.php2.13 ▼3.766.00 ▼88.15
Media Library /wp-admin/upload.php2.13 ▼1.106.45 ▼27.32
Badged /wp-admin/options-general.php?page=badged_settings2.136.84

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Badged
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.27 ▲0.131.73 ▲0.1642.66 ▲1.49
Dashboard /wp-admin2,204 ▲245.68 ▼0.0290.39 ▲1.9144.14 ▲0.04
Posts /wp-admin/edit.php2,103 ▲31.98 ▼0.0537.48 ▲2.8333.08 ▼1.52
Add New Post /wp-admin/post-new.php1,531 ▲523.17 ▲0.14670.33 ▼7.9869.33 ▼4.01
Media Library /wp-admin/upload.php1,403 ▲34.16 ▼0.0396.69 ▲0.9343.46 ▼1.84
Badged /wp-admin/options-general.php?page=badged_settings8602.1322.9828.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function is_embed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=badged_settings
    • > User notice in wp-includes/functions.php+5905
    Function is_embed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
    • > GET request to /wp-admin/options-general.php?page=badged_settings
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=badged_settings
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/badged/admin/views/admin.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: toolbar, adminbar, badges, badge, ios...

badged/badged.php Passed 13 tests

This is the main PHP file of "Badged" 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
132 characters long description:
Transforms the standard WordPress update & comment notification badges into iOS-styled ones. Just activate and enjoy the red badges.

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 detected506 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP4101197238
LESS44958181
PO File2256173
CSS33013
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods635.29%
▷ Public methods1376.47%
▷ Protected methods00.00%
▷ Private methods423.53%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.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 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/icon-badged-32@2x.png2.27KB2.59KB0.00%
admin/assets/img/icon-badged-32.png0.94KB1.57KB0.00%