84% notice

Code Review | Sitewide Notice

WordPress plugin Sitewide Notice scored 84% from 54 tests.

About plugin

  • Plugin page: notice
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 5.9.2
  • First release: Jan 11, 2022
  • Latest release: Mar 3, 2022
  • Number of updates: 15
  • Update frequency: every 3.5 days
  • Top authors: dna88 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 288 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.21MB] [CPU: ▼292.41ms] Passed 4 tests

An overview of server-side resources used by Sitewide Notice
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2256.62 ▲4.13
Dashboard /wp-admin3.64 ▲0.2434.84 ▼0.12
Posts /wp-admin/edit.php3.87 ▲0.2339.62 ▲2.18
Add New Post /wp-admin/post-new.php7.11 ▲0.1495.19 ▼1,171.56
Media Library /wp-admin/upload.php3.53 ▲0.2423.73 ▼0.14
Advanced Notices /wp-admin/admin.php?page=dna_notice3.5024.56
Notice /wp-admin/admin.php?page=dna88-notice-settings3.5526.12

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 18 new options
New WordPress options
dna88_wp_notifications_btn_bg_color
dna88_wp_notifications_scroll_position
dna88_wp_notifications_banner_sticky
dna88_wp_notifications_call_action_link
dna88_wp_notifications_text_align
dna88_wp_notifications_enable
dna88_wp_notifications_banner_position
dna88_wp_notifications_call_action_text
dna88_wp_notifications_button_text_align
dna88_wp_notifications_banner_style
...

Browser metrics Passed 4 tests

Sitewide Notice: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,838 ▲8415.98 ▲0.296.37 ▼0.032.51 ▼0.11
Dashboard /wp-admin2,936 ▲786.16 ▼0.05119.52 ▼21.06176.89 ▲12.04
Posts /wp-admin/edit.php2,732 ▲383.26 ▲0.2165.16 ▲1.95160.59 ▲15.52
Add New Post /wp-admin/post-new.php1,690 ▲2916.03 ▲0.06417.66 ▼5.32159.90 ▼0.49
Media Library /wp-admin/upload.php1,738 ▲465.54 ▲0.05150.56 ▲11.63209.98 ▲18.24
Advanced Notices /wp-admin/admin.php?page=dna_notice1,0302.3854.95138.36
Notice /wp-admin/admin.php?page=dna88-notice-settings2,9907.47168.09232.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 18 options in the database
    • dna88_wp_notifications_close_icon_position
    • dna88_wp_notifications_banner_sticky
    • dna88_wp_notifications_bg_color
    • dna88_wp_notifications_banner_position
    • dna88_wp_notifications_set_cookie
    • dna88_wp_notifications_call_action_link
    • dna88_wp_notifications_call_action_text
    • dna88_wp_notifications_btn_font_color
    • dna88_wp_notifications_enable
    • dna88_wp_notifications_button_text_align
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/notice/class-dna88-free-plugin-upgrade-notice.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: sitewide banner, sitewide notice, notification bar, notification, top bar

notice/dna88-wp-notice-main.php 85% from 13 tests

The main file in "Sitewide Notice" v. 1.0.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("notice.php" instead of "dna88-wp-notice-main.php")

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
Good job! No executable or dangerous file extensions detected1,010 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP223559670
CSS1283207
JavaScript23513133

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity49.50
▷ Minimum class complexity14.00
▷ Maximum class complexity85.00
Average method complexity6.39
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/dna-advances.png23.29KB12.40KB▼ 46.78%