77% wp-top-alert

Code Review | wp top alert bar

WordPress plugin wp top alert bar scored77%from 54 tests.

About plugin

  • Plugin page: wp-top-alert
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6.2
  • WordPress version: 6.3.1
  • First release: Aug 9, 2019
  • Latest release: Apr 25, 2021
  • Number of updates: 24
  • Update frequency: every 26.0 days
  • Top authors: myousefi08 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /852 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.26ms] Passed 4 tests

Server-side resources used by wp top alert bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.04 ▼7.40
Dashboard /wp-admin3.34 ▲0.0343.65 ▼2.95
Posts /wp-admin/edit.php3.39 ▲0.0345.95 ▲2.21
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.42 ▼16.89
Media Library /wp-admin/upload.php3.26 ▲0.0339.77 ▲5.49
WP Top Alert /wp-admin/options-general.php?page=wpa_alert_settings3.2331.09

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 15 new options
New WordPress options
wpa_alert_link_txt
wpa_alert_status
wpa_alert_link
wpa_alert_align
wpa_alert_link_bgColor
theysaidso_admin_options
widget_recent-posts
wpa_alert_txt
db_upgraded
wpa_alert_location
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for wp top alert bar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲16213.87 ▼0.516.86 ▲4.9043.07 ▲0.86
Dashboard /wp-admin2,228 ▲405.02 ▲0.11103.85 ▼14.4539.46 ▼4.88
Posts /wp-admin/edit.php2,119 ▲332.32 ▲0.3035.24 ▼1.0433.52 ▼0.54
Add New Post /wp-admin/post-new.php1,533 ▲1923.39 ▲5.97661.19 ▼19.1744.19 ▼8.89
Media Library /wp-admin/upload.php1,410 ▲224.47 ▲0.2495.92 ▼5.1343.86 ▲0.09
WP Top Alert /wp-admin/options-general.php?page=wpa_alert_settings1,1402.3352.9123.15

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 12 options in the database
    • wpa_alert_bgColor
    • widget_recent-posts
    • wpa_alert_align
    • wpa_alert_status
    • theysaidso_admin_options
    • wpa_alert_link_bgColor
    • wpa_alert_location
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-top-alert/public/partials/wp_top_alert-public-display.php
    • > /wp-content/plugins/wp-top-alert/admin/partials/wp_top_alert-admin-display.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-top-alert/public/partials/wpa_view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_settings_section() in wp-content/plugins/wp-top-alert/admin/partials/wpa_settings_patials.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (screenshot-1), #2 (screenshot-2)
The official readme.txt might help

wp-top-alert/wp_top_alert.php 85% from 13 tests

"wp top alert bar" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-top-alert.php" instead of "wp_top_alert.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin642 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP14174475449
CSS3188113
PO File1243271
JavaScript2309

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity1.86
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.21
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.26MB with 0.22MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/hero.png6.80KB3.63KB▼ 46.71%
(invalid) screenshot-2.png79.00KB0.00KB▼ 100.00%
(invalid) screenshot-1.png184.76KB0.00KB▼ 100.00%