10% terror-alert-level-widget

Code Review | Terror Alert Level Widget

WordPress plugin Terror Alert Level Widget scored 10% from 54 tests.

About plugin

  • Plugin page: terror-alert-leve...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-4.3
  • WordPress version: 6.3.1
  • First release: Mar 26, 2015
  • Latest release: Aug 18, 2015
  • Number of updates: 10
  • Update frequency: every 14.6 days
  • Top authors: Piotr Pesta (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 861 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/terror-alert-level-widget/terror-alert-widget.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; terror_alert has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼52.00ms] Passed 4 tests

This is a short check of server-side resources used by Terror Alert Level Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.06 ▼36.81
Dashboard /wp-admin2.10 ▼1.216.20 ▼39.95
Posts /wp-admin/edit.php2.10 ▼1.267.43 ▼38.33
Add New Post /wp-admin/post-new.php2.10 ▼3.795.39 ▼92.92
Media Library /wp-admin/upload.php2.10 ▼1.137.06 ▼26.53

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_terror_alert
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Terror Alert Level Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.67 ▲0.551.76 ▼3.6536.95 ▼11.02
Dashboard /wp-admin2,206 ▲154.85 ▼1.05111.39 ▼1.5738.80 ▼2.86
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0440.12 ▼0.1234.89 ▼1.06
Add New Post /wp-admin/post-new.php1,537 ▲1623.32 ▼0.18611.85 ▼3.0655.55 ▲7.72
Media Library /wp-admin/upload.php1,388 ▼04.30 ▲0.1298.42 ▼7.8739.73 ▼0.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/terror-alert-level-widget/terror-alert-widget.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; terror_alert has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_terror_alert
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/terror-alert-level-widget/terror-alert-widget.php:14

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 issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: widget, terrorist, isis, is, level...

terror-alert-level-widget/terror-alert-widget.php 92% from 13 tests

The entry point to "Terror Alert Level Widget" version 1.0.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("terror-alert-level-widget.php" instead of "terror-alert-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected172 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32917102
CSS14070

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin