79% lhl-environment-indicator

Code Review | LHL Environment Indicator, Email Redirect and Email Reroute

WordPress plugin LHL Environment Indicator, Email Redirect and Email Reroute scored79%from 54 tests.

About plugin

  • Plugin page: lhl-environment-i...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 27, 2023
  • Latest release: Sep 5, 2023
  • Number of updates: 10
  • Update frequency: every 13.1 days
  • Top authors: lehelm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.29MB] [CPU: ▼6.86ms] Passed 4 tests

Analyzing server-side resources used by LHL Environment Indicator, Email Redirect and Email Reroute
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3142.27 ▼0.03
Dashboard /wp-admin3.63 ▲0.2951.29 ▼14.14
Posts /wp-admin/edit.php3.68 ▲0.3252.01 ▲2.15
Add New Post /wp-admin/post-new.php6.17 ▲0.2992.32 ▼11.19
Media Library /wp-admin/upload.php3.49 ▲0.2636.76 ▼2.06
Environment and Email redirect /wp-admin/options-general.php?page=lhl_env_ind3.4634.30

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 206 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
lhlnvnd_environment_options
theysaidso_admin_options
lhlnvnd_main_options
lhlnvnd_email_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

LHL Environment Indicator, Email Redirect and Email Reroute: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲12513.60 ▼0.608.24 ▲6.1339.55 ▼4.31
Dashboard /wp-admin2,219 ▲314.88 ▼1.03103.22 ▼4.2538.97 ▼1.91
Posts /wp-admin/edit.php2,099 ▲72.00 ▲0.0036.48 ▲0.9833.93 ▲0.58
Add New Post /wp-admin/post-new.php1,531 ▲223.19 ▲4.66683.28 ▲31.1152.84 ▼0.90
Media Library /wp-admin/upload.php1,404 ▲164.23 ▼0.0197.35 ▼7.9745.90 ▼5.76
Environment and Email redirect /wp-admin/options-general.php?page=lhl_env_ind8062.0325.1028.43

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
  • This plugin does not fully uninstall, leaving 9 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • lhlnvnd_environment_options
    • widget_theysaidso_widget
    • lhlnvnd_email_options
    • lhlnvnd_main_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/lhl-environment-indicator/admin/partials/lhl-environment-indicator-admin-display.php
    • > /wp-content/plugins/lhl-environment-indicator/public/partials/lhl-environment-indicator-public-display.php
  • 49× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/psr7/src/LimitStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/psr7/src/Uri.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/psr7/src/InflateStream.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/promises/src/AggregateException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/promises/src/Coroutine.php:45
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/lhl-environment-indicator/vendor/guzzlehttp/psr7/src/MultipartStream.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: reroute, email, environment indicator, redirect

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

"LHL Environment Indicator, Email Redirect and Email Reroute" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
103 characters long description:
Simple environment indicator that lets amin users know which wordpress website environment they are on.

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 plugin17,337 lines of code in 185 files:
LanguageFilesBlank linesComment linesLines of code
PHP1502,7646,96311,993
Markdown181,38103,934
JSON11001,114
CSS34645172
JavaScript31688124

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity12.36
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces19
Interfaces27
Traits3
Classes101
▷ Abstract classes00.00%
▷ Concrete classes101100.00%
▷ Final classes3534.65%
Methods899
▷ Static methods16318.13%
▷ Public methods76585.09%
▷ Protected methods50.56%
▷ Private methods12914.35%
Functions129
▷ Named functions3728.68%
▷ Anonymous functions9271.32%
Constants64
▷ Global constants11.56%
▷ Class constants6398.44%
▷ Public constants5282.54%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected