73% site-notify

Code Review | Site Notify

WordPress plugin Site Notify scored73%from 54 tests.

About plugin

  • Plugin page: site-notify
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 21, 2022
  • Latest release: Dec 21, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: wpvsingh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,258 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.61ms] Passed 4 tests

Server-side resources used by Site Notify
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▼0.0025.20 ▼14.75
Dashboard /wp-admin3.38 ▲0.0450.33 ▼6.70
Posts /wp-admin/edit.php3.44 ▲0.0851.51 ▼0.62
Add New Post /wp-admin/post-new.php5.99 ▲0.0992.58 ▼4.73
Media Library /wp-admin/upload.php3.31 ▲0.0832.11 ▼4.24
Site Notification /wp-admin/options-general.php?page=siteNotify3.4330.40

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Site Notify: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲14013.61 ▼0.745.75 ▲3.7142.84 ▼3.53
Dashboard /wp-admin2,217 ▲264.84 ▼1.02109.90 ▲6.7143.68 ▼1.45
Posts /wp-admin/edit.php2,100 ▲112.05 ▲0.0041.31 ▼1.4335.34 ▼1.49
Add New Post /wp-admin/post-new.php1,538 ▲518.13 ▼5.12594.59 ▼95.0051.75 ▼4.68
Media Library /wp-admin/upload.php1,396 ▲84.24 ▲0.0695.82 ▼12.8440.23 ▼4.55
Site Notification /wp-admin/options-general.php?page=siteNotify1,8981.7227.8275.76

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=siteNotify
    • > Notice in wp-content/plugins/site-notify/functions/admin-ui.php+111
    Undefined offset: 0
    • > GET request to /wp-admin/options-general.php?page=siteNotify
    • > Notice in wp-content/plugins/site-notify/functions/admin-ui.php+111
    Trying to get property 'option_value' of non-object
  • 46 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=siteNotify
    • > Notice in wp-content/plugins/site-notify/functions/admin-ui.php+969
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/site-notify/functions/admin-ui.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=siteNotify
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=siteNotify 354 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=siteNotify
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=siteNotify 620 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=siteNotify
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=siteNotify 812 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=siteNotify
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=siteNotify 948 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

site-notify/site-notify.php Passed 13 tests

This is the main PHP file of "Site Notify" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
71 characters long description:
Display custom notifications, announcements, and alerts on your website

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,160 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP598831684
CSS34944378
JavaScript2151098

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/info_notify.png18.29KB7.30KB▼ 60.07%
assets/images/warning_notify.png18.36KB7.41KB▼ 59.65%
assets/images/success_notify.png18.19KB7.37KB▼ 59.49%
assets/images/simple_notify.png17.83KB7.21KB▼ 59.54%
assets/images/notify_banner.png25.84KB6.63KB▼ 74.36%