10% stay-home-stay-safe-notice

Code Review | Stay Home, Stay Safe Notice

WordPress plugin Stay Home, Stay Safe Notice scored10%from 54 tests.

About plugin

  • Plugin page: stay-home-stay-sa...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Mar 26, 2020
  • Latest release: Mar 26, 2020
  • Number of updates: 17
  • Update frequency: every 0.1 days
  • Top authors: mdeluk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /850 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/stay-home-stay-safe-notice/stayhome-plugin.php+136
    Methods with the same name as their class will not be constructors in a future version of PHP; stayhome_affiliate has a deprecated constructor

Server metrics [RAM: ▼1.88MB] [CPU: ▼56.80ms] Passed 4 tests

A check of server-side resources used by Stay Home, Stay Safe Notice
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.364.99 ▼39.29
Dashboard /wp-admin2.13 ▼1.185.73 ▼52.05
Posts /wp-admin/edit.php2.13 ▼1.236.83 ▼41.91
Add New Post /wp-admin/post-new.php2.13 ▼3.766.95 ▼93.94
Media Library /wp-admin/upload.php2.13 ▼1.116.05 ▼29.41
StayHome StaySafe /wp-admin/options-general.php?page=stayhome-options2.136.48

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_stayhome_affiliate_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Stay Home, Stay Safe Notice
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲3214.30 ▲0.072.05 ▼0.1840.92 ▼2.53
Dashboard /wp-admin2,196 ▲195.54 ▼0.1689.01 ▼8.0042.33 ▼1.84
Posts /wp-admin/edit.php2,104 ▲72.05 ▲0.0136.88 ▲1.1636.96 ▲0.78
Add New Post /wp-admin/post-new.php1,529 ▼217.77 ▼5.56707.67 ▲6.6265.95 ▲7.71
Media Library /wp-admin/upload.php1,404 ▲44.25 ▲0.05111.15 ▲9.5250.44 ▲5.42
StayHome StaySafe /wp-admin/options-general.php?page=stayhome-options8502.0524.0528.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/stay-home-stay-safe-notice/stayhome-plugin.php+136
    Methods with the same name as their class will not be constructors in a future version of PHP; stayhome_affiliate has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_stayhome_affiliate_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=stayhome-options
    • > request to
    • > Deprecated in wp-content/plugins/stay-home-stay-safe-notice/stayhome-plugin.php+136
    Methods with the same name as their class will not be constructors in a future version of PHP; stayhome_affiliate has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=stayhome-options
    • > request to
    • > Notice in wp-content/plugins/stay-home-stay-safe-notice/stayhome-plugin.php+142
    Undefined variable: defaults
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=stayhome-options
    • > request to
    • > Notice in wp-content/plugins/stay-home-stay-safe-notice/stayhome-plugin.php+290
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=stayhome-options
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/stay-home-stay-safe-notice/stayhome-plugin.php:66

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid url: ""
  • Screenshots: These screenshots do not have images: #1 (/settings-screenshot.png), #2 (/website-example-screenshot.png)
The official readme.txt is a good inspiration

stay-home-stay-safe-notice/stayhome-plugin.php 92% from 13 tests

The main file in "Stay Home, Stay Safe Notice" v. 0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stay-home-stay-safe-notice.php" instead of "stayhome-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin292 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP18122292

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity16.00
▷ Minimum class complexity3.00
▷ Maximum class complexity29.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin