10% wp-environment-label

Code Review | WP Environment Label

WordPress plugin WP Environment Label scored10%from 54 tests.

About plugin

  • Plugin page: wp-environment-label
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.8.2
  • WordPress version: 6.3.1
  • First release: Oct 12, 2017
  • Latest release: Oct 19, 2017
  • Number of updates: 8
  • Update frequency: every 8.5 days
  • Top authors: konradwww2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /630 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method EnvironmentLabel::onActivate() should not be called statically

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.60ms] Passed 4 tests

An overview of server-side resources used by WP Environment Label
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.53 ▼5.36
Dashboard /wp-admin3.33 ▲0.0351.05 ▼4.83
Posts /wp-admin/edit.php3.38 ▲0.0349.84 ▼7.11
Add New Post /wp-admin/post-new.php5.91 ▲0.0296.45 ▼13.11
Media Library /wp-admin/upload.php3.25 ▲0.0237.47 ▲0.49

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP Environment Label
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.26 ▼0.111.66 ▼0.2440.20 ▼6.48
Dashboard /wp-admin2,214 ▲375.65 ▲0.0391.16 ▼6.1840.86 ▼4.67
Posts /wp-admin/edit.php2,119 ▲191.99 ▼0.0439.84 ▼4.7037.82 ▲0.27
Add New Post /wp-admin/post-new.php1,558 ▲2223.19 ▲0.06645.89 ▲0.1347.56 ▼4.75
Media Library /wp-admin/upload.php1,419 ▲224.19 ▲0.00100.34 ▼0.4544.09 ▼1.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method EnvironmentLabel::onDeactivate() should not be called statically
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-environment-label/wp-environment-label.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

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

Analyzing the main PHP file in "WP Environment Label" version 1.1
104 characters long description:
WP Environment Label - shows label with current server/environment name defined by config or admin-panel

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected110 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22226110

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.45
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods763.64%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
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 were not PNG files found in your plugin