78% egreen-web-meter

Code Review | eGreen Web Meter

WordPress plugin eGreen Web Meter scored78%from 54 tests.

About plugin

  • Plugin page: egreen-web-meter
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.5.3
  • WordPress version: 6.3.1
  • First release: Jul 28, 2016
  • Latest release: Jul 28, 2016
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: mcnardelli (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /738 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.11ms] Passed 4 tests

Server-side resources used by eGreen Web Meter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.88 ▼6.37
Dashboard /wp-admin3.40 ▲0.1049.61 ▼2.57
Posts /wp-admin/edit.php3.51 ▲0.1651.16 ▲1.83
Add New Post /wp-admin/post-new.php6.00 ▲0.1186.92 ▼6.79
Media Library /wp-admin/upload.php3.32 ▲0.0937.44 ▼0.72

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for eGreen Web Meter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6913.26 ▼1.012.29 ▲0.1939.06 ▼7.53
Dashboard /wp-admin2,215 ▲274.94 ▼0.95110.55 ▼0.4573.18 ▲28.49
Posts /wp-admin/edit.php2,110 ▲212.05 ▲0.0239.17 ▼1.0632.96 ▼5.80
Add New Post /wp-admin/post-new.php1,551 ▲923.14 ▲4.91794.98 ▲189.0767.24 ▲16.58
Media Library /wp-admin/upload.php1,403 ▲154.26 ▲0.02119.02 ▲18.3345.85 ▲3.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/egreen-web-meter/src/eGreen/View/Script.php
    • > /wp-content/plugins/egreen-web-meter/src/eGreen/View/Style.php
    • > /wp-content/plugins/egreen-web-meter/egreen.php
  • 20× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'eGreen\\Core\\Lib\\Pimple' not found in wp-content/plugins/egreen-web-meter/src/eGreen/Core/Lib/Plugin.php:8
    • > PHP Notice
      Undefined variable: position in wp-content/plugins/egreen-web-meter/src/eGreen/View/Style.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/egreen-web-meter/src/eGreen/View/Style.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'eGreen\\Core\\Helper\\Helper' not found in wp-content/plugins/egreen-web-meter/src/eGreen/Core/Helper/Wordpress.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'eGreen\\Core\\Lib\\Assets' not found in wp-content/plugins/egreen-web-meter/config/menu.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function form() on null in wp-content/plugins/egreen-web-meter/src/eGreen/View/MainPage.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'eGreen\\Core\\Helper\\Helper' not found in wp-content/plugins/egreen-web-meter/src/eGreen/Core/Helper/Alert.php:6
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/egreen-web-meter/src/eGreen/View/Style.php on line 6
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/egreen-web-meter/src/eGreen/View/Style.php on line 22
    • > PHP Fatal error
      Uncaught Error: Class 'eGreen\\Core\\Lib\\General' not found in wp-content/plugins/egreen-web-meter/src/eGreen/Core/Lib/Assets.php:6

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === egreen-web-meter === )
You can look at the official readme.txt

egreen-web-meter/egreen.php 85% from 13 tests

The entry point to "eGreen Web Meter" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("egreen-web-meter.php" instead of "egreen.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin1,330 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP21322525766
CSS21114447
PO File23030100
JavaScript13017

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity8.21
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods78
▷ Static methods1012.82%
▷ Public methods6482.05%
▷ Protected methods00.00%
▷ Private methods1417.95%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/big_logo.png25.91KB2.84KB▼ 89.06%
assets/img/small_logo.png22.13KB1.01KB▼ 95.43%