84% emergency-alert

Code Review | Emergency Alerts

WordPress plugin Emergency Alerts scored84%from 54 tests.

About plugin

  • Plugin page: emergency-alert
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4
  • WordPress version: 6.3.1
  • First release: Mar 24, 2020
  • Latest release: Jun 3, 2020
  • Number of updates: 17
  • Update frequency: every 64.4 days
  • Top authors: wpmaintainer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /914 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

This is a short check of server-side resources used by Emergency Alerts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0432.36 ▼10.63
Dashboard /wp-admin3.35 ▲0.0550.08 ▼7.51
Posts /wp-admin/edit.php3.40 ▲0.0552.60 ▼1.41
Add New Post /wp-admin/post-new.php5.93 ▲0.0587.46 ▼14.43
Media Library /wp-admin/upload.php3.27 ▲0.0437.20 ▼0.98
Emergency Alert /wp-admin/options-general.php?page=wpm-ea-settings3.3041.57

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Emergency Alerts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲11713.33 ▼1.0110.12 ▲7.9546.63 ▲2.04
Dashboard /wp-admin2,199 ▲195.48 ▼0.1883.53 ▼3.9238.25 ▲0.77
Posts /wp-admin/edit.php2,101 ▲11.99 ▲0.0134.79 ▼0.9433.94 ▼4.69
Add New Post /wp-admin/post-new.php1,531 ▼023.24 ▲0.53628.73 ▼57.4652.16 ▲6.97
Media Library /wp-admin/upload.php1,395 ▲14.21 ▲0.0398.78 ▼3.6047.26 ▼0.06
Emergency Alert /wp-admin/options-general.php?page=wpm-ea-settings1,7166.62134.2663.80

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/emergency-alert/lib/views/alert-footer-fixed.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/emergency-alert/lib/views/alert-header-fixed.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/emergency-alert/lib/views/alert-lightbox.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/emergency-alert/lib/init.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/emergency-alert/lib/views/js-hooks.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/emergency-alert/lib/views/admin-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/emergency-alert/wpm-emergency-alert.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/emergency-alert/lib/views/alert-footer-absolute.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/emergency-alert/lib/views/alert-header-absolute.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: closing, alert, covid19, banner, lightbox...

emergency-alert/wpm-emergency-alert.php 92% from 13 tests

The primary PHP file in "Emergency Alerts" version 1.4.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("emergency-alert.php" instead of "wpm-emergency-alert.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
Good job! No executable or dangerous file extensions detected484 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP96211435
JavaScript16027
CSS15422

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods323.08%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants116.67%
▷ Class constants583.33%
▷ Public constants5100.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
1 PNG file occupies 0.12MB with 0.08MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png125.45KB39.54KB▼ 68.48%