84% dotenv

Code Review | dotenv

WordPress plugin dotenv scored84%from 54 tests.

About plugin

  • Plugin page: dotenv
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.7.2
  • WordPress version: 6.3.1
  • First release: May 26, 2021
  • Latest release: May 28, 2021
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: bradparbs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,829 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼5.34ms] Passed 4 tests

An overview of server-side resources used by dotenv
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1236.49 ▼7.77
Dashboard /wp-admin3.49 ▲0.1450.41 ▼11.62
Posts /wp-admin/edit.php3.54 ▲0.1848.34 ▼0.94
Add New Post /wp-admin/post-new.php6.01 ▲0.1291.06 ▼1.03
Media Library /wp-admin/upload.php3.35 ▲0.1234.07 ▼0.16

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 94 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

dotenv: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.22 ▼1.185.04 ▲3.0040.85 ▼8.63
Dashboard /wp-admin2,209 ▲244.88 ▲0.00110.13 ▲5.0341.62 ▼2.05
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0439.73 ▼2.2937.48 ▲3.10
Add New Post /wp-admin/post-new.php1,533 ▼023.21 ▼0.20658.84 ▼46.4262.95 ▼3.04
Media Library /wp-admin/upload.php1,391 ▲34.21 ▲0.0394.06 ▼14.2042.88 ▼7.77

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 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 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
The following issues need your attention
  • 25× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Store\\StoreInterface' not found in wp-content/plugins/dotenv/vendor/vlucas/phpdotenv/src/Store/StringStore.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOption\\Option' not found in wp-content/plugins/dotenv/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Exception\\ExceptionInterface' not found in wp-content/plugins/dotenv/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Exception\\ExceptionInterface' not found in wp-content/plugins/dotenv/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\RepositoryInterface' not found in wp-content/plugins/dotenv/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\ReaderInterface' not found in wp-content/plugins/dotenv/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GrahamCampbell\\ResultType\\Result' not found in wp-content/plugins/dotenv/vendor/graham-campbell/result-type/src/Success.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\WriterInterface' not found in wp-content/plugins/dotenv/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\AdapterInterface' not found in wp-content/plugins/dotenv/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\ReaderInterface' not found in wp-content/plugins/dotenv/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: configuration, developer, environment, config, tools

dotenv/dotenv.php 92% from 13 tests

The main PHP file in "dotenv" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/lang/")

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 plugin7,364 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
PHP741,0342,4916,580
JSON700732
Markdown313036
make17016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity8.34
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces17
Interfaces9
Traits0
Classes50
▷ Abstract classes24.00%
▷ Concrete classes4896.00%
▷ Final classes4083.33%
Methods352
▷ Static methods13638.64%
▷ Public methods30285.80%
▷ Protected methods00.00%
▷ Private methods5014.20%
Functions128
▷ Named functions7659.38%
▷ Anonymous functions5240.62%
Constants24
▷ Global constants416.67%
▷ Class constants2083.33%
▷ Public constants945.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin