78% first-response

Code Review | First response

WordPress plugin First response scored 78% from 54 tests.

About plugin

  • Plugin page: first-response
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 5.8.1
  • First release: Aug 18, 2015
  • Latest release: Aug 19, 2015
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: Avranu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 549 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by First response
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1441.28 ▲19.52
Dashboard /wp-admin3.09 ▲0.0441.89 ▼0.72
Posts /wp-admin/edit.php3.14 ▲0.0440.17 ▼3.14
Add New Post /wp-admin/post-new.php5.45 ▲0.0285.87 ▼563.29
Media Library /wp-admin/upload.php3.04 ▲0.0334.70 ▲0.70
Add New /wp-admin/post-new.php?post_type=ems_call3.1550.55
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=ems_call3.0328.33
Load Calls /wp-admin/edit.php?post_type=ems_call&page=load-calls3.1929.42
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=ems_call3.0334.17
All Calls /wp-admin/edit.php?post_type=ems_call3.0836.91

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 2 new options
New WordPress options
category_children
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Checking browser requirements for First response
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,757 ▲16115.85 ▲0.009.52 ▲0.3648.67 ▲2.00
Dashboard /wp-admin3,017 ▲865.89 ▼0.04139.60 ▼7.69116.04 ▲5.08
Posts /wp-admin/edit.php2,789 ▲502.70 ▲0.0063.56 ▼7.3285.88 ▼4.06
Add New Post /wp-admin/post-new.php3,721 ▲2,05115.29 ▼3.83438.18 ▲63.47108.71 ▲4.10
Media Library /wp-admin/upload.php1,857 ▲475.01 ▼0.02143.91 ▼18.94114.40 ▼13.76
Add New /wp-admin/post-new.php?post_type=ems_call3,2218.99235.19136.84
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=ems_call1,8882.4957.9685.19
Load Calls /wp-admin/edit.php?post_type=ems_call&page=load-calls9321.8533.0561.08
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=ems_call1,9752.4958.7593.55
All Calls /wp-admin/edit.php?post_type=ems_call1,5132.6360.4179.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 2 options in the database
    • recovery_mode_email_last_sent
    • category_children

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ems_call&page=load-calls
    • > Notice in wp-content/plugins/first-response/Emergency_Call.php+61
    Undefined offset: 0
    • > GET request to /wp-admin/edit.php?post_type=ems_call&page=load-calls
    • > Notice in wp-content/plugins/first-response/Emergency_Call.php+58
    Trying to get property 'post_date' of non-object
    • > GET request to /wp-admin/edit.php?post_type=ems_call&page=load-calls
    • > Notice in wp-content/plugins/first-response/Emergency_Call.php+61
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/edit.php?post_type=ems_call&page=load-calls
    • > Error in wp-content/plugins/first-response/Emergency_Call.php+64
    Uncaught Error: Call to undefined function imap_open() in wp-content/plugins/first-response/Emergency_Call.php:64
    Stack trace:
    #0 wp-content/plugins/first-response/first-response.php(74): Emergency_Call::find_recent_calls()
    #1 wp-includes/class-wp-hook.php(303): ems_load_calls_page()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/edit.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/first-response/first-response.php
    • > /wp-content/plugins/first-response/Emergency_Call.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === first-response === )
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can look at the official readme.txt

first-response/first-response.php Passed 13 tests

The primary PHP file in "First response" version 1.1 is used by WordPress to initiate all plugin functionality
84 characters long description:
Adds a "911 calls" post type for listing the calls your department is dispatched for

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin419 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26563419

PHP code Passed 2 tests

Analyzing 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.87
Average class complexity147.00
▷ Minimum class complexity147.00
▷ Maximum class complexity147.00
Average method complexity10.12
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods212.50%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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