83% site-notices-wp

Code Review | Site Notices WP

WordPress plugin Site Notices WP scored83%from 54 tests.

About plugin

  • Plugin page: site-notices-wp
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.0
  • WordPress version: 6.3.1
  • First release: Jun 30, 2021
  • Latest release: Jun 6, 2022
  • Number of updates: 11
  • Update frequency: every 30.9 days
  • Top authors: alsvin (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /755 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼1.24ms] Passed 4 tests

Server-side resources used by Site Notices WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1636.78 ▲0.93
Dashboard /wp-admin3.47 ▲0.1648.02 ▲2.19
Posts /wp-admin/edit.php3.57 ▲0.2249.72 ▲3.72
Add New Post /wp-admin/post-new.php6.12 ▲0.2492.01 ▼6.58
Media Library /wp-admin/upload.php3.38 ▲0.1534.69 ▼1.48
Add New /wp-admin/post-new.php?post_type=alsvin-site-notice3.4244.24
All Notices /wp-admin/edit.php?post_type=alsvin-site-notice3.4236.87

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Site Notices WP: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲10513.33 ▼1.041.70 ▼0.1040.40 ▼0.77
Dashboard /wp-admin2,254 ▲694.99 ▼0.86103.88 ▲6.3940.11 ▲0.28
Posts /wp-admin/edit.php2,142 ▲532.30 ▲0.3042.31 ▲2.1236.47 ▼0.52
Add New Post /wp-admin/post-new.php1,565 ▲5118.22 ▲0.73621.85 ▲8.0834.93 ▼17.54
Media Library /wp-admin/upload.php1,436 ▲484.50 ▲0.2596.84 ▼4.5042.22 ▼1.56
Add New /wp-admin/post-new.php?post_type=alsvin-site-notice1,9393.1263.5536.77
All Notices /wp-admin/edit.php?post_type=alsvin-site-notice1,1142.2931.5127.53

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/site-notices-wp/class-site-notices-wp-custom-fields.php:27

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

site-notices-wp/site-notices-wp.php 85% from 13 tests

The main PHP script in "Site Notices WP" version 1.1.2 is automatically included on every request by WordPress
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")
  • 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

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
Success! There were no dangerous files found in this plugin1,477 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP5109166652
JavaScript48626513
CSS2149312

PHP code Passed 2 tests

An short overview of 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 complexity17.00
▷ Minimum class complexity4.00
▷ Maximum class complexity43.00
Average method complexity4.11
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants2
▷ Global constants2100.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
No PNG images were found in this plugin