90% wp-environment-indicator

Code Review | WordPress Environment Indicator

WordPress plugin WordPress Environment Indicator scored90%from 54 tests.

About plugin

  • Plugin page: wp-environment-in...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 7, 2016
  • Latest release: May 24, 2019
  • Number of updates: 12
  • Update frequency: every 79.9 days
  • Top authors: crimson090 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /27,333 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼1.34ms] Passed 4 tests

Analyzing server-side resources used by WordPress Environment Indicator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0440.53 ▲0.05
Dashboard /wp-admin3.36 ▲0.0646.48 ▼0.43
Posts /wp-admin/edit.php3.47 ▲0.1242.90 ▼2.49
Add New Post /wp-admin/post-new.php5.94 ▲0.0582.61 ▼2.49
Media Library /wp-admin/upload.php3.28 ▲0.0538.34 ▲6.67
WP Environment Indicator /wp-admin/options-general.php?page=wp_environment_indicator_fields3.2531.23

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordPress Environment Indicator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▲0.031.79 ▼0.0443.14 ▼0.33
Dashboard /wp-admin2,210 ▲184.86 ▼0.07112.13 ▼4.6244.29 ▲0.14
Posts /wp-admin/edit.php2,075 ▼142.06 ▲0.0635.92 ▼1.8533.08 ▼0.10
Add New Post /wp-admin/post-new.php1,545 ▲2518.50 ▼4.41625.41 ▼58.8656.03 ▼5.41
Media Library /wp-admin/upload.php1,395 ▲44.17 ▼0.0596.19 ▼1.5440.88 ▼3.55
WP Environment Indicator /wp-admin/options-general.php?page=wp_environment_indicator_fields8062.0624.8227.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
No output text or server-side errors detected on direct access of PHP files

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 97% 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:
  • Plugin Name: You should set the name of your plugin on the first line ( === wp-environment-indicator === )
You can take inspiration from this readme.txt

wp-environment-indicator/wp-environment-indicator.php Passed 13 tests

The primary PHP file in "WordPress Environment Indicator" version 1.0.1 is used by WordPress to initiate all plugin functionality
76 characters long description:
Displays an indicator above the admin bar indicating the current environment

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
There were no executable files found in this plugin266 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP764367214
SVG30231
CSS351221

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.75
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.28
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png25.50KB7.57KB▼ 70.33%
assets/icon-128x128.png5.48KB3.40KB▼ 38.01%