79% wp-notes-widget

Code Review | WP Notes Widget

WordPress plugin WP Notes Widget scored79%from 54 tests.

About plugin

  • Plugin page: wp-notes-widget
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 2, 2014
  • Latest release: Jan 14, 2023
  • Number of updates: 99
  • Update frequency: every 30.3 days
  • Top authors: _silver (58.59%)stevepuddick (42.42%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /35,260 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.36MB] [CPU: ▲0.98ms] Passed 4 tests

A check of server-side resources used by WP Notes Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2744.07 ▲2.96
Dashboard /wp-admin3.72 ▲0.4250.51 ▼0.53
Posts /wp-admin/edit.php3.77 ▲0.4256.02 ▲9.00
Add New Post /wp-admin/post-new.php6.28 ▲0.39102.59 ▼4.25
Media Library /wp-admin/upload.php3.60 ▲0.3739.20 ▲5.74
All Notes /wp-admin/edit.php?post_type=nw-item3.7442.67
WP Notes Widget /wp-admin/options-general.php?page=wp-notes-widget-settings3.6037.90
Add New /wp-admin/post-new.php?post_type=nw-item3.8152.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 91 new files
Database: no new tables, 12 new options
New WordPress options
widget_wp-notes-class
default_wp_notes_created
wpnw_version
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
wp_notes_widget_default_shortcode_settings
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP Notes Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲19013.52 ▼0.869.67 ▲7.8938.86 ▼4.59
Dashboard /wp-admin2,245 ▲685.75 ▲0.0284.88 ▼9.8739.41 ▼3.18
Posts /wp-admin/edit.php2,147 ▲472.00 ▼0.0238.59 ▲2.2235.26 ▼0.84
Add New Post /wp-admin/post-new.php2,338 ▲81223.57 ▲5.98641.51 ▼52.3156.27 ▲2.28
Media Library /wp-admin/upload.php1,444 ▲474.28 ▲0.10101.29 ▼7.9145.86 ▼1.15
All Notes /wp-admin/edit.php?post_type=nw-item1,8522.1234.7133.07
WP Notes Widget /wp-admin/options-general.php?page=wp-notes-widget-settings1,7412.0931.0279.04
Add New /wp-admin/post-new.php?post_type=nw-item2,8954.1571.3951.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 12 options
    • theysaidso_admin_options
    • widget_wp-notes-class
    • wp_notes_widget_defaults
    • wp_notes_widget_twitter_credentials
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • default_wp_notes_created
    • wp_notes_widget_default_shortcode_settings
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-notes-widget/public/partials/public-widget-footer-partial.php
    • > /wp-content/plugins/wp-notes-widget/public/partials/wp-notes-public-display.php
    • > /wp-content/plugins/wp-notes-widget/admin/partials/wp-notes-admin-display.php
  • 55× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: text_colour in wp-content/plugins/wp-notes-widget/public/partials/public-widget-header-partial.php on line 3
    • > PHP Notice
      Undefined variable: text_colour in wp-content/plugins/wp-notes-widget/public/partials/public-widget-header-partial.php on line 3
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/wp-notes-widget/public/partials/public-widget-header-partial.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-notes-widget/admin/admin-settings-page-setup.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-notes-widget/public/partials/public-widget-empty-list-item-partial.php:8
    • > PHP Notice
      Undefined variable: font_style in wp-content/plugins/wp-notes-widget/public/partials/public-widget-header-partial.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-notes-widget/public/partials/public-widget-note-list-item-partial.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-notes-widget/admin/admin-settings-page-promo-sidebar.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-notes-widget/public/partials/public-widget-header-partial.php:9
    • > PHP Notice
      Undefined variable: do_not_force_uppercase in wp-content/plugins/wp-notes-widget/public/partials/public-widget-header-partial.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: widget, notes, sidebar, twitter, tweet...

wp-notes-widget/wp-notes-widget.php Passed 13 tests

"WP Notes Widget" version 1.0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
83 characters long description:
'Sticky note' style widget to display short, important, time sensitive information.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin15,701 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
CSS62,045119,089
PHP318741,4743,435
SVG2001,429
LESS42411681,097
JavaScript818584625
JSON10026

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity28.50
▷ Minimum class complexity1.00
▷ Maximum class complexity125.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods99
▷ Static methods88.08%
▷ Public methods6666.67%
▷ Protected methods2727.27%
▷ Private methods66.06%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
18 PNG files occupy 0.38MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/thumbtack-pink.png25.37KB8.53KB▼ 66.39%
admin/images/wp-notes-thumbnail-32.png2.88KB1.73KB▼ 39.84%
public/images/thumbtack-orange.png22.17KB8.43KB▼ 61.99%
public/images/thumbtack-yellow.png23.46KB8.57KB▼ 63.47%
public/images/thumbtack-pushpin-2-md.png38.54KB13.69KB▼ 64.49%